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

Side by Side Diff: chrome/browser/ui/sync/profile_signin_confirmation_helper_unittest.cc

Issue 1349613003: [Extensions] Un-refcount PermissionSet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/ui/sync/profile_signin_confirmation_helper.h" 5 #include "chrome/browser/ui/sync/profile_signin_confirmation_helper.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 extensions::ExtensionSystem::Get(profile_.get())->extension_service(); 206 extensions::ExtensionSystem::Get(profile_.get())->extension_service();
207 ASSERT_TRUE(extensions); 207 ASSERT_TRUE(extensions);
208 208
209 // Profile is new but has synced extensions. 209 // Profile is new but has synced extensions.
210 210
211 // (The web store doesn't count.) 211 // (The web store doesn't count.)
212 scoped_refptr<extensions::Extension> webstore = 212 scoped_refptr<extensions::Extension> webstore =
213 CreateExtension("web store", 213 CreateExtension("web store",
214 extensions::kWebStoreAppId, 214 extensions::kWebStoreAppId,
215 extensions::Manifest::COMPONENT); 215 extensions::Manifest::COMPONENT);
216 extensions::ExtensionPrefs::Get(profile_.get())->AddGrantedPermissions( 216 extensions::PermissionSet empty_permissions;
217 webstore->id(), make_scoped_refptr(new extensions::PermissionSet).get()); 217 extensions::ExtensionPrefs::Get(profile_.get())
218 ->AddGrantedPermissions(webstore->id(), &empty_permissions);
218 extensions->AddExtension(webstore.get()); 219 extensions->AddExtension(webstore.get());
219 EXPECT_FALSE(GetCallbackResult( 220 EXPECT_FALSE(GetCallbackResult(
220 base::Bind(&ui::CheckShouldPromptForNewProfile, profile_.get()))); 221 base::Bind(&ui::CheckShouldPromptForNewProfile, profile_.get())));
221 222
222 scoped_refptr<extensions::Extension> extension = 223 scoped_refptr<extensions::Extension> extension =
223 CreateExtension("foo", std::string(), extensions::Manifest::INTERNAL); 224 CreateExtension("foo", std::string(), extensions::Manifest::INTERNAL);
224 extensions::ExtensionPrefs::Get(profile_.get())->AddGrantedPermissions( 225 extensions::ExtensionPrefs::Get(profile_.get())
225 extension->id(), make_scoped_refptr(new extensions::PermissionSet).get()); 226 ->AddGrantedPermissions(extension->id(), &empty_permissions);
226 extensions->AddExtension(extension.get()); 227 extensions->AddExtension(extension.get());
227 EXPECT_TRUE(GetCallbackResult( 228 EXPECT_TRUE(GetCallbackResult(
228 base::Bind(&ui::CheckShouldPromptForNewProfile, profile_.get()))); 229 base::Bind(&ui::CheckShouldPromptForNewProfile, profile_.get())));
229 } 230 }
230 #endif 231 #endif
231 232
232 // http://crbug.com/393149 233 // http://crbug.com/393149
233 TEST_F(ProfileSigninConfirmationHelperTest, 234 TEST_F(ProfileSigninConfirmationHelperTest,
234 DISABLED_PromptForNewProfile_History) { 235 DISABLED_PromptForNewProfile_History) {
235 history::HistoryService* history = HistoryServiceFactory::GetForProfile( 236 history::HistoryService* history = HistoryServiceFactory::GetForProfile(
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 275
275 TEST_F(ProfileSigninConfirmationHelperTest, PromptForNewProfile_Restarted) { 276 TEST_F(ProfileSigninConfirmationHelperTest, PromptForNewProfile_Restarted) {
276 // Browser has been shut down since profile was created. 277 // Browser has been shut down since profile was created.
277 user_prefs_->set_read_error(PersistentPrefStore::PREF_READ_ERROR_NONE); 278 user_prefs_->set_read_error(PersistentPrefStore::PREF_READ_ERROR_NONE);
278 EXPECT_TRUE( 279 EXPECT_TRUE(
279 GetCallbackResult( 280 GetCallbackResult(
280 base::Bind( 281 base::Bind(
281 &ui::CheckShouldPromptForNewProfile, 282 &ui::CheckShouldPromptForNewProfile,
282 profile_.get()))); 283 profile_.get())));
283 } 284 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698