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 "chrome/browser/extensions/extension_service_test_base.h" | 5 #include "chrome/browser/extensions/extension_service_test_base.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "chrome/browser/extensions/updater/extension_updater.h" | 23 #include "chrome/browser/extensions/updater/extension_updater.h" |
24 #include "chrome/browser/prefs/browser_prefs.h" | 24 #include "chrome/browser/prefs/browser_prefs.h" |
25 #include "chrome/common/chrome_constants.h" | 25 #include "chrome/common/chrome_constants.h" |
26 #include "chrome/common/chrome_paths.h" | 26 #include "chrome/common/chrome_paths.h" |
27 #include "chrome/test/base/testing_browser_process.h" | 27 #include "chrome/test/base/testing_browser_process.h" |
28 #include "chrome/test/base/testing_profile.h" | 28 #include "chrome/test/base/testing_profile.h" |
29 #include "components/pref_registry/pref_registry_syncable.h" | 29 #include "components/pref_registry/pref_registry_syncable.h" |
30 #include "components/syncable_prefs/pref_service_mock_factory.h" | 30 #include "components/syncable_prefs/pref_service_mock_factory.h" |
31 #include "components/syncable_prefs/pref_service_syncable.h" | 31 #include "components/syncable_prefs/pref_service_syncable.h" |
32 #include "content/public/browser/browser_context.h" | 32 #include "content/public/browser/browser_context.h" |
| 33 #include "content/public/browser/shell_context.h" |
33 #include "extensions/browser/extension_prefs.h" | 34 #include "extensions/browser/extension_prefs.h" |
34 #include "extensions/browser/extension_registry.h" | 35 #include "extensions/browser/extension_registry.h" |
35 | 36 |
36 #if defined(OS_CHROMEOS) | 37 #if defined(OS_CHROMEOS) |
37 #include "chrome/browser/chromeos/extensions/install_limiter.h" | 38 #include "chrome/browser/chromeos/extensions/install_limiter.h" |
38 #endif | 39 #endif |
39 | 40 |
40 namespace extensions { | 41 namespace extensions { |
41 | 42 |
42 namespace { | 43 namespace { |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 const base::DictionaryValue* pref = NULL; | 279 const base::DictionaryValue* pref = NULL; |
279 std::string manifest_path = extension_id + ".manifest"; | 280 std::string manifest_path = extension_id + ".manifest"; |
280 ASSERT_TRUE(dict->GetDictionary(manifest_path, &pref)) << msg; | 281 ASSERT_TRUE(dict->GetDictionary(manifest_path, &pref)) << msg; |
281 EXPECT_TRUE(pref != NULL) << msg; | 282 EXPECT_TRUE(pref != NULL) << msg; |
282 std::string val; | 283 std::string val; |
283 ASSERT_TRUE(pref->GetString(pref_path, &val)) << msg; | 284 ASSERT_TRUE(pref->GetString(pref_path, &val)) << msg; |
284 EXPECT_EQ(expected_val, val) << msg; | 285 EXPECT_EQ(expected_val, val) << msg; |
285 } | 286 } |
286 | 287 |
287 void ExtensionServiceTestBase::SetUp() { | 288 void ExtensionServiceTestBase::SetUp() { |
| 289 shell_context_ = content::ShellContext::Create(); |
288 ExtensionErrorReporter::GetInstance()->ClearErrors(); | 290 ExtensionErrorReporter::GetInstance()->ClearErrors(); |
289 } | 291 } |
290 | 292 |
291 void ExtensionServiceTestBase::SetUpTestCase() { | 293 void ExtensionServiceTestBase::SetUpTestCase() { |
292 // Safe to call multiple times. | 294 // Safe to call multiple times. |
293 ExtensionErrorReporter::Init(false); // no noisy errors. | 295 ExtensionErrorReporter::Init(false); // no noisy errors. |
294 } | 296 } |
295 | 297 |
296 // These are declared in the .cc so that all inheritors don't need to know | 298 // These are declared in the .cc so that all inheritors don't need to know |
297 // that TestingProfile derives Profile derives BrowserContext. | 299 // that TestingProfile derives Profile derives BrowserContext. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 | 332 |
331 service_->RegisterInstallGate(ExtensionPrefs::DELAY_REASON_WAIT_FOR_IMPORTS, | 333 service_->RegisterInstallGate(ExtensionPrefs::DELAY_REASON_WAIT_FOR_IMPORTS, |
332 service_->shared_module_service()); | 334 service_->shared_module_service()); |
333 | 335 |
334 #if defined(OS_CHROMEOS) | 336 #if defined(OS_CHROMEOS) |
335 InstallLimiter::Get(profile_.get())->DisableForTest(); | 337 InstallLimiter::Get(profile_.get())->DisableForTest(); |
336 #endif | 338 #endif |
337 } | 339 } |
338 | 340 |
339 } // namespace extensions | 341 } // namespace extensions |
OLD | NEW |