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/files/file_path.h" | 6 #include "base/files/file_path.h" |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/metrics/statistics_recorder.h" | 8 #include "base/metrics/statistics_recorder.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/test/launcher/unit_test_launcher.h" | 10 #include "base/test/launcher/unit_test_launcher.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 #endif | 54 #endif |
55 | 55 |
56 ui::RegisterPathProvider(); | 56 ui::RegisterPathProvider(); |
57 | 57 |
58 base::FilePath pak_path; | 58 base::FilePath pak_path; |
59 #if defined(OS_ANDROID) | 59 #if defined(OS_ANDROID) |
60 PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &pak_path); | 60 PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &pak_path); |
61 #else | 61 #else |
62 PathService::Get(base::DIR_MODULE, &pak_path); | 62 PathService::Get(base::DIR_MODULE, &pak_path); |
63 #endif | 63 #endif |
64 ui::ResourceBundle::InitSharedInstanceWithPakPath( | 64 |
65 pak_path.AppendASCII("components_tests_resources.pak")); | 65 base::FilePath ui_test_pak_path; |
| 66 ASSERT_TRUE(PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path)); |
| 67 ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path); |
| 68 |
| 69 ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath( |
| 70 pak_path.AppendASCII("components_tests_resources.pak"), |
| 71 ui::SCALE_FACTOR_NONE); |
66 | 72 |
67 // These schemes need to be added globally to pass tests of | 73 // These schemes need to be added globally to pass tests of |
68 // autocomplete_input_unittest.cc and content_settings_pattern* | 74 // autocomplete_input_unittest.cc and content_settings_pattern* |
69 url::AddStandardScheme("chrome"); | 75 url::AddStandardScheme("chrome"); |
70 url::AddStandardScheme("chrome-extension"); | 76 url::AddStandardScheme("chrome-extension"); |
71 url::AddStandardScheme("chrome-devtools"); | 77 url::AddStandardScheme("chrome-devtools"); |
72 url::AddStandardScheme("chrome-search"); | 78 url::AddStandardScheme("chrome-search"); |
73 | 79 |
74 // Not using kExtensionScheme to avoid the dependency to extensions. | 80 // Not using kExtensionScheme to avoid the dependency to extensions. |
75 ContentSettingsPattern::SetNonWildcardDomainNonPortScheme( | 81 ContentSettingsPattern::SetNonWildcardDomainNonPortScheme( |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 // The listener will set up common test environment for all components unit | 118 // The listener will set up common test environment for all components unit |
113 // tests. | 119 // tests. |
114 testing::TestEventListeners& listeners = | 120 testing::TestEventListeners& listeners = |
115 testing::UnitTest::GetInstance()->listeners(); | 121 testing::UnitTest::GetInstance()->listeners(); |
116 listeners.Append(new ComponentsUnitTestEventListener()); | 122 listeners.Append(new ComponentsUnitTestEventListener()); |
117 | 123 |
118 return base::LaunchUnitTests( | 124 return base::LaunchUnitTests( |
119 argc, argv, base::Bind(&base::TestSuite::Run, | 125 argc, argv, base::Bind(&base::TestSuite::Run, |
120 base::Unretained(&test_suite))); | 126 base::Unretained(&test_suite))); |
121 } | 127 } |
OLD | NEW |