diff options
Diffstat (limited to 'content')
-rw-r--r-- | content/shell/shell_browser_context.cc | 4 | ||||
-rw-r--r-- | content/shell/shell_switches.cc | 3 | ||||
-rw-r--r-- | content/shell/shell_switches.h | 1 | ||||
-rw-r--r-- | content/test/content_browser_test.cc | 5 |
4 files changed, 11 insertions, 2 deletions
diff --git a/content/shell/shell_browser_context.cc b/content/shell/shell_browser_context.cc index fe91531..5f93fc1 100644 --- a/content/shell/shell_browser_context.cc +++ b/content/shell/shell_browser_context.cc @@ -41,7 +41,9 @@ ShellBrowserContext::~ShellBrowserContext() { } void ShellBrowserContext::InitWhileIOAllowed() { - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) { + CommandLine* cmd_line = CommandLine::ForCurrentProcess(); + if (cmd_line->HasSwitch(switches::kContentBrowserTest) || + cmd_line->HasSwitch(switches::kDumpRenderTree)) { CHECK(testing_path_.CreateUniqueTempDir()); path_ = testing_path_.path(); return; diff --git a/content/shell/shell_switches.cc b/content/shell/shell_switches.cc index 4a392f5..e3cffb3 100644 --- a/content/shell/shell_switches.cc +++ b/content/shell/shell_switches.cc @@ -9,6 +9,9 @@ namespace switches { // Check whether all system dependencies for running layout tests are met. const char kCheckLayoutTestSysDeps[] = "check-layout-test-sys-deps"; +// Tells Content Shell that it's running as a content_browsertest. +const char kContentBrowserTest[] = "browser-test"; + // Request pages to be dumped as text once they finished loading. const char kDumpRenderTree[] = "dump-render-tree"; diff --git a/content/shell/shell_switches.h b/content/shell/shell_switches.h index 0f05b1f3..342cedd 100644 --- a/content/shell/shell_switches.h +++ b/content/shell/shell_switches.h @@ -10,6 +10,7 @@ namespace switches { extern const char kCheckLayoutTestSysDeps[]; +extern const char kContentBrowserTest[]; extern const char kDumpRenderTree[]; } // namespace switches diff --git a/content/test/content_browser_test.cc b/content/test/content_browser_test.cc index 9eb5c63..a863d65 100644 --- a/content/test/content_browser_test.cc +++ b/content/test/content_browser_test.cc @@ -13,6 +13,7 @@ #include "content/public/common/content_switches.h" #include "content/shell/shell.h" #include "content/shell/shell_main_delegate.h" +#include "content/shell/shell_switches.h" #include "content/test/test_content_client.h" #if defined(OS_MACOSX) @@ -38,9 +39,11 @@ void ContentBrowserTest::SetUp() { shell_main_delegate_.reset(new ShellMainDelegate); shell_main_delegate_->PreSandboxStartup(); + CommandLine* command_line = CommandLine::ForCurrentProcess(); + command_line->AppendSwitch(switches::kContentBrowserTest); + #if defined(OS_MACOSX) // See InProcessBrowserTest::PrepareTestCommandLine(). - CommandLine* command_line = CommandLine::ForCurrentProcess(); FilePath subprocess_path; PathService::Get(base::FILE_EXE, &subprocess_path); subprocess_path = subprocess_path.DirName().DirName(); |