Chromium Code Reviews| 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..24939b9780e3692ec383dc6691b1629f0f568f5a 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 |
| @@ -227,6 +227,7 @@ class ViewCompositionRangeChangedObserver |
| private: |
| void VerifyChange() { |
| + LOG(INFO) << "View: " << tester()->GetUpdatedView(); |
|
Charlie Reis
2016/08/03 22:16:23
Did you mean to leave these in?
EhsanK
2016/08/04 18:57:58
No sorry. Removed. Thanks!
|
| if (expected_view_ == tester()->GetUpdatedView()) |
| OnSuccess(); |
| } |
| @@ -255,8 +256,10 @@ 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) { |
| + LOG(INFO) << "Observed length:" << selection_length; |
| OnSuccess(); |
| + } |
| } |
| } |
| @@ -614,32 +617,31 @@ 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(); |
| + LOG(INFO) << "Wait for view is over: " << view; |
|
Charlie Reis
2016/08/03 22:16:23
Should probably remove this as well.
EhsanK
2016/08/04 18:57:58
Done.
|
| + }; |
| for (auto* view : views) |
| send_tab_set_composition_wait_for_bounds_change(view); |