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

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

Issue 23944005: [chromedriver] Fix race in navigation tracker. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 3 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 92de57ab39a60b9f002aa6ca9073ddb0396d5a83..5f5fb3a705b77027d95c9ce3dbf8d3b47379fca2 100644
--- a/chrome/test/chromedriver/chrome/navigation_tracker.cc
+++ b/chrome/test/chromedriver/chrome/navigation_tracker.cc
@@ -150,6 +150,7 @@ Status NavigationTracker::OnCommandSuccess(DevToolsClient* client,
// been received.
// If case #3, the URL will be blank if the navigation hasn't been started
// yet. In that case, expect a load to happen in the future.
+ loading_state_ = kUnknown;
base::DictionaryValue params;
params.SetString("expression", "document.URL");
scoped_ptr<base::DictionaryValue> result;
@@ -158,7 +159,7 @@ Status NavigationTracker::OnCommandSuccess(DevToolsClient* client,
std::string url;
if (status.IsError() || !result->GetString("result.value", &url))
return Status(kUnknownError, "cannot determine loading status", status);
- if (url.empty())
+ if (loading_state_ == kUnknown && url.empty())
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