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

Side by Side Diff: services/service_manager/background/tests/background_service_manager_unittest.cc

Issue 2617883002: Add a new BindInterface() method to Connector. (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 unified diff | Download patch
« no previous file with comments | « services/navigation/navigation_unittest.cc ('k') | services/service_manager/connect_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "services/service_manager/background/background_service_manager.h" 5 #include "services/service_manager/background/background_service_manager.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 #define MAYBE_Basic Basic 53 #define MAYBE_Basic Basic
54 #endif 54 #endif
55 TEST(BackgroundServiceManagerTest, MAYBE_Basic) { 55 TEST(BackgroundServiceManagerTest, MAYBE_Basic) {
56 BackgroundServiceManager background_service_manager; 56 BackgroundServiceManager background_service_manager;
57 base::MessageLoop message_loop; 57 base::MessageLoop message_loop;
58 background_service_manager.Init(nullptr); 58 background_service_manager.Init(nullptr);
59 ServiceContext service_context( 59 ServiceContext service_context(
60 base::MakeUnique<ServiceImpl>(), 60 base::MakeUnique<ServiceImpl>(),
61 background_service_manager.CreateServiceRequest(kTestName)); 61 background_service_manager.CreateServiceRequest(kTestName));
62 mojom::TestServicePtr test_service; 62 mojom::TestServicePtr test_service;
63 service_context.connector()->ConnectToInterface(kAppName, &test_service); 63 service_context.connector()->BindInterface(kAppName, &test_service);
64 base::RunLoop run_loop; 64 base::RunLoop run_loop;
65 bool got_result = false; 65 bool got_result = false;
66 test_service->Test( 66 test_service->Test(
67 base::Bind(&SetFlagAndRunClosure, &got_result, run_loop.QuitClosure())); 67 base::Bind(&SetFlagAndRunClosure, &got_result, run_loop.QuitClosure()));
68 run_loop.Run(); 68 run_loop.Run();
69 EXPECT_TRUE(got_result); 69 EXPECT_TRUE(got_result);
70 } 70 }
71 71
72 } // namespace service_manager 72 } // namespace service_manager
OLDNEW
« no previous file with comments | « services/navigation/navigation_unittest.cc ('k') | services/service_manager/connect_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698