| 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 "mojo/public/cpp/bindings/lib/synchronous_connector.h" | 5 #include "mojo/public/cpp/bindings/synchronous_interface_ptr.h" |
| 6 | 6 |
| 7 #include <thread> | 7 #include <thread> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "gtest/gtest.h" |
| 10 #include "mojo/public/cpp/bindings/binding.h" | 11 #include "mojo/public/cpp/bindings/binding.h" |
| 11 #include "mojo/public/cpp/bindings/interface_request.h" | 12 #include "mojo/public/cpp/bindings/interface_request.h" |
| 12 #include "mojo/public/cpp/bindings/strong_binding.h" | 13 #include "mojo/public/cpp/bindings/strong_binding.h" |
| 13 #include "mojo/public/cpp/bindings/synchronous_interface_ptr.h" | |
| 14 #include "mojo/public/cpp/utility/run_loop.h" | 14 #include "mojo/public/cpp/utility/run_loop.h" |
| 15 #include "mojo/public/interfaces/bindings/tests/math_calculator.mojom-sync.h" | 15 #include "mojo/public/interfaces/bindings/tests/math_calculator.mojom-sync.h" |
| 16 #include "mojo/public/interfaces/bindings/tests/math_calculator.mojom.h" | 16 #include "mojo/public/interfaces/bindings/tests/math_calculator.mojom.h" |
| 17 #include "mojo/public/interfaces/bindings/tests/scoping.mojom-sync.h" | 17 #include "mojo/public/interfaces/bindings/tests/scoping.mojom-sync.h" |
| 18 #include "mojo/public/interfaces/bindings/tests/scoping.mojom.h" | 18 #include "mojo/public/interfaces/bindings/tests/scoping.mojom.h" |
| 19 #include "testing/gtest/include/gtest/gtest.h" | |
| 20 | 19 |
| 21 namespace mojo { | 20 namespace mojo { |
| 22 namespace test { | 21 namespace test { |
| 23 namespace { | 22 namespace { |
| 24 | 23 |
| 25 using CalcCallback = mojo::Callback<void(double)>; | 24 using CalcCallback = mojo::Callback<void(double)>; |
| 26 | 25 |
| 27 // This runs in a separate thread. | 26 // This runs in a separate thread. |
| 28 class MathCalculatorImpl : public math::Calculator { | 27 class MathCalculatorImpl : public math::Calculator { |
| 29 public: | 28 public: |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 // While B & C have fallen out of scope, the service-side endpoints of the | 215 // While B & C have fallen out of scope, the service-side endpoints of the |
| 217 // pipes will remain until they are flushed. | 216 // pipes will remain until they are flushed. |
| 218 EXPECT_FALSE(a_impl.d_called()); | 217 EXPECT_FALSE(a_impl.d_called()); |
| 219 PumpMessages(); | 218 PumpMessages(); |
| 220 EXPECT_TRUE(a_impl.d_called()); | 219 EXPECT_TRUE(a_impl.d_called()); |
| 221 } | 220 } |
| 222 | 221 |
| 223 } // namespace | 222 } // namespace |
| 224 } // namespace test | 223 } // namespace test |
| 225 } // namespace mojo | 224 } // namespace mojo |
| OLD | NEW |