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

Unified Diff: content/browser/renderer_host/render_widget_host_view_mac_unittest.mm

Issue 2480323003: [Merge to 2883] Fix memory leaks in macOS Sierra for IME. (Closed)
Patch Set: Created 4 years, 1 month 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 | « content/browser/renderer_host/render_widget_host_view_mac.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
diff --git a/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm b/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
index 101493a82577c2c55c873a5eff62884422d0d7d4..5afc9ffff5129209720a97a50817a872d6024894 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
@@ -317,6 +317,29 @@ TEST_F(RenderWidgetHostViewMacTest, AcceptsFirstResponder) {
EXPECT_TRUE([rwhv_cocoa_.get() acceptsFirstResponder]);
}
+// This test verifies that RenderWidgetHostViewCocoa's implementation of
+// NSTextInputClientConformance conforms to requirements.
+TEST_F(RenderWidgetHostViewMacTest, NSTextInputClientConformance) {
+ NSRange selectedRange = [rwhv_cocoa_ selectedRange];
+ EXPECT_EQ(NSNotFound, selectedRange.location);
+ EXPECT_EQ(0u, selectedRange.length);
+
+ NSRange actualRange = NSMakeRange(1u, 2u);
+ NSAttributedString* actualString = [rwhv_cocoa_
+ attributedSubstringForProposedRange:NSMakeRange(NSNotFound, 0u)
+ actualRange:&actualRange];
+ EXPECT_EQ(nil, actualString);
+ EXPECT_EQ(NSNotFound, actualRange.location);
+ EXPECT_EQ(0u, actualRange.length);
+
+ actualString = [rwhv_cocoa_
+ attributedSubstringForProposedRange:NSMakeRange(NSNotFound, 15u)
+ actualRange:&actualRange];
+ EXPECT_EQ(nil, actualString);
+ EXPECT_EQ(NSNotFound, actualRange.location);
+ EXPECT_EQ(0u, actualRange.length);
+}
+
TEST_F(RenderWidgetHostViewMacTest, Fullscreen) {
rwhv_mac_->InitAsFullscreen(NULL);
EXPECT_TRUE(rwhv_mac_->pepper_fullscreen_window());
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698