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

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

Issue 814543006: Move //mojo/{public, edk} underneath //third_party (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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
« no previous file with comments | « mojo/edk/system/system_impl_export.h ('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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef MOJO_EDK_SYSTEM_TEST_UTILS_H_
6 #define MOJO_EDK_SYSTEM_TEST_UTILS_H_
7
8 #include "base/macros.h"
9 #include "base/time/time.h"
10
11 namespace mojo {
12 namespace system {
13 namespace test {
14
15 // A timeout smaller than |TestTimeouts::tiny_timeout()|. Warning: This may lead
16 // to flakiness, but this is unavoidable if, e.g., you're trying to ensure that
17 // functions with timeouts are reasonably accurate. We want this to be as small
18 // as possible without causing too much flakiness.
19 base::TimeDelta EpsilonTimeout();
20
21 // Stopwatch -------------------------------------------------------------------
22
23 // A simple "stopwatch" for measuring time elapsed from a given starting point.
24 class Stopwatch {
25 public:
26 Stopwatch() {}
27 ~Stopwatch() {}
28
29 void Start() { start_time_ = base::TimeTicks::Now(); }
30
31 base::TimeDelta Elapsed() { return base::TimeTicks::Now() - start_time_; }
32
33 private:
34 base::TimeTicks start_time_;
35
36 DISALLOW_COPY_AND_ASSIGN(Stopwatch);
37 };
38
39 } // namespace test
40 } // namespace system
41 } // namespace mojo
42
43 #endif // MOJO_EDK_SYSTEM_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « mojo/edk/system/system_impl_export.h ('k') | mojo/edk/system/test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698