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 19e18971b4fcebfd9909c8c31ea2d642a54721b8..16ad2553e30780705a4bc9b9949f5032b8239155 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 |
| @@ -323,6 +323,10 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessTextInputManagerTest, |
| &first_view_type)); |
| EXPECT_EQ(ui::TEXT_INPUT_TYPE_NONE, first_view_type); |
| + size_t registered_views_count = |
|
EhsanK
2016/06/11 10:26:56
I was expecting this number to be 2U as it was in
|
| + content::GetAllViewsRegisteredWithTextInputManager(active_contents()) |
|
Charlie Reis
2016/06/13 18:46:13
We should just expose the count if we don't need t
EhsanK
2016/06/25 00:10:34
Acknowledged.
|
| + .size(); |
| + |
| // Now that the second frame's <input> is focused, we crash the first frame |
| // and observe that text input state is updated for the view. |
| std::unique_ptr<content::TestRenderWidgetHostViewDestructionObserver> |
| @@ -332,21 +336,23 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessTextInputManagerTest, |
| destruction_observer->Wait(); |
| // Verifying that the TextInputManager is no longer tracking TextInputState |
| - // for |first_view|. Note that |first_view| is now a dangling pointer. |
| - EXPECT_FALSE(content::GetTextInputTypeForView(active_contents(), first_view, |
| - &first_view_type)); |
| + // for |first_view|. |
| + EXPECT_EQ( |
| + registered_views_count - 1U, |
| + content::GetAllViewsRegisteredWithTextInputManager(active_contents()) |
| + .size()); |
| // Now crash the second <iframe> which has an active view. |
| - content::RenderWidgetHostView* second_view = frames[1]->GetView(); |
| TextInputManagerChangeObserver change_observer(active_contents()); |
| frames[1]->GetProcess()->Shutdown(0, false); |
| change_observer.Wait(); |
| EXPECT_EQ(ui::TEXT_INPUT_TYPE_NONE, |
| content::GetTextInputTypeFromWebContents(active_contents())); |
| EXPECT_FALSE(!!content::GetActiveViewFromWebContents(active_contents())); |
| - ui::TextInputType second_view_type; |
| - EXPECT_FALSE(content::GetTextInputTypeForView(active_contents(), second_view, |
| - &second_view_type)); |
| + EXPECT_EQ( |
| + registered_views_count - 2U, |
| + content::GetAllViewsRegisteredWithTextInputManager(active_contents()) |
| + .size()); |
| } |
| // The following test loads a page with two child frames: one in process and one |