diff options
author | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-21 21:42:46 +0000 |
---|---|---|
committer | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-21 21:42:46 +0000 |
commit | cd1b1db449f9bd1ea6d75bf38562e3a2e72106d9 (patch) | |
tree | 09591b0d16869ccccc5e2122aec6db2a07bb115b /chrome/browser/cocoa/about_window_controller_unittest.mm | |
parent | 3dc5eac55b0c9d69a3491296c34270d819506e2d (diff) | |
download | chromium_src-cd1b1db449f9bd1ea6d75bf38562e3a2e72106d9.zip chromium_src-cd1b1db449f9bd1ea6d75bf38562e3a2e72106d9.tar.gz chromium_src-cd1b1db449f9bd1ea6d75bf38562e3a2e72106d9.tar.bz2 |
Make links in the cocoa about dialog clickable. (Try #2).
Once again, we're changing the implementation from an NSTextField to an
NSTextView. The text is no longer editable, the margins have been fixed
to not be standard cocoa margins and the font is explicitly set to
Lucida Grande.
After talking with jrg, I think the text should be selectable.
BUG=20493
BUG=20855
Review URL: http://codereview.chromium.org/216028
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26737 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/about_window_controller_unittest.mm')
-rw-r--r-- | chrome/browser/cocoa/about_window_controller_unittest.mm | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/about_window_controller_unittest.mm b/chrome/browser/cocoa/about_window_controller_unittest.mm index 462824d..2ce86ac 100644 --- a/chrome/browser/cocoa/about_window_controller_unittest.mm +++ b/chrome/browser/cocoa/about_window_controller_unittest.mm @@ -26,6 +26,34 @@ class AboutWindowControllerTest : public PlatformTest { scoped_nsobject<AboutWindowController> about_window_controller_; }; +TEST_F(AboutWindowControllerTest, TestCopyright) { + NSString* text = [BuildAboutWindowLegalTextBlock() string]; + + // Make sure we have the word "Copyright" in it, which is present in all + // locales. + NSRange range = [text rangeOfString:@"Copyright"]; + EXPECT_NE(NSNotFound, range.location); +} + +TEST_F(AboutWindowControllerTest, RemovesLinkAnchors) { + NSString* text = [BuildAboutWindowLegalTextBlock() string]; + + // Make sure that we removed the "BEGIN_LINK" and "END_LINK" anchors. + NSRange range = [text rangeOfString:@"BEGIN_LINK"]; + EXPECT_EQ(NSNotFound, range.location); + + range = [text rangeOfString:@"END_LINK"]; + EXPECT_EQ(NSNotFound, range.location); +} + +TEST_F(AboutWindowControllerTest, AwakeNibSetsString) { + NSAttributedString* legal_text = BuildAboutWindowLegalTextBlock(); + NSAttributedString* text_storage = + [[about_window_controller_ legalText] textStorage]; + + EXPECT_TRUE([legal_text isEqualToAttributedString:text_storage]); +} + TEST_F(AboutWindowControllerTest, TestButton) { NSButton* button = [about_window_controller_ updateButton]; ASSERT_TRUE(button); |