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

Side by Side Diff: content/browser/renderer_host/render_view_host_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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/macros.h" 5 #include "base/macros.h"
6 #include "base/path_service.h" 6 #include "base/path_service.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 EXPECT_NE(old_root->current_frame_host()->routing_id(), 113 EXPECT_NE(old_root->current_frame_host()->routing_id(),
114 new_root->current_frame_host()->routing_id()); 114 new_root->current_frame_host()->routing_id());
115 } 115 }
116 116
117 IN_PROC_BROWSER_TEST_F(RenderViewHostTest, IsFocusedElementEditable) { 117 IN_PROC_BROWSER_TEST_F(RenderViewHostTest, IsFocusedElementEditable) {
118 ASSERT_TRUE(embedded_test_server()->Start()); 118 ASSERT_TRUE(embedded_test_server()->Start());
119 119
120 GURL test_url = embedded_test_server()->GetURL("/touch_selection.html"); 120 GURL test_url = embedded_test_server()->GetURL("/touch_selection.html");
121 NavigateToURL(shell(), test_url); 121 NavigateToURL(shell(), test_url);
122 122
123 RenderViewHost* rvh = shell()->web_contents()->GetRenderViewHost(); 123 WebContents* contents = shell()->web_contents();
124 EXPECT_FALSE(rvh->IsFocusedElementEditable()); 124 EXPECT_FALSE(contents->IsFocusedElementEditable());
125 EXPECT_TRUE(ExecuteScript(shell(), "focus_textfield();")); 125 EXPECT_TRUE(ExecuteScript(shell(), "focus_textfield();"));
126 EXPECT_TRUE(rvh->IsFocusedElementEditable()); 126 EXPECT_TRUE(contents->IsFocusedElementEditable());
127 } 127 }
128 128
129 // Flaky on Linux (https://crbug.com/559192). 129 // Flaky on Linux (https://crbug.com/559192).
130 #if defined(OS_LINUX) 130 #if defined(OS_LINUX)
131 #define MAYBE_ReleaseSessionOnCloseACK DISABLED_ReleaseSessionOnCloseACK 131 #define MAYBE_ReleaseSessionOnCloseACK DISABLED_ReleaseSessionOnCloseACK
132 #else 132 #else
133 #define MAYBE_ReleaseSessionOnCloseACK ReleaseSessionOnCloseACK 133 #define MAYBE_ReleaseSessionOnCloseACK ReleaseSessionOnCloseACK
134 #endif 134 #endif
135 IN_PROC_BROWSER_TEST_F(RenderViewHostTest, MAYBE_ReleaseSessionOnCloseACK) { 135 IN_PROC_BROWSER_TEST_F(RenderViewHostTest, MAYBE_ReleaseSessionOnCloseACK) {
136 ASSERT_TRUE(embedded_test_server()->Start()); 136 ASSERT_TRUE(embedded_test_server()->Start());
(...skipping 21 matching lines...) Expand all
158 158
159 // Do something that causes ipc queues to flush and tasks in 159 // Do something that causes ipc queues to flush and tasks in
160 // flight to complete such that we should have received the ACK. 160 // flight to complete such that we should have received the ACK.
161 NavigateToURL(shell(), test_url); 161 NavigateToURL(shell(), test_url);
162 162
163 // Verify we have the only remaining reference to the namespace. 163 // Verify we have the only remaining reference to the namespace.
164 EXPECT_TRUE(session_namespace->HasOneRef()); 164 EXPECT_TRUE(session_namespace->HasOneRef());
165 } 165 }
166 166
167 } // namespace content 167 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698