| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/test/test_suite.h" | 5 #include "base/test/test_suite.h" |
| 6 | 6 |
| 7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
| 8 #include "base/base_paths.h" | 8 #include "base/base_paths.h" |
| 9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 #endif | 48 #endif |
| 49 | 49 |
| 50 #if defined(OS_IOS) | 50 #if defined(OS_IOS) |
| 51 #include "base/test/test_support_ios.h" | 51 #include "base/test/test_support_ios.h" |
| 52 #endif | 52 #endif |
| 53 | 53 |
| 54 namespace { | 54 namespace { |
| 55 | 55 |
| 56 class MaybeTestDisabler : public testing::EmptyTestEventListener { | 56 class MaybeTestDisabler : public testing::EmptyTestEventListener { |
| 57 public: | 57 public: |
| 58 virtual void OnTestStart(const testing::TestInfo& test_info) override { | 58 void OnTestStart(const testing::TestInfo& test_info) override { |
| 59 ASSERT_FALSE(TestSuite::IsMarkedMaybe(test_info)) | 59 ASSERT_FALSE(TestSuite::IsMarkedMaybe(test_info)) |
| 60 << "Probably the OS #ifdefs don't include all of the necessary " | 60 << "Probably the OS #ifdefs don't include all of the necessary " |
| 61 "platforms.\nPlease ensure that no tests have the MAYBE_ prefix " | 61 "platforms.\nPlease ensure that no tests have the MAYBE_ prefix " |
| 62 "after the code is preprocessed."; | 62 "after the code is preprocessed."; |
| 63 } | 63 } |
| 64 }; | 64 }; |
| 65 | 65 |
| 66 class TestClientInitializer : public testing::EmptyTestEventListener { | 66 class TestClientInitializer : public testing::EmptyTestEventListener { |
| 67 public: | 67 public: |
| 68 TestClientInitializer() | 68 TestClientInitializer() |
| 69 : old_command_line_(base::CommandLine::NO_PROGRAM) { | 69 : old_command_line_(base::CommandLine::NO_PROGRAM) { |
| 70 } | 70 } |
| 71 | 71 |
| 72 virtual void OnTestStart(const testing::TestInfo& test_info) override { | 72 void OnTestStart(const testing::TestInfo& test_info) override { |
| 73 old_command_line_ = *base::CommandLine::ForCurrentProcess(); | 73 old_command_line_ = *base::CommandLine::ForCurrentProcess(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 virtual void OnTestEnd(const testing::TestInfo& test_info) override { | 76 void OnTestEnd(const testing::TestInfo& test_info) override { |
| 77 *base::CommandLine::ForCurrentProcess() = old_command_line_; | 77 *base::CommandLine::ForCurrentProcess() = old_command_line_; |
| 78 } | 78 } |
| 79 | 79 |
| 80 private: | 80 private: |
| 81 base::CommandLine old_command_line_; | 81 base::CommandLine old_command_line_; |
| 82 | 82 |
| 83 DISALLOW_COPY_AND_ASSIGN(TestClientInitializer); | 83 DISALLOW_COPY_AND_ASSIGN(TestClientInitializer); |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 } // namespace | 86 } // namespace |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 ResetCommandLine(); | 350 ResetCommandLine(); |
| 351 AddTestLauncherResultPrinter(); | 351 AddTestLauncherResultPrinter(); |
| 352 | 352 |
| 353 TestTimeouts::Initialize(); | 353 TestTimeouts::Initialize(); |
| 354 | 354 |
| 355 trace_to_file_.BeginTracingFromCommandLineOptions(); | 355 trace_to_file_.BeginTracingFromCommandLineOptions(); |
| 356 } | 356 } |
| 357 | 357 |
| 358 void TestSuite::Shutdown() { | 358 void TestSuite::Shutdown() { |
| 359 } | 359 } |
| OLD | NEW |