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

Side by Side Diff: chrome/browser/profiles/avatar_menu_model_unittest.cc

Issue 8230011: [Mac/multiprofile] "Customize User..." should edit the currently active profile (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/profiles/avatar_menu_model.h" 5 #include "chrome/browser/profiles/avatar_menu_model.h"
6 6
7 #include "base/string16.h" 7 #include "base/string16.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/profiles/avatar_menu_model_observer.h" 9 #include "chrome/browser/profiles/avatar_menu_model_observer.h"
10 #include "chrome/browser/profiles/profile_info_cache.h" 10 #include "chrome/browser/profiles/profile_info_cache.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 const AvatarMenuModel::Item& item1 = model.GetItemAt(0); 66 const AvatarMenuModel::Item& item1 = model.GetItemAt(0);
67 EXPECT_EQ(0U, item1.model_index); 67 EXPECT_EQ(0U, item1.model_index);
68 EXPECT_EQ(name1, item1.name); 68 EXPECT_EQ(name1, item1.name);
69 69
70 const AvatarMenuModel::Item& item2 = model.GetItemAt(1); 70 const AvatarMenuModel::Item& item2 = model.GetItemAt(1);
71 EXPECT_EQ(1U, item2.model_index); 71 EXPECT_EQ(1U, item2.model_index);
72 EXPECT_EQ(name2, item2.name); 72 EXPECT_EQ(name2, item2.name);
73 } 73 }
74 74
75 TEST_F(AvatarMenuModelTest, ActiveItem) {
76 string16 name1(ASCIIToUTF16("Test 1"));
77 string16 name2(ASCIIToUTF16("Test 2"));
78
79 manager()->CreateTestingProfile("p1", name1, 0);
80 manager()->CreateTestingProfile("p2", name2, 0);
81
82 MockObserver observer;
83 AvatarMenuModel model(manager()->profile_info_cache(), &observer, browser());
84 ASSERT_EQ(2U, model.GetNumberOfItems());
85 ASSERT_EQ(0U, model.GetActiveProfileIndex());
Robert Sesek 2011/10/11 14:23:13 May also want to change the active profile and ass
jeremy 2011/10/19 13:15:24 You're right but I'm a bit pressed for time with t
86 }
75 87
76 TEST_F(AvatarMenuModelTest, ChangeOnNotify) { 88 TEST_F(AvatarMenuModelTest, ChangeOnNotify) {
77 string16 name1(ASCIIToUTF16("Test 1")); 89 string16 name1(ASCIIToUTF16("Test 1"));
78 string16 name2(ASCIIToUTF16("Test 2")); 90 string16 name2(ASCIIToUTF16("Test 2"));
79 91
80 manager()->CreateTestingProfile("p1", name1, 0); 92 manager()->CreateTestingProfile("p1", name1, 0);
81 manager()->CreateTestingProfile("p2", name2, 0); 93 manager()->CreateTestingProfile("p2", name2, 0);
82 94
83 MockObserver observer; 95 MockObserver observer;
84 EXPECT_EQ(0, observer.change_count()); 96 EXPECT_EQ(0, observer.change_count());
(...skipping 17 matching lines...) Expand all
102 const AvatarMenuModel::Item& item2 = model.GetItemAt(1); 114 const AvatarMenuModel::Item& item2 = model.GetItemAt(1);
103 EXPECT_EQ(1U, item2.model_index); 115 EXPECT_EQ(1U, item2.model_index);
104 EXPECT_EQ(name2, item2.name); 116 EXPECT_EQ(name2, item2.name);
105 117
106 const AvatarMenuModel::Item& item3 = model.GetItemAt(2); 118 const AvatarMenuModel::Item& item3 = model.GetItemAt(2);
107 EXPECT_EQ(2U, item3.model_index); 119 EXPECT_EQ(2U, item3.model_index);
108 EXPECT_EQ(name3, item3.name); 120 EXPECT_EQ(name3, item3.name);
109 } 121 }
110 122
111 } // namespace 123 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698