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

Side by Side Diff: chrome/browser/cocoa/browser_frame_view_unittest.mm

Issue 260009: Several background pattern fixes on the Mac.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 2 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 | Annotate | Revision Log
Property Changes:
Name: svn:eol-style
+ LF
OLDNEW
(Empty)
1 // Copyright (c) 2009 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 <Cocoa/Cocoa.h>
6 #include <objc/runtime.h>
7
8 #include "base/scoped_nsobject.h"
9 #import "chrome/browser/cocoa/browser_frame_view.h"
10 #include "testing/gtest/include/gtest/gtest.h"
11 #include "testing/platform_test.h"
12
13 class BrowserFrameViewTest : public PlatformTest {
14 public:
15 BrowserFrameViewTest() {
16 NSRect frame = NSMakeRect(0, 0, 50, 50);
17 // We create NSGrayFrame instead of BrowserFrameView because
18 // we are swizzling into NSGrayFrame.
19 Class browserFrameClass = NSClassFromString(@"NSGrayFrame");
20 view_.reset([[browserFrameClass alloc] initWithFrame:frame]);
21 }
22
23 scoped_nsobject<NSView> view_;
24 };
25
26 // Test to make sure our class modifications were successful.
27 TEST_F(BrowserFrameViewTest, SuccessfulClassModifications) {
28 unsigned int count;
29 BOOL foundMouseInGroup = NO;
30 BOOL foundDrawRectOriginal = NO;
31 BOOL foundUpdateTrackingAreas = NO;
32
33 Method* methods = class_copyMethodList([view_ class], &count);
34 for (unsigned int i = 0; i < count; ++i) {
35 SEL selector = method_getName(methods[i]);
36 if (selector == @selector(_mouseInGroup:)) {
37 foundMouseInGroup = YES;
38 } else if (selector == @selector(drawRectOriginal:)) {
39 foundDrawRectOriginal = YES;
40 } else if (selector == @selector(updateTrackingAreas)) {
41 foundUpdateTrackingAreas = YES;
42 }
43 }
44 EXPECT_TRUE(foundMouseInGroup);
45 EXPECT_TRUE(foundDrawRectOriginal);
46 EXPECT_TRUE(foundUpdateTrackingAreas);
47 free(methods);
48 }
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/browser_frame_view.mm ('k') | chrome/browser/cocoa/browser_window_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698