| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/dom/Document.h" | 5 #include "core/dom/Document.h" |
| 6 #include "core/dom/Element.h" | 6 #include "core/dom/Element.h" |
| 7 #include "core/dom/Node.h" | 7 #include "core/dom/Node.h" |
| 8 #include "core/html/HTMLElement.h" | 8 #include "core/html/HTMLElement.h" |
| 9 #include "platform/testing/URLTestHelpers.h" | 9 #include "platform/testing/URLTestHelpers.h" |
| 10 #include "platform/testing/UnitTestHelpers.h" | 10 #include "platform/testing/UnitTestHelpers.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 Platform::current()->unitTestSupport()->unregisterAllMockedURLs(); | 61 Platform::current()->unitTestSupport()->unregisterAllMockedURLs(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 protected: | 64 protected: |
| 65 void sendGestureTap(WebView*, IntPoint); | 65 void sendGestureTap(WebView*, IntPoint); |
| 66 void focus(const AtomicString& element); | 66 void focus(const AtomicString& element); |
| 67 void runImeOnFocusTest(std::string fileName, int, IntPoint tapPoint = IntPoi
nt(-1, -1), const AtomicString& focusElement = nullAtom, std::string frame = "")
; | 67 void runImeOnFocusTest(std::string fileName, int, IntPoint tapPoint = IntPoi
nt(-1, -1), const AtomicString& focusElement = nullAtom, std::string frame = "")
; |
| 68 | 68 |
| 69 std::string m_baseURL; | 69 std::string m_baseURL; |
| 70 FrameTestHelpers::WebViewHelper m_webViewHelper; | 70 FrameTestHelpers::WebViewHelper m_webViewHelper; |
| 71 RefPtrWillBePersistent<Document> m_document; | 71 Persistent<Document> m_document; |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 void ImeOnFocusTest::sendGestureTap(WebView* webView, IntPoint clientPoint) | 74 void ImeOnFocusTest::sendGestureTap(WebView* webView, IntPoint clientPoint) |
| 75 { | 75 { |
| 76 WebGestureEvent webGestureEvent; | 76 WebGestureEvent webGestureEvent; |
| 77 webGestureEvent.type = WebInputEvent::GestureTap; | 77 webGestureEvent.type = WebInputEvent::GestureTap; |
| 78 // GestureTap is only ever from touch screens. | 78 // GestureTap is only ever from touch screens. |
| 79 webGestureEvent.sourceDevice = WebGestureDeviceTouchscreen; | 79 webGestureEvent.sourceDevice = WebGestureDeviceTouchscreen; |
| 80 webGestureEvent.x = clientPoint.x(); | 80 webGestureEvent.x = clientPoint.x(); |
| 81 webGestureEvent.y = clientPoint.y(); | 81 webGestureEvent.y = clientPoint.y(); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 { | 147 { |
| 148 runImeOnFocusTest("ime-on-focus-after-navigation-within-page.html", 1, IntPo
int(50, 50), "input"); | 148 runImeOnFocusTest("ime-on-focus-after-navigation-within-page.html", 1, IntPo
int(50, 50), "input"); |
| 149 } | 149 } |
| 150 | 150 |
| 151 TEST_F(ImeOnFocusTest, AfterFrameLoadOnGesture) | 151 TEST_F(ImeOnFocusTest, AfterFrameLoadOnGesture) |
| 152 { | 152 { |
| 153 runImeOnFocusTest("ime-on-focus-after-frame-load-on-gesture.html", 1, IntPoi
nt(50, 50), "input", "frame.html"); | 153 runImeOnFocusTest("ime-on-focus-after-frame-load-on-gesture.html", 1, IntPoi
nt(50, 50), "input", "frame.html"); |
| 154 } | 154 } |
| 155 | 155 |
| 156 } // namespace blink | 156 } // namespace blink |
| OLD | NEW |