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/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/command_line.h" |
6 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
7 #include "base/macros.h" | 8 #include "base/macros.h" |
8 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
9 #include "base/metrics/statistics_recorder.h" | 10 #include "base/metrics/statistics_recorder.h" |
10 #include "base/path_service.h" | 11 #include "base/path_service.h" |
11 #include "base/test/launcher/unit_test_launcher.h" | 12 #include "base/test/launcher/unit_test_launcher.h" |
12 #include "base/test/test_suite.h" | 13 #include "base/test/test_suite.h" |
13 #include "build/build_config.h" | 14 #include "build/build_config.h" |
14 #include "components/content_settings/core/common/content_settings_pattern.h" | 15 #include "components/content_settings/core/common/content_settings_pattern.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 #endif | 131 #endif |
131 | 132 |
132 DISALLOW_COPY_AND_ASSIGN(ComponentsUnitTestEventListener); | 133 DISALLOW_COPY_AND_ASSIGN(ComponentsUnitTestEventListener); |
133 }; | 134 }; |
134 | 135 |
135 } // namespace | 136 } // namespace |
136 | 137 |
137 int main(int argc, char** argv) { | 138 int main(int argc, char** argv) { |
138 ComponentsTestSuite test_suite(argc, argv); | 139 ComponentsTestSuite test_suite(argc, argv); |
139 | 140 |
| 141 // TODO(use_chrome_edk): This flag will go away and be default behavior soon, |
| 142 // but we explicitly add it here for test coverage. |
| 143 base::CommandLine::ForCurrentProcess()->AppendSwitch("use-new-edk"); |
| 144 |
140 // The listener will set up common test environment for all components unit | 145 // The listener will set up common test environment for all components unit |
141 // tests. | 146 // tests. |
142 testing::TestEventListeners& listeners = | 147 testing::TestEventListeners& listeners = |
143 testing::UnitTest::GetInstance()->listeners(); | 148 testing::UnitTest::GetInstance()->listeners(); |
144 listeners.Append(new ComponentsUnitTestEventListener()); | 149 listeners.Append(new ComponentsUnitTestEventListener()); |
145 | 150 |
146 #if defined(OS_CHROMEOS) | 151 #if defined(OS_CHROMEOS) |
147 mojo::embedder::Init(); | 152 mojo::embedder::Init(); |
148 #endif | 153 #endif |
149 | 154 |
150 return base::LaunchUnitTests( | 155 return base::LaunchUnitTests( |
151 argc, argv, base::Bind(&base::TestSuite::Run, | 156 argc, argv, base::Bind(&base::TestSuite::Run, |
152 base::Unretained(&test_suite))); | 157 base::Unretained(&test_suite))); |
153 } | 158 } |
OLD | NEW |