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

Unified Diff: chrome/browser/renderer_host/text_input_client_mac_unittest.mm

Issue 7039054: Fix assertion failure in range.mm while examining system dictionary popup. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 7 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
Index: chrome/browser/renderer_host/text_input_client_mac_unittest.mm
diff --git a/chrome/browser/renderer_host/text_input_client_mac_unittest.mm b/chrome/browser/renderer_host/text_input_client_mac_unittest.mm
index 6870064e81360133b829b80ae52a0d8db039a655..41551e5c460b86edd8adbae307767c3c3302e6e1 100644
--- a/chrome/browser/renderer_host/text_input_client_mac_unittest.mm
+++ b/chrome/browser/renderer_host/text_input_client_mac_unittest.mm
@@ -106,6 +106,21 @@ TEST_F(TextInputClientMacTest, TimeoutCharacterIndex) {
EXPECT_EQ(NSNotFound, index);
}
+TEST_F(TextInputClientMacTest, NotFoundCharacterIndex) {
+ ScopedTestingThread thread(this);
+ const NSUInteger kNotFoundValue = static_cast<NSUInteger>(-1);
+
+ PostTask(base::Bind(&TextInputClientMac::SetCharacterIndexAndSignal,
+ base::Unretained(service()), kNotFoundValue));
+ NSUInteger index = service()->GetCharacterIndexAtPoint(
+ widget(), gfx::Point(2, 2));
+
+ EXPECT_EQ(1U, ipc_sink().message_count());
+ EXPECT_TRUE(ipc_sink().GetUniqueMessageMatching(
+ TextInputClientMsg_CharacterIndexForPoint::ID));
+ EXPECT_EQ(NSNotFound, index);
+}
+
TEST_F(TextInputClientMacTest, GetRectForRange) {
ScopedTestingThread thread(this);
const NSRect kSuccessValue = NSMakeRect(42, 43, 44, 45);

Powered by Google App Engine
This is Rietveld 408576698