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

Unified Diff: chrome/browser/cocoa/wrench_menu_button_cell_unittest.mm

Issue 3072021: [Mac] Tweaks to the Wrench menu buttons. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/cocoa/wrench_menu_button_cell_unittest.mm
diff --git a/chrome/browser/cocoa/wrench_menu_button_cell_unittest.mm b/chrome/browser/cocoa/wrench_menu_button_cell_unittest.mm
new file mode 100644
index 0000000000000000000000000000000000000000..e736fdc0216cc832c9ed061039a4fdf311cb14ae
--- /dev/null
+++ b/chrome/browser/cocoa/wrench_menu_button_cell_unittest.mm
@@ -0,0 +1,51 @@
+// 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.
+
+#include "base/scoped_nsobject.h"
+#include "chrome/app/chrome_dll_resource.h"
+#import "chrome/browser/cocoa/cocoa_test_helper.h"
+#import "chrome/browser/cocoa/wrench_menu_button_cell.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "testing/platform_test.h"
+
+@interface TestWrenchMenuButton : NSButton
+@end
+@implementation TestWrenchMenuButton
++ (Class)cellClass {
+ return [WrenchMenuButtonCell class];
+}
+@end
+
+namespace {
+
+class WrenchMenuButtonCellTest : public CocoaTest {
+ public:
+ void SetUp() {
+ CocoaTest::SetUp();
+
+ NSRect frame = NSMakeRect(10, 10, 50, 19);
+ button_.reset([[TestWrenchMenuButton alloc] initWithFrame:frame]);
+ [button_ setBezelStyle:NSSmallSquareBezelStyle];
+ [[button_ cell] setControlSize:NSSmallControlSize];
+ [button_ setTitle:@"Allays"];
+ [button_ setButtonType:NSMomentaryPushInButton];
+ }
+
+ scoped_nsobject<NSButton> button_;
+};
+
+TEST_F(WrenchMenuButtonCellTest, Draw) {
+ ASSERT_TRUE(button_.get());
+ [[test_window() contentView] addSubview:button_.get()];
+ [button_ setNeedsDisplay:YES];
+}
+
+TEST_F(WrenchMenuButtonCellTest, DrawHighlight) {
+ ASSERT_TRUE(button_.get());
+ [[test_window() contentView] addSubview:button_.get()];
+ [button_ highlight:YES];
+ [button_ setNeedsDisplay:YES];
+}
+
+} // namespace

Powered by Google App Engine
This is Rietveld 408576698