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

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

Issue 1755003002: Remove MOJO_DISALLOW_COPY_AND_ASSIGN and MOJO_ALLOW_UNUSED_LOCAL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 9 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/waiter_test_utils.h ('k') | mojo/edk/test/multiprocess_test_helper.h » ('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 // NOTE(vtl): Some of these tests are inherently flaky (e.g., if run on a 5 // NOTE(vtl): Some of these tests are inherently flaky (e.g., if run on a
6 // heavily-loaded system). Sorry. |test::EpsilonDeadline()| may be increased to 6 // heavily-loaded system). Sorry. |test::EpsilonDeadline()| may be increased to
7 // increase tolerance and reduce observed flakiness (though doing so reduces the 7 // increase tolerance and reduce observed flakiness (though doing so reduces the
8 // meaningfulness of the test). 8 // meaningfulness of the test).
9 9
10 #include "mojo/edk/system/waiter.h" 10 #include "mojo/edk/system/waiter.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 78
79 const MojoDeadline deadline_; 79 const MojoDeadline deadline_;
80 Waiter waiter_; // Thread-safe. 80 Waiter waiter_; // Thread-safe.
81 81
82 base::Lock lock_; // Protects the following members. 82 base::Lock lock_; // Protects the following members.
83 bool done_; 83 bool done_;
84 MojoResult result_; 84 MojoResult result_;
85 uintptr_t context_; 85 uintptr_t context_;
86 MojoDeadline elapsed_; 86 MojoDeadline elapsed_;
87 87
88 MOJO_DISALLOW_COPY_AND_ASSIGN(WaitingThread); 88 DISALLOW_COPY_AND_ASSIGN(WaitingThread);
89 }; 89 };
90 90
91 TEST(WaiterTest, Basic) { 91 TEST(WaiterTest, Basic) {
92 MojoResult result; 92 MojoResult result;
93 uintptr_t context; 93 uintptr_t context;
94 MojoDeadline elapsed; 94 MojoDeadline elapsed;
95 95
96 // Finite deadline. 96 // Finite deadline.
97 97
98 // Awake immediately after thread start. 98 // Awake immediately after thread start.
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION, result); 289 EXPECT_EQ(MOJO_RESULT_FAILED_PRECONDITION, result);
290 EXPECT_EQ(7u, context); 290 EXPECT_EQ(7u, context);
291 EXPECT_GT(elapsed, (1 - 1) * test::EpsilonDeadline()); 291 EXPECT_GT(elapsed, (1 - 1) * test::EpsilonDeadline());
292 EXPECT_LT(elapsed, (1 + 1) * test::EpsilonDeadline()); 292 EXPECT_LT(elapsed, (1 + 1) * test::EpsilonDeadline());
293 } 293 }
294 } 294 }
295 295
296 } // namespace 296 } // namespace
297 } // namespace edk 297 } // namespace edk
298 } // namespace mojo 298 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/waiter_test_utils.h ('k') | mojo/edk/test/multiprocess_test_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698