| 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 "content/shell/test_runner/web_frame_test_client.h" | 5 #include "content/shell/test_runner/web_frame_test_client.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/string_piece.h" | 10 #include "base/strings/string_piece.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "content/shell/test_runner/web_widget_test_proxy.h" | 26 #include "content/shell/test_runner/web_widget_test_proxy.h" |
| 27 #include "net/base/net_errors.h" | 27 #include "net/base/net_errors.h" |
| 28 #include "third_party/WebKit/public/platform/WebString.h" | 28 #include "third_party/WebKit/public/platform/WebString.h" |
| 29 #include "third_party/WebKit/public/platform/WebURL.h" | 29 #include "third_party/WebKit/public/platform/WebURL.h" |
| 30 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 30 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
| 31 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 31 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
| 32 #include "third_party/WebKit/public/web/WebConsoleMessage.h" | 32 #include "third_party/WebKit/public/web/WebConsoleMessage.h" |
| 33 #include "third_party/WebKit/public/web/WebDataSource.h" | 33 #include "third_party/WebKit/public/web/WebDataSource.h" |
| 34 #include "third_party/WebKit/public/web/WebElement.h" | 34 #include "third_party/WebKit/public/web/WebElement.h" |
| 35 #include "third_party/WebKit/public/web/WebFrame.h" | 35 #include "third_party/WebKit/public/web/WebFrame.h" |
| 36 #include "third_party/WebKit/public/web/WebFrameWidget.h" |
| 36 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 37 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
| 37 #include "third_party/WebKit/public/web/WebNavigationPolicy.h" | 38 #include "third_party/WebKit/public/web/WebNavigationPolicy.h" |
| 38 #include "third_party/WebKit/public/web/WebPluginParams.h" | 39 #include "third_party/WebKit/public/web/WebPluginParams.h" |
| 39 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" | 40 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" |
| 40 #include "third_party/WebKit/public/web/WebView.h" | 41 #include "third_party/WebKit/public/web/WebView.h" |
| 41 #include "url/gurl.h" | 42 #include "url/gurl.h" |
| 42 #include "url/url_constants.h" | 43 #include "url/url_constants.h" |
| 43 | 44 |
| 44 namespace test_runner { | 45 namespace test_runner { |
| 45 | 46 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 : delegate_(delegate), | 175 : delegate_(delegate), |
| 175 web_view_test_proxy_base_(web_view_test_proxy_base), | 176 web_view_test_proxy_base_(web_view_test_proxy_base), |
| 176 web_frame_test_proxy_base_(web_frame_test_proxy_base) { | 177 web_frame_test_proxy_base_(web_frame_test_proxy_base) { |
| 177 DCHECK(delegate_); | 178 DCHECK(delegate_); |
| 178 DCHECK(web_frame_test_proxy_base_); | 179 DCHECK(web_frame_test_proxy_base_); |
| 179 DCHECK(web_view_test_proxy_base_); | 180 DCHECK(web_view_test_proxy_base_); |
| 180 } | 181 } |
| 181 | 182 |
| 182 WebFrameTestClient::~WebFrameTestClient() {} | 183 WebFrameTestClient::~WebFrameTestClient() {} |
| 183 | 184 |
| 185 void WebFrameTestClient::FrameDetached(blink::WebLocalFrame* frame, |
| 186 DetachType type) { |
| 187 if (type == DetachType::kRemove && frame->Parent()) |
| 188 frame->Parent()->RemoveChild(frame); |
| 189 |
| 190 if (frame->FrameWidget()) |
| 191 frame->FrameWidget()->Close(); |
| 192 |
| 193 frame->Close(); |
| 194 } |
| 195 |
| 184 blink::WebColorChooser* WebFrameTestClient::CreateColorChooser( | 196 blink::WebColorChooser* WebFrameTestClient::CreateColorChooser( |
| 185 blink::WebColorChooserClient* client, | 197 blink::WebColorChooserClient* client, |
| 186 const blink::WebColor& color, | 198 const blink::WebColor& color, |
| 187 const blink::WebVector<blink::WebColorSuggestion>& suggestions) { | 199 const blink::WebVector<blink::WebColorSuggestion>& suggestions) { |
| 188 // This instance is deleted by WebCore::ColorInputType | 200 // This instance is deleted by WebCore::ColorInputType |
| 189 return new MockColorChooser(client, delegate_, test_runner()); | 201 return new MockColorChooser(client, delegate_, test_runner()); |
| 190 } | 202 } |
| 191 | 203 |
| 192 void WebFrameTestClient::RunModalAlertDialog(const blink::WebString& message) { | 204 void WebFrameTestClient::RunModalAlertDialog(const blink::WebString& message) { |
| 193 if (!test_runner()->ShouldDumpJavaScriptDialogs()) | 205 if (!test_runner()->ShouldDumpJavaScriptDialogs()) |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 blink::WebEffectiveConnectionType | 749 blink::WebEffectiveConnectionType |
| 738 WebFrameTestClient::GetEffectiveConnectionType() { | 750 WebFrameTestClient::GetEffectiveConnectionType() { |
| 739 return test_runner()->effective_connection_type(); | 751 return test_runner()->effective_connection_type(); |
| 740 } | 752 } |
| 741 | 753 |
| 742 TestRunner* WebFrameTestClient::test_runner() { | 754 TestRunner* WebFrameTestClient::test_runner() { |
| 743 return web_view_test_proxy_base_->test_interfaces()->GetTestRunner(); | 755 return web_view_test_proxy_base_->test_interfaces()->GetTestRunner(); |
| 744 } | 756 } |
| 745 | 757 |
| 746 } // namespace test_runner | 758 } // namespace test_runner |
| OLD | NEW |