diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-10 02:00:50 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-10 02:00:50 +0000 |
commit | be623b0f2ec23b3032fc6c8b61d6062accf51bb7 (patch) | |
tree | 2ffa24729ec7c5a0c1d9d92d200ec66fa675feef /base/clipboard_unittest.cc | |
parent | 956d5aecbbf21ab3f84c87a8aec7d3a47eefbd34 (diff) | |
download | chromium_src-be623b0f2ec23b3032fc6c8b61d6062accf51bb7.zip chromium_src-be623b0f2ec23b3032fc6c8b61d6062accf51bb7.tar.gz chromium_src-be623b0f2ec23b3032fc6c8b61d6062accf51bb7.tar.bz2 |
Clipboard:
- Move link construction logic to scoped_clipboard_writer.cc
- Make callers use EscapeForHTML on the anchor text
- Make WriteHyperlink just write html, and not a bookmark as well (only affects one caller, which I updated)
- implement WriteBookmark for gtk
BUG=18034,18035
Review URL: http://codereview.chromium.org/194052
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25833 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/clipboard_unittest.cc')
-rw-r--r-- | base/clipboard_unittest.cc | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/base/clipboard_unittest.cc b/base/clipboard_unittest.cc index 1b77115..d26ba00 100644 --- a/base/clipboard_unittest.cc +++ b/base/clipboard_unittest.cc @@ -258,25 +258,21 @@ TEST_F(ClipboardTest, DataTest) { TEST_F(ClipboardTest, HyperlinkTest) { Clipboard clipboard; - string16 title(ASCIIToUTF16("The Example Company")), title_result; + std::string title("The Example Company"); std::string url("http://www.example.com/"), url_result; - string16 html(ASCIIToUTF16("<a href=\"http://www.example.com/\">" - "The Example Company</a>")), html_result; + std::string html("<a href=\"http://www.example.com/\">" + "The Example Company</a>"); + string16 html_result; { ScopedClipboardWriter clipboard_writer(&clipboard); clipboard_writer.WriteHyperlink(title, url); } - EXPECT_TRUE(clipboard.IsFormatAvailable(Clipboard::GetUrlWFormatType(), - Clipboard::BUFFER_STANDARD)); EXPECT_TRUE(clipboard.IsFormatAvailable(Clipboard::GetHtmlFormatType(), Clipboard::BUFFER_STANDARD)); - clipboard.ReadBookmark(&title_result, &url_result); - EXPECT_EQ(title, title_result); - EXPECT_EQ(url, url_result); clipboard.ReadHTML(Clipboard::BUFFER_STANDARD, &html_result, &url_result); - EXPECT_EQ(html, html_result); + EXPECT_EQ(UTF8ToUTF16(html), html_result); } TEST_F(ClipboardTest, WebSmartPasteTest) { |