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

Unified 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: Remove CHECK for redirect chain as the redirects may not be populated for provisional loads for ren… 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/test_runner/web_frame_test_client.h ('k') | components/test_runner/web_frame_test_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/test_runner/web_frame_test_client.cc
diff --git a/components/test_runner/web_frame_test_client.cc b/components/test_runner/web_frame_test_client.cc
index ca0aa871cf8c7080239684ef9614ce313809b63e..e2a1cc3a5944d6bda5dc42462c920d4249d0a535 100644
--- a/components/test_runner/web_frame_test_client.cc
+++ b/components/test_runner/web_frame_test_client.cc
@@ -29,6 +29,7 @@
#include "third_party/WebKit/public/platform/WebURLRequest.h"
#include "third_party/WebKit/public/platform/WebURLResponse.h"
#include "third_party/WebKit/public/web/WebConsoleMessage.h"
+#include "third_party/WebKit/public/web/WebDataSource.h"
#include "third_party/WebKit/public/web/WebElement.h"
#include "third_party/WebKit/public/web/WebFrame.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h"
@@ -412,16 +413,25 @@ void WebFrameTestClient::loadErrorPage(int reason) {
}
}
-void WebFrameTestClient::didStartProvisionalLoad(blink::WebLocalFrame* frame) {
- test_runner()->tryToSetTopLoadingFrame(frame);
+void WebFrameTestClient::didStartProvisionalLoad(
+ blink::WebDataSource* data_source) {
+ // PlzNavigate
+ // A provisional load notification is received when a frame navigation is
+ // sent to the browser. We don't want to log it again during commit.
+ if (delegate_->IsNavigationInitiatedByRenderer(data_source->getRequest()))
+ return;
+
+ test_runner()->tryToSetTopLoadingFrame(
+ web_frame_test_proxy_base_->web_frame());
if (test_runner()->shouldDumpFrameLoadCallbacks()) {
- PrintFrameDescription(delegate_, frame);
+ PrintFrameDescription(delegate_, web_frame_test_proxy_base_->web_frame());
delegate_->PrintMessage(" - didStartProvisionalLoadForFrame\n");
}
if (test_runner()->shouldDumpUserGestureInFrameLoadCallbacks()) {
- PrintFrameuserGestureStatus(delegate_, frame,
+ PrintFrameuserGestureStatus(delegate_,
+ web_frame_test_proxy_base_->web_frame(),
" - in didStartProvisionalLoadForFrame\n");
}
}
« no previous file with comments | « components/test_runner/web_frame_test_client.h ('k') | components/test_runner/web_frame_test_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698