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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/serviceworkerobject-scripturl.https.html

Issue 2894883003: Upstream service worker tests to WPT (Closed)
Patch Set: Created 3 years, 7 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 | « no previous file | third_party/WebKit/LayoutTests/http/tests/serviceworker/serviceworkerobject-scripturl.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>ServiceWorker object: scriptURL property</title> 2 <title>ServiceWorker object: scriptURL property</title>
3 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharness.js"></script>
4 <script src="/resources/testharnessreport.js"></script> 4 <script src="/resources/testharnessreport.js"></script>
5 <script src="resources/test-helpers.sub.js"></script> 5 <script src="resources/test-helpers.sub.js"></script>
6 <script> 6 <script>
7 'use strict';
7 8
8 function url_test(name, url) { 9 function url_test(name, url) {
9 var scope = 'resources/scope/' + name; 10 var scope = 'resources/scope/' + name;
10 async_test(function(t) { 11 var expectedURL = normalizeURL(url);
11 var expectedURL = (new URL(url, window.location)).toString(); 12
12 service_worker_unregister_and_register(t, url, scope) 13 promise_test(function(t) {
13 .then(function(registration) { 14 return service_worker_unregister_and_register(t, url, scope)
14 var worker = registration.installing; 15 .then(function(registration) {
15 assert_equals(worker.scriptURL, expectedURL, 16 var worker = registration.installing;
16 'Returned ServiceWorker object should have scriptURL'); 17
17 service_worker_unregister_and_done(t, scope); 18 t.add_cleanup(function() {
18 }) 19 registration.unregister();
19 .catch(unreached_rejection(t)); 20 });
20 }, 'Verify the scriptURL property: ' + name); 21
22 assert_equals(worker.scriptURL, expectedURL,
23 'Returned ServiceWorker object should have scriptURL') ;
24 });
25 }, 'Verify the scriptURL property: ' + name);
21 } 26 }
22 27
23 url_test('relative', 'resources/empty-worker.js'); 28 url_test('relative', 'resources/empty-worker.js');
24 url_test('absolute', (new URL('./resources/empty-worker.js', window.location)).h ref); 29 url_test('with-fragment', 'resources/empty-worker.js#ref');
25 30 url_test('absolute', normalizeURL('./resources/empty-worker.js'));
26 </script> 31 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/serviceworker/serviceworkerobject-scripturl.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698