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

Unified Diff: headless/lib/embedder_mojo_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 | « no previous file | headless/lib/headless_devtools_client_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: headless/lib/embedder_mojo_browsertest.cc
diff --git a/headless/lib/embedder_mojo_browsertest.cc b/headless/lib/embedder_mojo_browsertest.cc
index 0ae117b33dca0eeed79908682eb1b5a84ffdeefa..92800f1acc35b41be6966362a113cfc28c740839 100644
--- a/headless/lib/embedder_mojo_browsertest.cc
+++ b/headless/lib/embedder_mojo_browsertest.cc
@@ -234,7 +234,7 @@ class HttpDisabledByDefaultWhenMojoBindingsUsed : public EmbedderMojoTest,
}
void ReturnTestResult(const std::string& result) override {
- FinishAsynchronousTest();
+ DisableClientAndFinishAsynchronousTest();
FAIL() << "The HTTP page should not have been served and we should not have"
" recieved a mojo callback!";
}
@@ -242,6 +242,12 @@ class HttpDisabledByDefaultWhenMojoBindingsUsed : public EmbedderMojoTest,
void OnLoadingFailed(const network::LoadingFailedParams& params) override {
// The navigation should fail since HTTP requests are blackholed.
EXPECT_EQ(params.GetErrorText(), "net::ERR_FILE_NOT_FOUND");
+ DisableClientAndFinishAsynchronousTest();
+ }
+
+ void DisableClientAndFinishAsynchronousTest() {
+ devtools_client_->GetNetwork()->Disable();
+ devtools_client_->GetNetwork()->RemoveObserver(this);
FinishAsynchronousTest();
}
};
« no previous file with comments | « no previous file | headless/lib/headless_devtools_client_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698