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

Side by Side Diff: mojo/edk/test/simple_test_thread.h

Issue 1361143004: EDK: Add a mojo::test::SimpleTestThread (and use it). (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « mojo/edk/test/BUILD.gn ('k') | mojo/edk/test/simple_test_thread.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 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 MOJO_EDK_TEST_SIMPLE_TEST_THREAD_
6 #define MOJO_EDK_TEST_SIMPLE_TEST_THREAD_
7
8 #include "base/threading/simple_thread.h"
9 #include "mojo/public/cpp/system/macros.h"
10
11 namespace mojo {
12 namespace test {
13
14 // Class to help simple threads (with no message loops) in tests.
15 class SimpleTestThread : public base::DelegateSimpleThread::Delegate {
16 public:
17 SimpleTestThread();
18 ~SimpleTestThread() override;
19
20 // Starts the thread.
21 void Start();
22
23 // Joins the thread; this must be called if the thread was started.
24 void Join();
25
26 // Note: Subclasses must implement:
vardhan 2015/09/23 23:36:22 Could this note be above the class?
viettrungluu 2015/09/23 23:37:13 It could be, but it's sitting there as a placehold
27 // virtual void Run() = 0;
28 // TODO(vtl): When we stop using |base::DelegateSimpleThread|, this will
29 // directly become part of our interface.
30
31 private:
32 base::DelegateSimpleThread thread_;
33
34 MOJO_DISALLOW_COPY_AND_ASSIGN(SimpleTestThread);
35 };
36
37 } // namespace test
38 } // namespace mojo
39
40 #endif // MOJO_EDK_TEST_SIMPLE_TEST_THREAD_
OLDNEW
« no previous file with comments | « mojo/edk/test/BUILD.gn ('k') | mojo/edk/test/simple_test_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698