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

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

Issue 15393005: [chromedriver] Remove unnecessary round trips to Chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 7 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 | « chrome/test/chromedriver/chrome/navigation_tracker.h ('k') | chrome/test/chromedriver/chrome/stub_chrome.h » ('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 981d747eee83611aede8f7168853cf872a36d97d..cd04f819dcd82ff21cad30f63bc51b8845943e52 100644
--- a/chrome/test/chromedriver/chrome/navigation_tracker.cc
+++ b/chrome/test/chromedriver/chrome/navigation_tracker.cc
@@ -61,8 +61,11 @@ Status NavigationTracker::IsPendingNavigation(const std::string& frame_id,
if (loading_state_ == kUnknown)
loading_state_ = kLoading;
}
- *is_pending = (loading_state_ == kLoading) ||
- scheduled_frame_set_.count(frame_id) > 0;
+ *is_pending = loading_state_ == kLoading;
+ if (frame_id.empty())
+ *is_pending |= scheduled_frame_set_.size() > 0;
+ else
+ *is_pending |= scheduled_frame_set_.count(frame_id) > 0;
return Status(kOk);
}
@@ -118,5 +121,8 @@ void NavigationTracker::OnEvent(DevToolsClient* client,
const base::Value* unused_value;
if (!params.Get("frame.parentId", &unused_value))
scheduled_frame_set_.clear();
+ } else if (method == "Inspector.targetCrashed") {
+ loading_state_ = kNotLoading;
+ scheduled_frame_set_.clear();
}
}
« no previous file with comments | « chrome/test/chromedriver/chrome/navigation_tracker.h ('k') | chrome/test/chromedriver/chrome/stub_chrome.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698