Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P1: Update the wpt tests to expect to reject the cors synthesized response to a same origin request. #9148

Merged
merged 1 commit into from
Jan 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@
// Fetch to the other origin with same-origin mode should fail.
if (origin == OTHER_ORIGIN && mode == 'same-origin') {
ng_test(url, mode, credentials);
} else if (origin == BASE_ORIGIN && mode == 'same-origin') {
// Cors type response to a same-origin mode request should fail
ng_test(url, mode, credentials);
} else {
// The response from the SW should be cors.
ok_test(url, mode, credentials, 'cors', 'undefined');
Expand All @@ -208,6 +211,9 @@
// Fetch to the other origin with same-origin mode should fail.
if (origin == OTHER_ORIGIN && mode == 'same-origin') {
ng_test(url, mode, credentials);
} else if (origin == BASE_ORIGIN && mode == 'same-origin') {
// Cors type response to a same-origin mode request should fail
ng_test(url, mode, credentials);
} else {
// The response from the SW should be cors.
ok_test(url, mode, credentials, 'cors', 'username1s');
Expand Down
12 changes: 9 additions & 3 deletions service-workers/service-worker/worker-interception.https.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,16 @@
});
})
.then(function(data) {
assert_equals(data, 'dummy-worker-script loaded');
assert_unreached('intercepted cors response to a same-origin mode ' +
'worker load should fail');
service_worker_unregister_and_done(t, scope);
});
}, 'Verify worker script intercepted by cors response succeeds');
})
.catch(function(e) {
assert_true(true, 'intercepted cors response to a same-origin mode ' +
'worker load should fail');
service_worker_unregister_and_done(t, scope);
});
}, 'Verify worker script intercepted by cors response fails');

promise_test(function(t) {
var worker_url = 'resources/dummy-no-cors-worker.js';
Expand Down