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

Side by Side Diff: LayoutTests/http/tests/serviceworker/fetch-event.html

Issue 330173003: Make ServiceWorker an ActiveDOMObject (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: patch for landing Created 6 years, 6 months 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 | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script> 2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script> 3 <script src="../resources/testharnessreport.js"></script>
4 <script src="resources/test-helpers.js"></script> 4 <script src="resources/test-helpers.js"></script>
5 <body> 5 <body>
6 <script> 6 <script>
7 var worker = 'resources/fetch-event-test-worker.js'; 7 var worker = 'resources/fetch-event-test-worker.js';
8 8
9 (function() { 9 (function() {
10 var t = async_test('Service Worker responds to fetch event with blob body'); 10 var t = async_test('Service Worker responds to fetch event with blob body');
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 with_iframe(scope, t.step_func(function(frame) { 61 with_iframe(scope, t.step_func(function(frame) {
62 assert_equals(frame.contentDocument.body.textContent, '', 62 assert_equals(frame.contentDocument.body.textContent, '',
63 'Response should be the empty string'); 63 'Response should be the empty string');
64 service_worker_unregister_and_done(t, scope); 64 service_worker_unregister_and_done(t, scope);
65 })); 65 }));
66 } 66 }
67 }()); 67 }());
68 68
69 (function() { 69 (function() {
70 var t = async_test('Service Worker rejects fetch event'); 70 var t = async_test('Service Worker rejects fetch event');
71 var scope = 'resources/simple.html?ignore'; 71 var scope = 'resources/simple.html?reject';
72 service_worker_unregister_and_register(t, worker, scope, onRegister); 72 service_worker_unregister_and_register(t, worker, scope, onRegister);
73 73
74 function onRegister(sw) { 74 function onRegister(sw) {
75 sw.addEventListener('statechange', t.step_func(onStateChange)); 75 sw.addEventListener('statechange', t.step_func(onStateChange));
76 } 76 }
77 77
78 function onStateChange(event) { 78 function onStateChange(event) {
79 if (event.target.state != 'active') 79 if (event.target.state != 'active')
80 return; 80 return;
81 with_iframe(scope, t.step_func(function(frame) { 81 with_iframe(scope, t.step_func(function(frame) {
82 assert_equals(frame.contentDocument.body.textContent, 'Here\'s a sim ple html file.\n', 82 assert_equals(frame.contentDocument.body.textContent, 'Here\'s a sim ple html file.\n',
83 'Response should come from fallback to native fetch'); 83 'Response should come from fallback to native fetch');
84 service_worker_unregister_and_done(t, scope); 84 service_worker_unregister_and_done(t, scope);
85 })); 85 }));
86 } 86 }
87 }()); 87 }());
88 </script> 88 </script>
89 </body> 89 </body>
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/http/tests/serviceworker/service-worker-gc.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698