summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/browser_frame_view_unittest.mm
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-09 22:37:55 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-09 22:37:55 +0000
commitd546029a268e19c244bcbfba57e4bd2d39d44a83 (patch)
tree82090113ed3095ac5db6fe5610a908846b7cf0ec /chrome/browser/cocoa/browser_frame_view_unittest.mm
parent8717745b839efbe446902f3449a3a348f687a42f (diff)
downloadchromium_src-d546029a268e19c244bcbfba57e4bd2d39d44a83.zip
chromium_src-d546029a268e19c244bcbfba57e4bd2d39d44a83.tar.gz
chromium_src-d546029a268e19c244bcbfba57e4bd2d39d44a83.tar.bz2
Several theming fixes for the Mac. Sorry for the extensive change, but they
were all sort of intertwined. Fixes up patterns in general so that they are all in phase. Moves the window widget buttons down by two pixels. Draws overlays correctly. Fixes up some accessibility issues with the default window widgets. Gets rid of some out of date files (tab_cell). BUG=18438, 18547, 19851, 20295, 22213, 23651, 24338 TEST=Launch Chrome. Switch to "dots" theme from the Google themes. Create a couple of tabs. Check to make sure that the background pattern line up with the tabs. Move the tabs around. Check that the hightlight colors and text colors look correct for all of the tabs. Make sure the patterns stay lined up. Resize the window, make sure none of the patterns move around. Create new windows by dragging the tabs out of the windows and make sure a new window is created with the correct pattern. Show the "find" bar. Make sure its pattern lines up correctly with the tabbar. Switch to default theme. Make sure it looks correct and draws properly. Switch to Zen theme and make sure that the overlay at the top draws correctly. Create a new window. make sure that the rollovers in the window widgets work correctly in both the active and inactive window. Mouse down on the zoom button in the inactive window and notice that the window context changes. Move off of the zoom button and mouse up. Mouse down on the miniaturize button on the inactive window and notice that the window context does not change. Move off of the miniaturize button and mouse up. Do the same thing you did for the miniaturize button for the close button. Start up Accessibility Inspector from the developer tools. Make sure that the window widgets report their accessibility information correctly. Review URL: http://codereview.chromium.org/260009 Patch from dmaclach@chromium.org. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28613 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/browser_frame_view_unittest.mm')
-rw-r--r--chrome/browser/cocoa/browser_frame_view_unittest.mm48
1 files changed, 48 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/browser_frame_view_unittest.mm b/chrome/browser/cocoa/browser_frame_view_unittest.mm
new file mode 100644
index 0000000..90d51c7
--- /dev/null
+++ b/chrome/browser/cocoa/browser_frame_view_unittest.mm
@@ -0,0 +1,48 @@
+// Copyright (c) 2009 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 <Cocoa/Cocoa.h>
+#include <objc/runtime.h>
+
+#include "base/scoped_nsobject.h"
+#import "chrome/browser/cocoa/browser_frame_view.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "testing/platform_test.h"
+
+class BrowserFrameViewTest : public PlatformTest {
+ public:
+ BrowserFrameViewTest() {
+ NSRect frame = NSMakeRect(0, 0, 50, 50);
+ // We create NSGrayFrame instead of BrowserFrameView because
+ // we are swizzling into NSGrayFrame.
+ Class browserFrameClass = NSClassFromString(@"NSGrayFrame");
+ view_.reset([[browserFrameClass alloc] initWithFrame:frame]);
+ }
+
+ scoped_nsobject<NSView> view_;
+};
+
+// Test to make sure our class modifications were successful.
+TEST_F(BrowserFrameViewTest, SuccessfulClassModifications) {
+ unsigned int count;
+ BOOL foundMouseInGroup = NO;
+ BOOL foundDrawRectOriginal = NO;
+ BOOL foundUpdateTrackingAreas = NO;
+
+ Method* methods = class_copyMethodList([view_ class], &count);
+ for (unsigned int i = 0; i < count; ++i) {
+ SEL selector = method_getName(methods[i]);
+ if (selector == @selector(_mouseInGroup:)) {
+ foundMouseInGroup = YES;
+ } else if (selector == @selector(drawRectOriginal:)) {
+ foundDrawRectOriginal = YES;
+ } else if (selector == @selector(updateTrackingAreas)) {
+ foundUpdateTrackingAreas = YES;
+ }
+ }
+ EXPECT_TRUE(foundMouseInGroup);
+ EXPECT_TRUE(foundDrawRectOriginal);
+ EXPECT_TRUE(foundUpdateTrackingAreas);
+ free(methods);
+}