Commit b2795ddb authored by Austin James Ahlstrom's avatar Austin James Ahlstrom Committed by Commit Bot

Removing ported LayoutTests

Removing failure expectation for removed tests

Bug: 745385
Change-Id: Ica5c4b7f925ec2daed2c08b7f888e9cf03a4df82
Reviewed-on: https://chromium-review.googlesource.com/593384Reviewed-by: default avatarTakeshi Yoshino <tyoshino@chromium.org>
Reviewed-by: default avatarYutaka Hirano <yhirano@chromium.org>
Commit-Queue: Austin James Ahlstrom <aahlstrom@google.com>
Cr-Commit-Position: refs/heads/master@{#490735}
parent a863c313
......@@ -12729,8 +12729,6 @@ crbug.com/591099 http/tests/workers/worker-redirect.html [ Failure ]
crbug.com/591099 http/tests/workers/worker-workerScriptNotThere.html [ Failure ]
crbug.com/591099 http/tests/xmlhttprequest/XMLHttpRequestException.html [ Failure ]
crbug.com/591099 http/tests/xmlhttprequest/abort-should-destroy-responseText.html [ Failure ]
crbug.com/591099 http/tests/xmlhttprequest/access-control-allow-lists-starting-with-comma.html [ Failure ]
crbug.com/591099 http/tests/xmlhttprequest/access-control-and-redirects-async-same-origin.html [ Failure ]
crbug.com/591099 http/tests/xmlhttprequest/access-control-and-redirects-async.html [ Failure Timeout ]
crbug.com/591099 http/tests/xmlhttprequest/access-control-and-redirects.html [ Failure ]
crbug.com/591099 http/tests/xmlhttprequest/access-control-basic-denied-preflight-cache.html [ Crash Failure ]
CONSOLE WARNING: line 11: Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
Allow lists starting with a comma should be parsed correctly.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Sending GET request with custom headers.
PASS xhr.send(null) is undefined.
PASS response['x-print'] is "unicorn"
PASS response['y-print'] is "narwhal"
Sending PUT request.
PASS xhr.send(null) is undefined.
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE html>
<html>
<head>
<script src="../../js-test-resources/js-test.js"></script>
</head>
<body>
<script type="text/javascript">
description("Allow lists starting with a comma should be parsed correctly.");
var xhr = new XMLHttpRequest();
var url = "http://localhost:8000/xmlhttprequest/resources/access-control-allow-lists.php?headers=,y-lol,x-print,%20,,,y-print&origin=http://127.0.0.1:8000";
xhr.open("GET", url, false);
xhr.setRequestHeader('x-print', 'unicorn')
xhr.setRequestHeader('y-print', 'narwhal')
debug("Sending GET request with custom headers.");
shouldBeUndefined("xhr.send(null)");
var response = JSON.parse(xhr.response)
shouldBeEqualToString("response['x-print']", "unicorn");
shouldBeEqualToString("response['y-print']", "narwhal");
url = "http://localhost:8000/xmlhttprequest/resources/access-control-allow-lists.php?methods=,,PUT,GET&origin=http://127.0.0.1:8000";
xhr.open("PUT", url, false);
debug("Sending PUT request.");
shouldBeUndefined("xhr.send(null)");
</script>
</body>
</html>
CONSOLE ERROR: Failed to load http://localhost:8000/xmlhttprequest/resources/access-control-basic-allow-star.cgi: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. Origin 'http://127.0.0.1:8000' is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
CONSOLE ERROR: Failed to load http://localhost:8000/xmlhttprequest/resources/access-control-basic-allow-no-credentials.cgi: The value of the 'Access-Control-Allow-Credentials' header in the response is '' which must be 'true' when the request's credentials mode is 'include'. Origin 'http://127.0.0.1:8000' is therefore not allowed access. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials attribute.
Tests that asynchronous XMLHttpRequests handle redirects according to the CORS standard.
Testing resources/redirect.php?url=http://localhost:8000/xmlhttprequest/resources/access-control-basic-allow-star.cgi without credentials
Expecting success: true
PASS: PASS: Cross-domain access allowed.
Testing resources/redirect.php?url=http://localhost:8000/xmlhttprequest/resources/access-control-basic-allow-star.cgi with credentials
Expecting success: false
PASS: 0
Testing resources/redirect.php?url=http://localhost:8000/xmlhttprequest/resources/access-control-basic-allow.cgi without credentials
Expecting success: true
PASS: PASS: Cross-domain access allowed.
Testing resources/redirect.php?url=http://localhost:8000/xmlhttprequest/resources/access-control-basic-allow.cgi with credentials
Expecting success: true
PASS: PASS: Cross-domain access allowed.
Testing resources/redirect.php?url=http://localhost:8000/xmlhttprequest/resources/access-control-basic-allow-no-credentials.cgi without credentials
Expecting success: true
PASS: PASS: Cross-domain access allowed.
Testing resources/redirect.php?url=http://localhost:8000/xmlhttprequest/resources/access-control-basic-allow-no-credentials.cgi with credentials
Expecting success: false
PASS: 0
<p>Tests that asynchronous XMLHttpRequests handle redirects according to the CORS standard.</p>
<pre id="console"></pre>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
function log(message)
{
document.getElementById('console').appendChild(document.createTextNode(message + '\n'));
}
function runTestAsync(url, credentials, addCustomHeader, expectSuccess) {
log("Testing " + url + (credentials ? " with " : " without ") + "credentials");
log("Expecting success: " + expectSuccess);
xhr = new XMLHttpRequest();
xhr.withCredentials = credentials;
xhr.open("GET", url, true);
if (addCustomHeader)
xhr.setRequestHeader("x-webkit", "foo");
xhr.onload = function() {
log((expectSuccess ? "PASS" : "FAIL") + ": " + xhr.responseText);
nextTest();
}
xhr.onerror = function() {
log((expectSuccess ? "FAIL" : "PASS") + ": " + xhr.status);
nextTest();
}
xhr.send(null);
}
var withoutCredentials = false;
var withCredentials = true;
var noCustomHeader = false;
var addCustomHeader = true;
var succeeds = true;
var fails = false;
var tests = [
// Test simple same origin requests that receive cross origin redirects.
// Request without credentials is redirected to a cross-origin response with Access-Control-Allow-Origin=*.
// The redirect response passes the access check.
["resources/redirect.php?url=http://localhost:8000/xmlhttprequest/resources/access-control-basic-allow-star.cgi",
withoutCredentials, noCustomHeader, succeeds],
// Request with credentials is redirected to a cross-origin response with Access-Control-Allow-Origin=*.
// The redirect response fails the access check because credentials were sent.
["resources/redirect.php?url=http://localhost:8000/xmlhttprequest/resources/access-control-basic-allow-star.cgi",
withCredentials, noCustomHeader, fails],
// Request without credentials is redirected to a cross-origin response with a specific Access-Control-Allow-Origin.
// The redirect response passes the access check.
["resources/redirect.php?url=http://localhost:8000/xmlhttprequest/resources/access-control-basic-allow.cgi",
withoutCredentials, noCustomHeader, succeeds],
// Request with credentials is redirected to a cross-origin response with a specific Access-Control-Allow-Origin.
// The redirect response passes the access check.
["resources/redirect.php?url=http://localhost:8000/xmlhttprequest/resources/access-control-basic-allow.cgi",
withCredentials, noCustomHeader, succeeds],
// Request without credentials is redirected to a cross-origin response with a specific Access-Control-Allow-Origin
// forbidding credentials. The redirect response passes the access check.
["resources/redirect.php?url=http://localhost:8000/xmlhttprequest/resources/access-control-basic-allow-no-credentials.cgi",
withoutCredentials, noCustomHeader, succeeds],
// Request with credentials is redirected to a cross-origin response with a specific Access-Control-Allow-Origin
// forbidding credentials. The redirect response fails the access check.
["resources/redirect.php?url=http://localhost:8000/xmlhttprequest/resources/access-control-basic-allow-no-credentials.cgi",
withCredentials, noCustomHeader, fails],
]
var currentTest = 0;
function nextTest() {
if (currentTest < tests.length)
runTestAsync.apply(null, tests[currentTest++]);
else if (window.testRunner)
testRunner.notifyDone();
}
nextTest();
</script>
#!/usr/bin/perl -wT
use strict;
print "Content-Type: text/plain\n";
print "Access-Control-Allow-Origin: http://127.0.0.1:8000\n\n";
print "PASS: Cross-domain access allowed.\n";
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment