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

Unified Diff: content/test/content_browser_test.cc

Issue 138513002: Plumb network stack information about existence of cached copy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync'd to r248769. Created 6 years, 10 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 | « content/test/content_browser_test.h ('k') | content/test/data/nocache.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/content_browser_test.cc
diff --git a/content/test/content_browser_test.cc b/content/test/content_browser_test.cc
index a1644503a4f373c280f185a5802c8dcf76f6b9dc..38816138463f02dcfd71fa0dcf5ee7919112c17e 100644
--- a/content/test/content_browser_test.cc
+++ b/content/test/content_browser_test.cc
@@ -55,8 +55,6 @@ ContentBrowserTest::~ContentBrowserTest() {
}
void ContentBrowserTest::SetUp() {
- setup_called_ = true;
-
shell_main_delegate_.reset(new ShellMainDelegate);
shell_main_delegate_->PreSandboxStartup();
@@ -65,11 +63,16 @@ void ContentBrowserTest::SetUp() {
SetUpCommandLine(command_line);
- // Single-process mode is not set in BrowserMain, so process it explicitly,
- // and set up renderer.
+ // Single-process mode is not set in BrowserMain, so if a subclass hasn't
+ // modified it yet, process it explicitly, and set up renderer.
if (command_line->HasSwitch(switches::kSingleProcess)) {
- single_process_renderer_client_.reset(new ShellContentRendererClient);
+ if (!single_process_renderer_client_)
+ single_process_renderer_client_.reset(new ShellContentRendererClient());
SetRendererClientForTesting(single_process_renderer_client_.get());
+ } else {
+ // Confirm no test has called SetContentRendererClient() without
+ // setting up single process mode.
+ DCHECK(!single_process_renderer_client_);
}
#if defined(OS_MACOSX)
@@ -89,6 +92,8 @@ void ContentBrowserTest::SetUp() {
ui::InitializeInputMethodForTesting();
#endif
+ setup_called_ = true;
+
BrowserTestBase::SetUp();
}
@@ -144,6 +149,14 @@ void ContentBrowserTest::RunTestOnMainThreadLoop() {
Shell::CloseAllWindows();
}
+void ContentBrowserTest::SetContentRendererClient(
+ scoped_ptr<ContentRendererClient> renderer_client) {
+ // This routine must be called before SetUp().
+ DCHECK(!setup_called_);
+ DCHECK(!single_process_renderer_client_);
+ single_process_renderer_client_ = renderer_client.Pass();
+}
+
Shell* ContentBrowserTest::CreateBrowser() {
return Shell::CreateNewWindow(
ShellContentBrowserClient::Get()->browser_context(),
« no previous file with comments | « content/test/content_browser_test.h ('k') | content/test/data/nocache.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698