OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/js/test/echo_service.mojom.h" | 5 #include "services/js/test/echo_service.mojom.h" |
6 #include "services/js/test/js_application_test_base.h" | 6 #include "services/js/test/js_application_test_base.h" |
7 | 7 |
8 using mojo::String; | 8 using mojo::String; |
9 | 9 |
10 namespace js { | 10 namespace js { |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 EXPECT_TRUE(echo_service_.WaitForIncomingMethodCall()); | 101 EXPECT_TRUE(echo_service_.WaitForIncomingMethodCall()); |
102 EXPECT_TRUE(returned_value); | 102 EXPECT_TRUE(returned_value); |
103 echo_service_->Quit(); | 103 echo_service_->Quit(); |
104 } | 104 } |
105 | 105 |
106 // Verify that connecting via the echo service application's ServiceProvider | 106 // Verify that connecting via the echo service application's ServiceProvider |
107 // behaves the same as connecting to the echo service directly. | 107 // behaves the same as connecting to the echo service directly. |
108 TEST_F(JSServiceProviderEchoTest, UseApplicationServiceProvider) { | 108 TEST_F(JSServiceProviderEchoTest, UseApplicationServiceProvider) { |
109 mojo::EchoServicePtr echo_service; | 109 mojo::EchoServicePtr echo_service; |
110 mojo::MessagePipe pipe; | 110 mojo::MessagePipe pipe; |
111 echo_service.Bind(pipe.handle0.Pass()); | 111 echo_service.Bind( |
| 112 mojo::InterfacePtrInfo<mojo::EchoService>(pipe.handle0.Pass(), 0u)); |
112 echo_service_provider_->ConnectToService( | 113 echo_service_provider_->ConnectToService( |
113 mojo::EchoService::Name_, pipe.handle1.Pass()); | 114 mojo::EchoService::Name_, pipe.handle1.Pass()); |
114 String foo; | 115 String foo; |
115 EchoStringCallback callback(&foo); | 116 EchoStringCallback callback(&foo); |
116 echo_service->EchoString("foo", callback); | 117 echo_service->EchoString("foo", callback); |
117 EXPECT_TRUE(echo_service.WaitForIncomingMethodCall()); | 118 EXPECT_TRUE(echo_service.WaitForIncomingMethodCall()); |
118 EXPECT_EQ("foo", foo); | 119 EXPECT_EQ("foo", foo); |
119 echo_service->Quit(); | 120 echo_service->Quit(); |
120 } | 121 } |
121 | 122 |
122 } // namespace | 123 } // namespace |
123 } // namespace js | 124 } // namespace js |
OLD | NEW |