| 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/edk/test/test_io_thread.h" | 5 #include "mojo/edk/system/test/test_io_thread.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/synchronization/waitable_event.h" | 10 #include "base/synchronization/waitable_event.h" |
| 11 | 11 |
| 12 namespace mojo { | 12 namespace mojo { |
| 13 namespace system { |
| 13 namespace test { | 14 namespace test { |
| 14 | 15 |
| 15 namespace { | 16 namespace { |
| 16 | 17 |
| 17 void PostTaskAndWaitHelper(base::WaitableEvent* event, | 18 void PostTaskAndWaitHelper(base::WaitableEvent* event, |
| 18 const base::Closure& task) { | 19 const base::Closure& task) { |
| 19 task.Run(); | 20 task.Run(); |
| 20 event->Signal(); | 21 event->Signal(); |
| 21 } | 22 } |
| 22 | 23 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 } | 57 } |
| 57 | 58 |
| 58 void TestIOThread::PostTaskAndWait(const base::Closure& task) { | 59 void TestIOThread::PostTaskAndWait(const base::Closure& task) { |
| 59 base::WaitableEvent event(false, false); | 60 base::WaitableEvent event(false, false); |
| 60 task_runner()->PostTask(tracked_objects::Location(), | 61 task_runner()->PostTask(tracked_objects::Location(), |
| 61 base::Bind(&PostTaskAndWaitHelper, &event, task)); | 62 base::Bind(&PostTaskAndWaitHelper, &event, task)); |
| 62 event.Wait(); | 63 event.Wait(); |
| 63 } | 64 } |
| 64 | 65 |
| 65 } // namespace test | 66 } // namespace test |
| 67 } // namespace system |
| 66 } // namespace mojo | 68 } // namespace mojo |
| OLD | NEW |