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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/budget/interfaces-in-service-worker.html

Issue 2571453002: Expose the BudgetService interface to Workers. (Closed)
Patch Set: Rebase Created 4 years 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 <html>
3 <head>
4 <title>Budget interfaces available in a Service Worker</title>
5 <script src="../resources/testharness.js"></script>
6 <script src="../resources/testharnessreport.js"></script>
7 <script src="../serviceworker/resources/test-helpers.js"></script>
8 <script src="../notifications/resources/test-helpers.js"></script>
9 </head>
10 <body>
11 <script>
12 promise_test(function(test) {
13 const script = 'resources/instrumentation-service-worker.js';
14 const scope = 'resources/scope/' + location.pathname;
15 let port;
16
17 return getActiveServiceWorkerWithMessagePort(test, script, scope)
18 .then(function(workerInfo) {
19 port = workerInfo.port;
20
21 port.addEventListener('message', function(event) {
22 if (typeof event.data != 'object' || !event.data.command)
23 assert_unreached('Invalid message from the service worker');
24
25 assert_equals(event.data.command, 'checkInterfaces');
26 assert_true(event.data.success,
27 'checkInterfaces should succeed but failed with error: ' +
28 event.data.message);
29 });
30
31 return sendCommand(port, { command: 'checkInterfaces' });
32 })
33 .catch(unreached_rejection(test));
34 }, 'Budget interfaces should be available in a Service Worker');
35 </script>
36 </body>
37 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698