diff options
author | scottbyer@chromium.org <scottbyer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-25 20:36:33 +0000 |
---|---|---|
committer | scottbyer@chromium.org <scottbyer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-25 20:36:33 +0000 |
commit | fe992bf04826c6f7a067704a2fa117eda813d0fa (patch) | |
tree | 169cc41bb183542dbe526f6814c4d79fce6c7867 /content | |
parent | c9236ae784665dc4583e3c98a2b6c0280c21c8bd (diff) | |
download | chromium_src-fe992bf04826c6f7a067704a2fa117eda813d0fa.zip chromium_src-fe992bf04826c6f7a067704a2fa117eda813d0fa.tar.gz chromium_src-fe992bf04826c6f7a067704a2fa117eda813d0fa.tar.bz2 |
Revert 144488 - For unit tests, track additions to AtExitManager and warn.
While trying to bullet proof a unit test, I had trouble getting very far when
running all tests in shuffle mode. Tracked that back to a few other tests doing
stuff that accessed Singleton()s outside of a test-scoped
ShadowingAtExitManager. Seemed to me that should be an invariant around any
unit test, so created this towards that end, hopefully helping stabilize out
unit_tests a bit more.
BUG=133403
Review URL: https://chromiumcodereview.appspot.com/10582012
TBR=scottbyer@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10834010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148405 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/public/test/test_launcher.h | 4 | ||||
-rw-r--r-- | content/test/test_launcher.cc | 11 |
2 files changed, 9 insertions, 6 deletions
diff --git a/content/public/test/test_launcher.h b/content/public/test/test_launcher.h index d0859bb..1c6aa83 100644 --- a/content/public/test/test_launcher.h +++ b/content/public/test/test_launcher.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// 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. @@ -25,6 +25,8 @@ extern const char kGTestListTestsFlag[]; extern const char kGTestRepeatFlag[]; extern const char kGTestRunDisabledTestsFlag[]; extern const char kGTestOutputFlag[]; +extern const char kSingleProcessTestsFlag[]; +extern const char kSingleProcessTestsAndChromeFlag[]; extern const char kHelpFlag[]; // Flag that causes only the kEmptyTestName test to be run. diff --git a/content/test/test_launcher.cc b/content/test/test_launcher.cc index 9b6d449..188e6a0 100644 --- a/content/test/test_launcher.cc +++ b/content/test/test_launcher.cc @@ -19,7 +19,6 @@ #include "base/string_number_conversions.h" #include "base/string_util.h" #include "base/test/test_suite.h" -#include "base/test/test_switches.h" #include "base/test/test_timeouts.h" #include "base/time.h" #include "base/utf_string_conversions.h" @@ -338,7 +337,7 @@ int RunTest(TestLauncherDelegate* launcher_delegate, // tests unless this flag was specified to the browser test executable. new_cmd_line.AppendSwitch("gtest_also_run_disabled_tests"); new_cmd_line.AppendSwitchASCII("gtest_filter", test_name); - new_cmd_line.AppendSwitch(switches::kSingleProcessTestsFlag); + new_cmd_line.AppendSwitch(kSingleProcessTestsFlag); // Do not let the child ignore failures. We need to propagate the // failure status back to the parent. @@ -561,6 +560,8 @@ const char kGTestRepeatFlag[] = "gtest_repeat"; const char kGTestRunDisabledTestsFlag[] = "gtest_also_run_disabled_tests"; const char kGTestOutputFlag[] = "gtest_output"; +const char kSingleProcessTestsFlag[] = "single_process"; +const char kSingleProcessTestsAndChromeFlag[] = "single-process"; // The following is kept for historical reasons (so people that are used to // using it don't get surprised). const char kChildProcessFlag[] = "child"; @@ -590,12 +591,12 @@ int LaunchTests(TestLauncherDelegate* launcher_delegate, // 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(switches::kSingleProcessTestsFlag) || - command_line->HasSwitch(switches::kSingleProcessChromeFlag) || + if (command_line->HasSwitch(kSingleProcessTestsFlag) || + command_line->HasSwitch(kSingleProcessTestsAndChromeFlag) || command_line->HasSwitch(kGTestListTestsFlag) || command_line->HasSwitch(kGTestHelpFlag)) { #if defined(OS_WIN) - if (command_line->HasSwitch(switches::kSingleProcessTestsFlag)) { + if (command_line->HasSwitch(kSingleProcessTestsFlag)) { sandbox::SandboxInterfaceInfo sandbox_info; content::InitializeSandboxInfo(&sandbox_info); content::InitializeSandbox(&sandbox_info); |