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

Side by Side Diff: chrome/test/data/extensions/api_test/service_worker/register/test.js

Issue 1211243010: [Service Worker Registration] Registered extension scheme to allow service workers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test Created 5 years, 5 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 var registered = false;
Devlin 2015/07/10 21:51:23 nit: you'll need the license in .js files, too. (.
2 var error_msg = "";
Devlin 2015/07/10 21:51:23 nitty nit: prefer single quotes, unless you have a
3
not at google - send to devlin 2015/07/10 22:00:42 also, JS style is camelcase unlike C++.
4 chrome.test.runTests([
5 function registerServiceWorker() {
6 if ('serviceWorker' in navigator) {
Devlin 2015/07/10 21:51:23 We can probably ignore this - chrome always has se
7 navigator.serviceWorker.register('/sw.js').then(function(registration) {
8 // Registration was successful
9 console.log('ServiceWorker registration successful with scope: ',
Devlin 2015/07/10 21:51:22 We're not supposed to spam the log with status fro
10 registration.scope);
11 registered = true;
12 }).catch(function(err) {
13 // registration failed :(
14 error_msg = err.name + ': ' + err.message;
15 console.log('ServiceWorker registration failed: ' + error_msg);
16 // This is the error message that should appear when the extension
17 // scheme is registered to allow service workers
18 chrome.test.assertEq('SecurityError: Failed to register a'
Devlin 2015/07/10 21:51:23 For this test extension, how about we use chrome.t
19 + 'ServiceWorker: No URL is associated with the caller\'s'
Devlin 2015/07/10 21:51:23 nitty nit: prefer double quotes when you have a qu
20 + ' document.', error_msg);
21 });
22 }
23 chrome.test.assertTrue(registered);
24 }
25 ]);
26
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698