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

Unified Diff: chrome/test/data/cross-origin-redirect-blocked.html

Issue 10829070: Move resource_dispatcher_host_browsertest.cc to content_browsertests. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 8 years, 5 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
« no previous file with comments | « chrome/test/data/content-sniffer-test3.html.mock-http-headers ('k') | chrome/test/data/dynamic1.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/cross-origin-redirect-blocked.html
===================================================================
--- chrome/test/data/cross-origin-redirect-blocked.html (revision 148962)
+++ chrome/test/data/cross-origin-redirect-blocked.html (working copy)
@@ -1,56 +0,0 @@
-<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>
« no previous file with comments | « chrome/test/data/content-sniffer-test3.html.mock-http-headers ('k') | chrome/test/data/dynamic1.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698