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

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

Issue 3095004: [Mac] Use the new {EXPECT,ASSERT}_NS{EQ,NE} macros where possible. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Fix compile 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #include "base/scoped_nsobject.h" 7 #include "base/scoped_nsobject.h"
8 #include "chrome/app/chrome_dll_resource.h" 8 #include "chrome/app/chrome_dll_resource.h"
9 #import "chrome/browser/cocoa/chrome_browser_window.h" 9 #import "chrome/browser/cocoa/chrome_browser_window.h"
10 #import "chrome/browser/cocoa/browser_window_controller.h" 10 #import "chrome/browser/cocoa/browser_window_controller.h"
11 #import "chrome/browser/cocoa/browser_frame_view.h" 11 #import "chrome/browser/cocoa/browser_frame_view.h"
12 #import "chrome/browser/cocoa/cocoa_test_helper.h" 12 #import "chrome/browser/cocoa/cocoa_test_helper.h"
13 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
14 #import "testing/gtest_mac.h"
14 #include "testing/platform_test.h" 15 #include "testing/platform_test.h"
15 #import "third_party/ocmock/OCMock/OCMock.h" 16 #import "third_party/ocmock/OCMock/OCMock.h"
16 17
17 class ChromeBrowserWindowTest : public CocoaTest { 18 class ChromeBrowserWindowTest : public CocoaTest {
18 public: 19 public:
19 virtual void SetUp() { 20 virtual void SetUp() {
20 CocoaTest::SetUp(); 21 CocoaTest::SetUp();
21 // Create a window. 22 // Create a window.
22 const NSUInteger mask = NSTitledWindowMask | NSClosableWindowMask | 23 const NSUInteger mask = NSTitledWindowMask | NSClosableWindowMask |
23 NSMiniaturizableWindowMask | NSResizableWindowMask; 24 NSMiniaturizableWindowMask | NSResizableWindowMask;
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 NSView* frameView = [[window_ contentView] superview]; 162 NSView* frameView = [[window_ contentView] superview];
162 NSArray* trackingAreas = [frameView trackingAreas]; 163 NSArray* trackingAreas = [frameView trackingAreas];
163 NSPoint point = [closeBoxControl frame].origin; 164 NSPoint point = [closeBoxControl frame].origin;
164 point.x += 1; 165 point.x += 1;
165 point.y += 1; 166 point.y += 1;
166 BOOL foundArea = NO; 167 BOOL foundArea = NO;
167 for (NSTrackingArea* area in trackingAreas) { 168 for (NSTrackingArea* area in trackingAreas) {
168 NSRect rect = [area rect]; 169 NSRect rect = [area rect];
169 foundArea = NSPointInRect(point, rect); 170 foundArea = NSPointInRect(point, rect);
170 if (foundArea) { 171 if (foundArea) {
171 EXPECT_TRUE([[area owner] isEqual:frameView]); 172 EXPECT_NSEQ(frameView, [area owner]);
172 break; 173 break;
173 } 174 }
174 } 175 }
175 EXPECT_TRUE(foundArea); 176 EXPECT_TRUE(foundArea);
176 } 177 }
177 178
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698