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/memory/scoped_ptr.h" | 6 #include "base/memory/scoped_ptr.h" |
7 #include "base/test/launcher/unit_test_launcher.h" | 7 #include "base/test/launcher/unit_test_launcher.h" |
8 #include "base/test/test_suite.h" | 8 #include "base/test/test_suite.h" |
9 #include "content/public/test/test_content_client_initializer.h" | 9 #include "content/public/test/test_content_client_initializer.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 11 #include "ui/base/resource/resource_bundle.h" |
11 | 12 |
12 namespace components { | 13 namespace components { |
13 | 14 |
14 class ComponentsUnitTestEventListener : public testing::EmptyTestEventListener { | 15 class ComponentsUnitTestEventListener : public testing::EmptyTestEventListener { |
15 public: | 16 public: |
16 ComponentsUnitTestEventListener() {} | 17 ComponentsUnitTestEventListener() {} |
17 virtual ~ComponentsUnitTestEventListener() {} | 18 virtual ~ComponentsUnitTestEventListener() {} |
18 | 19 |
19 virtual void OnTestStart(const testing::TestInfo& test_info) OVERRIDE { | 20 virtual void OnTestStart(const testing::TestInfo& test_info) OVERRIDE { |
20 content_initializer_.reset(new content::TestContentClientInitializer()); | 21 content_initializer_.reset(new content::TestContentClientInitializer()); |
(...skipping 13 matching lines...) Expand all Loading... |
34 | 35 |
35 int main(int argc, char** argv) { | 36 int main(int argc, char** argv) { |
36 base::TestSuite test_suite(argc, argv); | 37 base::TestSuite test_suite(argc, argv); |
37 | 38 |
38 // The listener will set up common test environment for all components unit | 39 // The listener will set up common test environment for all components unit |
39 // tests. | 40 // tests. |
40 testing::TestEventListeners& listeners = | 41 testing::TestEventListeners& listeners = |
41 testing::UnitTest::GetInstance()->listeners(); | 42 testing::UnitTest::GetInstance()->listeners(); |
42 listeners.Append(new components::ComponentsUnitTestEventListener()); | 43 listeners.Append(new components::ComponentsUnitTestEventListener()); |
43 | 44 |
| 45 ui::ResourceBundle::InitSharedInstanceWithLocale("en-US", NULL); |
| 46 |
44 return base::LaunchUnitTests( | 47 return base::LaunchUnitTests( |
45 argc, argv, base::Bind(&base::TestSuite::Run, | 48 argc, argv, base::Bind(&base::TestSuite::Run, |
46 base::Unretained(&test_suite))); | 49 base::Unretained(&test_suite))); |
47 } | 50 } |
OLD | NEW |