OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "base/mac/scoped_nsobject.h" | 5 #include "base/mac/scoped_nsobject.h" |
6 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" | |
7 #import "chrome/browser/ui/cocoa/hyperlink_text_view.h" | |
8 #include "testing/gtest_mac.h" | 6 #include "testing/gtest_mac.h" |
| 7 #import "ui/base/cocoa/controls/hyperlink_text_view.h" |
| 8 #import "ui/gfx/test/ui_cocoa_test_helper.h" |
9 | 9 |
10 namespace { | 10 namespace { |
11 | 11 |
12 class HyperlinkTextViewTest : public CocoaTest { | 12 class HyperlinkTextViewTest : public ui::CocoaTest { |
13 public: | 13 public: |
14 HyperlinkTextViewTest() { | 14 HyperlinkTextViewTest() { |
15 NSRect frame = NSMakeRect(0, 0, 50, 50); | 15 NSRect frame = NSMakeRect(0, 0, 50, 50); |
16 base::scoped_nsobject<HyperlinkTextView> view( | 16 base::scoped_nsobject<HyperlinkTextView> view( |
17 [[HyperlinkTextView alloc] initWithFrame:frame]); | 17 [[HyperlinkTextView alloc] initWithFrame:frame]); |
18 view_ = view.get(); | 18 view_ = view.get(); |
19 [[test_window() contentView] addSubview:view_]; | 19 [[test_window() contentView] addSubview:view_]; |
20 } | 20 } |
21 | 21 |
22 NSFont* GetDefaultFont() { | 22 NSFont* GetDefaultFont() { |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 | 188 |
189 TEST_F(HyperlinkTextViewTest, FirstResponderBehavior) { | 189 TEST_F(HyperlinkTextViewTest, FirstResponderBehavior) { |
190 // By default, accept. | 190 // By default, accept. |
191 EXPECT_TRUE([view_ acceptsFirstResponder]); | 191 EXPECT_TRUE([view_ acceptsFirstResponder]); |
192 | 192 |
193 [view_ setRefusesFirstResponder:YES]; | 193 [view_ setRefusesFirstResponder:YES]; |
194 EXPECT_FALSE([view_ acceptsFirstResponder]); | 194 EXPECT_FALSE([view_ acceptsFirstResponder]); |
195 } | 195 } |
196 | 196 |
197 } // namespace | 197 } // namespace |
OLD | NEW |