OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/test_runner/web_view_test_client.h" | 5 #include "components/test_runner/web_view_test_client.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
13 #include "components/test_runner/event_sender.h" | 13 #include "components/test_runner/event_sender.h" |
14 #include "components/test_runner/mock_web_speech_recognizer.h" | 14 #include "components/test_runner/mock_web_speech_recognizer.h" |
15 #include "components/test_runner/test_common.h" | 15 #include "components/test_runner/test_common.h" |
16 #include "components/test_runner/test_runner.h" | 16 #include "components/test_runner/test_runner.h" |
17 #include "components/test_runner/test_runner_for_specific_view.h" | 17 #include "components/test_runner/test_runner_for_specific_view.h" |
18 #include "components/test_runner/web_test_delegate.h" | 18 #include "components/test_runner/web_test_delegate.h" |
19 #include "components/test_runner/web_view_test_proxy.h" | 19 #include "components/test_runner/web_view_test_proxy.h" |
| 20 #include "components/test_runner/web_widget_test_proxy.h" |
20 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 21 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
21 #include "third_party/WebKit/public/web/WebFrame.h" | 22 #include "third_party/WebKit/public/web/WebFrame.h" |
22 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 23 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
23 #include "third_party/WebKit/public/web/WebPagePopup.h" | 24 #include "third_party/WebKit/public/web/WebPagePopup.h" |
24 #include "third_party/WebKit/public/web/WebPrintParams.h" | 25 #include "third_party/WebKit/public/web/WebPrintParams.h" |
25 #include "third_party/WebKit/public/web/WebView.h" | 26 #include "third_party/WebKit/public/web/WebView.h" |
26 #include "third_party/WebKit/public/web/WebWidget.h" | 27 #include "third_party/WebKit/public/web/WebWidget.h" |
27 | 28 |
28 namespace test_runner { | 29 namespace test_runner { |
29 | 30 |
(...skipping 10 matching lines...) Expand all Loading... |
40 | 41 |
41 void WebViewTestClient::startDragging(blink::WebLocalFrame* frame, | 42 void WebViewTestClient::startDragging(blink::WebLocalFrame* frame, |
42 const blink::WebDragData& data, | 43 const blink::WebDragData& data, |
43 blink::WebDragOperationsMask mask, | 44 blink::WebDragOperationsMask mask, |
44 const blink::WebImage& image, | 45 const blink::WebImage& image, |
45 const blink::WebPoint& point) { | 46 const blink::WebPoint& point) { |
46 test_runner_->setDragImage(image); | 47 test_runner_->setDragImage(image); |
47 | 48 |
48 // When running a test, we need to fake a drag drop operation otherwise | 49 // When running a test, we need to fake a drag drop operation otherwise |
49 // Windows waits for real mouse events to know when the drag is over. | 50 // Windows waits for real mouse events to know when the drag is over. |
50 web_view_test_proxy_base_->event_sender()->DoDragDrop(data, mask); | 51 delegate()->GetWebWidgetTestProxyBase(frame)->event_sender()->DoDragDrop( |
| 52 data, mask); |
51 } | 53 } |
52 | 54 |
53 // The output from these methods in layout test mode should match that | 55 // The output from these methods in layout test mode should match that |
54 // expected by the layout tests. See EditingDelegate.m in DumpRenderTree. | 56 // expected by the layout tests. See EditingDelegate.m in DumpRenderTree. |
55 | 57 |
56 void WebViewTestClient::didChangeContents() { | 58 void WebViewTestClient::didChangeContents() { |
57 if (test_runner_->shouldDumpEditingCallbacks()) | 59 if (test_runner_->shouldDumpEditingCallbacks()) |
58 delegate()->PrintMessage( | 60 delegate()->PrintMessage( |
59 "EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification\n"); | 61 "EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification\n"); |
60 } | 62 } |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 | 146 |
145 WebTestDelegate* WebViewTestClient::delegate() { | 147 WebTestDelegate* WebViewTestClient::delegate() { |
146 return web_view_test_proxy_base_->delegate(); | 148 return web_view_test_proxy_base_->delegate(); |
147 } | 149 } |
148 | 150 |
149 void WebViewTestClient::didFocus() { | 151 void WebViewTestClient::didFocus() { |
150 test_runner_->SetFocus(web_view_test_proxy_base_->web_view(), true); | 152 test_runner_->SetFocus(web_view_test_proxy_base_->web_view(), true); |
151 } | 153 } |
152 | 154 |
153 } // namespace test_runner | 155 } // namespace test_runner |
OLD | NEW |