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

Unified Diff: chrome/browser/profiles/avatar_menu_model_unittest.cc

Issue 16658015: Add device policies to control accessibility settings on the login screen (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed leaky tests. Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/profiles/avatar_menu_model_unittest.cc
diff --git a/chrome/browser/profiles/avatar_menu_model_unittest.cc b/chrome/browser/profiles/avatar_menu_model_unittest.cc
index fcb5b1407b608b3ffc61802a7624e9903c211414..b01282702c26c2da24ea1e1570a5313805361abd 100644
--- a/chrome/browser/profiles/avatar_menu_model_unittest.cc
+++ b/chrome/browser/profiles/avatar_menu_model_unittest.cc
@@ -4,9 +4,11 @@
#include "chrome/browser/profiles/avatar_menu_model.h"
+#include "base/memory/scoped_ptr.h"
#include "base/metrics/field_trial.h"
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
+#include "chrome/browser/prefs/pref_service_syncable.h"
#include "chrome/browser/profiles/avatar_menu_model_observer.h"
#include "chrome/browser/profiles/profile_info_cache.h"
#include "chrome/browser/profiles/profile_manager.h"
@@ -60,8 +62,10 @@ TEST_F(AvatarMenuModelTest, InitialCreation) {
string16 name1(ASCIIToUTF16("Test 1"));
string16 name2(ASCIIToUTF16("Test 2"));
- manager()->CreateTestingProfile("p1", name1, 0);
- manager()->CreateTestingProfile("p2", name2, 0);
+ manager()->CreateTestingProfile("p1", scoped_ptr<PrefServiceSyncable>(),
+ name1, 0);
+ manager()->CreateTestingProfile("p2", scoped_ptr<PrefServiceSyncable>(),
+ name2, 0);
MockObserver observer;
EXPECT_EQ(0, observer.change_count());
@@ -84,8 +88,10 @@ TEST_F(AvatarMenuModelTest, ActiveItem) {
string16 name1(ASCIIToUTF16("Test 1"));
string16 name2(ASCIIToUTF16("Test 2"));
- manager()->CreateTestingProfile("p1", name1, 0);
- manager()->CreateTestingProfile("p2", name2, 0);
+ manager()->CreateTestingProfile("p1", scoped_ptr<PrefServiceSyncable>(),
+ name1, 0);
+ manager()->CreateTestingProfile("p2", scoped_ptr<PrefServiceSyncable>(),
+ name2, 0);
MockObserver observer;
AvatarMenuModel model(manager()->profile_info_cache(), &observer, browser());
@@ -100,8 +106,10 @@ TEST_F(AvatarMenuModelTest, ModifyingNameResortsCorrectly) {
string16 name2(ASCIIToUTF16("Beta"));
string16 newname1(ASCIIToUTF16("Gamma"));
- manager()->CreateTestingProfile("p1", name1, 0);
- manager()->CreateTestingProfile("p2", name2, 0);
+ manager()->CreateTestingProfile("p1", scoped_ptr<PrefServiceSyncable>(),
+ name1, 0);
+ manager()->CreateTestingProfile("p2", scoped_ptr<PrefServiceSyncable>(),
+ name2, 0);
MockObserver observer;
AvatarMenuModel model(manager()->profile_info_cache(), &observer, browser());
@@ -134,8 +142,10 @@ TEST_F(AvatarMenuModelTest, ChangeOnNotify) {
string16 name1(ASCIIToUTF16("Test 1"));
string16 name2(ASCIIToUTF16("Test 2"));
- manager()->CreateTestingProfile("p1", name1, 0);
- manager()->CreateTestingProfile("p2", name2, 0);
+ manager()->CreateTestingProfile("p1", scoped_ptr<PrefServiceSyncable>(),
+ name1, 0);
+ manager()->CreateTestingProfile("p2", scoped_ptr<PrefServiceSyncable>(),
+ name2, 0);
MockObserver observer;
EXPECT_EQ(0, observer.change_count());
@@ -145,7 +155,8 @@ TEST_F(AvatarMenuModelTest, ChangeOnNotify) {
EXPECT_EQ(2U, model.GetNumberOfItems());
string16 name3(ASCIIToUTF16("Test 3"));
- manager()->CreateTestingProfile("p3", name3, 0);
+ manager()->CreateTestingProfile("p3", scoped_ptr<PrefServiceSyncable>(),
+ name3, 0);
// Four changes happened via the call to CreateTestingProfile: adding the
// profile to the cache, setting the user name, rebuilding the list of
@@ -186,7 +197,8 @@ TEST_F(AvatarMenuModelTest, ShowAvatarMenuInTrial) {
TEST_F(AvatarMenuModelTest, DontShowAvatarMenu) {
string16 name1(ASCIIToUTF16("Test 1"));
- manager()->CreateTestingProfile("p1", name1, 0);
+ manager()->CreateTestingProfile("p1", scoped_ptr<PrefServiceSyncable>(),
+ name1, 0);
EXPECT_FALSE(AvatarMenuModel::ShouldShowAvatarMenu());
@@ -196,7 +208,8 @@ TEST_F(AvatarMenuModelTest, DontShowAvatarMenu) {
return;
string16 name2(ASCIIToUTF16("Test 2"));
- manager()->CreateTestingProfile("p2", name2, 0);
+ manager()->CreateTestingProfile("p2", scoped_ptr<PrefServiceSyncable>(),
+ name2, 0);
EXPECT_FALSE(AvatarMenuModel::ShouldShowAvatarMenu());
}
@@ -209,8 +222,10 @@ TEST_F(AvatarMenuModelTest, ShowAvatarMenu) {
string16 name1(ASCIIToUTF16("Test 1"));
string16 name2(ASCIIToUTF16("Test 2"));
- manager()->CreateTestingProfile("p1", name1, 0);
- manager()->CreateTestingProfile("p2", name2, 0);
+ manager()->CreateTestingProfile("p1", scoped_ptr<PrefServiceSyncable>(),
+ name1, 0);
+ manager()->CreateTestingProfile("p2", scoped_ptr<PrefServiceSyncable>(),
+ name2, 0);
#if defined(OS_CHROMEOS)
EXPECT_FALSE(AvatarMenuModel::ShouldShowAvatarMenu());
@@ -224,7 +239,8 @@ TEST_F(AvatarMenuModelTest, SyncState) {
if (!ProfileManager::IsMultipleProfilesEnabled())
return;
- manager()->CreateTestingProfile("p1", ASCIIToUTF16("Test 1"), 0);
+ manager()->CreateTestingProfile("p1", scoped_ptr<PrefServiceSyncable>(),
+ ASCIIToUTF16("Test 1"), 0);
// Add a managed user profile.
ProfileInfoCache* cache = manager()->profile_info_cache();

Powered by Google App Engine
This is Rietveld 408576698