Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/fetch-request-fallback.html

Issue 1391583002: Introduce "navigate" mode in Requests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Service Worker: the fallback behavior of FetchEvent</title> 2 <title>Service Worker: the fallback behavior of FetchEvent</title>
3 <script src="../resources/testharness.js"></script> 3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script> 4 <script src="../resources/testharnessreport.js"></script>
5 <script src="../resources/get-host-info.js?pipe=sub"></script> 5 <script src="../resources/get-host-info.js?pipe=sub"></script>
6 <script src="resources/test-helpers.js"></script> 6 <script src="resources/test-helpers.js"></script>
7 <script> 7 <script>
8 8
9 function assert_resolves(promise, description) { 9 function assert_resolves(promise, description) {
10 return new Promise(function(resolve, reject) { 10 return new Promise(function(resolve, reject) {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 worker = registration.installing; 59 worker = registration.installing;
60 return wait_for_state(t, worker, 'activated'); 60 return wait_for_state(t, worker, 'activated');
61 }) 61 })
62 .then(function() { return with_iframe(SCOPE); }) 62 .then(function() { return with_iframe(SCOPE); })
63 .then(function(f) { 63 .then(function(f) {
64 frame = f; 64 frame = f;
65 return check_urls( 65 return check_urls(
66 worker, 66 worker,
67 [{ 67 [{
68 url: host_info['HTTP_ORIGIN'] + '/serviceworker/' + SCOPE, 68 url: host_info['HTTP_ORIGIN'] + '/serviceworker/' + SCOPE,
69 mode: 'same-origin' 69 mode: 'navigate'
70 }], 70 }],
71 'The SW must intercept the request for a main resourc.'); 71 'The SW must intercept the request for a main resourc.');
72 }) 72 })
73 .then(function() { 73 .then(function() {
74 return assert_resolves( 74 return assert_resolves(
75 frame.contentWindow.xhr(BASE_URL), 75 frame.contentWindow.xhr(BASE_URL),
76 'SW fallbacked same origin XHR should succeed.'); 76 'SW fallbacked same origin XHR should succeed.');
77 }) 77 })
78 .then(function() { 78 .then(function() {
79 return check_urls( 79 return check_urls(
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 'The SW must intercept only the first request for image ' + 277 'The SW must intercept only the first request for image ' +
278 'resource which is redirected to CORS-supported other origin.'); 278 'resource which is redirected to CORS-supported other origin.');
279 }) 279 })
280 .then(function() { 280 .then(function() {
281 frame.remove(); 281 frame.remove();
282 service_worker_unregister_and_done(t, SCOPE); 282 service_worker_unregister_and_done(t, SCOPE);
283 }) 283 })
284 .catch(unreached_rejection(t)); 284 .catch(unreached_rejection(t));
285 }, 'Verify the fallback behavior of FetchEvent'); 285 }, 'Verify the fallback behavior of FetchEvent');
286 </script> 286 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698