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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/register-link-element.https.html

Issue 2671783002: Upstream <link rel=serviceworker> tests. (Closed)
Patch Set: rebase Created 3 years, 10 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script> 2 <script src="/resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script> 3 <script src="/resources/testharnessreport.js"></script>
4 <script src="resources/test-helpers.js"></script> 4 <script src="resources/test-helpers.sub.js"></script>
5 <script src="resources/registration-tests.js"></script> 5 <script src="resources/registration-tests.js"></script>
6 <body> 6 <body>
7 <script> 7 <script>
8 8
9 function registerUsingLink(script, options) { 9 function registerUsingLink(script, options) {
10 var scope = options.scope; 10 var scope = options.scope;
11 var link = document.createElement('link'); 11 var link = document.createElement('link');
12 link.setAttribute('rel', 'serviceworker'); 12 link.setAttribute('rel', 'serviceworker');
13 link.setAttribute('href', script); 13 link.setAttribute('href', script);
14 link.setAttribute('scope', scope); 14 link.setAttribute('scope', scope);
15 document.getElementsByTagName('head')[0].appendChild(link); 15 document.getElementsByTagName('head')[0].appendChild(link);
16 return new Promise(function(resolve, reject) { 16 return new Promise(function(resolve, reject) {
17 link.onload = resolve; 17 link.onload = resolve;
18 link.onerror = reject; 18 link.onerror = reject;
19 }) 19 })
20 .then(() => navigator.serviceWorker.getRegistration(scope)); 20 .then(() => navigator.serviceWorker.getRegistration(scope));
21 } 21 }
22 22
23 registration_tests(registerUsingLink, false); 23 registration_tests(registerUsingLink, false);
24 24
25 </script> 25 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698