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

Unified Diff: mojo/shell/tests/application_manager_unittest.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/standalone/desktop/main_helper.cc ('k') | mojo/shell/tests/capability_filter_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/tests/application_manager_unittest.cc
diff --git a/mojo/shell/tests/application_manager_unittest.cc b/mojo/shell/tests/application_manager_unittest.cc
index 98e4d8f55a36704af7e4a3084d20dac73db76e09..ac4133d9614d879401e6107be9a589458f94225d 100644
--- a/mojo/shell/tests/application_manager_unittest.cc
+++ b/mojo/shell/tests/application_manager_unittest.cc
@@ -37,9 +37,13 @@ struct TestContext {
int num_loader_deletes;
};
-void QuitClosure(bool* value) {
- *value = true;
- base::MessageLoop::current()->QuitWhenIdle();
+void QuitClosure(const Identity& expected,
+ bool* value,
+ const Identity& actual) {
+ if (expected == actual) {
+ *value = true;
+ base::MessageLoop::current()->QuitWhenIdle();
+ }
}
class TestServiceImpl : public TestService {
@@ -597,8 +601,8 @@ TEST_F(ApplicationManagerTest, TestEndApplicationClosure) {
bool called = false;
scoped_ptr<ConnectParams> params(new ConnectParams);
params->SetTargetURL(GURL("test:test"));
- params->set_on_application_end(
- base::Bind(&QuitClosure, base::Unretained(&called)));
+ application_manager_->SetInstanceQuitCallback(
+ base::Bind(&QuitClosure, params->target(), &called));
application_manager_->Connect(std::move(params));
loop_.Run();
EXPECT_TRUE(called);
« no previous file with comments | « mojo/shell/standalone/desktop/main_helper.cc ('k') | mojo/shell/tests/capability_filter_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698