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

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: Addressing creis@ comments 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: 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 dfebfa9efeb16ca5dd77c6aa13ab3a7bff65b665..9d48b9358d8a08abf18236bbc1467f76c7823f24 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
@@ -255,8 +255,9 @@ class ViewTextSelectionObserver : public TextInputManagerObserverBase {
if (expected_view_ == tester()->GetUpdatedView()) {
size_t selection_length;
if (tester()->GetCurrentTextSelectionLength(&selection_length) &&
- expected_selection_length_ == selection_length)
+ expected_selection_length_ == selection_length) {
OnSuccess();
+ }
Charlie Reis 2016/08/08 17:12:01 nit: No change needed here.
EhsanK 2016/08/09 16:42:29 Acknowledged.
}
}
@@ -614,32 +615,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);

Powered by Google App Engine
This is Rietveld 408576698