OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_UI_COCOA_COCOA_TEST_HELPER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_COCOA_TEST_HELPER_H_ |
6 #define CHROME_BROWSER_UI_COCOA_COCOA_TEST_HELPER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_COCOA_TEST_HELPER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
10 | 10 |
11 #include "base/mac_util.h" | |
12 #include "base/path_service.h" | 11 #include "base/path_service.h" |
13 #import "base/mac/scoped_nsautorelease_pool.h" | 12 #import "base/mac/scoped_nsautorelease_pool.h" |
14 #import "base/scoped_nsobject.h" | 13 #import "base/scoped_nsobject.h" |
15 #import "chrome/common/chrome_application_mac.h" | 14 #import "chrome/common/chrome_application_mac.h" |
16 #include "chrome/common/chrome_constants.h" | 15 #include "chrome/common/chrome_constants.h" |
17 #include "testing/platform_test.h" | 16 #include "testing/platform_test.h" |
18 | 17 |
19 // Background windows normally will not display things such as focus | 18 // Background windows normally will not display things such as focus |
20 // rings. This class allows -isKeyWindow to be manipulated to test | 19 // rings. This class allows -isKeyWindow to be manipulated to test |
21 // such things. | 20 // such things. |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 #define EXPECT_NSRECT_EQ(expected, actual) \ | 142 #define EXPECT_NSRECT_EQ(expected, actual) \ |
144 EXPECT_TRUE(CGFLOAT_EQ(expected.origin.x, actual.origin.x) && \ | 143 EXPECT_TRUE(CGFLOAT_EQ(expected.origin.x, actual.origin.x) && \ |
145 CGFLOAT_EQ(expected.origin.y, actual.origin.y) && \ | 144 CGFLOAT_EQ(expected.origin.y, actual.origin.y) && \ |
146 CGFLOAT_EQ(expected.size.width, actual.size.width) && \ | 145 CGFLOAT_EQ(expected.size.width, actual.size.width) && \ |
147 CGFLOAT_EQ(expected.size.height, actual.size.height)) << \ | 146 CGFLOAT_EQ(expected.size.height, actual.size.height)) << \ |
148 "Rects do not match: " << \ | 147 "Rects do not match: " << \ |
149 [NSStringFromRect(expected) UTF8String] << \ | 148 [NSStringFromRect(expected) UTF8String] << \ |
150 " != " << [NSStringFromRect(actual) UTF8String] | 149 " != " << [NSStringFromRect(actual) UTF8String] |
151 | 150 |
152 #endif // CHROME_BROWSER_UI_COCOA_COCOA_TEST_HELPER_H_ | 151 #endif // CHROME_BROWSER_UI_COCOA_COCOA_TEST_HELPER_H_ |
OLD | NEW |