Fix SitePerProcessTextInputManagerTest.StopTrackingCrashedChildFrame on CFI Bots.
Currently, the test SitePerProcessTextInputManagerTest.StopTrackingCrashedChildFrame
uses stale pointers of the views agains a map to verify that TextInputManager does not
track the view anymore. This is causing issues in Linux CFI bots.
This CL changes the test so that we now check for the number of views being tracked and
verify that after crashing a frame, the number drops by one.
BUG=619147
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation
Review-Url: https://codereview.chromium.org/2054163003
Cr-Commit-Position: refs/heads/master@{#402736}
diff --git a/content/browser/renderer_host/text_input_manager.cc b/content/browser/renderer_host/text_input_manager.cc
index b41efbec..903c471b 100644
--- a/content/browser/renderer_host/text_input_manager.cc
+++ b/content/browser/renderer_host/text_input_manager.cc
@@ -113,6 +113,16 @@
observer_list_.RemoveObserver(observer);
}
+size_t TextInputManager::GetRegisteredViewsCountForTesting() {
+ return text_input_state_map_.size();
+}
+
+ui::TextInputType TextInputManager::GetTextInputTypeForViewForTesting(
+ RenderWidgetHostViewBase* view) {
+ DCHECK(IsRegistered(view));
+ return text_input_state_map_[view].type;
+}
+
void TextInputManager::NotifyObserversAboutInputStateUpdate(
RenderWidgetHostViewBase* updated_view,
bool did_update_state) {