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_button_controller.h" | 5 #import "chrome/browser/ui/cocoa/profiles/avatar_button_controller.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/mac/scoped_nsobject.h" | 8 #include "base/mac/scoped_nsobject.h" |
9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 #include "ui/base/resource/resource_bundle.h" | 25 #include "ui/base/resource/resource_bundle.h" |
26 | 26 |
27 // Defined in the AvatarButtonController implementation. | 27 // Defined in the AvatarButtonController implementation. |
28 @interface AvatarButtonController (ExposedForTesting) | 28 @interface AvatarButtonController (ExposedForTesting) |
29 - (void)updateErrorStatus:(BOOL)hasError; | 29 - (void)updateErrorStatus:(BOOL)hasError; |
30 @end | 30 @end |
31 | 31 |
32 class AvatarButtonControllerTest : public CocoaProfileTest { | 32 class AvatarButtonControllerTest : public CocoaProfileTest { |
33 public: | 33 public: |
34 virtual void SetUp() override { | 34 virtual void SetUp() override { |
35 switches::EnableNewAvatarMenuForTesting(CommandLine::ForCurrentProcess()); | 35 switches::EnableNewAvatarMenuForTesting( |
| 36 base::CommandLine::ForCurrentProcess()); |
36 DCHECK(profiles::IsMultipleProfilesEnabled()); | 37 DCHECK(profiles::IsMultipleProfilesEnabled()); |
37 | 38 |
38 CocoaProfileTest::SetUp(); | 39 CocoaProfileTest::SetUp(); |
39 ASSERT_TRUE(browser()); | 40 ASSERT_TRUE(browser()); |
40 | 41 |
41 controller_.reset( | 42 controller_.reset( |
42 [[AvatarButtonController alloc] initWithBrowser:browser()]); | 43 [[AvatarButtonController alloc] initWithBrowser:browser()]); |
43 } | 44 } |
44 | 45 |
45 virtual void TearDown() override { | 46 virtual void TearDown() override { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 100 |
100 [button() performClick:button()]; | 101 [button() performClick:button()]; |
101 EXPECT_EQ(menu, [controller() menuController]); | 102 EXPECT_EQ(menu, [controller() menuController]); |
102 | 103 |
103 // Do not animate out because that is hard to test around. | 104 // Do not animate out because that is hard to test around. |
104 static_cast<InfoBubbleWindow*>(menu.window).allowedAnimations = | 105 static_cast<InfoBubbleWindow*>(menu.window).allowedAnimations = |
105 info_bubble::kAnimateNone; | 106 info_bubble::kAnimateNone; |
106 [menu close]; | 107 [menu close]; |
107 EXPECT_FALSE([controller() menuController]); | 108 EXPECT_FALSE([controller() menuController]); |
108 } | 109 } |
OLD | NEW |