OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #import "chrome/browser/ui/cocoa/profiles/avatar_icon_controller.h" | 5 #import "chrome/browser/ui/cocoa/profiles/avatar_icon_controller.h" |
6 | 6 |
7 #include "base/mac/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" | 9 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" |
10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
11 #include "chrome/browser/managed_mode/managed_user_service.h" | 11 #include "chrome/browser/managed_mode/managed_user_service.h" |
12 #include "chrome/browser/managed_mode/managed_user_service_factory.h" | 12 #include "chrome/browser/managed_mode/managed_user_service_factory.h" |
13 #include "chrome/browser/prefs/pref_service_syncable.h" | 13 #include "chrome/browser/prefs/pref_service_syncable.h" |
14 #include "chrome/browser/search_engines/template_url_service_factory.h" | 14 #include "chrome/browser/search_engines/template_url_service_factory.h" |
15 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
16 #include "chrome/browser/ui/browser_commands.h" | 16 #include "chrome/browser/ui/browser_commands.h" |
17 #include "chrome/browser/ui/browser_window.h" | 17 #include "chrome/browser/ui/browser_window.h" |
18 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" | 18 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" |
19 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" | 19 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" |
20 #include "chrome/browser/ui/cocoa/info_bubble_window.h" | 20 #include "chrome/browser/ui/cocoa/info_bubble_window.h" |
21 #import "chrome/browser/ui/cocoa/profiles/avatar_menu_bubble_controller.h" | 21 #import "chrome/browser/ui/cocoa/profiles/avatar_menu_bubble_controller.h" |
22 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 22 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
23 #include "chrome/common/pref_names.h" | 23 #include "chrome/common/pref_names.h" |
24 #include "chrome/test/base/testing_profile.h" | 24 #include "chrome/test/base/testing_profile.h" |
25 #include "components/bookmarks/core/test/bookmark_test_helpers.h" | 25 #include "components/bookmarks/test/bookmark_test_helpers.h" |
26 | 26 |
27 class AvatarIconControllerTest : public CocoaProfileTest { | 27 class AvatarIconControllerTest : public CocoaProfileTest { |
28 public: | 28 public: |
29 virtual void SetUp() OVERRIDE { | 29 virtual void SetUp() OVERRIDE { |
30 CocoaProfileTest::SetUp(); | 30 CocoaProfileTest::SetUp(); |
31 ASSERT_TRUE(browser()); | 31 ASSERT_TRUE(browser()); |
32 | 32 |
33 controller_.reset( | 33 controller_.reset( |
34 [[AvatarIconController alloc] initWithBrowser:browser()]); | 34 [[AvatarIconController alloc] initWithBrowser:browser()]); |
35 [[controller_ view] setHidden:YES]; | 35 [[controller_ view] setHidden:YES]; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 new Browser(Browser::CreateParams(profile, chrome::GetActiveDesktop())); | 116 new Browser(Browser::CreateParams(profile, chrome::GetActiveDesktop())); |
117 // Build a new controller to check if it is initialized correctly for a | 117 // Build a new controller to check if it is initialized correctly for a |
118 // managed user profile. | 118 // managed user profile. |
119 base::scoped_nsobject<AvatarIconController> controller( | 119 base::scoped_nsobject<AvatarIconController> controller( |
120 [[AvatarIconController alloc] initWithBrowser:browser]); | 120 [[AvatarIconController alloc] initWithBrowser:browser]); |
121 | 121 |
122 EXPECT_TRUE([controller labelButtonView]); | 122 EXPECT_TRUE([controller labelButtonView]); |
123 | 123 |
124 browser->window()->Close(); | 124 browser->window()->Close(); |
125 } | 125 } |
OLD | NEW |