Skip to content

Commit

Permalink
[chromedriver] Discard pending and scheduled navigations if the URL i…
Browse files Browse the repository at this point in the history
…s unreachable.

This fixes PageLoadingTest.testShouldReturnWhenGettingAUrlThatDoesNotResolve
from the Selenium test suite, which is failing for chrome_shell.

BUG=chromedriver:1167
TBR=stgao@chromium.org

Review URL: https://codereview.chromium.org/1298053002

Cr-Commit-Position: refs/heads/master@{#343761}
  • Loading branch information
samuong authored and Commit bot committed Aug 17, 2015
1 parent 7774360 commit 9d8bb0a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions chrome/test/chromedriver/chrome/navigation_tracker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ namespace {
const std::string kDummyFrameUrl =
"data:text/html,<!--chromedriver dummy frame-->";

const std::string kUnreachableWebDataURL = "data:text/html,chromewebdata";

} // namespace

NavigationTracker::NavigationTracker(DevToolsClient* client,
Expand Down Expand Up @@ -188,6 +190,16 @@ Status NavigationTracker::OnEvent(DevToolsClient* client,
// See crbug.com/180742.
pending_frame_set_.clear();
scheduled_frame_set_.clear();
} else {
// If the URL indicates that the web page is unreachable (the sad tab
// page) then discard any pending or scheduled navigations.
std::string frame_url;
if (!params.GetString("frame.url", &frame_url))
return Status(kUnknownError, "missing or invalid 'frame.url'");
if (frame_url == kUnreachableWebDataURL) {
pending_frame_set_.clear();
scheduled_frame_set_.clear();
}
}
} else {
// If a child frame just navigated, check if it is the dummy frame that
Expand Down

0 comments on commit 9d8bb0a

Please sign in to comment.