OLD | NEW |
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 <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 class TestService : public test::ServiceTestClient { | 110 class TestService : public test::ServiceTestClient { |
111 public: | 111 public: |
112 explicit TestService(ConnectTest* connect_test) | 112 explicit TestService(ConnectTest* connect_test) |
113 : test::ServiceTestClient(connect_test), connect_test_(connect_test) { | 113 : test::ServiceTestClient(connect_test), connect_test_(connect_test) { |
114 registry_.AddInterface<test::mojom::ExposedInterface>(connect_test_); | 114 registry_.AddInterface<test::mojom::ExposedInterface>(connect_test_); |
115 } | 115 } |
116 ~TestService() override {} | 116 ~TestService() override {} |
117 | 117 |
118 private: | 118 private: |
119 void OnBindInterface( | 119 void OnBindInterface( |
120 const ServiceInfo& source_info, | 120 const BindSourceInfo& source_info, |
121 const std::string& interface_name, | 121 const std::string& interface_name, |
122 mojo::ScopedMessagePipeHandle interface_pipe) override { | 122 mojo::ScopedMessagePipeHandle interface_pipe) override { |
123 registry_.BindInterface(source_info.identity, interface_name, | 123 registry_.BindInterface(source_info.identity, interface_name, |
124 std::move(interface_pipe)); | 124 std::move(interface_pipe)); |
125 } | 125 } |
126 | 126 |
127 ConnectTest* connect_test_; | 127 ConnectTest* connect_test_; |
128 BinderRegistry registry_; | 128 BinderRegistry registry_; |
129 | 129 |
130 DISALLOW_COPY_AND_ASSIGN(TestService); | 130 DISALLOW_COPY_AND_ASSIGN(TestService); |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 Connector::TestApi test_api(connector()); | 383 Connector::TestApi test_api(connector()); |
384 Identity resolved_identity; | 384 Identity resolved_identity; |
385 test_api.SetStartServiceCallback( | 385 test_api.SetStartServiceCallback( |
386 base::Bind(&StartServiceResponse, &loop, nullptr, &resolved_identity)); | 386 base::Bind(&StartServiceResponse, &loop, nullptr, &resolved_identity)); |
387 loop.Run(); | 387 loop.Run(); |
388 EXPECT_EQ(resolved_identity.user_id(), first_resolved_identity.user_id()); | 388 EXPECT_EQ(resolved_identity.user_id(), first_resolved_identity.user_id()); |
389 } | 389 } |
390 } | 390 } |
391 | 391 |
392 } // namespace service_manager | 392 } // namespace service_manager |
OLD | NEW |