| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "mojo/public/cpp/bindings/binding.h" | 10 #include "mojo/public/cpp/bindings/binding.h" |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 ScopedMessagePipeHandle pipe1_; | 150 ScopedMessagePipeHandle pipe1_; |
| 151 Binding<sample::Factory> binding_; | 151 Binding<sample::Factory> binding_; |
| 152 }; | 152 }; |
| 153 | 153 |
| 154 class HandlePassingTest : public testing::Test { | 154 class HandlePassingTest : public testing::Test { |
| 155 public: | 155 public: |
| 156 HandlePassingTest() {} | 156 HandlePassingTest() {} |
| 157 | 157 |
| 158 void TearDown() override { PumpMessages(); } | 158 void TearDown() override { PumpMessages(); } |
| 159 | 159 |
| 160 void PumpMessages() { loop_.RunUntilIdle(); } | 160 void PumpMessages() { base::RunLoop().RunUntilIdle(); } |
| 161 | 161 |
| 162 private: | 162 private: |
| 163 base::MessageLoop loop_; | 163 base::MessageLoop loop_; |
| 164 }; | 164 }; |
| 165 | 165 |
| 166 void DoStuff(bool* got_response, | 166 void DoStuff(bool* got_response, |
| 167 std::string* got_text_reply, | 167 std::string* got_text_reply, |
| 168 const base::Closure& closure, | 168 const base::Closure& closure, |
| 169 sample::ResponsePtr response, | 169 sample::ResponsePtr response, |
| 170 String text_reply) { | 170 String text_reply) { |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 run_loop.Run(); | 349 run_loop.Run(); |
| 350 run_loop2.Run(); | 350 run_loop2.Run(); |
| 351 | 351 |
| 352 EXPECT_EQ(std::string("object1"), name1); | 352 EXPECT_EQ(std::string("object1"), name1); |
| 353 EXPECT_EQ(std::string("object2"), name2); | 353 EXPECT_EQ(std::string("object2"), name2); |
| 354 } | 354 } |
| 355 | 355 |
| 356 } // namespace | 356 } // namespace |
| 357 } // namespace test | 357 } // namespace test |
| 358 } // namespace mojo | 358 } // namespace mojo |
| OLD | NEW |