OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/ui/cocoa/nsview_additions.h" | 5 #import "ui/base/cocoa/nsview_additions.h" |
6 | 6 |
7 #include "base/mac/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" |
8 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" | |
9 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
10 #import "testing/gtest_mac.h" | 9 #import "testing/gtest_mac.h" |
| 10 #import "ui/gfx/test/ui_cocoa_test_helper.h" |
11 | 11 |
12 typedef CocoaTest NSViewChromeAdditionsTest; | 12 typedef ui::CocoaTest NSViewChromeAdditionsTest; |
13 | 13 |
14 @interface ParentView : NSView { | 14 @interface ParentView : NSView { |
15 @private | 15 @private |
16 int removeCount_; | 16 int removeCount_; |
17 int addCount_; | 17 int addCount_; |
18 } | 18 } |
19 | 19 |
20 @property(readonly, nonatomic) int removeCount; | 20 @property(readonly, nonatomic) int removeCount; |
21 @property(readonly, nonatomic) int addCount; | 21 @property(readonly, nonatomic) int addCount; |
22 | 22 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 [parent addSubview:child2]; | 97 [parent addSubview:child2]; |
98 | 98 |
99 EXPECT_EQ(0, [parent removeCount]); | 99 EXPECT_EQ(0, [parent removeCount]); |
100 EXPECT_EQ(2, [parent addCount]); | 100 EXPECT_EQ(2, [parent addCount]); |
101 [parent cr_ensureSubview:child2 | 101 [parent cr_ensureSubview:child2 |
102 isPositioned:NSWindowAbove | 102 isPositioned:NSWindowAbove |
103 relativeTo:child1]; | 103 relativeTo:child1]; |
104 EXPECT_EQ(0, [parent removeCount]); | 104 EXPECT_EQ(0, [parent removeCount]); |
105 EXPECT_EQ(2, [parent addCount]); | 105 EXPECT_EQ(2, [parent addCount]); |
106 } | 106 } |
OLD | NEW |