| 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 1669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1680 | 1680 |
| 1681 WebGestureEvent event; | 1681 WebGestureEvent event; |
| 1682 event.type = WebInputEvent::GestureLongPress; | 1682 event.type = WebInputEvent::GestureLongPress; |
| 1683 event.sourceDevice = WebGestureDeviceTouchscreen; | 1683 event.sourceDevice = WebGestureDeviceTouchscreen; |
| 1684 event.x = 500; | 1684 event.x = 500; |
| 1685 event.y = 300; | 1685 event.y = 300; |
| 1686 | 1686 |
| 1687 EXPECT_EQ(WebInputEventResult::HandledSystem, webView->handleInputEvent(even
t)); | 1687 EXPECT_EQ(WebInputEventResult::HandledSystem, webView->handleInputEvent(even
t)); |
| 1688 } | 1688 } |
| 1689 | 1689 |
| 1690 TEST_F(WebViewTest, LongPressEmptyEditableSelection) |
| 1691 { |
| 1692 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), |
| 1693 WebString::fromUTF8("long_press_empty_editable_selection.html")); |
| 1694 |
| 1695 WebViewImpl* webView = m_webViewHelper.initializeAndLoad( |
| 1696 m_baseURL + "long_press_empty_editable_selection.html", true); |
| 1697 webView->resize(WebSize(500, 300)); |
| 1698 webView->updateAllLifecyclePhases(); |
| 1699 runPendingTasks(); |
| 1700 |
| 1701 WebGestureEvent event; |
| 1702 event.type = WebInputEvent::GestureLongPress; |
| 1703 event.sourceDevice = WebGestureDeviceTouchscreen; |
| 1704 event.x = 10; |
| 1705 event.y = 10; |
| 1706 |
| 1707 EXPECT_EQ(WebInputEventResult::HandledSystem, webView->handleInputEvent(even
t)); |
| 1708 } |
| 1709 |
| 1690 TEST_F(WebViewTest, LongPressSelection) | 1710 TEST_F(WebViewTest, LongPressSelection) |
| 1691 { | 1711 { |
| 1692 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("longpress_selection.html")); | 1712 URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(m_baseURL.c
_str()), WebString::fromUTF8("longpress_selection.html")); |
| 1693 | 1713 |
| 1694 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "longpress_
selection.html", true); | 1714 WebView* webView = m_webViewHelper.initializeAndLoad(m_baseURL + "longpress_
selection.html", true); |
| 1695 webView->resize(WebSize(500, 300)); | 1715 webView->resize(WebSize(500, 300)); |
| 1696 webView->updateAllLifecyclePhases(); | 1716 webView->updateAllLifecyclePhases(); |
| 1697 runPendingTasks(); | 1717 runPendingTasks(); |
| 1698 | 1718 |
| 1699 WebString target = WebString::fromUTF8("target"); | 1719 WebString target = WebString::fromUTF8("target"); |
| (...skipping 1436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3136 frame->setAutofillClient(&client); | 3156 frame->setAutofillClient(&client); |
| 3137 webView->setInitialFocus(false); | 3157 webView->setInitialFocus(false); |
| 3138 | 3158 |
| 3139 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel
lo").c_str()))); | 3159 EXPECT_TRUE(webView->confirmComposition(WebString::fromUTF8(std::string("hel
lo").c_str()))); |
| 3140 EXPECT_EQ(1, client.textChangesFromUserGesture()); | 3160 EXPECT_EQ(1, client.textChangesFromUserGesture()); |
| 3141 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); | 3161 EXPECT_FALSE(UserGestureIndicator::processingUserGesture()); |
| 3142 frame->setAutofillClient(0); | 3162 frame->setAutofillClient(0); |
| 3143 } | 3163 } |
| 3144 | 3164 |
| 3145 } // namespace blink | 3165 } // namespace blink |
| OLD | NEW |