| 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 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 WebViewNewWindowInteractiveTest : public WebViewInteractiveTest {}; | 516 class WebViewNewWindowInteractiveTest : public WebViewInteractiveTest {}; |
| 517 class WebViewPointerLockInteractiveTest : public WebViewInteractiveTest {}; |
| 517 | 518 |
| 518 // The tests below aren't needed in --use-cross-process-frames-for-guests. | 519 // The tests below aren't needed in --use-cross-process-frames-for-guests. |
| 519 class WebViewContextMenuInteractiveTest : public WebViewInteractiveTestBase {}; | 520 class WebViewContextMenuInteractiveTest : public WebViewInteractiveTestBase {}; |
| 520 | 521 |
| 521 // The following class of tests do not work for OOPIF <webview>. | 522 // The following class of tests do not work for OOPIF <webview>. |
| 522 // TODO(ekaramad): Make this tests work with OOPIF and replace the test classes | 523 // TODO(ekaramad): Make this tests work with OOPIF and replace the test classes |
| 523 // with WebViewInteractiveTest (see crbug.com/582562). | 524 // with WebViewInteractiveTest (see crbug.com/582562). |
| 524 class WebViewFocusInteractiveTest : public WebViewInteractiveTestBase {}; | 525 class WebViewFocusInteractiveTest : public WebViewInteractiveTestBase {}; |
| 525 class WebViewPopupInteractiveTest : public WebViewInteractiveTestBase {}; | 526 class WebViewPopupInteractiveTest : public WebViewInteractiveTestBase {}; |
| 526 class WebViewPointerLockInteractiveTest : public WebViewInteractiveTestBase {}; | |
| 527 class WebViewDragDropInteractiveTest : 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 WebViewNewWindowInteractiveTest, | 534 WebViewNewWindowInteractiveTest, |
| 535 testing::Bool()); | 535 testing::Bool()); |
| 536 | 536 |
| 537 INSTANTIATE_TEST_CASE_P(WebViewInteractiveTests, |
| 538 WebViewPointerLockInteractiveTest, |
| 539 testing::Bool()); |
| 540 |
| 537 // ui_test_utils::SendMouseMoveSync doesn't seem to work on OS_MACOSX, and | 541 // ui_test_utils::SendMouseMoveSync doesn't seem to work on OS_MACOSX, and |
| 538 // likely won't work on many other platforms as well, so for now this test | 542 // likely won't work on many other platforms as well, so for now this test |
| 539 // is for Windows and Linux only. As of Sept 17th, 2013 this test is disabled | 543 // is for Windows and Linux only. As of Sept 17th, 2013 this test is disabled |
| 540 // on Windows due to flakines, see http://crbug.com/293445. | 544 // on Windows due to flakines, see http://crbug.com/293445. |
| 541 | 545 |
| 542 // Disabled on Linux Aura because pointer lock does not work on Linux Aura. | 546 // Disabled on Linux Aura because pointer lock does not work on Linux Aura. |
| 543 // crbug.com/341876 | 547 // crbug.com/341876 |
| 544 | 548 |
| 545 #if defined(OS_LINUX) | 549 #if defined(OS_LINUX) |
| 546 // flaky http://crbug.com/412086 | 550 // flaky http://crbug.com/412086 |
| 547 IN_PROC_BROWSER_TEST_F(WebViewPointerLockInteractiveTest, | 551 IN_PROC_BROWSER_TEST_P(WebViewPointerLockInteractiveTest, |
| 548 DISABLED_PointerLock) { | 552 DISABLED_PointerLock) { |
| 549 SetupTest("web_view/pointer_lock", | 553 SetupTest("web_view/pointer_lock", |
| 550 "/extensions/platform_apps/web_view/pointer_lock/guest.html"); | 554 "/extensions/platform_apps/web_view/pointer_lock/guest.html"); |
| 551 | 555 |
| 552 // Move the mouse over the Lock Pointer button. | 556 // Move the mouse over the Lock Pointer button. |
| 553 ASSERT_TRUE(ui_test_utils::SendMouseMoveSync( | 557 ASSERT_TRUE(ui_test_utils::SendMouseMoveSync( |
| 554 gfx::Point(corner().x() + 75, corner().y() + 25))); | 558 gfx::Point(corner().x() + 75, corner().y() + 25))); |
| 555 | 559 |
| 556 // Click the Lock Pointer button. The first two times the button is clicked | 560 // Click the Lock Pointer button. The first two times the button is clicked |
| 557 // the permission API will deny the request (intentional). | 561 // the permission API will deny the request (intentional). |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 // Sending a right click seems to fix this (why?). | 615 // Sending a right click seems to fix this (why?). |
| 612 ExtensionTestMessageListener move_listener2("move-captured", false); | 616 ExtensionTestMessageListener move_listener2("move-captured", false); |
| 613 SendMouseClick(ui_controls::RIGHT); | 617 SendMouseClick(ui_controls::RIGHT); |
| 614 ASSERT_TRUE(ui_test_utils::SendMouseMoveSync( | 618 ASSERT_TRUE(ui_test_utils::SendMouseMoveSync( |
| 615 gfx::Point(corner().x() + 51, corner().y() + 11))); | 619 gfx::Point(corner().x() + 51, corner().y() + 11))); |
| 616 ASSERT_TRUE(move_listener2.WaitUntilSatisfied()); | 620 ASSERT_TRUE(move_listener2.WaitUntilSatisfied()); |
| 617 } | 621 } |
| 618 } | 622 } |
| 619 | 623 |
| 620 // flaky http://crbug.com/412086 | 624 // flaky http://crbug.com/412086 |
| 621 IN_PROC_BROWSER_TEST_F(WebViewPointerLockInteractiveTest, | 625 IN_PROC_BROWSER_TEST_P(WebViewPointerLockInteractiveTest, |
| 622 DISABLED_PointerLockFocus) { | 626 DISABLED_PointerLockFocus) { |
| 623 SetupTest("web_view/pointer_lock_focus", | 627 SetupTest("web_view/pointer_lock_focus", |
| 624 "/extensions/platform_apps/web_view/pointer_lock_focus/guest.html"); | 628 "/extensions/platform_apps/web_view/pointer_lock_focus/guest.html"); |
| 625 | 629 |
| 626 // Move the mouse over the Lock Pointer button. | 630 // Move the mouse over the Lock Pointer button. |
| 627 ASSERT_TRUE(ui_test_utils::SendMouseMoveSync( | 631 ASSERT_TRUE(ui_test_utils::SendMouseMoveSync( |
| 628 gfx::Point(corner().x() + 75, corner().y() + 25))); | 632 gfx::Point(corner().x() + 75, corner().y() + 25))); |
| 629 | 633 |
| 630 // Click the Lock Pointer button, locking the mouse to lockTarget. | 634 // Click the Lock Pointer button, locking the mouse to lockTarget. |
| 631 // This will also change focus to another element | 635 // This will also change focus to another element |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1099 | 1103 |
| 1100 ASSERT_TRUE(ready_back_key_listener.WaitUntilSatisfied()); | 1104 ASSERT_TRUE(ready_back_key_listener.WaitUntilSatisfied()); |
| 1101 SendBackShortcutToPlatformApp(); | 1105 SendBackShortcutToPlatformApp(); |
| 1102 | 1106 |
| 1103 ASSERT_TRUE(ready_forward_key_listener.WaitUntilSatisfied()); | 1107 ASSERT_TRUE(ready_forward_key_listener.WaitUntilSatisfied()); |
| 1104 SendForwardShortcutToPlatformApp(); | 1108 SendForwardShortcutToPlatformApp(); |
| 1105 | 1109 |
| 1106 ASSERT_TRUE(done_listener.WaitUntilSatisfied()); | 1110 ASSERT_TRUE(done_listener.WaitUntilSatisfied()); |
| 1107 } | 1111 } |
| 1108 | 1112 |
| 1109 IN_PROC_BROWSER_TEST_F(WebViewPointerLockInteractiveTest, | 1113 IN_PROC_BROWSER_TEST_P(WebViewPointerLockInteractiveTest, |
| 1110 PointerLock_PointerLockLostWithFocus) { | 1114 PointerLock_PointerLockLostWithFocus) { |
| 1111 TestHelper("testPointerLockLostWithFocus", | 1115 TestHelper("testPointerLockLostWithFocus", |
| 1112 "web_view/pointerlock", | 1116 "web_view/pointerlock", |
| 1113 NO_TEST_SERVER); | 1117 NO_TEST_SERVER); |
| 1114 } | 1118 } |
| 1115 | 1119 |
| 1116 // Disable this on mac, throws an assertion failure on teardown which | 1120 // Disable this on mac, throws an assertion failure on teardown which |
| 1117 // will result in flakiness: | 1121 // will result in flakiness: |
| 1118 // | 1122 // |
| 1119 // "not is fullscreen state" | 1123 // "not is fullscreen state" |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1464 ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync( | 1468 ASSERT_TRUE(ui_test_utils::SendKeyPressToWindowSync( |
| 1465 GetPlatformAppWindow(), ui::VKEY_Z, false, false, false, false)); | 1469 GetPlatformAppWindow(), ui::VKEY_Z, false, false, false, false)); |
| 1466 | 1470 |
| 1467 next_step_listener.Reset(); | 1471 next_step_listener.Reset(); |
| 1468 EXPECT_TRUE(content::ExecuteScript( | 1472 EXPECT_TRUE(content::ExecuteScript( |
| 1469 embedder_web_contents(), | 1473 embedder_web_contents(), |
| 1470 "window.runCommand('testKeyboardFocusRunNextStep', 'aBcxYz');")); | 1474 "window.runCommand('testKeyboardFocusRunNextStep', 'aBcxYz');")); |
| 1471 | 1475 |
| 1472 ASSERT_TRUE(next_step_listener.WaitUntilSatisfied()); | 1476 ASSERT_TRUE(next_step_listener.WaitUntilSatisfied()); |
| 1473 } | 1477 } |
| OLD | NEW |