Commit 7c89cfb5 authored by Dominic Battre's avatar Dominic Battre Committed by Commit Bot

Debug information for failing navigations

This CL adds some debug output to investigate why we are observing failing
navigations on the Windows 10 bots.

TBR=sky@chromium.org

Bug: 882545
Change-Id: I4ec3fd453eb7641f79f717c1a48993985ef99681
Reviewed-on: https://chromium-review.googlesource.com/1218902
Commit-Queue: Dominic Battré <battre@chromium.org>
Reviewed-by: default avatarYutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/master@{#590240}
parent 26540116
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "content/browser/renderer_host/media/video_capture_manager.h" #include "content/browser/renderer_host/media/video_capture_manager.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_controller.h" #include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/notification_source.h" #include "content/public/browser/notification_source.h"
#include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_frame_host.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
...@@ -50,6 +51,12 @@ void NavigateToURLBlockUntilNavigationsComplete(Shell* window, ...@@ -50,6 +51,12 @@ void NavigateToURLBlockUntilNavigationsComplete(Shell* window,
window->LoadURL(url); window->LoadURL(url);
same_tab_observer.Wait(); same_tab_observer.Wait();
// TODO(crbug.com/882545) Delete this if statement once the problem has been
// identified.
if (same_tab_observer.last_navigation_succeeded()) {
DLOG(WARNING) << "Last navigation to " << url << " failed with net error "
<< same_tab_observer.last_net_error_code();
}
} }
void ReloadBlockUntilNavigationsComplete(Shell* window, void ReloadBlockUntilNavigationsComplete(Shell* window,
...@@ -86,10 +93,30 @@ void LoadDataWithBaseURL(Shell* window, ...@@ -86,10 +93,30 @@ void LoadDataWithBaseURL(Shell* window,
bool NavigateToURL(Shell* window, const GURL& url) { bool NavigateToURL(Shell* window, const GURL& url) {
NavigateToURLBlockUntilNavigationsComplete(window, url, 1); NavigateToURLBlockUntilNavigationsComplete(window, url, 1);
if (!IsLastCommittedEntryOfPageType(window->web_contents(), PAGE_TYPE_NORMAL)) if (!IsLastCommittedEntryOfPageType(window->web_contents(),
PAGE_TYPE_NORMAL)) {
// TODO(crbug.com/882545) remove the following debug information:
{
NavigationEntry* last_entry =
window->web_contents()->GetController().GetLastCommittedEntry();
if (!last_entry) {
DLOG(WARNING) << "No last committed entry";
} else {
DLOG(WARNING) << "Last committed entry is of type "
<< last_entry->GetPageType();
}
}
return false; return false;
}
return window->web_contents()->GetLastCommittedURL() == url;
// TODO(crbug.com/882545) revert this to the return statement below.
bool same_url = window->web_contents()->GetLastCommittedURL() == url;
if (!same_url) {
DLOG(WARNING) << "Expected URL " << url << " but observed "
<< window->web_contents()->GetLastCommittedURL();
}
return same_url;
// return window->web_contents()->GetLastCommittedURL() == url;
} }
bool NavigateToURLFromRenderer(const ToRenderFrameHost& adapter, bool NavigateToURLFromRenderer(const ToRenderFrameHost& adapter,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment