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

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

Issue 2812223004: Adding an origin trial for Budget API (Closed)
Patch Set: Fix expected output for virtual LayoutTests Created 3 years, 8 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 <html>
3 <head>
4 <!-- Generate token with the command:
5 generate_token.py http://127.0.0.1:8000 BudgetQuery --expire-timestamp=2000 000000
6 -- -->
7 <meta http-equiv="origin-trial" content="AgFtR2Ps1Z9M/FW14Tgcwbajvq7kvzc/b1 SPPSaaucG/P4ba6xC/69I9v8Pqx4wbsJINoqMabs9GE/LxOnPRfQIAAABTeyJvcmlnaW4iOiAiaHR0cD ovLzEyNy4wLjAuMTo4MDAwIiwgImZlYXR1cmUiOiAiQnVkZ2V0UXVlcnkiLCAiZXhwaXJ5IjogMjAwMD AwMDAwMH0" />
Peter Beverloo 2017/04/24 14:24:01 Ian, how does this work? The Service Worker will b
iclelland 2017/04/24 14:45:33 If this test is passing, and it appears that the t
8 <title>Budget interfaces available in a Service Worker</title>
9 <script src="../../resources/testharness.js"></script>
10 <script src="../../resources/testharnessreport.js"></script>
11 <script src="../../serviceworker/resources/test-helpers.js"></script>
12 <script src="../../notifications/resources/test-helpers.js"></script>
13 </head>
14 <body>
15 <script>
16 promise_test(function(test) {
17 const script = '../../budget/resources/instrumentation-service-worker.js ';
18 const scope = '../../budget/resources/scope/' + location.pathname;
19 let port;
Peter Beverloo 2017/04/24 14:24:01 nit: |port| can be local to the function on line 2
20
21 return getActiveServiceWorkerWithMessagePort(test, script, scope)
22 .then(function(workerInfo) {
23 port = workerInfo.port;
24
25 port.addEventListener('message', function(event) {
26 if (typeof event.data != 'object' || !event.data.command)
27 assert_unreached('Invalid message from the service worker');
28
29 assert_equals(event.data.command, 'checkInterfaces');
30 assert_true(event.data.success,
31 'checkInterfaces should succeed but failed with error: ' +
32 event.data.message);
33 });
34
35 return sendCommand(port, { command: 'checkInterfaces' });
Peter Beverloo 2017/04/24 14:24:01 Are we sure that the event listener on line 25 is
36 })
37 }, 'BudgetQuery interfaces should be available in a Service Worker.');
38 </script>
39 </body>
40 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698