2017-08-07 22:09:02 -07:00
|
|
|
from .base_config_test import BaseConfigTest, fmod
|
|
|
|
|
|
|
|
|
|
|
|
# ============================================================================
|
|
|
|
class TestRootColl(BaseConfigTest):
|
|
|
|
@classmethod
|
|
|
|
def setup_class(cls):
|
|
|
|
super(TestRootColl, cls).setup_class('config_test_root_coll.yaml')
|
|
|
|
|
|
|
|
def test_root_replay_ts(self, fmod):
|
|
|
|
resp = self.get('/20140127171238{0}/http://www.iana.org/', fmod)
|
|
|
|
|
|
|
|
# Body
|
|
|
|
assert '"20140127171238"' in resp.text
|
Frame insert refactor (#246)
refactor frame/head insert templates:
ContentFrame:
- content iframe inited with new ContentFrame() which creates iframe
- wb_frame.js: contains ContentFrame system for initing, updating, closing content frame for replayed content.
- wb_frame.js: supports 'app_prefix' and 'content_prefix' or default 'prefix' for replay content
- window.location.hash passed added to init url.
- frame insert and head insert: simplify, remove 'wbrequest'
- frame insert: global wbinfo object no longer needed in top frame, each ContentFrame self-contained.
- wombat.js: next_parent() check does not assume wbinfo is present in top frame
- vidrw.js: only init if wbinfo is present
Banner:
- wb.js no longer needed, frame check/redirect folded into wombat.js
- default banner self-contained in default_banner.js/default_banner.css, handles both frame and frameless case
- rename wb.css -> default_banner.css
- banner html passed in as 'banner_html' variable to be optionally included, supports per collection banner html.
- templateview: BaseInsertView can accept an option 'banner view', used by HeadInsertView and TopFrameView
Tests:
- tests: test_auto_colls uses shared app to test dynamic changes, testing both frame and non-frame access, added per-collection banner html check.
2017-09-30 21:09:38 -07:00
|
|
|
assert 'wombat.js' in resp.text
|
2018-10-04 17:29:18 -04:00
|
|
|
assert 'WBWombatInit' in resp.text, resp.text
|
2018-10-22 17:12:22 -07:00
|
|
|
assert 'wbinfo.enable_auto_fetch = true;' in resp.text, resp.text
|
2017-08-07 22:09:02 -07:00
|
|
|
assert '/20140127171238{0}/http://www.iana.org/time-zones"'.format(fmod) in resp.text
|
|
|
|
|
|
|
|
def test_root_replay_no_ts(self, fmod):
|
|
|
|
fmod_slash = fmod + '/' if fmod else ''
|
|
|
|
resp = self.get('/{0}http://www.iana.org/', fmod_slash)
|
|
|
|
|
|
|
|
# Body
|
|
|
|
assert 'request_ts = ""' in resp.text
|
Frame insert refactor (#246)
refactor frame/head insert templates:
ContentFrame:
- content iframe inited with new ContentFrame() which creates iframe
- wb_frame.js: contains ContentFrame system for initing, updating, closing content frame for replayed content.
- wb_frame.js: supports 'app_prefix' and 'content_prefix' or default 'prefix' for replay content
- window.location.hash passed added to init url.
- frame insert and head insert: simplify, remove 'wbrequest'
- frame insert: global wbinfo object no longer needed in top frame, each ContentFrame self-contained.
- wombat.js: next_parent() check does not assume wbinfo is present in top frame
- vidrw.js: only init if wbinfo is present
Banner:
- wb.js no longer needed, frame check/redirect folded into wombat.js
- default banner self-contained in default_banner.js/default_banner.css, handles both frame and frameless case
- rename wb.css -> default_banner.css
- banner html passed in as 'banner_html' variable to be optionally included, supports per collection banner html.
- templateview: BaseInsertView can accept an option 'banner view', used by HeadInsertView and TopFrameView
Tests:
- tests: test_auto_colls uses shared app to test dynamic changes, testing both frame and non-frame access, added per-collection banner html check.
2017-09-30 21:09:38 -07:00
|
|
|
assert 'wombat.js' in resp.text
|
2018-10-04 17:29:18 -04:00
|
|
|
assert 'WBWombatInit' in resp.text, resp.text
|
2018-10-22 17:12:22 -07:00
|
|
|
assert 'wbinfo.enable_auto_fetch = true;' in resp.text, resp.text
|
2017-08-07 22:09:02 -07:00
|
|
|
assert '/{0}http://www.iana.org/time-zones"'.format(fmod_slash) in resp.text
|
|
|
|
|
|
|
|
def test_root_replay_redir(self, fmod):
|
|
|
|
resp = self.get('/20140128051539{0}/http://www.iana.org/domains/example', fmod)
|
|
|
|
|
wombat overhaul! fixes #449 (#451)
wombat:
- I: function overrides applied by wombat now better appear to be the original new function name same as originals when possible
- I: WombatLocation now looks and behaves more like the original Location interface
- I: The custom storage class now looks and behaves more like the original Storage
- I: SVG image rewriting has been improved: both the href and xlink:href deprecated since SVG2 now rewritten always
- I: document.open now handles the case of creation of a new window
- I: Request object rewriting of the readonly href property is now correctly handled
- I: EventTarget.addEventListener, removeEventListener overrides now preserve the original this argument of the wrapped listener
- A: document.close override to ensure wombat is initialized after write or writeln usage
- A: reconstruction of <doctype...> in rewriteHTMLComplete IFF it was included in the original string of HTML
- A: document.body setter override to ensure rewriting of the new body or frameset
- A: Attr.[value, nodeValue, textContent] added setter override to perform URL rewrites
- A: SVGElements rewriting of the filter, style, xlink:href, href, and src attributes
- A: HTMLTrackElement rewriting of the src attribute of the
- A: HTMLQuoteElement and HTMLModElement rewriting of the cite attribute
- A: Worklet.addModule: Loads JS module specified by a URL.
- A: HTMLHyperlinkElementUtils overrides to the areaelement
- A: ShadowRootoverrides to: innerHTML even though inherites from DocumentFragement and Node it still has innerHTML getter setter.
- A: ShadowRoot, Element, DocumentFragment append, prepend: adds strings of HTML or a new Node inherited from ParentNode
- A: StylePropertyMap override: New way to access and set CSS properties.
- A: Response.redirecthttps rewriting of the URL argument.
- A: UIEvent, MouseEvent, TouchEvent, KeyboardEvent, WheelEvent, InputEvent, and CompositionEven constructor and init{even-name} overrides in order to ensure that wombats JS Proxy usage does not affect their defined behaviors
- A: XSLTProcessor override to ensure its usage is not affected by wombats JS Proxy usage.
- A: navigator.unregisterProtocolHandler: Same override as existing navigator.registerProtocolHandler but from the inverse operation
- A: PresentationRequest: Constructor takes a URL or an array of URLs.
- A: EventSource and WebSocket override in order to ensure that they do not cause live leaks
- A: overrides for the child node interface
- Fix: autofetch worker creatation of the backing worker when it is operating within an execution context with a null origin
tests:
- A: 559 tests specific to wombat and client side rewritting
pywb:
- Fix: a few broken tests due to iana.org requiring a user agent in its requests
rewrite:
- introduced a new JSWorkerRewriter class in order to support rewriting via wombat workers in the context of all supported worker variants via
- ensured rewriter app correctly sets the static prefix
ci:
- Modified travis.yml to specifically enumerate jobs
documentation:
- Documented new wombat, wombat proxy moded, wombat workers
auto-fetch:
- switched to mutation observer when in proxy mode so that the behaviors can operate in tandem with the autofetcher
2019-05-15 14:42:51 -04:00
|
|
|
assert resp.status_int in (301, 302)
|
2017-08-07 22:09:02 -07:00
|
|
|
|
|
|
|
assert resp.headers['Location'] == 'http://localhost:80/20140128051539{0}/https://www.iana.org/domains/reserved'.format(fmod)
|
|
|
|
|
|
|
|
def test_root_home_search(self):
|
|
|
|
resp = self.testapp.get('/')
|
|
|
|
assert 'Search' in resp.text
|
|
|
|
|
2017-09-06 23:25:30 -07:00
|
|
|
def test_root_cdx(self):
|
|
|
|
resp = self.testapp.get('/cdx?url=http://www.iana.org/&output=json&limit=1')
|
|
|
|
resp.content_type = 'application/json'
|
|
|
|
assert resp.json['is_live'] == 'true'
|
|
|
|
assert resp.json['url'] == 'http://www.iana.org/'
|
|
|
|
assert resp.json['source'] == '$root'
|