OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "blimp/engine/browser_tests/waitable_content_pump.h" | |
6 | |
7 #include "content/public/browser/browser_thread.h" | |
8 #include "content/public/test/test_utils.h" | |
9 | |
10 namespace blimp { | |
11 | |
12 WaitableContentPump::WaitableContentPump() | |
13 : event_(base::WaitableEvent::ResetPolicy::MANUAL, | |
14 base::WaitableEvent::InitialState::NOT_SIGNALED) {} | |
15 | |
16 WaitableContentPump::~WaitableContentPump() = default; | |
17 | |
18 void WaitableContentPump::Wait() { | |
19 WaitFor(event()); | |
Khushal
2016/09/13 23:47:10
just &event_ here.
David Trainor- moved to gerrit
2016/09/14 00:31:09
Done.
| |
20 } | |
21 | |
22 void WaitableContentPump::WaitFor(base::WaitableEvent* event) { | |
23 while (!event->IsSignaled()) { | |
24 content::RunAllPendingInMessageLoop(content::BrowserThread::UI); | |
25 content::RunAllPendingInMessageLoop(content::BrowserThread::IO); | |
26 content::RunAllPendingInMessageLoop(content::BrowserThread::FILE); | |
27 } | |
28 event->Reset(); | |
29 } | |
30 | |
31 } // namespace blimp | |
OLD | NEW |