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

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

Issue 51433002: Enable permission warnings from ManifestHandlers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing. Created 7 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"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 service->Init(); 200 service->Init();
201 loop_.RunUntilIdle(); 201 loop_.RunUntilIdle();
202 202
203 // Create and add custom theme extension so the ThemeSyncableService can 203 // Create and add custom theme extension so the ThemeSyncableService can
204 // find it. 204 // find it.
205 theme_extension_ = MakeThemeExtension(base::FilePath(kExtensionFilePath), 205 theme_extension_ = MakeThemeExtension(base::FilePath(kExtensionFilePath),
206 kCustomThemeName, 206 kCustomThemeName,
207 GetThemeLocation(), 207 GetThemeLocation(),
208 kCustomThemeUrl); 208 kCustomThemeUrl);
209 extensions::APIPermissionSet empty_set; 209 extensions::APIPermissionSet empty_set;
210 extensions::ManifestPermissionSet empty_manifest_permissions;
210 extensions::URLPatternSet empty_extent; 211 extensions::URLPatternSet empty_extent;
211 scoped_refptr<extensions::PermissionSet> permissions = 212 scoped_refptr<extensions::PermissionSet> permissions =
212 new extensions::PermissionSet(empty_set, empty_extent, empty_extent); 213 new extensions::PermissionSet(empty_set, empty_manifest_permissions,
214 empty_extent, empty_extent);
213 service->extension_prefs()->AddGrantedPermissions( 215 service->extension_prefs()->AddGrantedPermissions(
214 theme_extension_->id(), permissions.get()); 216 theme_extension_->id(), permissions.get());
215 service->AddExtension(theme_extension_.get()); 217 service->AddExtension(theme_extension_.get());
216 ASSERT_EQ(1u, service->extensions()->size()); 218 ASSERT_EQ(1u, service->extensions()->size());
217 } 219 }
218 220
219 // Overridden in PolicyInstalledThemeTest below. 221 // Overridden in PolicyInstalledThemeTest below.
220 virtual extensions::Manifest::Location GetThemeLocation() { 222 virtual extensions::Manifest::Location GetThemeLocation() {
221 return extensions::Manifest::INTERNAL; 223 return extensions::Manifest::INTERNAL;
222 } 224 }
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 621
620 TEST_F(PolicyInstalledThemeTest, InstallThemeByPolicy) { 622 TEST_F(PolicyInstalledThemeTest, InstallThemeByPolicy) {
621 // Set up theme service to use custom theme that was installed by policy. 623 // Set up theme service to use custom theme that was installed by policy.
622 fake_theme_service_->SetTheme(theme_extension_.get()); 624 fake_theme_service_->SetTheme(theme_extension_.get());
623 625
624 syncer::SyncDataList data_list = 626 syncer::SyncDataList data_list =
625 theme_sync_service_->GetAllSyncData(syncer::THEMES); 627 theme_sync_service_->GetAllSyncData(syncer::THEMES);
626 628
627 ASSERT_EQ(0u, data_list.size()); 629 ASSERT_EQ(0u, data_list.size());
628 } 630 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698