Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(775)

Side by Side Diff: blimp/engine/browser_tests/waitable_content_pump.cc

Issue 2320923002: Add a full Blimp integration test. (Closed)
Patch Set: Addressed more comments, added thread restriction bypass for tests. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698