Chromium Code Reviews| 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/error_handler.h" | 6 #include "mojo/public/cpp/bindings/error_handler.h" |
| 7 #include "mojo/public/cpp/bindings/strong_binding.h" | 7 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 8 #include "mojo/public/cpp/environment/environment.h" | 8 #include "mojo/public/cpp/environment/environment.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/math_calculator.mojom.h" | 10 #include "mojo/public/interfaces/bindings/tests/math_calculator.mojom.h" |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 320 | 320 |
| 321 PumpMessages(); | 321 PumpMessages(); |
| 322 | 322 |
| 323 EXPECT_EQ(0, SelfDestructingMathCalculatorUIImpl::num_instances()); | 323 EXPECT_EQ(0, SelfDestructingMathCalculatorUIImpl::num_instances()); |
| 324 } | 324 } |
| 325 | 325 |
| 326 TEST_F(InterfacePtrTest, ReentrantWaitForIncomingMethodCall) { | 326 TEST_F(InterfacePtrTest, ReentrantWaitForIncomingMethodCall) { |
| 327 sample::ServicePtr proxy; | 327 sample::ServicePtr proxy; |
| 328 ReentrantServiceImpl* impl = BindToProxy(new ReentrantServiceImpl(), &proxy); | 328 ReentrantServiceImpl* impl = BindToProxy(new ReentrantServiceImpl(), &proxy); |
| 329 | 329 |
| 330 proxy->Frobinate(sample::FooPtr(), | 330 proxy->Frobinate(nullptr, sample::Service::BAZ_OPTIONS_REGULAR, nullptr); |
|
jamesr
2015/01/13 23:27:05
this is the example use. The first parameter to th
| |
| 331 sample::Service::BAZ_OPTIONS_REGULAR, | 331 proxy->Frobinate(nullptr, sample::Service::BAZ_OPTIONS_REGULAR, nullptr); |
| 332 sample::PortPtr()); | |
| 333 proxy->Frobinate(sample::FooPtr(), | |
| 334 sample::Service::BAZ_OPTIONS_REGULAR, | |
| 335 sample::PortPtr()); | |
| 336 | 332 |
| 337 PumpMessages(); | 333 PumpMessages(); |
| 338 | 334 |
| 339 EXPECT_EQ(2, impl->max_call_depth()); | 335 EXPECT_EQ(2, impl->max_call_depth()); |
| 340 } | 336 } |
| 341 | 337 |
| 342 class StrongMathCalculatorImpl : public math::Calculator, public ErrorHandler { | 338 class StrongMathCalculatorImpl : public math::Calculator, public ErrorHandler { |
| 343 public: | 339 public: |
| 344 StrongMathCalculatorImpl(ScopedMessagePipeHandle handle, | 340 StrongMathCalculatorImpl(ScopedMessagePipeHandle handle, |
| 345 bool* error_received, | 341 bool* error_received, |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 477 } | 473 } |
| 478 | 474 |
| 479 loop.RunUntilIdle(); | 475 loop.RunUntilIdle(); |
| 480 EXPECT_TRUE(error_received); | 476 EXPECT_TRUE(error_received); |
| 481 EXPECT_FALSE(destroyed); | 477 EXPECT_FALSE(destroyed); |
| 482 } | 478 } |
| 483 | 479 |
| 484 } // namespace | 480 } // namespace |
| 485 } // namespace test | 481 } // namespace test |
| 486 } // namespace mojo | 482 } // namespace mojo |
| OLD | NEW |