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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/suborigins/suborigin-invalid-options.html

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/suborigin-invalid-options.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/suborigins/suborigin-invalid-options.html b/third_party/WebKit/LayoutTests/http/tests/security/suborigins/suborigin-invalid-options.html
index 276ceaf165b2f3aed55430fc3d086a66950f70fa..6d3b8aadaebeecfb3c5cde8c9d166e204801ee3a 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/suborigins/suborigin-invalid-options.html
+++ b/third_party/WebKit/LayoutTests/http/tests/security/suborigins/suborigin-invalid-options.html
@@ -1,33 +1,37 @@
<!DOCTYPE html>
<html>
<head>
+<meta charset="utf-8">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
var test_suborigin_options = [
- [ "foobar '", "Single quote as option" ],
- [ "foobar 'unsafe-postmessage-send';", "Character after single policy" ],
- [ "foobar 'unsafe-postmessage-send'; 'unsafe-cookies';", "Charecters after multiple policies" ],
- [ "foobar; 'unsafe-postmessage-send'", "Character before policy" ],
- [ "foobar 'b@d character$'", "Bad characters in option" ],
+ [ 'foobar \'', 'Single quote as option' ],
+ [ 'foobar \'unsafe-postmessage-send\';', 'Character after single policy' ],
+ [ 'foobar \'unsafe-postmessage-send\'; \'unsafe-cookies\';',
+ 'Charecters after multiple policies' ],
+ [ 'foobar; \'unsafe-postmessage-send\'', 'Character before policy' ],
+ [ 'foobar \'b@d character$\'', 'Bad characters in option' ],
];
for (option in test_suborigin_options) {
- async_test(t => {
- var id = option;
- var iframe;
- window.addEventListener('message', t.step_func(event => {
- if (event.source != iframe.contentWindow)
- return;
+ async_test(t => {
+ var id = option;
+ var iframe;
+ window.addEventListener('message', t.step_func(event => {
+ if (event.source != iframe.contentWindow)
+ return;
- assert_equals(event.data, "I am a secret");
- t.done();
+ assert_equals(event.data, 'I am a secret');
+ t.done();
}));
- iframe = document.createElement('iframe');
- iframe.setAttribute('src', "resources/reach-into-iframe.php?childsuborigin=" + test_suborigin_options[id][0]);
- document.body.appendChild(iframe);
+ iframe = document.createElement('iframe');
+ iframe.setAttribute('src',
+ 'resources/reach-into-iframe.php?childsuborigin=' +
+ test_suborigin_options[id][0]);
+ document.body.appendChild(iframe);
}, test_suborigin_options[option][1]);
}
</script>

Powered by Google App Engine
This is Rietveld 408576698