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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/controller-on-disconnect.https.html

Issue 2415873002: Import w3c tests for the service workers (Closed)
Patch Set: Rebase Created 4 years, 2 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>Service Worker: Controller on load</title>
3 <script src="/resources/testharness.js"></script>
4 <script src="/resources/testharnessreport.js"></script>
5 <script src="resources/test-helpers.sub.js"></script>
6 <body>
7 <script>
8 var t = async_test('controller is cleared on disconnected window');
9 t.step(function() {
10 var url = 'resources/empty-worker.js';
11 var scope = 'resources/blank.html';
12 var registration;
13 var controller;
14 var frame;
15 service_worker_unregister_and_register(t, url, scope)
16 .then(t.step_func(function(swr) {
17 registration = swr;
18 return wait_for_state(t, registration.installing, 'activated');
19 }))
20 .then(t.step_func(function() {
21 return with_iframe(scope)
22 }))
23 .then(t.step_func(function(f) {
24 frame = f;
25 var w = frame.contentWindow;
26 var swc = w.navigator.serviceWorker;
27 assert_true(swc.controller instanceof w.ServiceWorker,
28 'controller should be a ServiceWorker object');
29
30 frame.remove();
31
32 assert_equals(swc.controller, null,
33 'disconnected frame should not be controlled');
34
35 service_worker_unregister_and_done(t, scope);
36 }))
37 .catch(unreached_rejection(t));
38 });
39 </script>
40 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698