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

Side by Side Diff: mojo/edk/system/core_unittest.cc

Issue 1154903003: "typedef Foo Bar" -> "using Bar = Foo" in //mojo/edk/.... (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 7 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
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/edk/system/core.h" 5 #include "mojo/edk/system/core.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <limits> 9 #include <limits>
10 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/threading/platform_thread.h" 12 #include "base/threading/platform_thread.h"
13 #include "base/time/time.h" 13 #include "base/time/time.h"
14 #include "mojo/edk/system/awakable.h" 14 #include "mojo/edk/system/awakable.h"
15 #include "mojo/edk/system/core_test_base.h" 15 #include "mojo/edk/system/core_test_base.h"
16 16
17 namespace mojo { 17 namespace mojo {
18 namespace system { 18 namespace system {
19 namespace { 19 namespace {
20 20
21 const MojoHandleSignalsState kEmptyMojoHandleSignalsState = {0u, 0u}; 21 const MojoHandleSignalsState kEmptyMojoHandleSignalsState = {0u, 0u};
22 const MojoHandleSignalsState kFullMojoHandleSignalsState = {~0u, ~0u}; 22 const MojoHandleSignalsState kFullMojoHandleSignalsState = {~0u, ~0u};
23 const MojoHandleSignals kAllSignals = MOJO_HANDLE_SIGNAL_READABLE | 23 const MojoHandleSignals kAllSignals = MOJO_HANDLE_SIGNAL_READABLE |
24 MOJO_HANDLE_SIGNAL_WRITABLE | 24 MOJO_HANDLE_SIGNAL_WRITABLE |
25 MOJO_HANDLE_SIGNAL_PEER_CLOSED; 25 MOJO_HANDLE_SIGNAL_PEER_CLOSED;
26 26
27 typedef test::CoreTestBase CoreTest; 27 using CoreTest = test::CoreTestBase;
28 28
29 TEST_F(CoreTest, GetTimeTicksNow) { 29 TEST_F(CoreTest, GetTimeTicksNow) {
30 const MojoTimeTicks start = core()->GetTimeTicksNow(); 30 const MojoTimeTicks start = core()->GetTimeTicksNow();
31 EXPECT_NE(static_cast<MojoTimeTicks>(0), start) 31 EXPECT_NE(static_cast<MojoTimeTicks>(0), start)
32 << "GetTimeTicksNow should return nonzero value"; 32 << "GetTimeTicksNow should return nonzero value";
33 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(15)); 33 base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(15));
34 const MojoTimeTicks finish = core()->GetTimeTicksNow(); 34 const MojoTimeTicks finish = core()->GetTimeTicksNow();
35 // Allow for some fuzz in sleep. 35 // Allow for some fuzz in sleep.
36 EXPECT_GE((finish - start), static_cast<MojoTimeTicks>(8000)) 36 EXPECT_GE((finish - start), static_cast<MojoTimeTicks>(8000))
37 << "Sleeping should result in increasing time ticks"; 37 << "Sleeping should result in increasing time ticks";
(...skipping 1270 matching lines...) Expand 10 before | Expand all | Expand 10 after
1308 EXPECT_EQ(MOJO_RESULT_BUSY, waiter.result); 1308 EXPECT_EQ(MOJO_RESULT_BUSY, waiter.result);
1309 1309
1310 EXPECT_EQ(MOJO_RESULT_OK, core()->Close(h)); 1310 EXPECT_EQ(MOJO_RESULT_OK, core()->Close(h));
1311 } 1311 }
1312 1312
1313 // TODO(vtl): Test |DuplicateBufferHandle()| and |MapBuffer()|. 1313 // TODO(vtl): Test |DuplicateBufferHandle()| and |MapBuffer()|.
1314 1314
1315 } // namespace 1315 } // namespace
1316 } // namespace system 1316 } // namespace system
1317 } // namespace mojo 1317 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698