Index: third_party/WebKit/LayoutTests/http/tests/security/suborigins/suborigin-service-worker-fetch-event.html |
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/suborigins/suborigin-service-worker-fetch-event.html b/third_party/WebKit/LayoutTests/http/tests/security/suborigins/suborigin-service-worker-fetch-event.html |
index a23ff8e3a24bc51d6b7576565be5472d43dfc003..e3a0d05c8d05472b8c7155383249f15c58ced7f8 100644 |
--- a/third_party/WebKit/LayoutTests/http/tests/security/suborigins/suborigin-service-worker-fetch-event.html |
+++ b/third_party/WebKit/LayoutTests/http/tests/security/suborigins/suborigin-service-worker-fetch-event.html |
@@ -1,6 +1,7 @@ |
<!DOCTYPE html> |
<html> |
<head> |
+<meta charset="utf-8"> |
<title>Service Worker cannot access fetch events from a suborigin</title> |
<script src="/resources/testharness.js"></script> |
<script src="/resources/testharnessreport.js"></script> |
@@ -9,42 +10,47 @@ |
<body> |
<script> |
-var t_nonsuborigin = async_test('Service worker can access fetch events from a non-suborigin on the origin'); |
-var t_suborigin = async_test('Service worker cannot access fetch events from a suborigin on the origin'); |
+var t_nonsuborigin = async_test( |
+ 'Service worker can access fetch events from a non-suborigin on the origin'); |
+var t_suborigin = async_test( |
+ 'Service worker cannot access fetch events from a suborigin on the origin'); |
window.addEventListener('message', function(e) { |
if (e.data.id == 'suborigin') { |
- t_suborigin.step(function() { |
- assert_equals(e.data.type, 'response'); |
- t_suborigin.done(); |
+ t_suborigin.step(function() { |
+ assert_equals(e.data.type, 'response'); |
+ t_suborigin.done(); |
}); |
} else if (e.data.id == 'nonsuborigin') { |
- t_nonsuborigin.step(function() { |
- assert_equals(e.data.type, 'error'); |
- t_nonsuborigin.done(); |
+ t_nonsuborigin.step(function() { |
+ assert_equals(e.data.type, 'error'); |
+ t_nonsuborigin.done(); |
}); |
} else { |
- assert_unreached('id must be one of \'suborigin\' or \'nonsuborigin\''); |
+ assert_unreached('id must be one of \'suborigin\' or \'nonsuborigin\''); |
} |
-}); |
+ }); |
-navigator.serviceWorker.register('/security/suborigins/resources/sw-reject-all-with-error.js') |
-.then(function(swr) { |
- var tests_started = false; |
+navigator.serviceWorker.register( |
+ '/security/suborigins/resources/sw-reject-all-with-error.js') |
+ .then(function(swr) { |
+ var tests_started = false; |
- swr.installing.onstatechange = function() { |
+ swr.installing.onstatechange = function() { |
if (tests_started) |
- return; |
+ return; |
tests_started = true; |
var iframe1 = document.createElement('iframe'); |
- iframe1.src = 'resources/fetch-resource.php?suborigin=foobar&resource=/resources/dummy.txt&id=suborigin&bypass'; |
+ iframe1.src = 'resources/fetch-resource.php?suborigin=foobar&' + |
+ 'resource=/resources/dummy.txt&id=suborigin&bypass'; |
document.body.appendChild(iframe1); |
var iframe2 = document.createElement('iframe'); |
- iframe2.src = 'resources/fetch-resource.php?resource=/resources/dummy.txt&id=nonsuborigin&bypass'; |
+ iframe2.src = 'resources/fetch-resource.php?' + |
+ 'resource=/resources/dummy.txt&id=nonsuborigin&bypass'; |
document.body.appendChild(iframe2); |
- }; |
-}); |
+ }; |
+ }); |
</script> |
</body> |