Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(619)

Side by Side Diff: chrome/browser/themes/theme_syncable_service_unittest.cc

Issue 709813004: Remove the deprecated function ExtensionService::extensions(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed thestig@'s comments. Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "chrome/browser/themes/theme_syncable_service.h" 5 #include "chrome/browser/themes/theme_syncable_service.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "base/time/time.h" 11 #include "base/time/time.h"
12 #include "chrome/browser/extensions/extension_service.h" 12 #include "chrome/browser/extensions/extension_service.h"
13 #include "chrome/browser/extensions/test_extension_system.h" 13 #include "chrome/browser/extensions/test_extension_system.h"
14 #include "chrome/browser/profiles/profile.h" 14 #include "chrome/browser/profiles/profile.h"
15 #include "chrome/browser/themes/theme_service.h" 15 #include "chrome/browser/themes/theme_service.h"
16 #include "chrome/browser/themes/theme_service_factory.h" 16 #include "chrome/browser/themes/theme_service_factory.h"
17 #include "chrome/test/base/testing_profile.h" 17 #include "chrome/test/base/testing_profile.h"
18 #include "content/public/test/test_browser_thread.h" 18 #include "content/public/test/test_browser_thread.h"
19 #include "extensions/browser/extension_prefs.h" 19 #include "extensions/browser/extension_prefs.h"
20 #include "extensions/browser/extension_registry.h"
20 #include "extensions/common/extension.h" 21 #include "extensions/common/extension.h"
21 #include "extensions/common/manifest_constants.h" 22 #include "extensions/common/manifest_constants.h"
22 #include "extensions/common/manifest_url_handlers.h" 23 #include "extensions/common/manifest_url_handlers.h"
23 #include "extensions/common/permissions/api_permission_set.h" 24 #include "extensions/common/permissions/api_permission_set.h"
24 #include "extensions/common/permissions/permission_set.h" 25 #include "extensions/common/permissions/permission_set.h"
25 #include "sync/api/attachments/attachment_id.h" 26 #include "sync/api/attachments/attachment_id.h"
26 #include "sync/api/fake_sync_change_processor.h" 27 #include "sync/api/fake_sync_change_processor.h"
27 #include "sync/api/sync_change_processor_wrapper_for_test.h" 28 #include "sync/api/sync_change_processor_wrapper_for_test.h"
28 #include "sync/api/sync_error.h" 29 #include "sync/api/sync_error.h"
29 #include "sync/api/sync_error_factory_mock.h" 30 #include "sync/api/sync_error_factory_mock.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 kCustomThemeUrl); 181 kCustomThemeUrl);
181 extensions::APIPermissionSet empty_set; 182 extensions::APIPermissionSet empty_set;
182 extensions::ManifestPermissionSet empty_manifest_permissions; 183 extensions::ManifestPermissionSet empty_manifest_permissions;
183 extensions::URLPatternSet empty_extent; 184 extensions::URLPatternSet empty_extent;
184 scoped_refptr<extensions::PermissionSet> permissions = 185 scoped_refptr<extensions::PermissionSet> permissions =
185 new extensions::PermissionSet(empty_set, empty_manifest_permissions, 186 new extensions::PermissionSet(empty_set, empty_manifest_permissions,
186 empty_extent, empty_extent); 187 empty_extent, empty_extent);
187 extensions::ExtensionPrefs::Get(profile_.get()) 188 extensions::ExtensionPrefs::Get(profile_.get())
188 ->AddGrantedPermissions(theme_extension_->id(), permissions.get()); 189 ->AddGrantedPermissions(theme_extension_->id(), permissions.get());
189 service->AddExtension(theme_extension_.get()); 190 service->AddExtension(theme_extension_.get());
190 ASSERT_EQ(1u, service->extensions()->size()); 191 extensions::ExtensionRegistry* registry =
192 extensions::ExtensionRegistry::Get(profile_.get());
193 ASSERT_EQ(1u, registry->enabled_extensions().size());
191 } 194 }
192 195
193 // Overridden in PolicyInstalledThemeTest below. 196 // Overridden in PolicyInstalledThemeTest below.
194 virtual extensions::Manifest::Location GetThemeLocation() { 197 virtual extensions::Manifest::Location GetThemeLocation() {
195 return extensions::Manifest::INTERNAL; 198 return extensions::Manifest::INTERNAL;
196 } 199 }
197 200
198 FakeThemeService* BuildForProfile(Profile* profile) { 201 FakeThemeService* BuildForProfile(Profile* profile) {
199 return static_cast<FakeThemeService*>( 202 return static_cast<FakeThemeService*>(
200 ThemeServiceFactory::GetInstance()->SetTestingFactoryAndUse( 203 ThemeServiceFactory::GetInstance()->SetTestingFactoryAndUse(
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 652
650 TEST_F(PolicyInstalledThemeTest, InstallThemeByPolicy) { 653 TEST_F(PolicyInstalledThemeTest, InstallThemeByPolicy) {
651 // Set up theme service to use custom theme that was installed by policy. 654 // Set up theme service to use custom theme that was installed by policy.
652 fake_theme_service_->SetTheme(theme_extension_.get()); 655 fake_theme_service_->SetTheme(theme_extension_.get());
653 656
654 syncer::SyncDataList data_list = 657 syncer::SyncDataList data_list =
655 theme_sync_service_->GetAllSyncData(syncer::THEMES); 658 theme_sync_service_->GetAllSyncData(syncer::THEMES);
656 659
657 ASSERT_EQ(0u, data_list.size()); 660 ASSERT_EQ(0u, data_list.size());
658 } 661 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698