| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/strings/stringprintf.h" | 6 #include "base/strings/stringprintf.h" |
| 7 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 7 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
| 8 #include "content/public/browser/navigation_entry.h" | 8 #include "content/public/browser/navigation_entry.h" |
| 9 #include "content/public/browser/resource_dispatcher_host_delegate.h" | 9 #include "content/public/browser/resource_dispatcher_host_delegate.h" |
| 10 #include "content/public/browser/resource_throttle.h" | 10 #include "content/public/browser/resource_throttle.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 public: | 170 public: |
| 171 CrossSiteTransferTest() : old_delegate_(nullptr) {} | 171 CrossSiteTransferTest() : old_delegate_(nullptr) {} |
| 172 | 172 |
| 173 // ContentBrowserTest implementation: | 173 // ContentBrowserTest implementation: |
| 174 void SetUpOnMainThread() override { | 174 void SetUpOnMainThread() override { |
| 175 BrowserThread::PostTask( | 175 BrowserThread::PostTask( |
| 176 BrowserThread::IO, FROM_HERE, | 176 BrowserThread::IO, FROM_HERE, |
| 177 base::Bind(&CrossSiteTransferTest::InjectResourceDispatcherHostDelegate, | 177 base::Bind(&CrossSiteTransferTest::InjectResourceDispatcherHostDelegate, |
| 178 base::Unretained(this))); | 178 base::Unretained(this))); |
| 179 host_resolver()->AddRule("*", "127.0.0.1"); | 179 host_resolver()->AddRule("*", "127.0.0.1"); |
| 180 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 180 ASSERT_TRUE(embedded_test_server()->Start()); |
| 181 content::SetupCrossSiteRedirector(embedded_test_server()); | 181 content::SetupCrossSiteRedirector(embedded_test_server()); |
| 182 } | 182 } |
| 183 | 183 |
| 184 void TearDownOnMainThread() override { | 184 void TearDownOnMainThread() override { |
| 185 BrowserThread::PostTask( | 185 BrowserThread::PostTask( |
| 186 BrowserThread::IO, FROM_HERE, | 186 BrowserThread::IO, FROM_HERE, |
| 187 base::Bind( | 187 base::Bind( |
| 188 &CrossSiteTransferTest::RestoreResourceDisptcherHostDelegate, | 188 &CrossSiteTransferTest::RestoreResourceDisptcherHostDelegate, |
| 189 base::Unretained(this))); | 189 base::Unretained(this))); |
| 190 } | 190 } |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 EXPECT_EQ(0, controller.GetCurrentEntryIndex()); | 424 EXPECT_EQ(0, controller.GetCurrentEntryIndex()); |
| 425 EXPECT_EQ(url1, controller.GetEntryAtIndex(0)->GetURL()); | 425 EXPECT_EQ(url1, controller.GetEntryAtIndex(0)->GetURL()); |
| 426 | 426 |
| 427 // Make sure the request for url2 did not complete. | 427 // Make sure the request for url2 did not complete. |
| 428 EXPECT_FALSE(tracking_delegate().WaitForTrackedURLAndGetCompleted()); | 428 EXPECT_FALSE(tracking_delegate().WaitForTrackedURLAndGetCompleted()); |
| 429 | 429 |
| 430 shell()->web_contents()->SetDelegate(old_delegate); | 430 shell()->web_contents()->SetDelegate(old_delegate); |
| 431 } | 431 } |
| 432 | 432 |
| 433 } // namespace content | 433 } // namespace content |
| OLD | NEW |