| OLD | NEW |
| 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 "content/browser/web_contents/touch_editable_impl_aura.h" | 5 #include "content/browser/web_contents/touch_editable_impl_aura.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/test/test_timeouts.h" | 9 #include "base/test/test_timeouts.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 std::string selection; | 145 std::string selection; |
| 146 value->GetAsString(&selection); | 146 value->GetAsString(&selection); |
| 147 | 147 |
| 148 // Check if selection handles are showing. | 148 // Check if selection handles are showing. |
| 149 EXPECT_TRUE(touch_editable->touch_selection_controller_.get()); | 149 EXPECT_TRUE(touch_editable->touch_selection_controller_.get()); |
| 150 EXPECT_STREQ("Some text we can select", selection.c_str()); | 150 EXPECT_STREQ("Some text we can select", selection.c_str()); |
| 151 | 151 |
| 152 // Lets move the handles a bit to modify the selection | 152 // Lets move the handles a bit to modify the selection |
| 153 touch_editable->Reset(); | 153 touch_editable->Reset(); |
| 154 generator.GestureScrollSequence( | 154 generator.GestureScrollSequence( |
| 155 gfx::Point(10, 37), | 155 gfx::Point(10, 47), |
| 156 gfx::Point(30, 37), | 156 gfx::Point(30, 47), |
| 157 base::TimeDelta::FromMilliseconds(20), | 157 base::TimeDelta::FromMilliseconds(20), |
| 158 1); | 158 1); |
| 159 EXPECT_TRUE(touch_editable->touch_selection_controller_.get()); | 159 EXPECT_TRUE(touch_editable->touch_selection_controller_.get()); |
| 160 value = content::ExecuteScriptAndGetValue(view_host, "get_selection()"); | 160 value = content::ExecuteScriptAndGetValue(view_host, "get_selection()"); |
| 161 value->GetAsString(&selection); | 161 value->GetAsString(&selection); |
| 162 | 162 |
| 163 // It is hard to tell what exactly the selection would be now. But it would | 163 // It is hard to tell what exactly the selection would be now. But it would |
| 164 // definitely be less than whatever was selected before. | 164 // definitely be less than whatever was selected before. |
| 165 EXPECT_GT(std::strlen("Some text we can select"), selection.size()); | 165 EXPECT_GT(std::strlen("Some text we can select"), selection.size()); |
| 166 } | 166 } |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 TestTouchSelectionOnLongPress(); | 276 TestTouchSelectionOnLongPress(); |
| 277 } | 277 } |
| 278 | 278 |
| 279 // TODO(miu): Disabled test due to flakiness. http://crbug.com/235991 | 279 // TODO(miu): Disabled test due to flakiness. http://crbug.com/235991 |
| 280 IN_PROC_BROWSER_TEST_F(TouchEditableImplAuraTest, | 280 IN_PROC_BROWSER_TEST_F(TouchEditableImplAuraTest, |
| 281 DISABLED_TouchCursorInTextfieldTest) { | 281 DISABLED_TouchCursorInTextfieldTest) { |
| 282 TestTouchCursorInTextfield(); | 282 TestTouchCursorInTextfield(); |
| 283 } | 283 } |
| 284 | 284 |
| 285 } // namespace content | 285 } // namespace content |
| OLD | NEW |