| 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 1633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1644 | 1644 |
| 1645 WebGestureEvent event; | 1645 WebGestureEvent event; |
| 1646 event.type = WebInputEvent::GestureLongPress; | 1646 event.type = WebInputEvent::GestureLongPress; |
| 1647 event.sourceDevice = WebGestureDeviceTouchscreen; | 1647 event.sourceDevice = WebGestureDeviceTouchscreen; |
| 1648 event.x = 250; | 1648 event.x = 250; |
| 1649 event.y = 150; | 1649 event.y = 150; |
| 1650 | 1650 |
| 1651 EXPECT_EQ(WebInputEventResult::HandledSystem, webView->handleInputEvent(even
t)); | 1651 EXPECT_EQ(WebInputEventResult::HandledSystem, webView->handleInputEvent(even
t)); |
| 1652 } | 1652 } |
| 1653 | 1653 |
| 1654 TEST_F(WebViewTest, LongPressPlugin) |
| 1655 { |
| 1656 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), |
| 1657 WebString::fromUTF8("long_press_embed.html")); |
| 1658 |
| 1659 WebViewImpl* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "long_p
ress_embed.html", true); |
| 1660 webView->settingsImpl()->setAlwaysShowContextMenuOnTouch(true); |
| 1661 webView->resize(WebSize(500, 300)); |
| 1662 webView->updateAllLifecyclePhases(); |
| 1663 runPendingTasks(); |
| 1664 |
| 1665 WebGestureEvent event; |
| 1666 event.type = WebInputEvent::GestureLongPress; |
| 1667 event.sourceDevice = WebGestureDeviceTouchscreen; |
| 1668 event.x = 100; |
| 1669 event.y = 100; |
| 1670 |
| 1671 EXPECT_NE(WebInputEventResult::HandledSystem, webView->handleInputEvent(even
t)); |
| 1672 } |
| 1673 |
| 1654 TEST_F(WebViewTest, LongPressImage) | 1674 TEST_F(WebViewTest, LongPressImage) |
| 1655 { | 1675 { |
| 1656 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), | 1676 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), |
| 1657 WebString::fromUTF8("long_press_image.html")); | 1677 WebString::fromUTF8("long_press_image.html")); |
| 1658 | 1678 |
| 1659 WebViewImpl* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "long_p
ress_image.html", true); | 1679 WebViewImpl* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "long_p
ress_image.html", true); |
| 1660 webView->settingsImpl()->setAlwaysShowContextMenuOnTouch(false); | 1680 webView->settingsImpl()->setAlwaysShowContextMenuOnTouch(false); |
| 1661 webView->resize(WebSize(500, 300)); | 1681 webView->resize(WebSize(500, 300)); |
| 1662 webView->updateAllLifecyclePhases(); | 1682 webView->updateAllLifecyclePhases(); |
| 1663 runPendingTasks(); | 1683 runPendingTasks(); |
| (...skipping 1517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3181 frame->setAutofillClient(&client); | 3201 frame->setAutofillClient(&client); |
| 3182 webView->setInitialFocus(false); | 3202 webView->setInitialFocus(false); |
| 3183 | 3203 |
| 3184 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel
lo").c_str()))); | 3204 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel
lo").c_str()))); |
| 3185 EXPECT_EQ(1, client.textChangesFromUserGesture()); | 3205 EXPECT_EQ(1, client.textChangesFromUserGesture()); |
| 3186 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); | 3206 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); |
| 3187 frame->setAutofillClient(0); | 3207 frame->setAutofillClient(0); |
| 3188 } | 3208 } |
| 3189 | 3209 |
| 3190 } // namespace blink | 3210 } // namespace blink |
| OLD | NEW |