| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "mojo/public/cpp/bindings/binding.h" | 5 #include "mojo/public/cpp/bindings/binding.h" |
| 6 #include "mojo/public/cpp/bindings/strong_binding.h" | 6 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 7 #include "mojo/public/cpp/environment/environment.h" | 7 #include "mojo/public/cpp/environment/environment.h" |
| 8 #include "mojo/public/cpp/test_support/test_utils.h" | 8 #include "mojo/public/cpp/test_support/test_utils.h" |
| 9 #include "mojo/public/cpp/utility/run_loop.h" | 9 #include "mojo/public/cpp/utility/run_loop.h" |
| 10 #include "mojo/public/interfaces/bindings/tests/sample_factory.mojom.h" | 10 #include "mojo/public/interfaces/bindings/tests/sample_factory.mojom.h" |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 TEST_F(HandlePassingTest, PipesAreClosed) { | 278 TEST_F(HandlePassingTest, PipesAreClosed) { |
| 279 sample::FactoryPtr factory; | 279 sample::FactoryPtr factory; |
| 280 SampleFactoryImpl factory_impl(GetProxy(&factory)); | 280 SampleFactoryImpl factory_impl(GetProxy(&factory)); |
| 281 | 281 |
| 282 MessagePipe extra_pipe; | 282 MessagePipe extra_pipe; |
| 283 | 283 |
| 284 MojoHandle handle0_value = extra_pipe.handle0.get().value(); | 284 MojoHandle handle0_value = extra_pipe.handle0.get().value(); |
| 285 MojoHandle handle1_value = extra_pipe.handle1.get().value(); | 285 MojoHandle handle1_value = extra_pipe.handle1.get().value(); |
| 286 | 286 |
| 287 { | 287 { |
| 288 Array<ScopedMessagePipeHandle> pipes(2); | 288 auto pipes = Array<ScopedMessagePipeHandle>::New(2); |
| 289 pipes[0] = extra_pipe.handle0.Pass(); | 289 pipes[0] = extra_pipe.handle0.Pass(); |
| 290 pipes[1] = extra_pipe.handle1.Pass(); | 290 pipes[1] = extra_pipe.handle1.Pass(); |
| 291 | 291 |
| 292 sample::RequestPtr request(sample::Request::New()); | 292 sample::RequestPtr request(sample::Request::New()); |
| 293 request->more_pipes = pipes.Pass(); | 293 request->more_pipes = pipes.Pass(); |
| 294 | 294 |
| 295 factory->DoStuff(request.Pass(), ScopedMessagePipeHandle(), | 295 factory->DoStuff(request.Pass(), ScopedMessagePipeHandle(), |
| 296 sample::Factory::DoStuffCallback()); | 296 sample::Factory::DoStuffCallback()); |
| 297 } | 297 } |
| 298 | 298 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 | 343 |
| 344 PumpMessages(); // Yield for results. | 344 PumpMessages(); // Yield for results. |
| 345 | 345 |
| 346 EXPECT_EQ(std::string("object1"), name1); | 346 EXPECT_EQ(std::string("object1"), name1); |
| 347 EXPECT_EQ(std::string("object2"), name2); | 347 EXPECT_EQ(std::string("object2"), name2); |
| 348 } | 348 } |
| 349 | 349 |
| 350 } // namespace | 350 } // namespace |
| 351 } // namespace test | 351 } // namespace test |
| 352 } // namespace mojo | 352 } // namespace mojo |
| OLD | NEW |