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

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: Incorporated comments from Matt & Ricardo. Created 6 years, 11 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
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..cb4a713626249da3adb59ae8ac00cf21e5c22d00 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,12 +63,12 @@ void ContentBrowserTest::SetUp() {
SetUpCommandLine(command_line);
- // Single-process mode is not set in BrowserMain, so process it explicitly,
- // and set up renderer.
- if (command_line->HasSwitch(switches::kSingleProcess)) {
- single_process_renderer_client_.reset(new ShellContentRendererClient);
- SetRendererClientForTesting(single_process_renderer_client_.get());
- }
+ // 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 (!single_process_renderer_client_.get() &&
+ command_line->HasSwitch(switches::kSingleProcess))
+ SetContentRendererClient(
+ scoped_ptr<ContentRendererClient>(new ShellContentRendererClient));
#if defined(OS_MACOSX)
// See InProcessBrowserTest::PrepareTestCommandLine().
@@ -89,6 +87,8 @@ void ContentBrowserTest::SetUp() {
ui::InitializeInputMethodForTesting();
#endif
+ setup_called_ = true;
+
BrowserTestBase::SetUp();
}
@@ -144,6 +144,13 @@ void ContentBrowserTest::RunTestOnMainThreadLoop() {
Shell::CloseAllWindows();
}
+void ContentBrowserTest::SetContentRendererClient(
+ scoped_ptr<ContentRendererClient> renderer_client) {
+ DCHECK(!setup_called_);
+ single_process_renderer_client_ = renderer_client.Pass();
+ SetRendererClientForTesting(single_process_renderer_client_.get());
+}
+
Shell* ContentBrowserTest::CreateBrowser() {
return Shell::CreateNewWindow(
ShellContentBrowserClient::Get()->browser_context(),

Powered by Google App Engine
This is Rietveld 408576698