| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 UI_GFX_TEST_UI_COCOA_TEST_HELPER_H_ | 5 #ifndef UI_GFX_TEST_UI_COCOA_TEST_HELPER_H_ |
| 6 #define UI_GFX_TEST_UI_COCOA_TEST_HELPER_H_ | 6 #define UI_GFX_TEST_UI_COCOA_TEST_HELPER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #import <Cocoa/Cocoa.h> | 10 #import <Cocoa/Cocoa.h> |
| 11 | 11 |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #import "base/mac/scoped_nsautorelease_pool.h" | 13 #import "base/mac/scoped_nsautorelease_pool.h" |
| 14 #import "base/mac/scoped_nsobject.h" |
| 14 #include "testing/platform_test.h" | 15 #include "testing/platform_test.h" |
| 15 | 16 |
| 16 // Background windows normally will not display things such as focus | 17 // Background windows normally will not display things such as focus |
| 17 // rings. This class allows -isKeyWindow to be manipulated to test | 18 // rings. This class allows -isKeyWindow to be manipulated to test |
| 18 // such things. | 19 // such things. |
| 19 @interface CocoaTestHelperWindow : NSWindow { | 20 @interface CocoaTestHelperWindow : NSWindow { |
| 20 @private | 21 @private |
| 21 BOOL pretendIsKeyWindow_; | 22 BOOL pretendIsKeyWindow_; |
| 22 BOOL useDefaultConstraints_; | 23 BOOL useDefaultConstraints_; |
| 23 } | 24 } |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 #define EXPECT_NSRECT_EQ(expected, actual) \ | 146 #define EXPECT_NSRECT_EQ(expected, actual) \ |
| 146 EXPECT_TRUE(CGFLOAT_EQ(expected.origin.x, actual.origin.x) && \ | 147 EXPECT_TRUE(CGFLOAT_EQ(expected.origin.x, actual.origin.x) && \ |
| 147 CGFLOAT_EQ(expected.origin.y, actual.origin.y) && \ | 148 CGFLOAT_EQ(expected.origin.y, actual.origin.y) && \ |
| 148 CGFLOAT_EQ(expected.size.width, actual.size.width) && \ | 149 CGFLOAT_EQ(expected.size.width, actual.size.width) && \ |
| 149 CGFLOAT_EQ(expected.size.height, actual.size.height)) << \ | 150 CGFLOAT_EQ(expected.size.height, actual.size.height)) << \ |
| 150 "Rects do not match: " << \ | 151 "Rects do not match: " << \ |
| 151 [NSStringFromRect(expected) UTF8String] << \ | 152 [NSStringFromRect(expected) UTF8String] << \ |
| 152 " != " << [NSStringFromRect(actual) UTF8String] | 153 " != " << [NSStringFromRect(actual) UTF8String] |
| 153 | 154 |
| 154 #endif // UI_GFX_TEST_UI_COCOA_TEST_HELPER_H_ | 155 #endif // UI_GFX_TEST_UI_COCOA_TEST_HELPER_H_ |
| OLD | NEW |