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

Side by Side Diff: chrome/browser/cocoa/extensions/chevron_menu_button_unittest.mm

Issue 3014049: [Mac] Integrate divider into browser-action overflow chevron. (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: whitespace. Created 10 years, 4 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
« no previous file with comments | « chrome/browser/cocoa/extensions/chevron_menu_button_cell.mm ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #import "chrome/browser/cocoa/extensions/chevron_menu_button.h"
6 #import "chrome/browser/cocoa/extensions/chevron_menu_button_cell.h"
7
8 #include "base/scoped_nsobject.h"
9 #import "chrome/browser/cocoa/cocoa_test_helper.h"
10
11 namespace {
12
13 class ChevronMenuButtonTest : public CocoaTest {
14 public:
15 ChevronMenuButtonTest() {
16 NSRect frame = NSMakeRect(0, 0, 50, 30);
17 scoped_nsobject<ChevronMenuButton> button(
18 [[ChevronMenuButton alloc] initWithFrame:frame]);
19 button_ = button.get();
20 [[test_window() contentView] addSubview:button_];
21 }
22
23 ChevronMenuButton* button_;
24 };
25
26 // Test basic view operation.
27 TEST_VIEW(ChevronMenuButtonTest, button_);
28
29 // |ChevronMenuButton exists entirely to override the cell class.
30 TEST_F(ChevronMenuButtonTest, CellSubclass) {
31 EXPECT_TRUE([[button_ cell] isKindOfClass:[ChevronMenuButtonCell class]]);
32 }
33
34 // Test both hovered and non-hovered display.
35 TEST_F(ChevronMenuButtonTest, HoverAndNonHoverDisplay) {
36 ChevronMenuButtonCell* cell = [button_ cell];
37 EXPECT_FALSE([cell showsBorderOnlyWhileMouseInside]);
38 EXPECT_FALSE([cell isMouseInside]);
39
40 [cell setShowsBorderOnlyWhileMouseInside:YES];
41 [cell mouseEntered:nil];
42 EXPECT_TRUE([cell isMouseInside]);
43 [button_ display];
44
45 [cell mouseExited:nil];
46 EXPECT_FALSE([cell isMouseInside]);
47 [button_ display];
48 }
49
50 } // namespace
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/extensions/chevron_menu_button_cell.mm ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698