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 "base/test/test_io_thread.h" | 5 #include "base/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/synchronization/waitable_event.h" | 9 #include "base/synchronization/waitable_event.h" |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 io_thread_started_ = false; | 49 io_thread_started_ = false; |
50 } | 50 } |
51 | 51 |
52 void TestIOThread::PostTask(const tracked_objects::Location& from_here, | 52 void TestIOThread::PostTask(const tracked_objects::Location& from_here, |
53 const base::Closure& task) { | 53 const base::Closure& task) { |
54 task_runner()->PostTask(from_here, task); | 54 task_runner()->PostTask(from_here, task); |
55 } | 55 } |
56 | 56 |
57 void TestIOThread::PostTaskAndWait(const tracked_objects::Location& from_here, | 57 void TestIOThread::PostTaskAndWait(const tracked_objects::Location& from_here, |
58 const base::Closure& task) { | 58 const base::Closure& task) { |
59 base::WaitableEvent event(false, false); | 59 base::WaitableEvent event(WaitableEvent::ResetPolicy::AUTOMATIC, |
| 60 WaitableEvent::InitialState::NOT_SIGNALED); |
60 task_runner()->PostTask(from_here, | 61 task_runner()->PostTask(from_here, |
61 base::Bind(&PostTaskAndWaitHelper, &event, task)); | 62 base::Bind(&PostTaskAndWaitHelper, &event, task)); |
62 event.Wait(); | 63 event.Wait(); |
63 } | 64 } |
64 | 65 |
65 } // namespace base | 66 } // namespace base |
OLD | NEW |