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

Unified Diff: chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc

Issue 2659433002: Track Text Selection information in TextInputManager (OOPIF for Android) (Closed)
Patch Set: Clean ups Created 3 years, 11 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 | « no previous file | content/browser/renderer_host/render_widget_host_view_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc
diff --git a/chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc b/chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc
index 22ae2676ceb800b3d05ddcf0b8593a3ba39d8692..dc71dce007b1342a5dcc0cff1e41e7e4e749ce3b 100644
--- a/chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc
+++ b/chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc
@@ -742,48 +742,6 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessTextInputManagerTest,
send_tab_set_composition_wait_for_bounds_change(view);
}
-// TODO(ekaramad): Some of the following tests should be active on Android as
-// well. Enable them when the corresponding feature is implemented for Android
-// (https://crbug.com/602723).
-#if !defined(OS_ANDROID)
-// This test creates a page with multiple child frames and adds an <input> to
-// each frame. Then, sequentially, each <input> is focused by sending a tab key.
-// Then, after |TextInputState.type| for a view is changed to text, another key
-// is pressed (a character) and then the test verifies that TextInputManager
-// receives the corresponding update on the change in selection bounds on the
-// browser side.
-IN_PROC_BROWSER_TEST_F(SitePerProcessTextInputManagerTest,
- TrackSelectionBoundsForAllFrames) {
- CreateIframePage("a(b,c(a,b),d)");
- std::vector<content::RenderFrameHost*> frames{
- GetFrame(IndexVector{}), GetFrame(IndexVector{0}),
- GetFrame(IndexVector{1}), GetFrame(IndexVector{1, 0}),
- GetFrame(IndexVector{1, 1}), GetFrame(IndexVector{2})};
- std::vector<content::RenderWidgetHostView*> views;
- for (auto* frame : frames)
- views.push_back(frame->GetView());
- for (size_t i = 0; i < frames.size(); ++i)
- AddInputFieldToFrame(frames[i], "text", "", true);
-
- content::WebContents* web_contents = active_contents();
-
- auto send_tab_insert_text_wait_for_bounds_change = [&web_contents](
- content::RenderWidgetHostView* view) {
- ViewTextInputTypeObserver type_observer(web_contents, view,
- ui::TEXT_INPUT_TYPE_TEXT);
- SimulateKeyPress(web_contents, ui::DomKey::TAB, ui::DomCode::TAB,
- ui::VKEY_TAB, false, false, false, false);
- type_observer.Wait();
- ViewSelectionBoundsChangedObserver bounds_observer(web_contents, view);
- SimulateKeyPress(web_contents, ui::DomKey::FromCharacter('E'),
- ui::DomCode::US_E, ui::VKEY_E, false, false, false, false);
- bounds_observer.Wait();
- };
-
- for (auto* view : views)
- send_tab_insert_text_wait_for_bounds_change(view);
-}
-
// This test creates a page with multiple child frames and adds an <input> to
// each frame. Then, sequentially, each <input> is focused by sending a tab key.
// After focusing each input, a sequence of key presses (character 'E') are sent
@@ -834,6 +792,48 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessTextInputManagerTest,
}
}
+// TODO(ekaramad): Some of the following tests should be active on Android as
+// well. Enable them when the corresponding feature is implemented for Android
+// (https://crbug.com/602723).
+#if !defined(OS_ANDROID)
+// This test creates a page with multiple child frames and adds an <input> to
+// each frame. Then, sequentially, each <input> is focused by sending a tab key.
+// Then, after |TextInputState.type| for a view is changed to text, another key
+// is pressed (a character) and then the test verifies that TextInputManager
+// receives the corresponding update on the change in selection bounds on the
+// browser side.
+IN_PROC_BROWSER_TEST_F(SitePerProcessTextInputManagerTest,
+ TrackSelectionBoundsForAllFrames) {
+ CreateIframePage("a(b,c(a,b),d)");
+ std::vector<content::RenderFrameHost*> frames{
+ GetFrame(IndexVector{}), GetFrame(IndexVector{0}),
+ GetFrame(IndexVector{1}), GetFrame(IndexVector{1, 0}),
+ GetFrame(IndexVector{1, 1}), GetFrame(IndexVector{2})};
+ std::vector<content::RenderWidgetHostView*> views;
+ for (auto* frame : frames)
+ views.push_back(frame->GetView());
+ for (size_t i = 0; i < frames.size(); ++i)
+ AddInputFieldToFrame(frames[i], "text", "", true);
+
+ content::WebContents* web_contents = active_contents();
+
+ auto send_tab_insert_text_wait_for_bounds_change = [&web_contents](
+ content::RenderWidgetHostView* view) {
+ ViewTextInputTypeObserver type_observer(web_contents, view,
+ ui::TEXT_INPUT_TYPE_TEXT);
+ SimulateKeyPress(web_contents, ui::DomKey::TAB, ui::DomCode::TAB,
+ ui::VKEY_TAB, false, false, false, false);
+ type_observer.Wait();
+ ViewSelectionBoundsChangedObserver bounds_observer(web_contents, view);
+ SimulateKeyPress(web_contents, ui::DomKey::FromCharacter('E'),
+ ui::DomCode::US_E, ui::VKEY_E, false, false, false, false);
+ bounds_observer.Wait();
+ };
+
+ for (auto* view : views)
+ send_tab_insert_text_wait_for_bounds_change(view);
+}
+
// This test creates a page with multiple child frames and adds two <input>
// elements to each frame. Then, sequentially, each <input> is focused through
// javascript. For each frame, its text and placeholder attributes are queried
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698