OLD | NEW |
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" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 CHECK_EQ(new_satisfiable_signals & state_.satisfied_signals, | 53 CHECK_EQ(new_satisfiable_signals & state_.satisfied_signals, |
54 state_.satisfied_signals); | 54 state_.satisfied_signals); |
55 | 55 |
56 if (new_satisfiable_signals == state_.satisfiable_signals) | 56 if (new_satisfiable_signals == state_.satisfiable_signals) |
57 return; | 57 return; |
58 | 58 |
59 state_.satisfiable_signals = new_satisfiable_signals; | 59 state_.satisfiable_signals = new_satisfiable_signals; |
60 HandleSignalsStateChangedNoLock(); | 60 HandleSignalsStateChangedNoLock(); |
61 } | 61 } |
62 | 62 |
63 Type GetType() const override { return kTypeUnknown; } | 63 Type GetType() const override { return Type::UNKNOWN; } |
64 | 64 |
65 private: | 65 private: |
66 friend class base::RefCountedThreadSafe<MockSimpleDispatcher>; | 66 friend class base::RefCountedThreadSafe<MockSimpleDispatcher>; |
67 ~MockSimpleDispatcher() override {} | 67 ~MockSimpleDispatcher() override {} |
68 | 68 |
69 scoped_refptr<Dispatcher> CreateEquivalentDispatcherAndCloseImplNoLock() | 69 scoped_refptr<Dispatcher> CreateEquivalentDispatcherAndCloseImplNoLock() |
70 override { | 70 override { |
71 scoped_refptr<MockSimpleDispatcher> rv(new MockSimpleDispatcher()); | 71 scoped_refptr<MockSimpleDispatcher> rv(new MockSimpleDispatcher()); |
72 rv->state_ = state_; | 72 rv->state_ = state_; |
73 return scoped_refptr<Dispatcher>(rv.get()); | 73 return scoped_refptr<Dispatcher>(rv.get()); |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 // Since we closed before joining, we can't say much about what each thread | 600 // Since we closed before joining, we can't say much about what each thread |
601 // saw as the state. | 601 // saw as the state. |
602 } | 602 } |
603 } | 603 } |
604 | 604 |
605 // TODO(vtl): Stress test? | 605 // TODO(vtl): Stress test? |
606 | 606 |
607 } // namespace | 607 } // namespace |
608 } // namespace system | 608 } // namespace system |
609 } // namespace mojo | 609 } // namespace mojo |
OLD | NEW |