Index: third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/registration-iframe.https.html |
diff --git a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/registration-iframe.https.html b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/registration-iframe.https.html |
index fb60afe84975b1fa26862e577c3e6e5143911b0e..1a69ecc743ada977662d7b3bfe462adc18f481d5 100644 |
--- a/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/registration-iframe.https.html |
+++ b/third_party/WebKit/LayoutTests/external/wpt/service-workers/service-worker/registration-iframe.https.html |
@@ -5,15 +5,13 @@ |
<script src="/resources/testharnessreport.js"></script> |
<script src="resources/test-helpers.sub.js"></script> |
<script> |
-// Set script url and scope url relative to the calling frame's document's url. |
-// Assert the implementation parses the urls against the calling frame's |
-// document's url. |
falken
2017/02/24 06:49:27
I actually liked these comments explaining each te
jungkees
2017/02/24 12:25:26
Okay. I thought it was a bit redundant to the test
|
+ |
async_test(function(t) { |
var url = 'resources/blank.html'; |
- var scope = 'resources/registration-for-iframe-from-calling-frame'; |
- var parsed_scope = normalizeURL(scope); |
- var script = 'resources/empty-worker.js'; |
- var parsed_script = normalizeURL(script); |
+ var scope = 'registration-for-iframe-from-parent-frame'; |
+ var expected_scope = normalizeURL('resources/' + scope); |
+ var script = 'empty-worker.js'; |
+ var expected_script = normalizeURL('resources/' + script); |
var frame; |
var registration; |
@@ -31,27 +29,22 @@ async_test(function(t) { |
}) |
.then(function() { |
assert_equals( |
- registration.scope, parsed_scope, |
- 'registration\'s scope must be the scope parsed against calling ' + |
- 'document\'s url'); |
+ registration.scope, expected_scope, |
+ 'registration\'s scope must be parsed against relevant global'); |
assert_equals( |
- registration.active.scriptURL, parsed_script, |
- 'worker\'s script must be the url parsed against calling ' + |
- 'document\'s url'); |
+ registration.active.scriptURL, expected_script, |
+ 'worker\'s scriptURL must be parsed against relevant global'); |
frame.remove(); |
return service_worker_unregister_and_done(t, scope); |
}) |
.catch(unreached_rejection(t)); |
- }, 'Subframe\'s container\'s register method should use calling frame\'s ' + |
- 'document\'s url as a base url for parsing its script url and scope url ' + |
- '- normal case'); |
+ }, 'register method should use relevant global to parse its scriptURL and ' + |
+ 'scope - normal case'); |
falken
2017/02/24 06:49:27
maybe s/relevant global/the "relevant global objec
jungkees
2017/02/24 12:25:26
Yes. Addressed.
|
-// Set script url and scope url relative to the iframe's document's url. |
-// Assert the implementation throws a NetworkError exception. |
async_test(function(t) { |
var url = 'resources/blank.html'; |
- var scope = 'registration-for-iframe-from-calling-frame'; |
- var script = 'empty-worker.js'; |
+ var scope = 'resources/registration-for-iframe-from-parent-frame'; |
+ var script = 'resources/empty-worker.js'; |
var frame; |
var registration; |
@@ -68,21 +61,20 @@ async_test(function(t) { |
assert_unreached('register() should reject'); |
}, |
function(e) { |
- assert_equals(e.name, 'TypeError'); |
+ assert_equals(e.name, 'TypeError', |
+ 'register method with scriptURL and scope parsed to ' + |
+ 'nonexistent location should reject with TypeError'); |
frame.remove(); |
return service_worker_unregister_and_done(t, scope); |
}) |
.catch(unreached_rejection(t)); |
- }, 'Subframe\'s container\'s register method should use calling frame\'s ' + |
- 'document\'s url as a base url for parsing its script url and scope url ' + |
- '- error case'); |
+ }, 'register method should use relevant global to parse its scriptURL and ' + |
+ 'scope - error case'); |
falken
2017/02/24 06:49:27
ditto
jungkees
2017/02/24 12:25:26
Done.
|
-// Set the scope url to a non-subdirectory of the script url. |
-// Assert the implementation throws a SecurityError exception. |
async_test(function(t) { |
var url = 'resources/blank.html'; |
- var scope = 'registration-for-iframe-from-calling-frame'; |
- var script = 'resources/empty-worker.js'; |
+ var scope = '../registration-for-iframe-from-parent-frame'; |
+ var script = 'empty-worker.js'; |
var frame; |
var registration; |
@@ -99,10 +91,13 @@ async_test(function(t) { |
assert_unreached('register() should reject'); |
}, |
function(e) { |
- assert_equals(e.name, 'SecurityError'); |
+ assert_equals(e.name, 'SecurityError', |
+ 'The scope set to a non-subdirectory of the scriptURL ' + |
+ 'should reject with SecurityError'); |
frame.remove(); |
return service_worker_unregister_and_done(t, scope); |
}) |
.catch(unreached_rejection(t)); |
}, 'A scope url should start with the given script url'); |
+ |
</script> |