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

Unified Diff: content/test/content_test_launcher.cc

Issue 8036044: Add (not yet working) content_browsertests target. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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_test_launcher.cc
===================================================================
--- content/test/content_test_launcher.cc (revision 0)
+++ content/test/content_test_launcher.cc (revision 0)
@@ -0,0 +1,52 @@
+// 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
jam 2011/09/29 23:07:06 why copy this code now?
Paweł Hajdan Jr. 2011/09/29 23:21:47 I think that's simpler than adding even more indir
jam 2011/09/29 23:33:58 I think we have to share this code, given how frag
+ // 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);
+}
Property changes on: content\test\content_test_launcher.cc
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698