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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/suborigins/crossorigin/suborigin-cors-xhr-failure-output.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-cors-xhr-failure-output.php
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/suborigins/crossorigin/suborigin-cors-xhr-failure-output.php b/third_party/WebKit/LayoutTests/http/tests/security/suborigins/crossorigin/suborigin-cors-xhr-failure-output.php
index c50fe52eb86e8451d4a51e5fc0aa0b17dbf88fa8..bae8eb3f8d3d60c492b28c60955547b5b4f498c5 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/suborigins/crossorigin/suborigin-cors-xhr-failure-output.php
+++ b/third_party/WebKit/LayoutTests/http/tests/security/suborigins/crossorigin/suborigin-cors-xhr-failure-output.php
@@ -3,50 +3,58 @@ header("Suborigin: foobar");
?>
<!DOCTYPE html>
<html>
+<head>
+<meta charset="utf-8">
+</head>
<body>
<script>
if (window.testRunner) {
- testRunner.waitUntilDone();
- testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ testRunner.dumpAsText();
}
-console.log("If a Suborigin makes a request, a response without an Access-Control-Allow-Suborigin header should fail and should output a reasonable error message.");
+console.log(
+ 'If a Suborigin makes a request, a response without an ' +
+ 'Access-Control-Allow-Suborigin header should fail and should ' +
+ 'output a reasonable error message.');
function success() {
- alert("PASS: XHR correctly failed");
- next();
+ alert('PASS: XHR correctly failed');
+ next();
}
function failure() {
- alert("FAIL: XHR incorrectly succeeded");
- next();
+ alert('FAIL: XHR incorrectly succeeded');
+ next();
}
// First one should fail with preflight failure. Second one should
// fail with access control header failure.
var tests = [
- function() {
- var xhr = new XMLHttpRequest();
- xhr.onerror = success;
- xhr.onload = failure;
- xhr.open("GET", "http://127.0.0.1:8000/security/resources/cors-script.php?cors=false");
- xhr.setRequestHeader("x-custom-header", "foobar");
- xhr.send();
- },
- function() {
- var xhr = new XMLHttpRequest();
- xhr.onerror = success;
- xhr.onload = failure;
- xhr.open("GET", "http://127.0.0.1:8000/security/resources/cors-script.php?cors=false");
- xhr.send();
- }
+ function() {
+ var xhr = new XMLHttpRequest();
+ xhr.onerror = success;
+ xhr.onload = failure;
+ xhr.open('GET', 'http://127.0.0.1:8000/security/resources/' +
+ 'cors-script.php?cors=false');
+ xhr.setRequestHeader('x-custom-header', 'foobar');
+ xhr.send();
+ },
+ function() {
+ var xhr = new XMLHttpRequest();
+ xhr.onerror = success;
+ xhr.onload = failure;
+ xhr.open('GET', 'http://127.0.0.1:8000/security/resources/' +
+ 'cors-script.php?cors=false');
+ xhr.send();
+ }
];
function next() {
- if (tests.length !== 0) {
- tests.shift()();
- } else if (window.testRunner) {
- testRunner.notifyDone();
- }
+ if (tests.length !== 0) {
+ tests.shift()();
+ } else if (window.testRunner) {
+ testRunner.notifyDone();
+ }
}
next();

Powered by Google App Engine
This is Rietveld 408576698