summaryrefslogtreecommitdiffstats
path: root/chrome/test/chromedriver
diff options
context:
space:
mode:
authorsamuong <samuong@chromium.org>2015-08-17 15:21:19 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-17 22:22:01 +0000
commit9d8bb0ac97b5d039ce936453696003d9eb1802c0 (patch)
tree838463948734b761e9e8dc48e060b6a2b04d7d4d /chrome/test/chromedriver
parent7774360907679c60f9018b1f2cb11a262e84e2cf (diff)
downloadchromium_src-9d8bb0ac97b5d039ce936453696003d9eb1802c0.zip
chromium_src-9d8bb0ac97b5d039ce936453696003d9eb1802c0.tar.gz
chromium_src-9d8bb0ac97b5d039ce936453696003d9eb1802c0.tar.bz2
[chromedriver] Discard pending and scheduled navigations if the URL is 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}
Diffstat (limited to 'chrome/test/chromedriver')
-rw-r--r--chrome/test/chromedriver/chrome/navigation_tracker.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/chrome/test/chromedriver/chrome/navigation_tracker.cc b/chrome/test/chromedriver/chrome/navigation_tracker.cc
index a557b6b..5273859 100644
--- a/chrome/test/chromedriver/chrome/navigation_tracker.cc
+++ b/chrome/test/chromedriver/chrome/navigation_tracker.cc
@@ -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,
@@ -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