| 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/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 } | 188 } |
| 189 } | 189 } |
| 190 | 190 |
| 191 int64_t integer_; | 191 int64_t integer_; |
| 192 base::Closure closure_; | 192 base::Closure closure_; |
| 193 }; | 193 }; |
| 194 | 194 |
| 195 class InterfacePtrTest : public testing::Test { | 195 class InterfacePtrTest : public testing::Test { |
| 196 public: | 196 public: |
| 197 InterfacePtrTest() {} | 197 InterfacePtrTest() {} |
| 198 ~InterfacePtrTest() override { loop_.RunUntilIdle(); } | 198 ~InterfacePtrTest() override { base::RunLoop().RunUntilIdle(); } |
| 199 | 199 |
| 200 void PumpMessages() { loop_.RunUntilIdle(); } | 200 void PumpMessages() { base::RunLoop().RunUntilIdle(); } |
| 201 | 201 |
| 202 private: | 202 private: |
| 203 base::MessageLoop loop_; | 203 base::MessageLoop loop_; |
| 204 }; | 204 }; |
| 205 | 205 |
| 206 void SetFlagAndRunClosure(bool* flag, const base::Closure& closure) { | 206 void SetFlagAndRunClosure(bool* flag, const base::Closure& closure) { |
| 207 *flag = true; | 207 *flag = true; |
| 208 closure.Run(); | 208 closure.Run(); |
| 209 } | 209 } |
| 210 | 210 |
| (...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 bool called = false; | 733 bool called = false; |
| 734 base::RunLoop loop; | 734 base::RunLoop loop; |
| 735 ptr->Ping(base::Bind(&SetFlagAndRunClosure, &called, loop.QuitClosure())); | 735 ptr->Ping(base::Bind(&SetFlagAndRunClosure, &called, loop.QuitClosure())); |
| 736 loop.Run(); | 736 loop.Run(); |
| 737 EXPECT_TRUE(called); | 737 EXPECT_TRUE(called); |
| 738 } | 738 } |
| 739 | 739 |
| 740 } // namespace | 740 } // namespace |
| 741 } // namespace test | 741 } // namespace test |
| 742 } // namespace mojo | 742 } // namespace mojo |
| OLD | NEW |