| 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 "mojo/public/cpp/bindings/lib/router.h" | 5 #include "mojo/public/cpp/bindings/lib/router.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 class RouterTest : public testing::Test { | 21 class RouterTest : public testing::Test { |
| 22 public: | 22 public: |
| 23 RouterTest() {} | 23 RouterTest() {} |
| 24 | 24 |
| 25 void SetUp() override { | 25 void SetUp() override { |
| 26 CreateMessagePipe(nullptr, &handle0_, &handle1_); | 26 CreateMessagePipe(nullptr, &handle0_, &handle1_); |
| 27 } | 27 } |
| 28 | 28 |
| 29 void TearDown() override {} | 29 void TearDown() override {} |
| 30 | 30 |
| 31 void PumpMessages() { loop_.RunUntilIdle(); } | 31 void PumpMessages() { base::RunLoop().RunUntilIdle(); } |
| 32 | 32 |
| 33 protected: | 33 protected: |
| 34 ScopedMessagePipeHandle handle0_; | 34 ScopedMessagePipeHandle handle0_; |
| 35 ScopedMessagePipeHandle handle1_; | 35 ScopedMessagePipeHandle handle1_; |
| 36 | 36 |
| 37 private: | 37 private: |
| 38 base::MessageLoop loop_; | 38 base::MessageLoop loop_; |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 TEST_F(RouterTest, BasicRequestResponse) { | 41 TEST_F(RouterTest, BasicRequestResponse) { |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 EXPECT_TRUE(generator.has_responder()); | 307 EXPECT_TRUE(generator.has_responder()); |
| 308 } | 308 } |
| 309 | 309 |
| 310 EXPECT_FALSE(generator.responder_is_valid()); | 310 EXPECT_FALSE(generator.responder_is_valid()); |
| 311 generator.CompleteWithResponse(); // This should end up doing nothing. | 311 generator.CompleteWithResponse(); // This should end up doing nothing. |
| 312 } | 312 } |
| 313 | 313 |
| 314 } // namespace | 314 } // namespace |
| 315 } // namespace test | 315 } // namespace test |
| 316 } // namespace mojo | 316 } // namespace mojo |
| OLD | NEW |