Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: components/test_runner/web_frame_test_client.cc

Issue 2661743002: PlzNavigate: Invoke didStartProvisionalLoad() when the renderer initiates a navigation in startLoad( (Closed)
Patch Set: Rebased to tip Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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,
Nate Chapin 2017/02/02 19:16:48 Could we use web_frame_test_proxy_base_->web_frame
ananta 2017/02/02 23:54:02 Done.
418 blink::WebDataSource* data_source) {
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 if (delegate_->IsNavigationInitiatedByRenderer(data_source->getRequest()))
423 return;
424
416 test_runner()->tryToSetTopLoadingFrame(frame); 425 test_runner()->tryToSetTopLoadingFrame(frame);
417 426
418 if (test_runner()->shouldDumpFrameLoadCallbacks()) { 427 if (test_runner()->shouldDumpFrameLoadCallbacks()) {
419 PrintFrameDescription(delegate_, frame); 428 PrintFrameDescription(delegate_, frame);
420 delegate_->PrintMessage(" - didStartProvisionalLoadForFrame\n"); 429 delegate_->PrintMessage(" - didStartProvisionalLoadForFrame\n");
421 } 430 }
422 431
423 if (test_runner()->shouldDumpUserGestureInFrameLoadCallbacks()) { 432 if (test_runner()->shouldDumpUserGestureInFrameLoadCallbacks()) {
424 PrintFrameuserGestureStatus(delegate_, frame, 433 PrintFrameuserGestureStatus(delegate_, frame,
425 " - in didStartProvisionalLoadForFrame\n"); 434 " - in didStartProvisionalLoadForFrame\n");
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 blink::WebEffectiveConnectionType 725 blink::WebEffectiveConnectionType
717 WebFrameTestClient::getEffectiveConnectionType() { 726 WebFrameTestClient::getEffectiveConnectionType() {
718 return test_runner()->effective_connection_type(); 727 return test_runner()->effective_connection_type();
719 } 728 }
720 729
721 TestRunner* WebFrameTestClient::test_runner() { 730 TestRunner* WebFrameTestClient::test_runner() {
722 return web_view_test_proxy_base_->test_interfaces()->GetTestRunner(); 731 return web_view_test_proxy_base_->test_interfaces()->GetTestRunner();
723 } 732 }
724 733
725 } // namespace test_runner 734 } // namespace test_runner
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698