diff options
author | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-03 06:40:21 +0000 |
---|---|---|
committer | kinuko@chromium.org <kinuko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-03 06:40:21 +0000 |
commit | 70b2726ad5be0486c9e0654056c3bcae80cd0b41 (patch) | |
tree | f6b2c531c6774b67e2a1578fefa26784a6ca40a3 /app/clipboard | |
parent | 0b1fff4feffee827a4dda10de099b64f039ab3dc (diff) | |
download | chromium_src-70b2726ad5be0486c9e0654056c3bcae80cd0b41.zip chromium_src-70b2726ad5be0486c9e0654056c3bcae80cd0b41.tar.gz chromium_src-70b2726ad5be0486c9e0654056c3bcae80cd0b41.tar.bz2 |
Copy percent-escaped URL when copying all the text from the address bar (Mac)
BUG=31104
TEST=Visit http://www.google.com/search?ie=UTF-8&q=上地 and select entire text in Omnibox, then copy the text.
Paste the copied text into other applications such as notepad and check if the pasted text contains %E4%B8%8A%E5%9C%B0, not 上地.
Paste the copied text into Safari's URL bar and type return. Check if you are navigated to the same website.
Paste the copied text into textareas in Chrome and check if the pasted text contains %E4%B8%8A%E5%9C%B0.
Paste the copied text into Gmail's rich text editing mode and check if the pasted text contains 上地.
Right click the link you pasted in Gmail and check if you see "Go to: http://www.google.com/...%E4%B8%8A%E5%9C%B0".
Paste the copied text into TextEdit and check if the pasted text isn't garbled and correctly contains 上地.
Check if the link in TextEdit is pointing to encoded URL (http://www.google.com/...%E4%B8%8A%E5%9C%B0).
TEST=Visit http://www.google.com/search?ie=UTF-8&q=上地 again and select "q=上地" in Omnibox, then copy the text.
Paste it into somewhere and check if you see "q=上地".
TEST=Copy "上地" from somewhere and paste it into Omnibox.
Copy from Omnibox and paste it into notepad. Then check if the pasted text is NOT encoded.
Review URL: http://codereview.chromium.org/549172
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37955 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/clipboard')
-rw-r--r-- | app/clipboard/clipboard_mac.mm | 4 | ||||
-rw-r--r-- | app/clipboard/clipboard_unittest.cc | 3 |
2 files changed, 4 insertions, 3 deletions
diff --git a/app/clipboard/clipboard_mac.mm b/app/clipboard/clipboard_mac.mm index 1596eba..f546f84 100644 --- a/app/clipboard/clipboard_mac.mm +++ b/app/clipboard/clipboard_mac.mm @@ -64,7 +64,9 @@ void Clipboard::WriteHTML(const char* markup_data, size_t markup_len, const char* url_data, size_t url_len) { - std::string html_fragment_str(markup_data, markup_len); + // We need to mark it as utf-8. (see crbug.com/11957) + std::string html_fragment_str("<meta charset='utf-8'>"); + html_fragment_str.append(markup_data, markup_len); NSString *html_fragment = base::SysUTF8ToNSString(html_fragment_str); // TODO(avi): url_data? diff --git a/app/clipboard/clipboard_unittest.cc b/app/clipboard/clipboard_unittest.cc index 8203bac..8a2bd62 100644 --- a/app/clipboard/clipboard_unittest.cc +++ b/app/clipboard/clipboard_unittest.cc @@ -34,7 +34,7 @@ namespace { bool ClipboardContentsIsExpected(const string16& copied_markup, const string16& pasted_markup) { -#if defined(OS_LINUX) +#if defined(OS_POSIX) return pasted_markup.find(copied_markup) != string16::npos; #else return copied_markup == pasted_markup; @@ -353,4 +353,3 @@ TEST_F(ClipboardTest, WriteEverything) { // Passes if we don't crash. } - |