| 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/error_handler.h" | 5 #include "mojo/public/cpp/bindings/error_handler.h" |
| 6 #include "mojo/public/cpp/environment/environment.h" | 6 #include "mojo/public/cpp/environment/environment.h" |
| 7 #include "mojo/public/cpp/utility/run_loop.h" | 7 #include "mojo/public/cpp/utility/run_loop.h" |
| 8 #include "mojo/public/interfaces/bindings/tests/math_calculator.mojom.h" | 8 #include "mojo/public/interfaces/bindings/tests/math_calculator.mojom.h" |
| 9 #include "mojo/public/interfaces/bindings/tests/sample_service.mojom.h" | 9 #include "mojo/public/interfaces/bindings/tests/sample_service.mojom.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 void GetPort(mojo::InterfaceRequest<sample::Port> port) override {} | 145 void GetPort(mojo::InterfaceRequest<sample::Port> port) override {} |
| 146 | 146 |
| 147 private: | 147 private: |
| 148 bool got_connection_; | 148 bool got_connection_; |
| 149 int call_depth_; | 149 int call_depth_; |
| 150 int max_call_depth_; | 150 int max_call_depth_; |
| 151 }; | 151 }; |
| 152 | 152 |
| 153 class InterfacePtrTest : public testing::Test { | 153 class InterfacePtrTest : public testing::Test { |
| 154 public: | 154 public: |
| 155 virtual ~InterfacePtrTest() { loop_.RunUntilIdle(); } | 155 ~InterfacePtrTest() override { loop_.RunUntilIdle(); } |
| 156 | 156 |
| 157 void PumpMessages() { loop_.RunUntilIdle(); } | 157 void PumpMessages() { loop_.RunUntilIdle(); } |
| 158 | 158 |
| 159 private: | 159 private: |
| 160 Environment env_; | 160 Environment env_; |
| 161 RunLoop loop_; | 161 RunLoop loop_; |
| 162 }; | 162 }; |
| 163 | 163 |
| 164 TEST_F(InterfacePtrTest, EndToEnd) { | 164 TEST_F(InterfacePtrTest, EndToEnd) { |
| 165 math::CalculatorPtr calc; | 165 math::CalculatorPtr calc; |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 sample::PortPtr()); | 347 sample::PortPtr()); |
| 348 | 348 |
| 349 PumpMessages(); | 349 PumpMessages(); |
| 350 | 350 |
| 351 EXPECT_EQ(2, impl->max_call_depth()); | 351 EXPECT_EQ(2, impl->max_call_depth()); |
| 352 } | 352 } |
| 353 | 353 |
| 354 } // namespace | 354 } // namespace |
| 355 } // namespace test | 355 } // namespace test |
| 356 } // namespace mojo | 356 } // namespace mojo |
| OLD | NEW |