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

Unified 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, 5 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/extensions/chevron_menu_button_unittest.mm
diff --git a/chrome/browser/cocoa/extensions/chevron_menu_button_unittest.mm b/chrome/browser/cocoa/extensions/chevron_menu_button_unittest.mm
new file mode 100644
index 0000000000000000000000000000000000000000..e5c2f7721526f14f814c801af2dcc96991324c34
--- /dev/null
+++ b/chrome/browser/cocoa/extensions/chevron_menu_button_unittest.mm
@@ -0,0 +1,50 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "chrome/browser/cocoa/extensions/chevron_menu_button.h"
+#import "chrome/browser/cocoa/extensions/chevron_menu_button_cell.h"
+
+#include "base/scoped_nsobject.h"
+#import "chrome/browser/cocoa/cocoa_test_helper.h"
+
+namespace {
+
+class ChevronMenuButtonTest : public CocoaTest {
+ public:
+ ChevronMenuButtonTest() {
+ NSRect frame = NSMakeRect(0, 0, 50, 30);
+ scoped_nsobject<ChevronMenuButton> button(
+ [[ChevronMenuButton alloc] initWithFrame:frame]);
+ button_ = button.get();
+ [[test_window() contentView] addSubview:button_];
+ }
+
+ ChevronMenuButton* button_;
+};
+
+// Test basic view operation.
+TEST_VIEW(ChevronMenuButtonTest, button_);
+
+// |ChevronMenuButton exists entirely to override the cell class.
+TEST_F(ChevronMenuButtonTest, CellSubclass) {
+ EXPECT_TRUE([[button_ cell] isKindOfClass:[ChevronMenuButtonCell class]]);
+}
+
+// Test both hovered and non-hovered display.
+TEST_F(ChevronMenuButtonTest, HoverAndNonHoverDisplay) {
+ ChevronMenuButtonCell* cell = [button_ cell];
+ EXPECT_FALSE([cell showsBorderOnlyWhileMouseInside]);
+ EXPECT_FALSE([cell isMouseInside]);
+
+ [cell setShowsBorderOnlyWhileMouseInside:YES];
+ [cell mouseEntered:nil];
+ EXPECT_TRUE([cell isMouseInside]);
+ [button_ display];
+
+ [cell mouseExited:nil];
+ EXPECT_FALSE([cell isMouseInside]);
+ [button_ display];
+}
+
+} // namespace
« 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