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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/service-workers/service-worker/registration-iframe.https.html

Issue 2415873002: Import w3c tests for the service workers (Closed)
Patch Set: Rebase Created 4 years, 2 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 <meta charset="utf-8"> 2 <meta charset="utf-8">
3 <title>Service Worker: Registration for iframe</title> 3 <title>Service Worker: Registration for iframe</title>
4 <script src="../resources/testharness.js"></script> 4 <script src="/resources/testharness.js"></script>
5 <script src="../resources/testharnessreport.js"></script> 5 <script src="/resources/testharnessreport.js"></script>
6 <script src="resources/test-helpers.js"></script> 6 <script src="resources/test-helpers.sub.js"></script>
7 <script> 7 <script>
8 // Set script url and scope url relative to the calling frame's document's url. 8 // Set script url and scope url relative to the calling frame's document's url.
9 // Assert the implementation parses the urls against the calling frame's 9 // Assert the implementation parses the urls against the calling frame's
10 // document's url. 10 // document's url.
11 async_test(function(t) { 11 async_test(function(t) {
12 var url = 'resources/blank.html'; 12 var url = 'resources/blank.html';
13 var scope = 'resources/registration-for-iframe-from-calling-frame'; 13 var scope = 'resources/registration-for-iframe-from-calling-frame';
14 var parsed_scope = normalizeURL(scope); 14 var parsed_scope = normalizeURL(scope);
15 var script = 'resources/empty-worker.js'; 15 var script = 'resources/empty-worker.js';
16 var parsed_script = normalizeURL(script); 16 var parsed_script = normalizeURL(script);
(...skipping 23 matching lines...) Expand all
40 'document\'s url'); 40 'document\'s url');
41 frame.remove(); 41 frame.remove();
42 return service_worker_unregister_and_done(t, scope); 42 return service_worker_unregister_and_done(t, scope);
43 }) 43 })
44 .catch(unreached_rejection(t)); 44 .catch(unreached_rejection(t));
45 }, 'Subframe\'s container\'s register method should use calling frame\'s ' + 45 }, 'Subframe\'s container\'s register method should use calling frame\'s ' +
46 'document\'s url as a base url for parsing its script url and scope url ' + 46 'document\'s url as a base url for parsing its script url and scope url ' +
47 '- normal case'); 47 '- normal case');
48 48
49 // Set script url and scope url relative to the iframe's document's url. 49 // Set script url and scope url relative to the iframe's document's url.
50 // Assert the implementation throws a TypeError exception. 50 // Assert the implementation throws a NetworkError exception.
51 async_test(function(t) { 51 async_test(function(t) {
52 var url = 'resources/blank.html'; 52 var url = 'resources/blank.html';
53 var scope = 'registration-for-iframe-from-calling-frame'; 53 var scope = 'registration-for-iframe-from-calling-frame';
54 var script = 'empty-worker.js'; 54 var script = 'empty-worker.js';
55 var frame; 55 var frame;
56 var registration; 56 var registration;
57 57
58 service_worker_unregister(t, scope) 58 service_worker_unregister(t, scope)
59 .then(function() { return with_iframe(url); }) 59 .then(function() { return with_iframe(url); })
60 .then(function(f) { 60 .then(function(f) {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 assert_unreached('register() should reject'); 99 assert_unreached('register() should reject');
100 }, 100 },
101 function(e) { 101 function(e) {
102 assert_equals(e.name, 'SecurityError'); 102 assert_equals(e.name, 'SecurityError');
103 frame.remove(); 103 frame.remove();
104 return service_worker_unregister_and_done(t, scope); 104 return service_worker_unregister_and_done(t, scope);
105 }) 105 })
106 .catch(unreached_rejection(t)); 106 .catch(unreached_rejection(t));
107 }, 'A scope url should start with the given script url'); 107 }, 'A scope url should start with the given script url');
108 </script> 108 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698