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

Side by Side Diff: LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/registration-attribute.html

Issue 861743002: ServiceWorker: Test ServiceWorkerGlobalScope.registration attribute (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@expose_swreg2
Patch Set: s/eventsSeen/events_seen/ Created 5 years, 10 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
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/resources/registration-attribute-worker.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>ServiceWorkerGlobalScope: registration</title> 2 <title>ServiceWorkerGlobalScope: registration</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/test-helpers.js'></script> 5 <script src='../resources/test-helpers.js'></script>
6 <script> 6 <script>
7 7
8 promise_test(function(t) { 8 promise_test(function(t) {
9 var script = 'resources/registration-attribute-worker.js'; 9 var script = 'resources/registration-attribute-worker.js';
10 var scope = 'resources/scope/registration-attribute'; 10 var scope = 'resources/scope/registration-attribute';
11 11
12 return service_worker_unregister_and_register(t, script, scope) 12 return service_worker_unregister_and_register(t, script, scope)
13 .then(function(registration) { 13 .then(function(registration) {
14 return wait_for_state(t, registration.installing, 'activated'); 14 return wait_for_state(t, registration.installing, 'activated');
15 }) 15 })
16 .then(function() { return with_iframe(scope); }) 16 .then(function() { return with_iframe(scope); })
17 .then(function(frame) { 17 .then(function(frame) {
18 var expected_events_seen = [
19 'updatefound',
20 'install',
21 'statechange(installed)',
22 'statechange(activating)',
23 'activate',
24 'statechange(activated)',
25 'fetch',
26 ];
27
18 assert_equals( 28 assert_equals(
19 frame.contentDocument.body.textContent, 29 frame.contentDocument.body.textContent,
20 'PASS', 30 expected_events_seen.toString(),
21 'Service Worker should respond to fetch'); 31 'Service Worker should respond to fetch');
22 frame.remove(); 32 frame.remove();
23 return service_worker_unregister_and_done(t, scope); 33 return service_worker_unregister_and_done(t, scope);
24 }); 34 });
25 }, 'Verify registration attribute on ServiceWorkerGlobalScope'); 35 }, 'Verify registration attribute on ServiceWorkerGlobalScope');
26 36
27 </script> 37 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/serviceworker/ServiceWorkerGlobalScope/resources/registration-attribute-worker.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698