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

Unified Diff: mojo/shell/tests/capability_filter_test.cc

Issue 1714753002: 7/ Eliminate on_application_end from ConnectParams (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@client_request
Patch Set: . Created 4 years, 10 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 | « mojo/shell/tests/capability_filter_test.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/tests/capability_filter_test.cc
diff --git a/mojo/shell/tests/capability_filter_test.cc b/mojo/shell/tests/capability_filter_test.cc
index 11364e83f6d74fae26d14fc7a925d4565d5037f7..9bce8923500e3517b915437b0b220d4504897174 100644
--- a/mojo/shell/tests/capability_filter_test.cc
+++ b/mojo/shell/tests/capability_filter_test.cc
@@ -281,6 +281,9 @@ void CapabilityFilterTest::RunWildcardTest() {
void CapabilityFilterTest::SetUp() {
application_manager_.reset(new ApplicationManager(true));
+ application_manager_->SetInstanceQuitCallback(
+ base::Bind(&CapabilityFilterTest::OnInstanceQuit,
+ base::Unretained(this)));
CreateLoader<ServiceApplication>("test:service");
CreateLoader<ServiceApplication>("test:service2");
}
@@ -327,7 +330,7 @@ void CapabilityFilterTest::RunApplication(const std::string& url,
params->set_target(Identity(GURL(url), std::string(), filter));
params->set_remote_interfaces(GetProxy(&remote_interfaces));
params->set_local_interfaces(std::move(local_interfaces));
- params->set_on_application_end(base::MessageLoop::QuitWhenIdleClosure());
+ quit_identities_.insert(params->target());
application_manager_->Connect(std::move(params));
}
@@ -345,6 +348,14 @@ void CapabilityFilterTest::RunTest() {
validator_->PrintUnmetExpectations();
}
+void CapabilityFilterTest::OnInstanceQuit(const Identity& identity) {
+ auto it = quit_identities_.find(identity);
+ if (it != quit_identities_.end())
+ quit_identities_.erase(it);
+ if (quit_identities_.empty())
+ base::MessageLoop::current()->QuitWhenIdle();
+}
+
} // namespace test
} // namespace shell
} // namespace mojo
« no previous file with comments | « mojo/shell/tests/capability_filter_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698