Commit 52236e14 authored by arthursonzogni's avatar arthursonzogni Committed by Commit Bot

Cleanup: Remove unused NavigationRecorder class.

Bug: None.
Change-Id: Icdc78e4134664feb9fca3c27c907bec11b093466
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1768138
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: default avatarCamille Lamy <clamy@chromium.org>
Commit-Queue: Camille Lamy <clamy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#690374}
parent c2e2bd1b
......@@ -151,47 +151,6 @@ class InterceptAndCancelDidCommitProvisionalLoad
std::unique_ptr<base::RunLoop> loop_;
};
// Record every WebContentsObserver's event related to navigation. The goal is
// to check these events happen and happen in the expected right order.
class NavigationRecorder : public WebContentsObserver {
public:
explicit NavigationRecorder(WebContents* web_contents)
: WebContentsObserver(web_contents) {}
// WebContentsObserver implementation.
void DidStartNavigation(NavigationHandle* navigation_handle) override {
records_.push_back("start " + navigation_handle->GetURL().path());
WakeUp();
}
void ReadyToCommitNavigation(NavigationHandle* navigation_handle) override {
records_.push_back("ready-to-commit " + navigation_handle->GetURL().path());
WakeUp();
}
void DidFinishNavigation(NavigationHandle* navigation_handle) override {
records_.push_back("did-commit " + navigation_handle->GetURL().path());
WakeUp();
}
void WaitForEvents(size_t numbers_of_events) {
while (records_.size() < numbers_of_events) {
loop_.reset(new base::RunLoop);
loop_->Run();
loop_.reset();
}
}
const std::vector<std::string> records() { return records_; }
private:
void WakeUp() {
if (loop_)
loop_->Quit();
}
std::unique_ptr<base::RunLoop> loop_;
std::vector<std::string> records_;
};
// Used to wait for an observed IPC to be received.
class BrowserMessageObserver : public content::BrowserMessageFilter {
public:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment