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

Side by Side Diff: content/browser/cross_site_transfer_browsertest.cc

Issue 1411073005: Migrating tests to use EmbeddedTestServer (/content) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 1 month 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 unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698