| OLD | NEW |
| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 124 |
| 125 protected: | 125 protected: |
| 126 // Starts the test server and navigates to the given url. Sets a large enough | 126 // Starts the test server and navigates to the given url. Sets a large enough |
| 127 // size to the root window. Returns after the navigation to the url is | 127 // size to the root window. Returns after the navigation to the url is |
| 128 // complete. | 128 // complete. |
| 129 void StartTestWithPage(const std::string& url) { | 129 void StartTestWithPage(const std::string& url) { |
| 130 ASSERT_TRUE(embedded_test_server()->Start()); | 130 ASSERT_TRUE(embedded_test_server()->Start()); |
| 131 GURL test_url(embedded_test_server()->GetURL(url)); | 131 GURL test_url(embedded_test_server()->GetURL(url)); |
| 132 NavigateToURL(shell(), test_url); | 132 NavigateToURL(shell(), test_url); |
| 133 aura::Window* content = shell()->web_contents()->GetContentNativeView(); | 133 aura::Window* content = shell()->web_contents()->GetContentNativeView(); |
| 134 content->GetHost()->SetBounds(gfx::Rect(800, 600)); | 134 content->GetHost()->SetBoundsInPixels(gfx::Rect(800, 600)); |
| 135 } | 135 } |
| 136 | 136 |
| 137 bool GetPointInsideText(gfx::PointF* point) { | 137 bool GetPointInsideText(gfx::PointF* point) { |
| 138 std::string str; | 138 std::string str; |
| 139 if (ExecuteScriptAndExtractString(shell(), "get_point_inside_text()", | 139 if (ExecuteScriptAndExtractString(shell(), "get_point_inside_text()", |
| 140 &str)) { | 140 &str)) { |
| 141 return JSONToPoint(str, point); | 141 return JSONToPoint(str, point); |
| 142 } | 142 } |
| 143 return false; | 143 return false; |
| 144 } | 144 } |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 | 713 |
| 714 // The handle should have moved to right. | 714 // The handle should have moved to right. |
| 715 EXPECT_EQ(initial_handle_rect.y(), moved_handle_rect.y()); | 715 EXPECT_EQ(initial_handle_rect.y(), moved_handle_rect.y()); |
| 716 EXPECT_LT(initial_handle_rect.x(), moved_handle_rect.x()); | 716 EXPECT_LT(initial_handle_rect.x(), moved_handle_rect.x()); |
| 717 | 717 |
| 718 EXPECT_EQ(ui::TouchSelectionController::INSERTION_ACTIVE, | 718 EXPECT_EQ(ui::TouchSelectionController::INSERTION_ACTIVE, |
| 719 rwhva->selection_controller()->active_status()); | 719 rwhva->selection_controller()->active_status()); |
| 720 } | 720 } |
| 721 | 721 |
| 722 } // namespace content | 722 } // namespace content |
| OLD | NEW |