Skip to content

Commit

Permalink
rename resources
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk committed Jun 6, 2018
1 parent 3776e19 commit 4fcb0f3
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
let evilGlobalState = null;
onfetch = e => {
if(e.request.url.endsWith("test.window.js-redirect.py")) {
if(e.request.url.endsWith("resources/opaque-redirect.py")) {
e.respondWith(new Promise(async resolve => {
evilGlobalState = await fetch(e.request);
resolve(new Response("stage 1 completed\n"));
}));
} else if(e.request.url.endsWith("x/")) {
} else if(e.request.url.endsWith("resources/x/")) {
e.respondWith(evilGlobalState);
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// META: script=../service-worker/resources/test-helpers.sub.js

promise_test(async t => {
const reg = await service_worker_unregister_and_register(t, "test.window.js-serviceworker.js", "./");
const reg = await service_worker_unregister_and_register(t, "opaque-redirect-serviceworker.js", "./");
t.add_cleanup(async () => await reg.unregister());
await wait_for_state(t, reg.installing, 'activated');
const frame = await with_iframe("test.window.js-redirect.py");
const frame = await with_iframe("resources/opaque-redirect.py");
assert_equals(frame.contentDocument.body.textContent, "stage 1 completed\n");
frame.remove();
const frame2 = await with_iframe("x/");
const frame2 = await with_iframe("resources/x/");
assert_equals(frame2.contentDocument.body.textContent, "YAY!\n");
frame2.remove();
}, "Passing an (opaque) redirect with a relative URL in its Location header to a second navigation with a different base URL");
3 changes: 3 additions & 0 deletions service-workers/redirects/resources/opaque-redirect.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
def main(request, response):
response.status = 302
response.headers.set("Location", "opaque-redirect-result.txt")
3 changes: 0 additions & 3 deletions service-workers/redirects/test.window.js-redirect.py

This file was deleted.

0 comments on commit 4fcb0f3

Please sign in to comment.