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

Side by Side Diff: content/public/test/text_input_test_utils.cc

Issue 2054163003: Fix SitePerProcessTextInputManagerTest.StopTrackingCrashedChildFrame on CFI Bots. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed the added code to RenderWidgetHostViewChildFrame::Destroy(). Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/public/test/text_input_test_utils.h" 5 #include "content/public/test/text_input_test_utils.h"
6 6
7 #include "content/browser/renderer_host/render_widget_host_impl.h" 7 #include "content/browser/renderer_host/render_widget_host_impl.h"
8 #include "content/browser/renderer_host/render_widget_host_view_aura.h" 8 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
9 #include "content/browser/renderer_host/render_widget_host_view_base.h" 9 #include "content/browser/renderer_host/render_widget_host_view_base.h"
10 #include "content/browser/renderer_host/render_widget_host_view_base_observer.h" 10 #include "content/browser/renderer_host/render_widget_host_view_base_observer.h"
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 RenderWidgetHostView* view, 189 RenderWidgetHostView* view,
190 ui::TextInputType* type) { 190 ui::TextInputType* type) {
191 TextInputManager* manager = 191 TextInputManager* manager =
192 static_cast<WebContentsImpl*>(web_contents)->GetTextInputManager(); 192 static_cast<WebContentsImpl*>(web_contents)->GetTextInputManager();
193 193
194 RenderWidgetHostViewBase* view_base = 194 RenderWidgetHostViewBase* view_base =
195 static_cast<RenderWidgetHostViewBase*>(view); 195 static_cast<RenderWidgetHostViewBase*>(view);
196 if (!manager || !manager->IsRegistered(view_base)) 196 if (!manager || !manager->IsRegistered(view_base))
197 return false; 197 return false;
198 198
199 *type = manager->text_input_state_map_[view_base].type; 199 *type = manager->GetTextInputTypeForViewForTesting(view_base);
200
200 return true; 201 return true;
201 } 202 }
202 203
204 size_t GetRegisteredViewsCountFromTextInputManager(WebContents* web_contents) {
205 std::unordered_set<RenderWidgetHostView*> views;
206 TextInputManager* manager =
207 static_cast<WebContentsImpl*>(web_contents)->GetTextInputManager();
208 return !!manager ? manager->GetRegisteredViewsCountForTesting() : 0;
209 }
210
203 RenderWidgetHostView* GetActiveViewFromWebContents(WebContents* web_contents) { 211 RenderWidgetHostView* GetActiveViewFromWebContents(WebContents* web_contents) {
204 return static_cast<WebContentsImpl*>(web_contents) 212 return static_cast<WebContentsImpl*>(web_contents)
205 ->GetTextInputManager() 213 ->GetTextInputManager()
206 ->active_view_for_testing(); 214 ->active_view_for_testing();
207 } 215 }
208 216
209 TextInputManagerTester::TextInputManagerTester(WebContents* web_contents) 217 TextInputManagerTester::TextInputManagerTester(WebContents* web_contents)
210 : observer_(new InternalObserver(web_contents, this)) {} 218 : observer_(new InternalObserver(web_contents, this)) {}
211 219
212 TextInputManagerTester::~TextInputManagerTester() {} 220 TextInputManagerTester::~TextInputManagerTester() {}
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 325
318 #ifdef USE_AURA 326 #ifdef USE_AURA
319 RenderWidgetHostViewAura* view = static_cast<RenderWidgetHostViewAura*>( 327 RenderWidgetHostViewAura* view = static_cast<RenderWidgetHostViewAura*>(
320 web_contents->GetRenderWidgetHostView()); 328 web_contents->GetRenderWidgetHostView());
321 observer.reset(new InputMethodObserverAura(view->GetInputMethod())); 329 observer.reset(new InputMethodObserverAura(view->GetInputMethod()));
322 #endif 330 #endif
323 return observer; 331 return observer;
324 } 332 }
325 333
326 } // namespace content 334 } // namespace content
OLDNEW
« content/public/test/text_input_test_utils.h ('K') | « content/public/test/text_input_test_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698