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_frame_test_client.h" | 5 #include "components/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 11 matching lines...) Expand all Loading... |
22 #include "components/test_runner/web_frame_test_proxy.h" | 22 #include "components/test_runner/web_frame_test_proxy.h" |
23 #include "components/test_runner/web_test_delegate.h" | 23 #include "components/test_runner/web_test_delegate.h" |
24 #include "components/test_runner/web_view_test_proxy.h" | 24 #include "components/test_runner/web_view_test_proxy.h" |
25 #include "components/test_runner/web_widget_test_proxy.h" | 25 #include "components/test_runner/web_widget_test_proxy.h" |
26 #include "net/base/net_errors.h" | 26 #include "net/base/net_errors.h" |
27 #include "third_party/WebKit/public/platform/WebString.h" | 27 #include "third_party/WebKit/public/platform/WebString.h" |
28 #include "third_party/WebKit/public/platform/WebURL.h" | 28 #include "third_party/WebKit/public/platform/WebURL.h" |
29 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 29 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
30 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 30 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
31 #include "third_party/WebKit/public/web/WebConsoleMessage.h" | 31 #include "third_party/WebKit/public/web/WebConsoleMessage.h" |
| 32 #include "third_party/WebKit/public/web/WebDataSource.h" |
32 #include "third_party/WebKit/public/web/WebElement.h" | 33 #include "third_party/WebKit/public/web/WebElement.h" |
33 #include "third_party/WebKit/public/web/WebFrame.h" | 34 #include "third_party/WebKit/public/web/WebFrame.h" |
34 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 35 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
35 #include "third_party/WebKit/public/web/WebNavigationPolicy.h" | 36 #include "third_party/WebKit/public/web/WebNavigationPolicy.h" |
36 #include "third_party/WebKit/public/web/WebPluginParams.h" | 37 #include "third_party/WebKit/public/web/WebPluginParams.h" |
37 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" | 38 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" |
38 #include "third_party/WebKit/public/web/WebView.h" | 39 #include "third_party/WebKit/public/web/WebView.h" |
39 #include "url/gurl.h" | 40 #include "url/gurl.h" |
40 #include "url/url_constants.h" | 41 #include "url/url_constants.h" |
41 | 42 |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 } | 406 } |
406 } | 407 } |
407 | 408 |
408 void WebFrameTestClient::loadErrorPage(int reason) { | 409 void WebFrameTestClient::loadErrorPage(int reason) { |
409 if (test_runner()->shouldDumpFrameLoadCallbacks()) { | 410 if (test_runner()->shouldDumpFrameLoadCallbacks()) { |
410 delegate_->PrintMessage(base::StringPrintf( | 411 delegate_->PrintMessage(base::StringPrintf( |
411 "- loadErrorPage: %s\n", net::ErrorToString(reason).c_str())); | 412 "- loadErrorPage: %s\n", net::ErrorToString(reason).c_str())); |
412 } | 413 } |
413 } | 414 } |
414 | 415 |
415 void WebFrameTestClient::didStartProvisionalLoad(blink::WebLocalFrame* frame) { | 416 void WebFrameTestClient::didStartProvisionalLoad( |
| 417 blink::WebLocalFrame* frame, |
| 418 const blink::WebURLRequest& request) { |
| 419 // PlzNavigate |
| 420 // A provisional load notification is received when a frame navigation is |
| 421 // sent to the browser. We don't want to log it again during commit. |
| 422 // Please see the RenderFrameImpl::BeginNavigation() function. |
| 423 if (delegate_->IsNavigationInitiatedByRenderer(request)) |
| 424 return; |
| 425 |
416 test_runner()->tryToSetTopLoadingFrame(frame); | 426 test_runner()->tryToSetTopLoadingFrame(frame); |
417 | 427 |
418 if (test_runner()->shouldDumpFrameLoadCallbacks()) { | 428 if (test_runner()->shouldDumpFrameLoadCallbacks()) { |
419 PrintFrameDescription(delegate_, frame); | 429 PrintFrameDescription(delegate_, frame); |
420 delegate_->PrintMessage(" - didStartProvisionalLoadForFrame\n"); | 430 delegate_->PrintMessage(" - didStartProvisionalLoadForFrame\n"); |
421 } | 431 } |
422 | 432 |
423 if (test_runner()->shouldDumpUserGestureInFrameLoadCallbacks()) { | 433 if (test_runner()->shouldDumpUserGestureInFrameLoadCallbacks()) { |
424 PrintFrameuserGestureStatus(delegate_, frame, | 434 PrintFrameuserGestureStatus(delegate_, frame, |
425 " - in didStartProvisionalLoadForFrame\n"); | 435 " - in didStartProvisionalLoadForFrame\n"); |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
716 blink::WebEffectiveConnectionType | 726 blink::WebEffectiveConnectionType |
717 WebFrameTestClient::getEffectiveConnectionType() { | 727 WebFrameTestClient::getEffectiveConnectionType() { |
718 return test_runner()->effective_connection_type(); | 728 return test_runner()->effective_connection_type(); |
719 } | 729 } |
720 | 730 |
721 TestRunner* WebFrameTestClient::test_runner() { | 731 TestRunner* WebFrameTestClient::test_runner() { |
722 return web_view_test_proxy_base_->test_interfaces()->GetTestRunner(); | 732 return web_view_test_proxy_base_->test_interfaces()->GetTestRunner(); |
723 } | 733 } |
724 | 734 |
725 } // namespace test_runner | 735 } // namespace test_runner |
OLD | NEW |