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

Side by Side Diff: content/browser/renderer_host/input/touch_selection_controller_client_aura_browsertest.cc

Issue 2052633002: Extend the ToRenderFrameHost magic to FrameTreeNode* and Shell* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix induced script bug. Created 4 years, 6 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/browser/renderer_host/input/touch_selection_controller_client_ aura.h" 5 #include "content/browser/renderer_host/input/touch_selection_controller_client_ aura.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 void StartTestWithPage(const std::string& url) { 128 void StartTestWithPage(const std::string& url) {
129 ASSERT_TRUE(embedded_test_server()->Start()); 129 ASSERT_TRUE(embedded_test_server()->Start());
130 GURL test_url(embedded_test_server()->GetURL(url)); 130 GURL test_url(embedded_test_server()->GetURL(url));
131 NavigateToURL(shell(), test_url); 131 NavigateToURL(shell(), test_url);
132 aura::Window* content = shell()->web_contents()->GetContentNativeView(); 132 aura::Window* content = shell()->web_contents()->GetContentNativeView();
133 content->GetHost()->SetBounds(gfx::Rect(800, 600)); 133 content->GetHost()->SetBounds(gfx::Rect(800, 600));
134 } 134 }
135 135
136 bool GetPointInsideText(gfx::PointF* point) { 136 bool GetPointInsideText(gfx::PointF* point) {
137 std::string str; 137 std::string str;
138 if (ExecuteScriptAndExtractString(shell()->web_contents()->GetMainFrame(), 138 if (ExecuteScriptAndExtractString(shell(), "get_point_inside_text()",
139 "get_point_inside_text()", &str)) { 139 &str)) {
140 return JSONToPoint(str, point); 140 return JSONToPoint(str, point);
141 } 141 }
142 return false; 142 return false;
143 } 143 }
144 144
145 bool GetPointInsideTextfield(gfx::PointF* point) { 145 bool GetPointInsideTextfield(gfx::PointF* point) {
146 std::string str; 146 std::string str;
147 if (ExecuteScriptAndExtractString(shell()->web_contents()->GetMainFrame(), 147 if (ExecuteScriptAndExtractString(shell(), "get_point_inside_textfield()",
148 "get_point_inside_textfield()", &str)) { 148 &str)) {
149 return JSONToPoint(str, point); 149 return JSONToPoint(str, point);
150 } 150 }
151 return false; 151 return false;
152 } 152 }
153 153
154 bool EmptyTextfield() { 154 bool EmptyTextfield() { return ExecuteScript(shell(), "empty_textfield()"); }
155 return ExecuteScript(shell()->web_contents()->GetMainFrame(),
156 "empty_textfield()");
157 }
158 155
159 RenderWidgetHostViewAura* GetRenderWidgetHostViewAura() { 156 RenderWidgetHostViewAura* GetRenderWidgetHostViewAura() {
160 return static_cast<RenderWidgetHostViewAura*>( 157 return static_cast<RenderWidgetHostViewAura*>(
161 shell()->web_contents()->GetRenderWidgetHostView()); 158 shell()->web_contents()->GetRenderWidgetHostView());
162 } 159 }
163 160
164 TestTouchSelectionControllerClientAura* selection_controller_client() { 161 TestTouchSelectionControllerClientAura* selection_controller_client() {
165 return selection_controller_client_; 162 return selection_controller_client_;
166 } 163 }
167 164
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 674
678 // The handle should have moved to right. 675 // The handle should have moved to right.
679 EXPECT_EQ(initial_handle_rect.y(), moved_handle_rect.y()); 676 EXPECT_EQ(initial_handle_rect.y(), moved_handle_rect.y());
680 EXPECT_LT(initial_handle_rect.x(), moved_handle_rect.x()); 677 EXPECT_LT(initial_handle_rect.x(), moved_handle_rect.x());
681 678
682 EXPECT_EQ(ui::TouchSelectionController::INSERTION_ACTIVE, 679 EXPECT_EQ(ui::TouchSelectionController::INSERTION_ACTIVE,
683 rwhva->selection_controller()->active_status()); 680 rwhva->selection_controller()->active_status());
684 } 681 }
685 682
686 } // namespace content 683 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698