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

Unified Diff: chrome/browser/renderer_host/site_per_process_text_input_browsertest.cc

Issue 2641403002: [refactor] - Move IsFocusedElementEditable() and ClearFocusedElement() from RenderViewHost to WebCo… (Closed)
Patch Set: Addressed sky@'s comment Created 3 years, 11 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/find_bar_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 bf14dac20475f4f7df68553de9e5cce34ea7091f..91b642c1cabe0081f83ea9f024ed9816c0e94f12 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
@@ -15,7 +15,6 @@
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
-#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_client.h"
@@ -363,10 +362,6 @@ class SitePerProcessTextInputManagerTest : public InProcessBrowserTest {
return browser()->tab_strip_model()->GetActiveWebContents();
}
- content::RenderViewHost* render_view_host() {
- return active_contents()->GetRenderViewHost();
- }
-
// static
// Adds an <input> field to a given frame by executing javascript code.
// The input can be added as the first element or the last element of
@@ -911,9 +906,9 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessTextInputManagerTest,
}
// This test tracks page level focused editable element tracking using
-// RenderViewHost. In a page with multiple frames, a frame is selected and
+// WebContents. In a page with multiple frames, a frame is selected and
// focused. Then the <input> inside frame is both focused and blurred and and
-// in both cases the test verifies that RendeViewHost is aware whether or not a
+// in both cases the test verifies that WebContents is aware whether or not a
// focused editable element exists on the page.
IN_PROC_BROWSER_TEST_F(SitePerProcessTextInputManagerTest,
TrackPageFocusEditableElement) {
@@ -938,17 +933,17 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessTextInputManagerTest,
focus_frame(frame);
// Focus the <input>.
set_input_focus(frame, true);
- EXPECT_TRUE(render_view_host()->IsFocusedElementEditable());
+ EXPECT_TRUE(active_contents()->IsFocusedElementEditable());
// No blur <input>.
set_input_focus(frame, false);
- EXPECT_FALSE(render_view_host()->IsFocusedElementEditable());
+ EXPECT_FALSE(active_contents()->IsFocusedElementEditable());
}
}
// TODO(ekaramad): Could this become a unit test instead?
// This test focuses <input> elements on the page and verifies that
-// RenderViewHost knows about the focused editable element. Then it asks the
-// RenderViewHost to clear focused element and verifies that there is no longer
+// WebContents knows about the focused editable element. Then it asks the
+// WebContents to clear focused element and verifies that there is no longer
// a focused editable element on the page.
IN_PROC_BROWSER_TEST_F(SitePerProcessTextInputManagerTest,
ClearFocusedElementOnPage) {
@@ -967,9 +962,9 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessTextInputManagerTest,
for (auto* frame : frames) {
focus_frame_and_input(frame);
- EXPECT_TRUE(render_view_host()->IsFocusedElementEditable());
- render_view_host()->ClearFocusedElement();
- EXPECT_FALSE(render_view_host()->IsFocusedElementEditable());
+ EXPECT_TRUE(active_contents()->IsFocusedElementEditable());
+ active_contents()->ClearFocusedElement();
+ EXPECT_FALSE(active_contents()->IsFocusedElementEditable());
}
}
« no previous file with comments | « no previous file | chrome/browser/ui/views/find_bar_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698