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" |
11 #include "public/platform/Platform.h" | 11 #include "public/platform/Platform.h" |
| 12 #include "public/platform/WebCoalescedInputEvent.h" |
12 #include "public/platform/WebURLLoaderMockFactory.h" | 13 #include "public/platform/WebURLLoaderMockFactory.h" |
13 #include "public/web/WebDocument.h" | 14 #include "public/web/WebDocument.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
15 #include "web/WebLocalFrameImpl.h" | 16 #include "web/WebLocalFrameImpl.h" |
16 #include "web/tests/FrameTestHelpers.h" | 17 #include "web/tests/FrameTestHelpers.h" |
17 | 18 |
18 using blink::FrameTestHelpers::LoadFrame; | 19 using blink::FrameTestHelpers::LoadFrame; |
19 using blink::testing::RunPendingTasks; | 20 using blink::testing::RunPendingTasks; |
20 using blink::URLTestHelpers::RegisterMockedURLLoadFromBase; | 21 using blink::URLTestHelpers::RegisterMockedURLLoadFromBase; |
21 | 22 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 void ImeOnFocusTest::RunImeOnFocusTest( | 90 void ImeOnFocusTest::RunImeOnFocusTest( |
90 std::string file_name, | 91 std::string file_name, |
91 int expected_virtual_keyboard_request_count, | 92 int expected_virtual_keyboard_request_count, |
92 IntPoint tap_point, | 93 IntPoint tap_point, |
93 const AtomicString& focus_element, | 94 const AtomicString& focus_element, |
94 std::string frame) { | 95 std::string frame) { |
95 ImeRequestTrackingWebViewClient client; | 96 ImeRequestTrackingWebViewClient client; |
96 RegisterMockedURLLoadFromBase(WebString::FromUTF8(base_url_), | 97 RegisterMockedURLLoadFromBase(WebString::FromUTF8(base_url_), |
97 testing::WebTestDataPath(), | 98 testing::WebTestDataPath(), |
98 WebString::FromUTF8(file_name)); | 99 WebString::FromUTF8(file_name)); |
99 WebViewImpl* web_view = | 100 WebViewBase* web_view = |
100 web_view_helper_.Initialize(true, 0, nullptr, &client); | 101 web_view_helper_.Initialize(true, 0, nullptr, &client); |
101 web_view->Resize(WebSize(800, 1200)); | 102 web_view->Resize(WebSize(800, 1200)); |
102 LoadFrame(web_view->MainFrame(), base_url_ + file_name); | 103 LoadFrame(web_view->MainFrame(), base_url_ + file_name); |
103 document_ = web_view_helper_.WebView() | 104 document_ = web_view_helper_.WebView() |
104 ->MainFrameImpl() | 105 ->MainFrameImpl() |
105 ->GetDocument() | 106 ->GetDocument() |
106 .Unwrap<Document>(); | 107 .Unwrap<Document>(); |
107 | 108 |
108 if (!focus_element.IsNull()) | 109 if (!focus_element.IsNull()) |
109 Focus(focus_element); | 110 Focus(focus_element); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 RunImeOnFocusTest("ime-on-focus-after-navigation-within-page.html", 1, | 150 RunImeOnFocusTest("ime-on-focus-after-navigation-within-page.html", 1, |
150 IntPoint(50, 50), "input"); | 151 IntPoint(50, 50), "input"); |
151 } | 152 } |
152 | 153 |
153 TEST_F(ImeOnFocusTest, AfterFrameLoadOnGesture) { | 154 TEST_F(ImeOnFocusTest, AfterFrameLoadOnGesture) { |
154 RunImeOnFocusTest("ime-on-focus-after-frame-load-on-gesture.html", 1, | 155 RunImeOnFocusTest("ime-on-focus-after-frame-load-on-gesture.html", 1, |
155 IntPoint(50, 50), "input", "frame.html"); | 156 IntPoint(50, 50), "input", "frame.html"); |
156 } | 157 } |
157 | 158 |
158 } // namespace blink | 159 } // namespace blink |
OLD | NEW |