| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "base/location.h" | 7 #include "base/location.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 switches::kEnableFeatures, | 506 switches::kEnableFeatures, |
| 507 ::features::kGuestViewCrossProcessFrames.name); | 507 ::features::kGuestViewCrossProcessFrames.name); |
| 508 } else { | 508 } else { |
| 509 command_line->AppendSwitchASCII( | 509 command_line->AppendSwitchASCII( |
| 510 switches::kDisableFeatures, | 510 switches::kDisableFeatures, |
| 511 ::features::kGuestViewCrossProcessFrames.name); | 511 ::features::kGuestViewCrossProcessFrames.name); |
| 512 } | 512 } |
| 513 } | 513 } |
| 514 }; | 514 }; |
| 515 | 515 |
| 516 class WebViewDragDropInteractiveTest : public WebViewInteractiveTest {}; |
| 516 class WebViewNewWindowInteractiveTest : public WebViewInteractiveTest {}; | 517 class WebViewNewWindowInteractiveTest : public WebViewInteractiveTest {}; |
| 517 class WebViewPointerLockInteractiveTest : public WebViewInteractiveTest {}; | 518 class WebViewPointerLockInteractiveTest : public WebViewInteractiveTest {}; |
| 518 | 519 |
| 519 // The tests below aren't needed in --use-cross-process-frames-for-guests. | 520 // The tests below aren't needed in --use-cross-process-frames-for-guests. |
| 520 class WebViewContextMenuInteractiveTest : public WebViewInteractiveTestBase {}; | 521 class WebViewContextMenuInteractiveTest : public WebViewInteractiveTestBase {}; |
| 521 | 522 |
| 522 // The following class of tests do not work for OOPIF <webview>. | 523 // The following class of tests do not work for OOPIF <webview>. |
| 523 // TODO(ekaramad): Make this tests work with OOPIF and replace the test classes | 524 // TODO(ekaramad): Make this tests work with OOPIF and replace the test classes |
| 524 // with WebViewInteractiveTest (see crbug.com/582562). | 525 // with WebViewInteractiveTest (see crbug.com/582562). |
| 525 class WebViewFocusInteractiveTest : public WebViewInteractiveTestBase {}; | 526 class WebViewFocusInteractiveTest : public WebViewInteractiveTestBase {}; |
| 526 class WebViewPopupInteractiveTest : public WebViewInteractiveTestBase {}; | 527 class WebViewPopupInteractiveTest : public WebViewInteractiveTestBase {}; |
| 527 class WebViewDragDropInteractiveTest : public WebViewInteractiveTestBase {}; | |
| 528 | 528 |
| 529 INSTANTIATE_TEST_CASE_P(WebViewInteractiveTests, | 529 INSTANTIATE_TEST_CASE_P(WebViewInteractiveTests, |
| 530 WebViewInteractiveTest, | 530 WebViewInteractiveTest, |
| 531 testing::Bool()); | 531 testing::Bool()); |
| 532 | 532 |
| 533 INSTANTIATE_TEST_CASE_P(WebViewInteractiveTests, | 533 INSTANTIATE_TEST_CASE_P(WebViewInteractiveTests, |
| 534 WebViewDragDropInteractiveTest, |
| 535 testing::Bool()); |
| 536 |
| 537 INSTANTIATE_TEST_CASE_P(WebViewInteractiveTests, |
| 534 WebViewNewWindowInteractiveTest, | 538 WebViewNewWindowInteractiveTest, |
| 535 testing::Bool()); | 539 testing::Bool()); |
| 536 | 540 |
| 537 INSTANTIATE_TEST_CASE_P(WebViewInteractiveTests, | 541 INSTANTIATE_TEST_CASE_P(WebViewInteractiveTests, |
| 538 WebViewPointerLockInteractiveTest, | 542 WebViewPointerLockInteractiveTest, |
| 539 testing::Bool()); | 543 testing::Bool()); |
| 540 | 544 |
| 541 // ui_test_utils::SendMouseMoveSync doesn't seem to work on OS_MACOSX, and | 545 // ui_test_utils::SendMouseMoveSync doesn't seem to work on OS_MACOSX, and |
| 542 // likely won't work on many other platforms as well, so for now this test | 546 // likely won't work on many other platforms as well, so for now this test |
| 543 // is for Windows and Linux only. As of Sept 17th, 2013 this test is disabled | 547 // is for Windows and Linux only. As of Sept 17th, 2013 this test is disabled |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1030 MAYBE_PopupPositioningMoved) { | 1034 MAYBE_PopupPositioningMoved) { |
| 1031 TestHelper("testMoved", "web_view/popup_positioning", NO_TEST_SERVER); | 1035 TestHelper("testMoved", "web_view/popup_positioning", NO_TEST_SERVER); |
| 1032 ASSERT_TRUE(guest_web_contents()); | 1036 ASSERT_TRUE(guest_web_contents()); |
| 1033 PopupTestHelper(gfx::Point(20, 0)); | 1037 PopupTestHelper(gfx::Point(20, 0)); |
| 1034 } | 1038 } |
| 1035 | 1039 |
| 1036 // Drag and drop inside a webview is currently only enabled for linux and mac, | 1040 // Drag and drop inside a webview is currently only enabled for linux and mac, |
| 1037 // but the tests don't work on anything except chromeos for now. This is because | 1041 // but the tests don't work on anything except chromeos for now. This is because |
| 1038 // of simulating mouse drag code's dependency on platforms. | 1042 // of simulating mouse drag code's dependency on platforms. |
| 1039 #if defined(OS_CHROMEOS) && !defined(USE_OZONE) | 1043 #if defined(OS_CHROMEOS) && !defined(USE_OZONE) |
| 1040 IN_PROC_BROWSER_TEST_F(WebViewDragDropInteractiveTest, DragDropWithinWebView) { | 1044 IN_PROC_BROWSER_TEST_P(WebViewDragDropInteractiveTest, DragDropWithinWebView) { |
| 1041 LoadAndLaunchPlatformApp("web_view/dnd_within_webview", "connected"); | 1045 LoadAndLaunchPlatformApp("web_view/dnd_within_webview", "connected"); |
| 1042 ASSERT_TRUE(ui_test_utils::ShowAndFocusNativeWindow(GetPlatformAppWindow())); | 1046 ASSERT_TRUE(ui_test_utils::ShowAndFocusNativeWindow(GetPlatformAppWindow())); |
| 1043 | 1047 |
| 1044 embedder_web_contents_ = GetFirstAppWindowWebContents(); | 1048 embedder_web_contents_ = GetFirstAppWindowWebContents(); |
| 1045 gfx::Rect offset = embedder_web_contents_->GetContainerBounds(); | 1049 gfx::Rect offset = embedder_web_contents_->GetContainerBounds(); |
| 1046 corner_ = gfx::Point(offset.x(), offset.y()); | 1050 corner_ = gfx::Point(offset.x(), offset.y()); |
| 1047 | 1051 |
| 1048 // In the drag drop test we add 20px padding to the page body because on | 1052 // In the drag drop test we add 20px padding to the page body because on |
| 1049 // windows if we get too close to the edge of the window the resize cursor | 1053 // windows if we get too close to the edge of the window the resize cursor |
| 1050 // appears and we start dragging the window edge. | 1054 // appears and we start dragging the window edge. |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1476 ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync( | 1480 ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync( |
| 1477 GetPlatformAppWindow(), ui::VKEY_Z, false, false, false, false)); | 1481 GetPlatformAppWindow(), ui::VKEY_Z, false, false, false, false)); |
| 1478 | 1482 |
| 1479 next_step_listener.Reset(); | 1483 next_step_listener.Reset(); |
| 1480 EXPECT_TRUE(content::ExecuteScript( | 1484 EXPECT_TRUE(content::ExecuteScript( |
| 1481 embedder_web_contents(), | 1485 embedder_web_contents(), |
| 1482 "window.runCommand('testKeyboardFocusRunNextStep', 'aBcxYz');")); | 1486 "window.runCommand('testKeyboardFocusRunNextStep', 'aBcxYz');")); |
| 1483 | 1487 |
| 1484 ASSERT_TRUE(next_step_listener.WaitUntilSatisfied()); | 1488 ASSERT_TRUE(next_step_listener.WaitUntilSatisfied()); |
| 1485 } | 1489 } |
| OLD | NEW |