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

Unified Diff: chrome/test/chromedriver/chrome/navigation_tracker.cc

Issue 2830903005: [Chromedriver] Ensure baseURL is 'about:blank' for dummy page on Chrome 60+. (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | chrome/test/chromedriver/chrome/navigation_tracker_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/chromedriver/chrome/navigation_tracker.cc
diff --git a/chrome/test/chromedriver/chrome/navigation_tracker.cc b/chrome/test/chromedriver/chrome/navigation_tracker.cc
index 0fdceb635306ef5953370e5f978f6565b4ebea99..39804789b514d762ad58604eae52426fcf7d8cbd 100644
--- a/chrome/test/chromedriver/chrome/navigation_tracker.cc
+++ b/chrome/test/chromedriver/chrome/navigation_tracker.cc
@@ -117,15 +117,26 @@ Status NavigationTracker::IsPendingNavigation(const std::string& frame_id,
if (loading_state_ == kUnknown) {
// In the case that a http request is sent to server to fetch the page
// content and the server hasn't responded at all, a dummy page is created
- // for the new window. In such case, the baseURL will be empty.
+ // for the new window. In such case, the baseURL will be empty for <=M59 ;
+ // whereas the baseURL will be 'about:blank' for >=M60. See crbug/711562.
+ // TODO(gmanikpure):Remove condition for <3076 when we stop supporting M59.
base::DictionaryValue empty_params;
std::unique_ptr<base::DictionaryValue> result;
Status status = client_->SendCommandAndGetResultWithTimeout(
"DOM.getDocument", empty_params, timeout, &result);
std::string base_url;
- if (status.IsError() || !result->GetString("root.baseURL", &base_url))
+ std::string doc_url;
+ if (status.IsError() || !result->GetString("root.baseURL", &base_url) ||
+ !result->GetString("root.documentURL", &doc_url))
return MakeNavigationCheckFailedStatus(status);
- if (base_url.empty()) {
+
+ bool condition;
+ if (browser_info_->build_no >= 3076)
+ condition = doc_url != "about:blank" && base_url == "about:blank";
+ else
+ condition = base_url.empty();
+
+ if (condition) {
*is_pending = true;
loading_state_ = kLoading;
return Status(kOk);
« no previous file with comments | « no previous file | chrome/test/chromedriver/chrome/navigation_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698