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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/serviceworker/shared-worker-controlled.html

Issue 2897113002: Remove duplicate service wrkr "shared worker" test (Closed)
Patch Set: Re-introduce shared resource file Created 3 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
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/shared-worker-import.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>Service Worker: controlling a SharedWorker</title>
3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script>
5 <script src="resources/test-helpers.js"></script>
6 <body>
7 <script>
8 promise_test(function(t) {
9 var shared_worker = 'resources/shared-worker-controlled.js';
10 var service_worker = 'resources/simple-intercept-worker.js';
11 var scope = shared_worker;
12
13 return service_worker_unregister_and_register(t, service_worker, scope)
14 .then(function(r) {
15 return wait_for_state(t, r.installing, 'activated');
16 })
17 .then(function() {
18 return new Promise(function(resolve, reject) {
19 var w = new SharedWorker(shared_worker);
20 w.port.onmessage = function(e) {
21 resolve(e.data);
22 }
23 });
24 })
25 .then(function(data) {
26 assert_equals(data, 'intercepted by service worker');
27 service_worker_unregister_and_done(t, scope);
28 });
29 }, 'Verify subresource loads in SharedWorker are controlled by a Service Worke r');
30
31 promise_test(function(t) {
32 var shared_worker = 'resources/dummy-shared-worker.js';
33 var service_worker = 'resources/dummy-shared-worker-interceptor.js';
34 var scope = shared_worker;
35
36 return service_worker_unregister_and_register(t, service_worker, scope)
37 .then(function(r) {
38 return wait_for_state(t, r.installing, 'activated');
39 })
40 .then(function() {
41 return new Promise(function(resolve, reject) {
42 var w = new SharedWorker(shared_worker);
43 w.port.onmessage = function(e) {
44 resolve(e.data);
45 }
46 });
47 })
48 .then(function(data) {
49 assert_equals(data, 'worker loading intercepted by service worker');
50 service_worker_unregister_and_done(t, scope);
51 });
52 }, 'Verify SharedWorker construction is controlled by a Service Worker');
53
54 promise_test(function(t) {
55 var shared_worker = 'resources/shared-worker-import.js';
56 var service_worker = 'resources/dummy-shared-worker-interceptor.js';
57 var scope = shared_worker;
58
59 return service_worker_unregister_and_register(t, service_worker, scope)
60 .then(function(r) {
61 return wait_for_state(t, r.installing, 'activated');
62 })
63 .then(function() {
64 return new Promise(function(resolve, reject) {
65 var w = new SharedWorker(shared_worker);
66 w.port.onmessage = function(e) {
67 resolve(e.data);
68 }
69 });
70 })
71 .then(function(data) {
72 assert_equals(data, 'worker loading intercepted by service worker');
73 service_worker_unregister_and_done(t, scope);
74 });
75 }, 'Verify importScripts from SharedWorker is controlled by a Service Worker') ;
76 </script>
77 </body>
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/shared-worker-import.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698