diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-30 20:55:09 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-30 20:55:09 +0000 |
commit | bb36d82adbfa20d4fa5998c7c28c934b68432437 (patch) | |
tree | d3de0afac1d11e0fd22b660e5d058ad9b088795a /content/test/content_test_launcher.cc | |
parent | 14ba5c87d532793a59e6c79dd647850ac26ccc5c (diff) | |
download | chromium_src-bb36d82adbfa20d4fa5998c7c28c934b68432437.zip chromium_src-bb36d82adbfa20d4fa5998c7c28c934b68432437.tar.gz chromium_src-bb36d82adbfa20d4fa5998c7c28c934b68432437.tar.bz2 |
Add (not yet working) content_browsertests target.
This implements ContentBrowserTest and a transparent switch
between content and chrome browser tests.
BUG=90448
Review URL: http://codereview.chromium.org/8036044
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103540 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/test/content_test_launcher.cc')
-rw-r--r-- | content/test/content_test_launcher.cc | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/content/test/content_test_launcher.cc b/content/test/content_test_launcher.cc new file mode 100644 index 0000000..7bef177 --- /dev/null +++ b/content/test/content_test_launcher.cc @@ -0,0 +1,54 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "content/test/test_launcher.h" + +#include "base/command_line.h" +#include "base/logging.h" +#include "base/scoped_temp_dir.h" +#include "content/test/content_test_suite.h" + +class ContentTestLauncherDelegate : public test_launcher::TestLauncherDelegate { + public: + ContentTestLauncherDelegate() { + } + + virtual ~ContentTestLauncherDelegate() { + } + + virtual void EarlyInitialize() OVERRIDE { + } + + virtual bool Run(int argc, char** argv, int* return_code) OVERRIDE { + 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(); + return true; + } + + return false; + } + + virtual bool AdjustChildProcessCommandLine( + CommandLine* command_line) OVERRIDE { + return true; + } + + private: + DISALLOW_COPY_AND_ASSIGN(ContentTestLauncherDelegate); +}; + +int main(int argc, char** argv) { + ContentTestLauncherDelegate launcher_delegate; + return test_launcher::LaunchTests(&launcher_delegate, argc, argv); +}
\ No newline at end of file |