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

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

Issue 2235283003: Track composition range and character bounds on the browser side (Mac) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased to fix some crashing tests Created 4 years, 4 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: 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 751ff9c86bdc46f7f5566c92d500f81f188457f7..b4eecea318e93a82317a96f56240090d31a7d047 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
@@ -279,6 +279,13 @@ class RenderWidgetHostViewMacTest : public RenderViewHostImplTestHarness {
rwhv_mac_->Destroy();
}
+ void ActivateViewWithTextInputManager(RenderWidgetHostViewBase* view,
+ ui::TextInputType type) {
+ TextInputState state;
+ state.type = type;
+ view->TextInputStateChanged(state);
+ }
+
private:
// This class isn't derived from PlatformTest.
base::mac::ScopedNSAutoreleasePool pool_;
@@ -534,6 +541,7 @@ TEST_F(RenderWidgetHostViewMacTest, GetFirstRectForCharacterRangeCaretCase) {
}
TEST_F(RenderWidgetHostViewMacTest, UpdateCompositionSinglelineCase) {
+ ActivateViewWithTextInputManager(rwhv_mac_, ui::TEXT_INPUT_TYPE_TEXT);
const gfx::Point kOrigin(10, 11);
const gfx::Size kBoundsUnit(10, 20);
@@ -642,6 +650,7 @@ TEST_F(RenderWidgetHostViewMacTest, UpdateCompositionSinglelineCase) {
}
TEST_F(RenderWidgetHostViewMacTest, UpdateCompositionMultilineCase) {
+ ActivateViewWithTextInputManager(rwhv_mac_, ui::TEXT_INPUT_TYPE_TEXT);
const gfx::Point kOrigin(10, 11);
const gfx::Size kBoundsUnit(10, 20);
NSRect rect;
@@ -775,6 +784,7 @@ TEST_F(RenderWidgetHostViewMacTest, UpdateCompositionMultilineCase) {
// firstRectForCharacterRange:actualRange] are handled in a sane manner if they
// arrive after the C++ RenderWidgetHostView is destroyed.
TEST_F(RenderWidgetHostViewMacTest, CompositionEventAfterDestroy) {
+ ActivateViewWithTextInputManager(rwhv_mac_, ui::TEXT_INPUT_TYPE_TEXT);
const gfx::Rect composition_bounds(0, 0, 30, 40);
const gfx::Range range(0, 1);
rwhv_mac_->ImeCompositionRangeChanged(
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_mac.mm ('k') | content/browser/renderer_host/text_input_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698