Commit 1cdfb501 authored by jam@chromium.org's avatar jam@chromium.org

Commit test data to be moved since try bots won't apply otherwise

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148884 0039d316-1c4b-4281-b951-d872f2087c98
parent 2c3ac4cb
<html>
<head><title>success</title></head>
<body>this page should be displayed instead of downloaded</body>
</html>
HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 116
Content-Disposition: filename="foo.html"
Date: Mon, 13 Nov 2006 21:38:09 GMT
Expires: Tue, 14 Nov 2006 19:23:58 GMT
<html>
<head><title>success</title></head>
<body>this page should be displayed instead of downloaded</body>
</html>
HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 116
Content-Disposition: inline; filename="foo.html"
Date: Mon, 13 Nov 2006 21:38:09 GMT
Expires: Tue, 14 Nov 2006 19:23:58 GMT
<html>
<head><title>Content Sniffer Test 0</title></head>
<body>We should sniff this content as HTML.</body>
</html>
<html>
<head><title>Content Sniffer Test 1</title></head>
<body>We should not sniff this content as HTML.</body>
</html>
HTTP/1.1 200 OK
Content-Type: text/plain; charset=utf-8
Content-Length: 125
<html>
<head><title>Content Sniffer Test 2</title></head>
<body>We should not sniff this as HTML as server says its a GIF.</body>
</html>
HTTP/1.1 200 OK
Content-Type: image/gif
Content-Length: 142
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<title>Content Sniffer Test 3</title>
</head>
<body>
<script id="sc">
var iframe = document.createElement('iframe');
iframe.frameBorder = iframe.width = iframe.height = 0;
iframe.src = "http://mock.http/content-sniffer-test3-frame.txt";
document.body.appendChild(iframe);
</script>
<pre>Do NOT download!!</pre>
</body>
</html>
\ No newline at end of file
HTTP/1.1 200 OK
Content-Length: 472
Content-Type: text/html
<html>
<head>
<title></title>
</head>
<body>
<script>
function NewXHR(url) {
var r = new XMLHttpRequest
r.open("GET", url);
return r;
}
function SignalSuccess() {
document.location = "title3.html";
}
function SignalFailure() {
document.location = "title1.html";
}
function CreateDummyRequest() {
dummy_request = NewXHR("http://mock.http/title2.html");
dummy_request.onload = SignalSuccess;
dummy_request.send(null);
}
function RedirectFailed() {
// Good, the redirect was blocked by WebKit.
//
// We also care that the underlying network stack does not send the redirect.
// We cannot detect that from JS, but our test harness is designed to detect
// that (see ResourceDispatcherTest::CrossOriginRedirectBlocked). Before
// calling SignalSuccess, we want to allow the browser time to notice a request
// to follow the redirect if one should exist. To do that, we just need to
// make another network request.
//
// The setTimeout call is intended to delay CreateDummyRequest so that any
// processing associated with the current "error" handler completes.
setTimeout(CreateDummyRequest, 0);
}
function RedirectSucceeded() {
// Oops, the redirect should have been denied!
SignalFailure();
}
// Kick off a request that will attempt a cross-origin redirect.
request = NewXHR("http://mock.http/redirect-to-title2.html");
request.onerror = RedirectFailed;
request.onload = RedirectSucceeded;
request.send(null);
</script>
</body>
</html>
<html>
<head>
<title>Test Title</title>
<script type="text/javascript">
function OpenPopup() {
// Create a new popup window
var oWnd = window.open('','MyPopupName','width=350,height=300',false);
// Dynamically generate the HTML content for popup window
var sHtml =
'<html>'
+ '<head><title>My Popup Title</title></head>'
+ '<body></body>'
+ '</html>';
// Push the HTML into that window
oWnd.document.write(sHtml);
// Finish
oWnd.document.close();
}
</script>
</head>
<body>
<p>This is dynamic1.html</p>
</body>
</html>
<html>
<head>
<title>Test Title</title>
<script type="text/javascript">
function OpenPopup() {
// Create a new popup window
var oWnd = window.open('','MyPopupName','width=350,height=300',false);
// Dynamically generate the HTML content for popup window
var sHtml =
'<html>'
+ '<head><title>My Popup Title</title></head>'
+ '<body>'
+ '<script type="text/javascript">'
+ 'document.title="My Dynamic Title";'
+ '<\/script>'
+ '</body>'
+ '</html>';
// Push the HTML into that window
oWnd.document.write(sHtml);
// Finish
oWnd.document.close();
}
</script>
</head>
<body>
<p>This is dynamic2.html</p>
</body>
</html>
<html>
<head><title>nosniff Test</title></head>
<body>We should NOT sniff this content as HTML.</body>
</html>
HTTP/1.1 200 OK
Content-Length: 111
X-Content-Type-Options: nosniff
<html>
<head>
<title>Loading...</title>
</head>
<body onload="attachUnloadListener()">
<script>
function attachUnloadListener() {
window.addEventListener('unload', onUnload, false);
document.title = "set cookie on unload";
}
function onUnload() {
document.cookie = "onunloadCookie=foo";
}
</script>
<p>Navigate to another page to set cookie</p>
</body>
</html>
<html>
<head>
<script>
var request_success = false;
function OnLoad() {
var request = new XMLHttpRequest();
request.open("GET", "title1.html", false);
request.send("");
var my_div = document.getElementById("my_div");
if (request.readyState == 4 && request.status == 200) {
request_success = true;
my_div.innerHTML = "Got a successful response: " + request.responseText;
} else {
my_div.innerHTML = "Request failed: ready state=" + request.readyState +
" status=" + request.status;
}
}
function DidSyncRequestSucceed() {
return request_success;
}
</script>
</head>
<body onload="OnLoad();">
This page sends a synchronous XMLHttpRequest.
<br><br>
<div id="my_div"></div>
</body>
</html>
<html>
<head>
<script>
var success = false;
function OnLoad() {
try {
var request = new XMLHttpRequest();
request.open("GET", "file:///c:/foo.txt", false);
request.send(null);
} catch (e) {
success = true;
}
document.getElementById("console").appendChild(
document.createTextNode(success ? "SUCCESS" : "FAILURE"));
}
function DidSucceed() {
return success;
}
</script>
</head>
<body onload="OnLoad();">
This page sends a synchronous XMLHttpRequest to fetch a local file, which
should not be allowed.
<div id="console"></div>
</body>
</html>
<html>
<head>
<title>Loading...</title>
</head>
<body onload="attachUnloadListener()">
<script>
function attachUnloadListener() {
window.addEventListener('unload', onUnload, false);
document.title = "sync xhr on unload";
}
var req = new XMLHttpRequest();
function onUnload() {
req.open('GET','download-test1.lib', false);
req.send(null);
}
</script>
<p>Navigate to another page to trigger synch xmlhttprequest</p>
</body>
</html>
<html>
<head></head>
<body>This page has no title.</body>
</html>
<html>
<head><title>Title Of Awesomeness</title></head>
<body>This page has a title.</body>
</html>
<html>
<head><title>Title Of More Awesomeness</title></head>
<body>This page has a title.</body>
</html>
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