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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/suborigins/crossorigin/suborigin-cross-origin-worker-onerror-no-cors.php

Issue 2370843003: Suborigin LayoutTest formatting and refactoring (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/security/suborigins/crossorigin/suborigin-cross-origin-worker-onerror-no-cors.php
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/suborigins/crossorigin/suborigin-cross-origin-worker-onerror-no-cors.php b/third_party/WebKit/LayoutTests/http/tests/security/suborigins/crossorigin/suborigin-cross-origin-worker-onerror-no-cors.php
index 2c34eadf282fdcc48a35aa230ffcb136677ffcab..43d07040abb64e094a9665f86f65f672f4a77634 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/suborigins/crossorigin/suborigin-cross-origin-worker-onerror-no-cors.php
+++ b/third_party/WebKit/LayoutTests/http/tests/security/suborigins/crossorigin/suborigin-cross-origin-worker-onerror-no-cors.php
@@ -4,19 +4,26 @@ header("Suborigin: foobar");
<!DOCTYPE html>
<html>
<head>
- <script>
- window.jsTestIsAsync = true;
- window.isOnErrorTest = true;
- </script>
- <script src="/js-test-resources/js-test.js"></script>
+<meta charset="utf-8">
+<script>
+window.jsTestIsAsync = true;
+window.isOnErrorTest = true;
+</script>
+<script src="/js-test-resources/js-test.js"></script>
</head>
<body>
<script>
- description("Ensure that scripts imported into a Worker from cross-origin hosts trigger sanitized onerror messages.");
+description('Ensure that scripts imported into a Worker from cross-origin hosts trigger sanitized onerror messages.');
- var worker;
- shouldThrow('worker = new Worker("/workers/resources/worker-importscripts-onerror-sameorigin.js")', '"SecurityError: Failed to construct \'Worker\': Script at \'http://127.0.0.1:8000/workers/resources/worker-importscripts-onerror-sameorigin.js\' cannot be accessed from origin \'http-so://foobar.127.0.0.1:8000\'."');
- finishJSTest();
- </script>
+var worker;
+var worker_path =
+ '/workers/resources/worker-importscripts-onerror-sameorigin.js';
+shouldThrow(
+ 'worker = new Worker("' + worker_path + '")',
+ '"SecurityError: Failed to construct \'Worker\': Script at ' +
+ '\'http://127.0.0.1:8000' + worker_path +
+ '\' cannot be accessed from origin \'http-so://foobar.127.0.0.1:8000\'."');
+finishJSTest();
+</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698