OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/base_paths.h" | 5 #include "base/base_paths.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/test/launcher/unit_test_launcher.h" | 9 #include "base/test/launcher/unit_test_launcher.h" |
10 #include "content/public/common/content_client.h" | 10 #include "content/public/common/content_client.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 // Register the chrome-extension:// scheme via this circuitous path. Note | 67 // Register the chrome-extension:// scheme via this circuitous path. Note |
68 // that this does not persistently set up a ContentClient; individual tests | 68 // that this does not persistently set up a ContentClient; individual tests |
69 // must use content::SetContentClient(). | 69 // must use content::SetContentClient(). |
70 { | 70 { |
71 ExtensionsContentClient content_client; | 71 ExtensionsContentClient content_client; |
72 RegisterContentSchemes(&content_client); | 72 RegisterContentSchemes(&content_client); |
73 } | 73 } |
74 | 74 |
75 extensions::RegisterPathProvider(); | 75 extensions::RegisterPathProvider(); |
76 | 76 |
77 base::FilePath resources_pack_path; | 77 base::FilePath extensions_pak_path; |
78 PathService::Get(base::DIR_MODULE, &resources_pack_path); | 78 PathService::Get(base::DIR_MODULE, &extensions_pak_path); |
79 ResourceBundle::InitSharedInstanceWithPakPath( | 79 ui::ResourceBundle::InitSharedInstanceWithPakPath( |
80 resources_pack_path.AppendASCII("extensions_unittests_resources.pak")); | 80 extensions_pak_path.AppendASCII("extensions.pak")); |
81 | 81 |
82 client_.reset(new extensions::TestExtensionsClient()); | 82 client_.reset(new extensions::TestExtensionsClient()); |
83 extensions::ExtensionsClient::Set(client_.get()); | 83 extensions::ExtensionsClient::Set(client_.get()); |
84 } | 84 } |
85 | 85 |
86 void ExtensionsTestSuite::Shutdown() { | 86 void ExtensionsTestSuite::Shutdown() { |
87 extensions::ExtensionsClient::Set(NULL); | 87 extensions::ExtensionsClient::Set(NULL); |
88 client_.reset(); | 88 client_.reset(); |
89 | 89 |
90 ResourceBundle::CleanupSharedInstance(); | 90 ui::ResourceBundle::CleanupSharedInstance(); |
91 content::ContentTestSuiteBase::Shutdown(); | 91 content::ContentTestSuiteBase::Shutdown(); |
92 } | 92 } |
93 | 93 |
94 } // namespace | 94 } // namespace |
95 | 95 |
96 int main(int argc, char** argv) { | 96 int main(int argc, char** argv) { |
97 content::UnitTestTestSuite test_suite(new ExtensionsTestSuite(argc, argv)); | 97 content::UnitTestTestSuite test_suite(new ExtensionsTestSuite(argc, argv)); |
98 | 98 |
99 return base::LaunchUnitTests(argc, | 99 return base::LaunchUnitTests(argc, |
100 argv, | 100 argv, |
101 base::Bind(&content::UnitTestTestSuite::Run, | 101 base::Bind(&content::UnitTestTestSuite::Run, |
102 base::Unretained(&test_suite))); | 102 base::Unretained(&test_suite))); |
103 } | 103 } |
OLD | NEW |