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

Side by Side Diff: chrome/browser/ui/cocoa/browser/profile_chooser_controller_unittest.mm

Issue 216523005: show avatar bubble in edit mode on mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/browser/profile_chooser_controller.h" 5 #import "chrome/browser/ui/cocoa/browser/profile_chooser_controller.h"
6 6
7 #include "base/mac/scoped_nsobject.h" 7 #include "base/mac/scoped_nsobject.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 virtual void TearDown() OVERRIDE { 57 virtual void TearDown() OVERRIDE {
58 [controller() close]; 58 [controller() close];
59 controller_.reset(); 59 controller_.reset();
60 CocoaProfileTest::TearDown(); 60 CocoaProfileTest::TearDown();
61 } 61 }
62 62
63 void StartProfileChooserController() { 63 void StartProfileChooserController() {
64 NSRect frame = [test_window() frame]; 64 NSRect frame = [test_window() frame];
65 NSPoint point = NSMakePoint(NSMidX(frame), NSMidY(frame)); 65 NSPoint point = NSMakePoint(NSMidX(frame), NSMidY(frame));
66 controller_.reset( 66 controller_.reset([[ProfileChooserController alloc]
67 [[ProfileChooserController alloc] initWithBrowser:browser() 67 initWithBrowser:browser()
68 anchoredAt:point]); 68 anchoredAt:point
69 viewMode:PROFILE_CHOOSER_VIEW]);
69 [controller_ showWindow:nil]; 70 [controller_ showWindow:nil];
70 } 71 }
71 72
72 ProfileChooserController* controller() { return controller_; } 73 ProfileChooserController* controller() { return controller_; }
73 AvatarMenu* menu() { return menu_; } 74 AvatarMenu* menu() { return menu_; }
74 75
75 private: 76 private:
76 base::scoped_nsobject<ProfileChooserController> controller_; 77 base::scoped_nsobject<ProfileChooserController> controller_;
77 78
78 // Weak; owned by |controller_|. 79 // Weak; owned by |controller_|.
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 EXPECT_EQ(2U, [activeCardSubviews count]); 273 EXPECT_EQ(2U, [activeCardSubviews count]);
273 274
274 NSView* activeProfileImage = [activeCardSubviews objectAtIndex:0]; 275 NSView* activeProfileImage = [activeCardSubviews objectAtIndex:0];
275 EXPECT_TRUE([activeProfileImage isKindOfClass:[NSImageView class]]); 276 EXPECT_TRUE([activeProfileImage isKindOfClass:[NSImageView class]]);
276 277
277 NSView* activeProfileName = [activeCardSubviews objectAtIndex:1]; 278 NSView* activeProfileName = [activeCardSubviews objectAtIndex:1];
278 EXPECT_TRUE([activeProfileName isKindOfClass:[NSButton class]]); 279 EXPECT_TRUE([activeProfileName isKindOfClass:[NSButton class]]);
279 EXPECT_EQ(menu()->GetItemAt(0).name, base::SysNSStringToUTF16( 280 EXPECT_EQ(menu()->GetItemAt(0).name, base::SysNSStringToUTF16(
280 [static_cast<NSButton*>(activeProfileName) title])); 281 [static_cast<NSButton*>(activeProfileName) title]));
281 } 282 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698