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/command_line.h" |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/metrics/statistics_recorder.h" | 10 #include "base/metrics/statistics_recorder.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "components/policy/core/browser/android/component_jni_registrar.h" | 29 #include "components/policy/core/browser/android/component_jni_registrar.h" |
30 #include "components/safe_json/android/component_jni_registrar.h" | 30 #include "components/safe_json/android/component_jni_registrar.h" |
31 #include "components/signin/core/browser/android/component_jni_registrar.h" | 31 #include "components/signin/core/browser/android/component_jni_registrar.h" |
32 #include "content/public/test/test_utils.h" | 32 #include "content/public/test/test_utils.h" |
33 #include "net/android/net_jni_registrar.h" | 33 #include "net/android/net_jni_registrar.h" |
34 #include "ui/base/android/ui_base_jni_registrar.h" | 34 #include "ui/base/android/ui_base_jni_registrar.h" |
35 #include "ui/gfx/android/gfx_jni_registrar.h" | 35 #include "ui/gfx/android/gfx_jni_registrar.h" |
36 #endif | 36 #endif |
37 | 37 |
38 #if defined(OS_CHROMEOS) | 38 #if defined(OS_CHROMEOS) |
39 #include "third_party/mojo/src/mojo/edk/embedder/embedder.h" | 39 #include "mojo/edk/embedder/embedder.h" |
40 #endif | 40 #endif |
41 | 41 |
42 namespace { | 42 namespace { |
43 | 43 |
44 class ComponentsTestSuite : public base::TestSuite { | 44 class ComponentsTestSuite : public base::TestSuite { |
45 public: | 45 public: |
46 ComponentsTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} | 46 ComponentsTestSuite(int argc, char** argv) : base::TestSuite(argc, argv) {} |
47 | 47 |
48 private: | 48 private: |
49 void Initialize() override { | 49 void Initialize() override { |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 #endif | 131 #endif |
132 | 132 |
133 DISALLOW_COPY_AND_ASSIGN(ComponentsUnitTestEventListener); | 133 DISALLOW_COPY_AND_ASSIGN(ComponentsUnitTestEventListener); |
134 }; | 134 }; |
135 | 135 |
136 } // namespace | 136 } // namespace |
137 | 137 |
138 int main(int argc, char** argv) { | 138 int main(int argc, char** argv) { |
139 ComponentsTestSuite test_suite(argc, argv); | 139 ComponentsTestSuite test_suite(argc, argv); |
140 | 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 | |
145 // The listener will set up common test environment for all components unit | 141 // The listener will set up common test environment for all components unit |
146 // tests. | 142 // tests. |
147 testing::TestEventListeners& listeners = | 143 testing::TestEventListeners& listeners = |
148 testing::UnitTest::GetInstance()->listeners(); | 144 testing::UnitTest::GetInstance()->listeners(); |
149 listeners.Append(new ComponentsUnitTestEventListener()); | 145 listeners.Append(new ComponentsUnitTestEventListener()); |
150 | 146 |
151 #if defined(OS_CHROMEOS) | 147 #if defined(OS_CHROMEOS) |
152 mojo::embedder::Init(); | 148 mojo::edk::Init(); |
153 #endif | 149 #endif |
154 | 150 |
155 return base::LaunchUnitTests( | 151 return base::LaunchUnitTests( |
156 argc, argv, base::Bind(&base::TestSuite::Run, | 152 argc, argv, base::Bind(&base::TestSuite::Run, |
157 base::Unretained(&test_suite))); | 153 base::Unretained(&test_suite))); |
158 } | 154 } |
OLD | NEW |