| 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 1593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1604 event.type = WebInputEvent::GestureTap; | 1604 event.type = WebInputEvent::GestureTap; |
| 1605 event.sourceDevice = WebGestureDeviceTouchscreen; | 1605 event.sourceDevice = WebGestureDeviceTouchscreen; |
| 1606 event.x = 3; | 1606 event.x = 3; |
| 1607 event.y = 8; | 1607 event.y = 8; |
| 1608 EXPECT_EQ(WebInputEventResult::NotHandled, webView->handleInputEvent(event))
; | 1608 EXPECT_EQ(WebInputEventResult::NotHandled, webView->handleInputEvent(event))
; |
| 1609 webView->close(); | 1609 webView->close(); |
| 1610 // Explicitly close as the frame as no frame client to do so on frameDetache
d(). | 1610 // Explicitly close as the frame as no frame client to do so on frameDetache
d(). |
| 1611 localFrame->close(); | 1611 localFrame->close(); |
| 1612 } | 1612 } |
| 1613 | 1613 |
| 1614 TEST_F(WebViewTest, LongPressEmptyDiv) |
| 1615 { |
| 1616 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), |
| 1617 WebString::fromUTF8("long_press_empty_div.html")); |
| 1618 |
| 1619 WebViewImpl* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "long_p
ress_empty_div.html", true); |
| 1620 webView->resize(WebSize(500, 300)); |
| 1621 webView->updateAllLifecyclePhases(); |
| 1622 runPendingTasks(); |
| 1623 |
| 1624 WebGestureEvent event; |
| 1625 event.type = WebInputEvent::GestureLongPress; |
| 1626 event.sourceDevice = WebGestureDeviceTouchscreen; |
| 1627 event.x = 250; |
| 1628 event.y = 150; |
| 1629 |
| 1630 EXPECT_EQ(WebInputEventResult::NotHandled, webView->handleInputEvent(event))
; |
| 1631 } |
| 1632 |
| 1633 TEST_F(WebViewTest, LongPressImage) |
| 1634 { |
| 1635 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), |
| 1636 WebString::fromUTF8("long_press_image.html")); |
| 1637 |
| 1638 WebViewImpl* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "long_p
ress_image.html", true); |
| 1639 webView->resize(WebSize(500, 300)); |
| 1640 webView->updateAllLifecyclePhases(); |
| 1641 runPendingTasks(); |
| 1642 |
| 1643 WebGestureEvent event; |
| 1644 event.type = WebInputEvent::GestureLongPress; |
| 1645 event.sourceDevice = WebGestureDeviceTouchscreen; |
| 1646 event.x = 10; |
| 1647 event.y = 10; |
| 1648 |
| 1649 EXPECT_EQ(WebInputEventResult::HandledSystem, webView->handleInputEvent(even
t)); |
| 1650 } |
| 1651 |
| 1652 TEST_F(WebViewTest, LongPressVideo) |
| 1653 { |
| 1654 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), |
| 1655 WebString::fromUTF8("long_press_video.html")); |
| 1656 |
| 1657 WebViewImpl* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "long_p
ress_video.html", true); |
| 1658 webView->resize(WebSize(500, 300)); |
| 1659 webView->updateAllLifecyclePhases(); |
| 1660 runPendingTasks(); |
| 1661 |
| 1662 WebGestureEvent event; |
| 1663 event.type = WebInputEvent::GestureLongPress; |
| 1664 event.sourceDevice = WebGestureDeviceTouchscreen; |
| 1665 event.x = 10; |
| 1666 event.y = 10; |
| 1667 |
| 1668 EXPECT_EQ(WebInputEventResult::HandledSystem, webView->handleInputEvent(even
t)); |
| 1669 } |
| 1670 |
| 1671 TEST_F(WebViewTest, LongPressLink) |
| 1672 { |
| 1673 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), |
| 1674 WebString::fromUTF8("long_press_link.html")); |
| 1675 |
| 1676 WebViewImpl* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "long_p
ress_link.html", true); |
| 1677 webView->resize(WebSize(500, 300)); |
| 1678 webView->updateAllLifecyclePhases(); |
| 1679 runPendingTasks(); |
| 1680 |
| 1681 WebGestureEvent event; |
| 1682 event.type = WebInputEvent::GestureLongPress; |
| 1683 event.sourceDevice = WebGestureDeviceTouchscreen; |
| 1684 event.x = 500; |
| 1685 event.y = 300; |
| 1686 |
| 1687 EXPECT_EQ(WebInputEventResult::HandledSystem, webView->handleInputEvent(even
t)); |
| 1688 } |
| 1689 |
| 1614 TEST_F(WebViewTest, LongPressSelection) | 1690 TEST_F(WebViewTest, LongPressSelection) |
| 1615 { | 1691 { |
| 1616 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("longpress_selection.html")); | 1692 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("longpress_selection.html")); |
| 1617 | 1693 |
| 1618 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "longpress_
selection.html", true); | 1694 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "longpress_
selection.html", true); |
| 1619 webView->resize(WebSize(500, 300)); | 1695 webView->resize(WebSize(500, 300)); |
| 1620 webView->updateAllLifecyclePhases(); | 1696 webView->updateAllLifecyclePhases(); |
| 1621 runPendingTasks(); | 1697 runPendingTasks(); |
| 1622 | 1698 |
| 1623 WebString target = WebString::fromUTF8("target"); | 1699 WebString target = WebString::fromUTF8("target"); |
| (...skipping 1432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3056 frame->setAutofillClient(&client); | 3132 frame->setAutofillClient(&client); |
| 3057 webView->setInitialFocus(false); | 3133 webView->setInitialFocus(false); |
| 3058 | 3134 |
| 3059 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel
lo").c_str()))); | 3135 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel
lo").c_str()))); |
| 3060 EXPECT_EQ(1, client.textChangesFromUserGesture()); | 3136 EXPECT_EQ(1, client.textChangesFromUserGesture()); |
| 3061 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); | 3137 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); |
| 3062 frame->setAutofillClient(0); | 3138 frame->setAutofillClient(0); |
| 3063 } | 3139 } |
| 3064 | 3140 |
| 3065 } // namespace blink | 3141 } // namespace blink |
| OLD | NEW |