| 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 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 class AvatarButtonControllerTest : public CocoaProfileTest { | 32 class AvatarButtonControllerTest : public CocoaProfileTest { |
| 33 public: | 33 public: |
| 34 void SetUp() override { | 34 void SetUp() override { |
| 35 DCHECK(profiles::IsMultipleProfilesEnabled()); | 35 DCHECK(profiles::IsMultipleProfilesEnabled()); |
| 36 | 36 |
| 37 CocoaProfileTest::SetUp(); | 37 CocoaProfileTest::SetUp(); |
| 38 ASSERT_TRUE(browser()); | 38 ASSERT_TRUE(browser()); |
| 39 | 39 |
| 40 controller_.reset( | 40 controller_.reset( |
| 41 [[AvatarButtonController alloc] initWithBrowser:browser()]); | 41 [[AvatarButtonController alloc] initWithBrowser:browser() window:nil]); |
| 42 } | 42 } |
| 43 | 43 |
| 44 void TearDown() override { | 44 void TearDown() override { |
| 45 browser()->window()->Close(); | 45 browser()->window()->Close(); |
| 46 CocoaProfileTest::TearDown(); | 46 CocoaProfileTest::TearDown(); |
| 47 } | 47 } |
| 48 | 48 |
| 49 NSButton* button() { return [controller_ buttonView]; } | 49 NSButton* button() { return [controller_ buttonView]; } |
| 50 | 50 |
| 51 NSView* view() { return [controller_ view]; } | 51 NSView* view() { return [controller_ view]; } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 97 |
| 98 [button() performClick:button()]; | 98 [button() performClick:button()]; |
| 99 EXPECT_EQ(menu, [controller() menuController]); | 99 EXPECT_EQ(menu, [controller() menuController]); |
| 100 | 100 |
| 101 // Do not animate out because that is hard to test around. | 101 // Do not animate out because that is hard to test around. |
| 102 static_cast<InfoBubbleWindow*>(menu.window).allowedAnimations = | 102 static_cast<InfoBubbleWindow*>(menu.window).allowedAnimations = |
| 103 info_bubble::kAnimateNone; | 103 info_bubble::kAnimateNone; |
| 104 [menu close]; | 104 [menu close]; |
| 105 EXPECT_FALSE([controller() menuController]); | 105 EXPECT_FALSE([controller() menuController]); |
| 106 } | 106 } |
| OLD | NEW |