| OLD | NEW |
| 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_interface.h" | 10 #include "chrome/browser/profiles/profile_info_interface.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 std::vector<AvatarMenuModel::Item*> profiles_; | 52 std::vector<AvatarMenuModel::Item*> profiles_; |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 class MockObserver : public AvatarMenuModelObserver { | 55 class MockObserver : public AvatarMenuModelObserver { |
| 56 public: | 56 public: |
| 57 MockObserver() : count_(0) {} | 57 MockObserver() : count_(0) {} |
| 58 virtual ~MockObserver() {} | 58 virtual ~MockObserver() {} |
| 59 | 59 |
| 60 virtual void OnAvatarMenuModelChanged() { | 60 virtual void OnAvatarMenuModelChanged(AvatarMenuModel* avatar_menu_model) { |
| 61 ++count_; | 61 ++count_; |
| 62 } | 62 } |
| 63 | 63 |
| 64 int change_count() { return count_; } | 64 int change_count() { return count_; } |
| 65 | 65 |
| 66 private: | 66 private: |
| 67 int count_; | 67 int count_; |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 class AvatarMenuModelTest : public TestingBrowserProcessTest { | 70 class AvatarMenuModelTest : public TestingBrowserProcessTest { |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 const AvatarMenuModel::Item& item2 = model.GetItemAt(1); | 151 const AvatarMenuModel::Item& item2 = model.GetItemAt(1); |
| 152 EXPECT_EQ(1U, item2.model_index); | 152 EXPECT_EQ(1U, item2.model_index); |
| 153 EXPECT_EQ(ASCIIToUTF16("Test 3"), item2.name); | 153 EXPECT_EQ(ASCIIToUTF16("Test 3"), item2.name); |
| 154 | 154 |
| 155 const AvatarMenuModel::Item& item3 = model.GetItemAt(2); | 155 const AvatarMenuModel::Item& item3 = model.GetItemAt(2); |
| 156 EXPECT_EQ(2U, item3.model_index); | 156 EXPECT_EQ(2U, item3.model_index); |
| 157 EXPECT_EQ(ASCIIToUTF16("Test 2"), item3.name); | 157 EXPECT_EQ(ASCIIToUTF16("Test 2"), item3.name); |
| 158 } | 158 } |
| 159 | 159 |
| 160 } // namespace | 160 } // namespace |
| OLD | NEW |