summaryrefslogtreecommitdiffstats
path: root/content/test/content_test_launcher.cc
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-05 21:59:33 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-05 21:59:33 +0000
commitc1f87b2a4f2d08b92db6f0c7f4f6661d5166feb9 (patch)
treed1348080214f9bab7a2f3d2b7f6e474b55cb24d5 /content/test/content_test_launcher.cc
parent5435643695ec7f4e77fd4a2cda5bfa1222ec198f (diff)
downloadchromium_src-c1f87b2a4f2d08b92db6f0c7f4f6661d5166feb9.zip
chromium_src-c1f87b2a4f2d08b92db6f0c7f4f6661d5166feb9.tar.gz
chromium_src-c1f87b2a4f2d08b92db6f0c7f4f6661d5166feb9.tar.bz2
Make an empty content browser test work.
BUG=90448 Review URL: http://codereview.chromium.org/8137012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104181 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/test/content_test_launcher.cc')
-rw-r--r--content/test/content_test_launcher.cc39
1 files changed, 27 insertions, 12 deletions
diff --git a/content/test/content_test_launcher.cc b/content/test/content_test_launcher.cc
index 5e1ba50..0fe5ba5 100644
--- a/content/test/content_test_launcher.cc
+++ b/content/test/content_test_launcher.cc
@@ -4,10 +4,20 @@
#include "content/test/test_launcher.h"
+#include "base/base_paths.h"
#include "base/command_line.h"
#include "base/logging.h"
+#include "base/path_service.h"
#include "base/scoped_temp_dir.h"
-#include "content/test/content_test_suite.h"
+#include "base/test/test_suite.h"
+#include "content/app/content_main.h"
+#include "content/common/content_switches.h"
+#include "content/shell/shell_main_delegate.h"
+
+#if defined(OS_WIN)
+#include "content/app/startup_helper_win.h"
+#include "sandbox/src/sandbox_types.h"
+#endif // defined(OS_WIN)
class ContentTestLauncherDelegate : public test_launcher::TestLauncherDelegate {
public:
@@ -21,26 +31,31 @@ class ContentTestLauncherDelegate : public test_launcher::TestLauncherDelegate {
}
virtual bool Run(int argc, char** argv, int* return_code) OVERRIDE {
+#if defined(OS_WIN)
CommandLine* command_line = CommandLine::ForCurrentProcess();
-
- // TODO(pkasting): This "single_process vs. single-process" design is
- // terrible UI. Instead, there should be some sort of signal flag on the
- // command line, with all subsequent arguments passed through to the
- // underlying browser.
- if (command_line->HasSwitch(test_launcher::kSingleProcessTestsFlag) ||
- command_line->HasSwitch(
- test_launcher::kSingleProcessTestsAndChromeFlag) ||
- command_line->HasSwitch(test_launcher::kGTestListTestsFlag) ||
- command_line->HasSwitch(test_launcher::kGTestHelpFlag)) {
- *return_code = ContentTestSuite(argc, argv).Run();
+ if (command_line->HasSwitch(switches::kProcessType)) {
+ sandbox::SandboxInterfaceInfo sandbox_info = {0};
+ content::InitializeSandboxInfo(&sandbox_info);
+ ShellMainDelegate delegate;
+ *return_code =
+ content::ContentMain(GetModuleHandle(NULL), &sandbox_info, &delegate);
return true;
}
+#endif // defined(OS_WIN)
return false;
}
+ virtual int RunTestSuite(int argc, char** argv) OVERRIDE {
+ return base::TestSuite(argc, argv).Run();
+ }
+
virtual bool AdjustChildProcessCommandLine(
CommandLine* command_line) OVERRIDE {
+ FilePath file_exe;
+ if (!PathService::Get(base::FILE_EXE, &file_exe))
+ return false;
+ command_line->AppendSwitchPath(switches::kBrowserSubprocessPath, file_exe);
return true;
}