| 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 2524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2535 webView->setInitialFocus(false); | 2535 webView->setInitialFocus(false); |
| 2536 runPendingTasks(); | 2536 runPendingTasks(); |
| 2537 | 2537 |
| 2538 // We suspend caret blinking when pressing with mouse right button. | 2538 // We suspend caret blinking when pressing with mouse right button. |
| 2539 // Note that we do not send MouseUp event here since it will be consumed | 2539 // Note that we do not send MouseUp event here since it will be consumed |
| 2540 // by the context menu once it shows up. | 2540 // by the context menu once it shows up. |
| 2541 WebMouseEvent mouseEvent(WebInputEvent::MouseDown, WebInputEvent::NoModifiers, | 2541 WebMouseEvent mouseEvent(WebInputEvent::MouseDown, WebInputEvent::NoModifiers, |
| 2542 WebInputEvent::TimeStampForTesting); | 2542 WebInputEvent::TimeStampForTesting); |
| 2543 | 2543 |
| 2544 mouseEvent.button = WebMouseEvent::Button::Right; | 2544 mouseEvent.button = WebMouseEvent::Button::Right; |
| 2545 mouseEvent.x = 1; | 2545 mouseEvent.setPositionInWidget(1, 1); |
| 2546 mouseEvent.y = 1; | |
| 2547 mouseEvent.clickCount = 1; | 2546 mouseEvent.clickCount = 1; |
| 2548 webView->handleInputEvent(WebCoalescedInputEvent(mouseEvent)); | 2547 webView->handleInputEvent(WebCoalescedInputEvent(mouseEvent)); |
| 2549 runPendingTasks(); | 2548 runPendingTasks(); |
| 2550 | 2549 |
| 2551 WebLocalFrameImpl* mainFrame = webView->mainFrameImpl(); | 2550 WebLocalFrameImpl* mainFrame = webView->mainFrameImpl(); |
| 2552 EXPECT_TRUE(mainFrame->frame()->selection().isCaretBlinkingSuspended()); | 2551 EXPECT_TRUE(mainFrame->frame()->selection().isCaretBlinkingSuspended()); |
| 2553 | 2552 |
| 2554 // Caret blinking is still suspended after showing context menu. | 2553 // Caret blinking is still suspended after showing context menu. |
| 2555 webView->showContextMenu(); | 2554 webView->showContextMenu(); |
| 2556 EXPECT_TRUE(mainFrame->frame()->selection().isCaretBlinkingSuspended()); | 2555 EXPECT_TRUE(mainFrame->frame()->selection().isCaretBlinkingSuspended()); |
| (...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3582 m_webViewHelper.initializeAndLoad(m_baseURL + "form.html", true); | 3581 m_webViewHelper.initializeAndLoad(m_baseURL + "form.html", true); |
| 3583 WebLocalFrameImpl* frame = webView->mainFrameImpl(); | 3582 WebLocalFrameImpl* frame = webView->mainFrameImpl(); |
| 3584 frame->setAutofillClient(&client); | 3583 frame->setAutofillClient(&client); |
| 3585 webView->setInitialFocus(false); | 3584 webView->setInitialFocus(false); |
| 3586 | 3585 |
| 3587 EXPECT_EQ(0, client.getUserGestureNotificationsCount()); | 3586 EXPECT_EQ(0, client.getUserGestureNotificationsCount()); |
| 3588 | 3587 |
| 3589 WebMouseEvent mouseEvent(WebInputEvent::MouseDown, WebInputEvent::NoModifiers, | 3588 WebMouseEvent mouseEvent(WebInputEvent::MouseDown, WebInputEvent::NoModifiers, |
| 3590 WebInputEvent::TimeStampForTesting); | 3589 WebInputEvent::TimeStampForTesting); |
| 3591 mouseEvent.button = WebMouseEvent::Button::Left; | 3590 mouseEvent.button = WebMouseEvent::Button::Left; |
| 3592 mouseEvent.x = 1; | 3591 mouseEvent.setPositionInWidget(1, 1); |
| 3593 mouseEvent.y = 1; | |
| 3594 mouseEvent.clickCount = 1; | 3592 mouseEvent.clickCount = 1; |
| 3595 webView->handleInputEvent(WebCoalescedInputEvent(mouseEvent)); | 3593 webView->handleInputEvent(WebCoalescedInputEvent(mouseEvent)); |
| 3596 mouseEvent.setType(WebInputEvent::MouseUp); | 3594 mouseEvent.setType(WebInputEvent::MouseUp); |
| 3597 webView->handleInputEvent(WebCoalescedInputEvent(mouseEvent)); | 3595 webView->handleInputEvent(WebCoalescedInputEvent(mouseEvent)); |
| 3598 | 3596 |
| 3599 EXPECT_EQ(1, client.getUserGestureNotificationsCount()); | 3597 EXPECT_EQ(1, client.getUserGestureNotificationsCount()); |
| 3600 frame->setAutofillClient(0); | 3598 frame->setAutofillClient(0); |
| 3601 } | 3599 } |
| 3602 | 3600 |
| 3603 TEST_P(WebViewTest, FirstUserGestureObservedGestureTap) { | 3601 TEST_P(WebViewTest, FirstUserGestureObservedGestureTap) { |
| (...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4443 EXPECT_FALSE(frameView->visualViewportSuppliesScrollbars()); | 4441 EXPECT_FALSE(frameView->visualViewportSuppliesScrollbars()); |
| 4444 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { | 4442 if (RuntimeEnabledFeatures::rootLayerScrollingEnabled()) { |
| 4445 EXPECT_NE(nullptr, | 4443 EXPECT_NE(nullptr, |
| 4446 frameView->layoutViewportScrollableArea()->verticalScrollbar()); | 4444 frameView->layoutViewportScrollableArea()->verticalScrollbar()); |
| 4447 } else { | 4445 } else { |
| 4448 EXPECT_NE(nullptr, frameView->verticalScrollbar()); | 4446 EXPECT_NE(nullptr, frameView->verticalScrollbar()); |
| 4449 } | 4447 } |
| 4450 } | 4448 } |
| 4451 | 4449 |
| 4452 } // namespace blink | 4450 } // namespace blink |
| OLD | NEW |