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/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 // Make sure touch selection handles are not showing. | 305 // Make sure touch selection handles are not showing. |
306 EXPECT_FALSE(GetTouchSelectionController(touch_editable)); | 306 EXPECT_FALSE(GetTouchSelectionController(touch_editable)); |
307 | 307 |
308 scoped_ptr<base::Value> value = | 308 scoped_ptr<base::Value> value = |
309 content::ExecuteScriptAndGetValue(main_frame, "get_selection()"); | 309 content::ExecuteScriptAndGetValue(main_frame, "get_selection()"); |
310 std::string selection; | 310 std::string selection; |
311 value->GetAsString(&selection); | 311 value->GetAsString(&selection); |
312 EXPECT_STREQ("Some", selection.c_str()); | 312 EXPECT_STREQ("Some", selection.c_str()); |
313 } | 313 } |
314 | 314 |
| 315 #if defined(OS_CHROMEOS) |
| 316 // http://crbug.com/396509 |
| 317 #define MAYBE_TouchCursorInTextfieldTest DISABLED_TouchCursorInTextfieldTest |
| 318 #else |
| 319 #define MAYBE_TouchCursorInTextfieldTest TouchCursorInTextfieldTest |
| 320 #endif |
315 IN_PROC_BROWSER_TEST_F(TouchEditableImplAuraTest, | 321 IN_PROC_BROWSER_TEST_F(TouchEditableImplAuraTest, |
316 TouchCursorInTextfieldTest) { | 322 MAYBE_TouchCursorInTextfieldTest) { |
317 ASSERT_NO_FATAL_FAILURE(StartTestWithPage("files/touch_selection.html")); | 323 ASSERT_NO_FATAL_FAILURE(StartTestWithPage("files/touch_selection.html")); |
318 WebContentsImpl* web_contents = | 324 WebContentsImpl* web_contents = |
319 static_cast<WebContentsImpl*>(shell()->web_contents()); | 325 static_cast<WebContentsImpl*>(shell()->web_contents()); |
320 RenderFrameHost* main_frame = web_contents->GetMainFrame(); | 326 RenderFrameHost* main_frame = web_contents->GetMainFrame(); |
321 WebContentsViewAura* view_aura = static_cast<WebContentsViewAura*>( | 327 WebContentsViewAura* view_aura = static_cast<WebContentsViewAura*>( |
322 web_contents->GetView()); | 328 web_contents->GetView()); |
323 TestTouchEditableImplAura* touch_editable = new TestTouchEditableImplAura; | 329 TestTouchEditableImplAura* touch_editable = new TestTouchEditableImplAura; |
324 view_aura->SetTouchEditableForTest(touch_editable); | 330 view_aura->SetTouchEditableForTest(touch_editable); |
325 RenderWidgetHostViewAura* rwhva = static_cast<RenderWidgetHostViewAura*>( | 331 RenderWidgetHostViewAura* rwhva = static_cast<RenderWidgetHostViewAura*>( |
326 web_contents->GetRenderWidgetHostView()); | 332 web_contents->GetRenderWidgetHostView()); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 value = content::ExecuteScriptAndGetValue(main_frame, | 367 value = content::ExecuteScriptAndGetValue(main_frame, |
362 "get_cursor_position()"); | 368 "get_cursor_position()"); |
363 int new_cursor_pos = -1; | 369 int new_cursor_pos = -1; |
364 value->GetAsInteger(&new_cursor_pos); | 370 value->GetAsInteger(&new_cursor_pos); |
365 EXPECT_NE(-1, new_cursor_pos); | 371 EXPECT_NE(-1, new_cursor_pos); |
366 // Cursor should have moved. | 372 // Cursor should have moved. |
367 EXPECT_NE(new_cursor_pos, cursor_pos); | 373 EXPECT_NE(new_cursor_pos, cursor_pos); |
368 } | 374 } |
369 | 375 |
370 } // namespace content | 376 } // namespace content |
OLD | NEW |