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

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

Issue 1423713009: EDK: Move ref counting classes to mojo/edk/util. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 1 month 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 // 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::EpsilonTimeout()| may be increased to 6 // heavily-loaded system). Sorry. |test::EpsilonTimeout()| 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/simple_dispatcher.h" 10 #include "mojo/edk/system/simple_dispatcher.h"
11 11
12 #include <memory> 12 #include <memory>
13 #include <vector> 13 #include <vector>
14 14
15 #include "base/logging.h" 15 #include "base/logging.h"
16 #include "mojo/edk/system/ref_ptr.h"
17 #include "mojo/edk/system/test/sleep.h" 16 #include "mojo/edk/system/test/sleep.h"
18 #include "mojo/edk/system/test/stopwatch.h" 17 #include "mojo/edk/system/test/stopwatch.h"
19 #include "mojo/edk/system/test/timeouts.h" 18 #include "mojo/edk/system/test/timeouts.h"
20 #include "mojo/edk/system/thread_annotations.h" 19 #include "mojo/edk/system/thread_annotations.h"
21 #include "mojo/edk/system/waiter.h" 20 #include "mojo/edk/system/waiter.h"
22 #include "mojo/edk/system/waiter_test_utils.h" 21 #include "mojo/edk/system/waiter_test_utils.h"
23 #include "mojo/edk/util/make_unique.h" 22 #include "mojo/edk/util/make_unique.h"
23 #include "mojo/edk/util/ref_ptr.h"
24 #include "mojo/public/cpp/system/macros.h" 24 #include "mojo/public/cpp/system/macros.h"
25 #include "testing/gtest/include/gtest/gtest.h" 25 #include "testing/gtest/include/gtest/gtest.h"
26 26
27 using mojo::util::MakeRefCounted;
28 using mojo::util::RefPtr;
29
27 namespace mojo { 30 namespace mojo {
28 namespace system { 31 namespace system {
29 namespace { 32 namespace {
30 33
31 class MockSimpleDispatcher final : public SimpleDispatcher { 34 class MockSimpleDispatcher final : public SimpleDispatcher {
32 public: 35 public:
33 // Note: Use |MakeRefCounted<MockSimpleDispatcher>()|. 36 // Note: Use |MakeRefCounted<MockSimpleDispatcher>()|.
34 37
35 void SetSatisfiedSignals(MojoHandleSignals new_satisfied_signals) { 38 void SetSatisfiedSignals(MojoHandleSignals new_satisfied_signals) {
36 MutexLocker locker(&mutex()); 39 MutexLocker locker(&mutex());
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
583 // Since we closed before joining, we can't say much about what each thread 586 // Since we closed before joining, we can't say much about what each thread
584 // saw as the state. 587 // saw as the state.
585 } 588 }
586 } 589 }
587 590
588 // TODO(vtl): Stress test? 591 // TODO(vtl): Stress test?
589 592
590 } // namespace 593 } // namespace
591 } // namespace system 594 } // namespace system
592 } // namespace mojo 595 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/edk/system/shared_buffer_dispatcher_unittest.cc ('k') | mojo/edk/system/test_channel_endpoint_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698