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

Side by Side Diff: mojo/system/test_utils.cc

Issue 140403002: Mojo: Add the ability to hook up a channel to the embedder API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « mojo/system/test_utils.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "mojo/system/test_utils.h" 5 #include "mojo/system/test_utils.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 13 matching lines...) Expand all
24 24
25 void PostTaskAndWait(scoped_refptr<base::TaskRunner> task_runner, 25 void PostTaskAndWait(scoped_refptr<base::TaskRunner> task_runner,
26 const tracked_objects::Location& from_here, 26 const tracked_objects::Location& from_here,
27 const base::Closure& task) { 27 const base::Closure& task) {
28 base::WaitableEvent event(false, false); 28 base::WaitableEvent event(false, false);
29 task_runner->PostTask(from_here, 29 task_runner->PostTask(from_here,
30 base::Bind(&PostTaskAndWaitHelper, &event, task)); 30 base::Bind(&PostTaskAndWaitHelper, &event, task));
31 event.Wait(); 31 event.Wait();
32 } 32 }
33 33
34 // TestWithIOThreadBase --------------------------------------------------------
35
36 TestWithIOThreadBase::TestWithIOThreadBase() : io_thread_("io_thread") {
37 }
38
39 TestWithIOThreadBase::~TestWithIOThreadBase() {
40 }
41
42 void TestWithIOThreadBase::SetUp() {
43 io_thread_.StartWithOptions(
44 base::Thread::Options(base::MessageLoop::TYPE_IO, 0));
45 }
46
47 void TestWithIOThreadBase::TearDown() {
48 io_thread_.Stop();
49 }
50
34 } // namespace test 51 } // namespace test
35 } // namespace system 52 } // namespace system
36 } // namespace mojo 53 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/system/test_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698