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

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

Issue 2320923002: Add a full Blimp integration test. (Closed)
Patch Set: Fix build break with chrome embedder 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 // static
19 void WaitableContentPump::WaitFor(base::WaitableEvent* event) {
20 while (!event->IsSignaled()) {
21 content::RunAllPendingInMessageLoop(content::BrowserThread::UI);
22 content::RunAllPendingInMessageLoop(content::BrowserThread::IO);
23 content::RunAllPendingInMessageLoop(content::BrowserThread::FILE);
24 }
25 event->Reset();
26 }
27
28 void WaitableContentPump::Wait() {
29 WaitableContentPump::WaitFor(&event_);
30 }
31
32 } // namespace blimp
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698