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

Unified Diff: chrome/browser/ui/cocoa/omnibox/omnibox_view_mac_browsertest.mm

Issue 2395233005: [Mac] Preserve original selection when suggesting completions with diacritics (Closed)
Patch Set: Wrap retained object in scoped_nsobject Created 4 years, 2 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 | « chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/omnibox/omnibox_view_mac_browsertest.mm
diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac_browsertest.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac_browsertest.mm
index 0d40dfffd3f11686dc3159d9696722e201acd17a..5b9525dede6a4f550f42abf5ad44ca5eb356ce97 100644
--- a/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac_browsertest.mm
+++ b/chrome/browser/ui/cocoa/omnibox/omnibox_view_mac_browsertest.mm
@@ -94,3 +94,22 @@ IN_PROC_BROWSER_TEST_F(OmniboxViewMacBrowserTest, CopyToPasteboard) {
pasteboard_string = [pasteboard->get() stringForType:NSPasteboardTypeString];
EXPECT_EQ(text, pasteboard_string.UTF8String);
}
+
+// Verify that copying text from the omnibox into the pasteboard works with
+// a selection that begins on a combining character.
+IN_PROC_BROWSER_TEST_F(OmniboxViewMacBrowserTest, CopyToPasteboardDiacritic) {
+ base::string16 text = base::UTF8ToUTF16("สวัสดี");
+
+ scoped_refptr<ui::UniquePasteboard> pasteboard = new ui::UniquePasteboard;
+ [[GetOmnibox()->field() currentEditor]
+ setString:base::SysUTF16ToNSString(text)];
+ [[GetOmnibox()->field() currentEditor]
+ setSelectedRange:NSMakeRange(2, text.size() - 2)];
+
+ GetOmnibox()->model()->SetUserText(text);
+ GetOmnibox()->CopyToPasteboard(pasteboard->get());
+
+ NSString* pasteboard_string =
+ [pasteboard->get() stringForType:NSPasteboardTypeString];
+ EXPECT_EQ(text.substr(2, 4), base::SysNSStringToUTF16(pasteboard_string));
+}
« no previous file with comments | « chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698