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

Side by Side Diff: ui/base/cocoa/controls/hyperlink_text_view_unittest.mm

Issue 1842663003: Mac: Replace uses of deprecated NSNoUnderlineStyle and NSSingleUnderlineStyle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20160329-Mac-DeploymentTarget
Patch Set: cl format Created 4 years, 8 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
« no previous file with comments | « ui/base/cocoa/controls/hyperlink_text_view.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "testing/gtest_mac.h" 6 #include "testing/gtest_mac.h"
7 #import "ui/base/cocoa/controls/hyperlink_text_view.h" 7 #import "ui/base/cocoa/controls/hyperlink_text_view.h"
8 #import "ui/gfx/test/ui_cocoa_test_helper.h" 8 #import "ui/gfx/test/ui_cocoa_test_helper.h"
9 9
10 namespace { 10 namespace {
(...skipping 22 matching lines...) Expand all
33 NSBaselineOffsetAttributeName : @(kTextBaselineShift) 33 NSBaselineOffsetAttributeName : @(kTextBaselineShift)
34 }; 34 };
35 } 35 }
36 36
37 NSMutableDictionary* GetDefaultLinkAttributes() { 37 NSMutableDictionary* GetDefaultLinkAttributes() {
38 if (!linkAttributes_.get()) { 38 if (!linkAttributes_.get()) {
39 linkAttributes_.reset( 39 linkAttributes_.reset(
40 [[NSMutableDictionary dictionaryWithDictionary: 40 [[NSMutableDictionary dictionaryWithDictionary:
41 GetDefaultTextAttributes()] retain]); 41 GetDefaultTextAttributes()] retain]);
42 [linkAttributes_ addEntriesFromDictionary:@{ 42 [linkAttributes_ addEntriesFromDictionary:@{
43 NSForegroundColorAttributeName : [NSColor blueColor], 43 NSForegroundColorAttributeName : [NSColor blueColor],
44 NSUnderlineStyleAttributeName : @(YES), 44 NSUnderlineStyleAttributeName : @(YES),
45 NSCursorAttributeName : [NSCursor pointingHandCursor], 45 NSCursorAttributeName : [NSCursor pointingHandCursor],
46 NSUnderlineStyleAttributeName : @(NSSingleUnderlineStyle), 46 NSUnderlineStyleAttributeName : @(NSUnderlineStyleSingle),
47 NSLinkAttributeName : @""}]; 47 NSLinkAttributeName : @""
48 }];
48 } 49 }
49 return [NSMutableDictionary dictionaryWithDictionary:linkAttributes_]; 50 return [NSMutableDictionary dictionaryWithDictionary:linkAttributes_];
50 } 51 }
51 52
52 HyperlinkTextView* view_; 53 HyperlinkTextView* view_;
53 54
54 private: 55 private:
55 base::scoped_nsobject<NSMutableDictionary> linkAttributes_; 56 base::scoped_nsobject<NSMutableDictionary> linkAttributes_;
56 }; 57 };
57 58
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 131
131 TEST_F(HyperlinkTextViewTest, FirstResponderBehavior) { 132 TEST_F(HyperlinkTextViewTest, FirstResponderBehavior) {
132 // By default, accept. 133 // By default, accept.
133 EXPECT_TRUE([view_ acceptsFirstResponder]); 134 EXPECT_TRUE([view_ acceptsFirstResponder]);
134 135
135 [view_ setRefusesFirstResponder:YES]; 136 [view_ setRefusesFirstResponder:YES];
136 EXPECT_FALSE([view_ acceptsFirstResponder]); 137 EXPECT_FALSE([view_ acceptsFirstResponder]);
137 } 138 }
138 139
139 } // namespace 140 } // namespace
OLDNEW
« no previous file with comments | « ui/base/cocoa/controls/hyperlink_text_view.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698