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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #endif | 42 #endif |
43 | 43 |
44 #if defined(OS_IOS) | 44 #if defined(OS_IOS) |
45 #include "base/test/test_support_ios.h" | 45 #include "base/test/test_support_ios.h" |
46 #endif | 46 #endif |
47 | 47 |
48 namespace { | 48 namespace { |
49 | 49 |
50 class MaybeTestDisabler : public testing::EmptyTestEventListener { | 50 class MaybeTestDisabler : public testing::EmptyTestEventListener { |
51 public: | 51 public: |
52 virtual void OnTestStart(const testing::TestInfo& test_info) OVERRIDE { | 52 void OnTestStart(const testing::TestInfo& test_info) override { |
53 ASSERT_FALSE(TestSuite::IsMarkedMaybe(test_info)) | 53 ASSERT_FALSE(TestSuite::IsMarkedMaybe(test_info)) |
54 << "Probably the OS #ifdefs don't include all of the necessary " | 54 << "Probably the OS #ifdefs don't include all of the necessary " |
55 "platforms.\nPlease ensure that no tests have the MAYBE_ prefix " | 55 "platforms.\nPlease ensure that no tests have the MAYBE_ prefix " |
56 "after the code is preprocessed."; | 56 "after the code is preprocessed."; |
57 } | 57 } |
58 }; | 58 }; |
59 | 59 |
60 class TestClientInitializer : public testing::EmptyTestEventListener { | 60 class TestClientInitializer : public testing::EmptyTestEventListener { |
61 public: | 61 public: |
62 TestClientInitializer() | 62 TestClientInitializer() |
63 : old_command_line_(CommandLine::NO_PROGRAM) { | 63 : old_command_line_(CommandLine::NO_PROGRAM) { |
64 } | 64 } |
65 | 65 |
66 virtual void OnTestStart(const testing::TestInfo& test_info) OVERRIDE { | 66 void OnTestStart(const testing::TestInfo& test_info) override { |
67 old_command_line_ = *CommandLine::ForCurrentProcess(); | 67 old_command_line_ = *CommandLine::ForCurrentProcess(); |
68 } | 68 } |
69 | 69 |
70 virtual void OnTestEnd(const testing::TestInfo& test_info) OVERRIDE { | 70 void OnTestEnd(const testing::TestInfo& test_info) override { |
71 *CommandLine::ForCurrentProcess() = old_command_line_; | 71 *CommandLine::ForCurrentProcess() = old_command_line_; |
72 } | 72 } |
73 | 73 |
74 private: | 74 private: |
75 CommandLine old_command_line_; | 75 CommandLine old_command_line_; |
76 | 76 |
77 DISALLOW_COPY_AND_ASSIGN(TestClientInitializer); | 77 DISALLOW_COPY_AND_ASSIGN(TestClientInitializer); |
78 }; | 78 }; |
79 | 79 |
80 } // namespace | 80 } // namespace |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 AddTestLauncherResultPrinter(); | 336 AddTestLauncherResultPrinter(); |
337 #endif // !defined(OS_IOS) | 337 #endif // !defined(OS_IOS) |
338 | 338 |
339 TestTimeouts::Initialize(); | 339 TestTimeouts::Initialize(); |
340 | 340 |
341 trace_to_file_.BeginTracingFromCommandLineOptions(); | 341 trace_to_file_.BeginTracingFromCommandLineOptions(); |
342 } | 342 } |
343 | 343 |
344 void TestSuite::Shutdown() { | 344 void TestSuite::Shutdown() { |
345 } | 345 } |
OLD | NEW |