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

Unified Diff: ui/base/cocoa/controls/hyperlink_text_view_unittest.mm

Issue 887823002: Finished swap out of old API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed formatting issues, changed code to perform string operations in C++ rather than ObjC Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/cocoa/controls/hyperlink_text_view.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/cocoa/controls/hyperlink_text_view_unittest.mm
diff --git a/ui/base/cocoa/controls/hyperlink_text_view_unittest.mm b/ui/base/cocoa/controls/hyperlink_text_view_unittest.mm
index 37f4a544deba3ca65d75e77021acffa35d75f64f..1aca1a36812388fa8607cd9ac9c62a8696d75863 100644
--- a/ui/base/cocoa/controls/hyperlink_text_view_unittest.mm
+++ b/ui/base/cocoa/controls/hyperlink_text_view_unittest.mm
@@ -64,64 +64,6 @@ TEST_F(HyperlinkTextViewTest, TestViewConfiguration) {
EXPECT_FALSE([view_ isVerticallyResizable]);
}
-TEST_F(HyperlinkTextViewTest, LinkInsertion) {
- // Test that setMessage:withLink:... inserts the link text.
- [view_ setMessageAndLink:@"This is a short text message"
- withLink:@"alarmingly "
- atOffset:10
- font:GetDefaultFont()
- messageColor:[NSColor blackColor]
- linkColor:[NSColor blueColor]];
- EXPECT_NSEQ(@"This is a alarmingly short text message",
- [[view_ textStorage] string]);
-
- // Test insertion at end - most common use case.
- NSString* message=@"This is another test message ";
- [view_ setMessageAndLink:message
- withLink:@"with link"
- atOffset:[message length]
- font:GetDefaultFont()
- messageColor:[NSColor blackColor]
- linkColor:[NSColor blueColor]];
- EXPECT_NSEQ(@"This is another test message with link",
- [[view_ textStorage] string]);
-}
-
-TEST_F(HyperlinkTextViewTest, AttributesForMessageWithLink) {
- // Verifies text attributes are set as expected for setMessageWithLink:...
- [view_ setMessageAndLink:@"aaabbbbb"
- withLink:@"xxxx"
- atOffset:3
- font:GetDefaultFont()
- messageColor:[NSColor blackColor]
- linkColor:[NSColor blueColor]];
-
- NSDictionary* attributes;
- NSRange rangeLimit = NSMakeRange(0, 12);
- NSRange range;
- attributes = [[view_ textStorage] attributesAtIndex:0
- longestEffectiveRange:&range
- inRange:rangeLimit];
- EXPECT_EQ(0U, range.location);
- EXPECT_EQ(3U, range.length);
- EXPECT_NSEQ(GetDefaultTextAttributes(), attributes);
-
- attributes = [[view_ textStorage] attributesAtIndex:3
- longestEffectiveRange:&range
- inRange:rangeLimit];
- EXPECT_EQ(3U, range.location);
- EXPECT_EQ(4U, range.length);
- EXPECT_NSEQ(GetDefaultLinkAttributes(), attributes);
-
- attributes = [[view_ textStorage] attributesAtIndex:7
- longestEffectiveRange:&range
- inRange:rangeLimit];
- EXPECT_EQ(7U, range.location);
- EXPECT_EQ(5U, range.length);
- EXPECT_NSEQ(GetDefaultTextAttributes(), attributes);
-
-}
-
TEST_F(HyperlinkTextViewTest, TestSetMessage) {
// Verifies setMessage sets text and attributes properly.
NSString* message = @"Test message";
« 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