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

Side by Side Diff: mojo/edk/system/test_utils.h

Issue 1488853002: Add multiplexing of message pipes in the new EDK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tsepez review comments Created 5 years 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/system/run_all_unittests.cc ('k') | mojo/edk/system/test_utils.cc » ('j') | 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 #ifndef MOJO_EDK_SYSTEM_TEST_UTILS_H_ 5 #ifndef MOJO_EDK_SYSTEM_TEST_UTILS_H_
6 #define MOJO_EDK_SYSTEM_TEST_UTILS_H_ 6 #define MOJO_EDK_SYSTEM_TEST_UTILS_H_
7 7
8 #include "base/test/test_io_thread.h"
9 #include "base/time/time.h" 8 #include "base/time/time.h"
10 #include "mojo/edk/test/scoped_ipc_support.h"
11 #include "mojo/public/c/system/types.h" 9 #include "mojo/public/c/system/types.h"
12 #include "mojo/public/cpp/system/macros.h" 10 #include "mojo/public/cpp/system/macros.h"
13 #include "testing/gtest/include/gtest/gtest.h" 11 #include "testing/gtest/include/gtest/gtest.h"
14 12
15 namespace mojo { 13 namespace mojo {
16 namespace edk { 14 namespace edk {
17 namespace test { 15 namespace test {
18 16
19 MojoDeadline DeadlineFromMilliseconds(unsigned milliseconds); 17 MojoDeadline DeadlineFromMilliseconds(unsigned milliseconds);
20 18
(...skipping 26 matching lines...) Expand all
47 // Returns the amount of time elapsed since the last call to |Start()| (in 45 // Returns the amount of time elapsed since the last call to |Start()| (in
48 // microseconds). 46 // microseconds).
49 MojoDeadline Elapsed(); 47 MojoDeadline Elapsed();
50 48
51 private: 49 private:
52 base::TimeTicks start_time_; 50 base::TimeTicks start_time_;
53 51
54 MOJO_DISALLOW_COPY_AND_ASSIGN(Stopwatch); 52 MOJO_DISALLOW_COPY_AND_ASSIGN(Stopwatch);
55 }; 53 };
56 54
57 // A base class which initializes and shuts down the necessary objects so that
58 // Mojo system calls can be made.
59 class MojoSystemTest : public testing::Test {
60 public:
61 MojoSystemTest();
62 ~MojoSystemTest() override;
63
64 base::TestIOThread* test_io_thread() { return &test_io_thread_; }
65
66 private:
67 base::MessageLoop message_loop_;
68 base::TestIOThread test_io_thread_;
69 test::ScopedIPCSupport ipc_support_;
70
71 MOJO_DISALLOW_COPY_AND_ASSIGN(MojoSystemTest);
72 };
73
74 } // namespace test 55 } // namespace test
75 } // namespace edk 56 } // namespace edk
76 } // namespace mojo 57 } // namespace mojo
77 58
78 #endif // MOJO_EDK_SYSTEM_TEST_UTILS_H_ 59 #endif // MOJO_EDK_SYSTEM_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « mojo/edk/system/run_all_unittests.cc ('k') | mojo/edk/system/test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698