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

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

Issue 2208583005: Request to start/stop calculating composition info from RenderWidget when it is active/inactive. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased (nona@'s patch relanded) 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
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_aura.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 15a8ae0aef84bcff0e59feb29aa9eb535507e85d..38443d3030b2d0beae064231f95932e440830148 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
@@ -613,32 +613,30 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessTextInputManagerTest,
// updates its composition range.
IN_PROC_BROWSER_TEST_F(SitePerProcessTextInputManagerTest,
TrackCompositionRangeForAllFrames) {
- // TODO(ekaramd): After IME methods are implemented for WebFrameWidgetImpl,
- // change the page so that it contains child frames as well
- // (crbug.com/626746).
- CreateIframePage("a()");
- std::vector<content::RenderFrameHost*> frames{GetFrame(IndexVector{})};
+ 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);
+ AddInputFieldToFrame(frames[i], "text", "text", true);
content::WebContents* web_contents = active_contents();
- auto send_tab_set_composition_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();
- ViewCompositionRangeChangedObserver range_observer(web_contents, view);
- content::SetCompositionForRenderWidgetHost(
- view->GetRenderWidgetHost(), base::ASCIIToUTF16("text"),
- {ui::CompositionUnderline()}, gfx::Range::InvalidRange(), 0, 0);
- range_observer.Wait();
- };
+ auto send_tab_set_composition_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();
+ ViewCompositionRangeChangedObserver range_observer(web_contents, view);
+ EXPECT_TRUE(content::RequestCompositionInfoFromActiveWidget(web_contents));
+ range_observer.Wait();
+ };
for (auto* view : views)
send_tab_set_composition_wait_for_bounds_change(view);
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698