| 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. |kEpsilonMicros| may be increased to increase | 6 // heavily-loaded system). Sorry. |kEpsilonMicros| may be increased to increase |
| 7 // tolerance and reduce observed flakiness. | 7 // tolerance and reduce observed flakiness. |
| 8 | 8 |
| 9 #include "mojo/system/simple_dispatcher.h" | 9 #include "mojo/system/simple_dispatcher.h" |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 return; | 54 return; |
| 55 | 55 |
| 56 satisfiable_flags_ = new_satisfiable_flags; | 56 satisfiable_flags_ = new_satisfiable_flags; |
| 57 StateChangedNoLock(); | 57 StateChangedNoLock(); |
| 58 } | 58 } |
| 59 | 59 |
| 60 private: | 60 private: |
| 61 friend class base::RefCountedThreadSafe<MockSimpleDispatcher>; | 61 friend class base::RefCountedThreadSafe<MockSimpleDispatcher>; |
| 62 virtual ~MockSimpleDispatcher() {} | 62 virtual ~MockSimpleDispatcher() {} |
| 63 | 63 |
| 64 virtual scoped_refptr<Dispatcher> |
| 65 CreateEquivalentDispatcherAndCloseImplNoLock() OVERRIDE { |
| 66 scoped_refptr<MockSimpleDispatcher> rv(new MockSimpleDispatcher()); |
| 67 rv->satisfied_flags_ = satisfied_flags_; |
| 68 rv->satisfiable_flags_ = satisfiable_flags_; |
| 69 return scoped_refptr<Dispatcher>(rv.get()); |
| 70 } |
| 71 |
| 64 // |SimpleDispatcher| implementation: | 72 // |SimpleDispatcher| implementation: |
| 65 virtual MojoWaitFlags SatisfiedFlagsNoLock() const OVERRIDE { | 73 virtual MojoWaitFlags SatisfiedFlagsNoLock() const OVERRIDE { |
| 66 lock().AssertAcquired(); | 74 lock().AssertAcquired(); |
| 67 return satisfied_flags_; | 75 return satisfied_flags_; |
| 68 } | 76 } |
| 69 | 77 |
| 70 virtual MojoWaitFlags SatisfiableFlagsNoLock() const OVERRIDE { | 78 virtual MojoWaitFlags SatisfiableFlagsNoLock() const OVERRIDE { |
| 71 lock().AssertAcquired(); | 79 lock().AssertAcquired(); |
| 72 return satisfiable_flags_; | 80 return satisfiable_flags_; |
| 73 } | 81 } |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 EXPECT_TRUE(did_wait[i]); | 513 EXPECT_TRUE(did_wait[i]); |
| 506 EXPECT_EQ(MOJO_RESULT_DEADLINE_EXCEEDED, result[i]); | 514 EXPECT_EQ(MOJO_RESULT_DEADLINE_EXCEEDED, result[i]); |
| 507 } | 515 } |
| 508 } | 516 } |
| 509 | 517 |
| 510 // TODO(vtl): Stress test? | 518 // TODO(vtl): Stress test? |
| 511 | 519 |
| 512 } // namespace | 520 } // namespace |
| 513 } // namespace system | 521 } // namespace system |
| 514 } // namespace mojo | 522 } // namespace mojo |
| OLD | NEW |