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

Unified Diff: headless/lib/headless_devtools_client_browsertest.cc

Issue 2642683004: [headless] Ensure devtooled tests call Disable/RemoveObserver. (Closed)
Patch Set: . Created 3 years, 11 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 | « headless/lib/embedder_mojo_browsertest.cc ('k') | headless/public/util/dom_tree_extractor_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/lib/headless_devtools_client_browsertest.cc
diff --git a/headless/lib/headless_devtools_client_browsertest.cc b/headless/lib/headless_devtools_client_browsertest.cc
index 4c19d056e676df7536d0d3987008773a8db4c14a..6dbd79fad281a12b7b0375626f17df655f36762a 100644
--- a/headless/lib/headless_devtools_client_browsertest.cc
+++ b/headless/lib/headless_devtools_client_browsertest.cc
@@ -65,6 +65,7 @@ class HeadlessDevToolsClientNavigationTest
}
void OnLoadEventFired(const page::LoadEventFiredParams& params) override {
+ devtools_client_->GetPage()->Disable();
devtools_client_->GetPage()->GetExperimental()->RemoveObserver(this);
FinishAsynchronousTest();
}
@@ -174,6 +175,7 @@ class HeadlessDevToolsClientObserverTest
&content_type));
EXPECT_EQ("text/html", content_type);
+ devtools_client_->GetNetwork()->Disable();
devtools_client_->GetNetwork()->RemoveObserver(this);
FinishAsynchronousTest();
}
@@ -208,6 +210,9 @@ class HeadlessDevToolsClientExperimentalTest
void OnFrameStoppedLoading(
const page::FrameStoppedLoadingParams& params) override {
+ devtools_client_->GetPage()->Disable();
+ devtools_client_->GetPage()->GetExperimental()->RemoveObserver(this);
+
// Check that a non-experimental command which has no return value can be
// called with a void() callback.
devtools_client_->GetPage()->Reload(
« no previous file with comments | « headless/lib/embedder_mojo_browsertest.cc ('k') | headless/public/util/dom_tree_extractor_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698