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

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

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 #ifndef BLIMP_ENGINE_BROWSER_TESTS_WAITABLE_CONTENT_PUMP_H_
6 #define BLIMP_ENGINE_BROWSER_TESTS_WAITABLE_CONTENT_PUMP_H_
7
8 #include "base/macros.h"
9 #include "base/synchronization/waitable_event.h"
10
11 namespace blimp {
12
13 // A helper class to suspend execution on the current stack and still allow all
14 // content message loops to run until a WaitableEvent is signaled. This
15 // currently only pumps the UI, IO, and FILE threads. The typical use case
16 // would look like:
17 //
18 // WaitableContentPump waiter;
19 // GiveEventToSomeoneToEventuallySignal(waiter.event());
20 // waiter.Wait();
21 class WaitableContentPump {
22 public:
23 WaitableContentPump();
24 virtual ~WaitableContentPump();
25
26 // Pumps content message loops until |event| is signaled. This will reset
27 // |event| afterwards.
28 static void WaitFor(base::WaitableEvent* event);
29
30 // Helper methods to use the WaitableContentPump without needing to build a
31 // WaitableEvent.
32 base::WaitableEvent* event() { return &event_; }
33 void Wait();
34
35 private:
36 base::WaitableEvent event_;
37
38 DISALLOW_COPY_AND_ASSIGN(WaitableContentPump);
39 };
40
41 } // namespace blimp
42
43 #endif // BLIMP_ENGINE_BROWSER_TESTS_WAITABLE_CONTENT_PUMP_H_
OLDNEW
« no previous file with comments | « blimp/engine/browser_tests/integration_test.cc ('k') | blimp/engine/browser_tests/waitable_content_pump.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698