| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 2508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2519 webView->setInitialFocus(false); | 2519 webView->setInitialFocus(false); |
| 2520 runPendingTasks(); | 2520 runPendingTasks(); |
| 2521 | 2521 |
| 2522 // We suspend caret blinking when pressing with mouse right button. | 2522 // We suspend caret blinking when pressing with mouse right button. |
| 2523 // Note that we do not send MouseUp event here since it will be consumed | 2523 // Note that we do not send MouseUp event here since it will be consumed |
| 2524 // by the context menu once it shows up. | 2524 // by the context menu once it shows up. |
| 2525 WebMouseEvent mouseEvent(WebInputEvent::MouseDown, WebInputEvent::NoModifiers, | 2525 WebMouseEvent mouseEvent(WebInputEvent::MouseDown, WebInputEvent::NoModifiers, |
| 2526 WebInputEvent::TimeStampForTesting); | 2526 WebInputEvent::TimeStampForTesting); |
| 2527 | 2527 |
| 2528 mouseEvent.button = WebMouseEvent::Button::Right; | 2528 mouseEvent.button = WebMouseEvent::Button::Right; |
| 2529 mouseEvent.x = 1; | 2529 mouseEvent.setPositionInWidget(1, 1); |
| 2530 mouseEvent.y = 1; | |
| 2531 mouseEvent.clickCount = 1; | 2530 mouseEvent.clickCount = 1; |
| 2532 webView->handleInputEvent(WebCoalescedInputEvent(mouseEvent)); | 2531 webView->handleInputEvent(WebCoalescedInputEvent(mouseEvent)); |
| 2533 runPendingTasks(); | 2532 runPendingTasks(); |
| 2534 | 2533 |
| 2535 WebLocalFrameImpl* mainFrame = webView->mainFrameImpl(); | 2534 WebLocalFrameImpl* mainFrame = webView->mainFrameImpl(); |
| 2536 EXPECT_TRUE(mainFrame->frame()->selection().isCaretBlinkingSuspended()); | 2535 EXPECT_TRUE(mainFrame->frame()->selection().isCaretBlinkingSuspended()); |
| 2537 | 2536 |
| 2538 // Caret blinking is still suspended after showing context menu. | 2537 // Caret blinking is still suspended after showing context menu. |
| 2539 webView->showContextMenu(); | 2538 webView->showContextMenu(); |
| 2540 EXPECT_TRUE(mainFrame->frame()->selection().isCaretBlinkingSuspended()); | 2539 EXPECT_TRUE(mainFrame->frame()->selection().isCaretBlinkingSuspended()); |
| (...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3566 m_webViewHelper.initializeAndLoad(m_baseURL + "form.html", true); | 3565 m_webViewHelper.initializeAndLoad(m_baseURL + "form.html", true); |
| 3567 WebLocalFrameImpl* frame = webView->mainFrameImpl(); | 3566 WebLocalFrameImpl* frame = webView->mainFrameImpl(); |
| 3568 frame->setAutofillClient(&client); | 3567 frame->setAutofillClient(&client); |
| 3569 webView->setInitialFocus(false); | 3568 webView->setInitialFocus(false); |
| 3570 | 3569 |
| 3571 EXPECT_EQ(0, client.getUserGestureNotificationsCount()); | 3570 EXPECT_EQ(0, client.getUserGestureNotificationsCount()); |
| 3572 | 3571 |
| 3573 WebMouseEvent mouseEvent(WebInputEvent::MouseDown, WebInputEvent::NoModifiers, | 3572 WebMouseEvent mouseEvent(WebInputEvent::MouseDown, WebInputEvent::NoModifiers, |
| 3574 WebInputEvent::TimeStampForTesting); | 3573 WebInputEvent::TimeStampForTesting); |
| 3575 mouseEvent.button = WebMouseEvent::Button::Left; | 3574 mouseEvent.button = WebMouseEvent::Button::Left; |
| 3576 mouseEvent.x = 1; | 3575 mouseEvent.setPositionInWidget(1, 1); |
| 3577 mouseEvent.y = 1; | |
| 3578 mouseEvent.clickCount = 1; | 3576 mouseEvent.clickCount = 1; |
| 3579 webView->handleInputEvent(WebCoalescedInputEvent(mouseEvent)); | 3577 webView->handleInputEvent(WebCoalescedInputEvent(mouseEvent)); |
| 3580 mouseEvent.setType(WebInputEvent::MouseUp); | 3578 mouseEvent.setType(WebInputEvent::MouseUp); |
| 3581 webView->handleInputEvent(WebCoalescedInputEvent(mouseEvent)); | 3579 webView->handleInputEvent(WebCoalescedInputEvent(mouseEvent)); |
| 3582 | 3580 |
| 3583 EXPECT_EQ(1, client.getUserGestureNotificationsCount()); | 3581 EXPECT_EQ(1, client.getUserGestureNotificationsCount()); |
| 3584 frame->setAutofillClient(0); | 3582 frame->setAutofillClient(0); |
| 3585 } | 3583 } |
| 3586 | 3584 |
| 3587 TEST_P(WebViewTest, FirstUserGestureObservedGestureTap) { | 3585 TEST_P(WebViewTest, FirstUserGestureObservedGestureTap) { |
| (...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4427 EXPECT_FALSE(frameView->visualViewportSuppliesScrollbars()); | 4425 EXPECT_FALSE(frameView->visualViewportSuppliesScrollbars()); |
| 4428 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { | 4426 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { |
| 4429 EXPECT_NE(nullptr, | 4427 EXPECT_NE(nullptr, |
| 4430 frameView->layoutViewportScrollableArea()->verticalScrollbar()); | 4428 frameView->layoutViewportScrollableArea()->verticalScrollbar()); |
| 4431 } else { | 4429 } else { |
| 4432 EXPECT_NE(nullptr, frameView->verticalScrollbar()); | 4430 EXPECT_NE(nullptr, frameView->verticalScrollbar()); |
| 4433 } | 4431 } |
| 4434 } | 4432 } |
| 4435 | 4433 |
| 4436 } // namespace blink | 4434 } // namespace blink |
| OLD | NEW |