Chromium Code Reviews| 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 2089f9866530d256c7f4db4e7e488ffe8d782116..bebbc72f1f86e027a8c566cb237844de43d3fc13 100644 |
| --- a/chrome/test/chromedriver/chrome/navigation_tracker.cc |
| +++ b/chrome/test/chromedriver/chrome/navigation_tracker.cc |
| @@ -281,15 +281,24 @@ Status NavigationTracker::OnEvent(DevToolsClient* client, |
| pending_frame_set_.clear(); |
| scheduled_frame_set_.clear(); |
| } else { |
| + // Discard pending and scheduled frames, except for the frame that just |
|
stgao
2016/09/20 23:44:19
It might worth mentioning this is the root frame.
samuong
2016/09/21 14:36:55
Done.
|
| + // navigated (which we should consider pending until we receive a |
| + // Page.frameStoppedLoading event for it). |
| + std::string frame_id; |
| + if (!params.GetString("frame.id", &frame_id)) |
| + return Status(kUnknownError, "missing or invalid 'frame.id'"); |
| + bool frame_was_pending = pending_frame_set_.count(frame_id) > 0; |
| + pending_frame_set_.clear(); |
| + scheduled_frame_set_.clear(); |
| + if (frame_was_pending) |
| + pending_frame_set_.insert(frame_id); |
| // If the URL indicates that the web page is unreachable (the sad tab |
| - // page) then discard any pending or scheduled navigations. |
| + // page) then discard all pending navigations. |
| std::string frame_url; |
| if (!params.GetString("frame.url", &frame_url)) |
| return Status(kUnknownError, "missing or invalid 'frame.url'"); |
| - if (frame_url == kUnreachableWebDataURL) { |
| + 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 |