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 #ifndef MOJO_EDK_SYSTEM_CORE_TEST_BASE_H_ | 5 #ifndef MOJO_EDK_SYSTEM_CORE_TEST_BASE_H_ |
6 #define MOJO_EDK_SYSTEM_CORE_TEST_BASE_H_ | 6 #define MOJO_EDK_SYSTEM_CORE_TEST_BASE_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 unsigned GetDtorCallCount() const; | 51 unsigned GetDtorCallCount() const; |
52 unsigned GetCloseCallCount() const; | 52 unsigned GetCloseCallCount() const; |
53 unsigned GetWriteMessageCallCount() const; | 53 unsigned GetWriteMessageCallCount() const; |
54 unsigned GetReadMessageCallCount() const; | 54 unsigned GetReadMessageCallCount() const; |
55 unsigned GetWriteDataCallCount() const; | 55 unsigned GetWriteDataCallCount() const; |
56 unsigned GetBeginWriteDataCallCount() const; | 56 unsigned GetBeginWriteDataCallCount() const; |
57 unsigned GetEndWriteDataCallCount() const; | 57 unsigned GetEndWriteDataCallCount() const; |
58 unsigned GetReadDataCallCount() const; | 58 unsigned GetReadDataCallCount() const; |
59 unsigned GetBeginReadDataCallCount() const; | 59 unsigned GetBeginReadDataCallCount() const; |
60 unsigned GetEndReadDataCallCount() const; | 60 unsigned GetEndReadDataCallCount() const; |
61 unsigned GetAddWaiterCallCount() const; | 61 unsigned GetAddAwakableCallCount() const; |
62 unsigned GetRemoveWaiterCallCount() const; | 62 unsigned GetRemoveAwakableCallCount() const; |
63 unsigned GetCancelAllWaitersCallCount() const; | 63 unsigned GetCancelAllAwakablesCallCount() const; |
64 | 64 |
65 // For use by |MockDispatcher|: | 65 // For use by |MockDispatcher|: |
66 void IncrementCtorCallCount(); | 66 void IncrementCtorCallCount(); |
67 void IncrementDtorCallCount(); | 67 void IncrementDtorCallCount(); |
68 void IncrementCloseCallCount(); | 68 void IncrementCloseCallCount(); |
69 void IncrementWriteMessageCallCount(); | 69 void IncrementWriteMessageCallCount(); |
70 void IncrementReadMessageCallCount(); | 70 void IncrementReadMessageCallCount(); |
71 void IncrementWriteDataCallCount(); | 71 void IncrementWriteDataCallCount(); |
72 void IncrementBeginWriteDataCallCount(); | 72 void IncrementBeginWriteDataCallCount(); |
73 void IncrementEndWriteDataCallCount(); | 73 void IncrementEndWriteDataCallCount(); |
74 void IncrementReadDataCallCount(); | 74 void IncrementReadDataCallCount(); |
75 void IncrementBeginReadDataCallCount(); | 75 void IncrementBeginReadDataCallCount(); |
76 void IncrementEndReadDataCallCount(); | 76 void IncrementEndReadDataCallCount(); |
77 void IncrementAddWaiterCallCount(); | 77 void IncrementAddAwakableCallCount(); |
78 void IncrementRemoveWaiterCallCount(); | 78 void IncrementRemoveAwakableCallCount(); |
79 void IncrementCancelAllWaitersCallCount(); | 79 void IncrementCancelAllAwakablesCallCount(); |
80 | 80 |
81 private: | 81 private: |
82 mutable base::Lock lock_; // Protects the following members. | 82 mutable base::Lock lock_; // Protects the following members. |
83 unsigned ctor_call_count_; | 83 unsigned ctor_call_count_; |
84 unsigned dtor_call_count_; | 84 unsigned dtor_call_count_; |
85 unsigned close_call_count_; | 85 unsigned close_call_count_; |
86 unsigned write_message_call_count_; | 86 unsigned write_message_call_count_; |
87 unsigned read_message_call_count_; | 87 unsigned read_message_call_count_; |
88 unsigned write_data_call_count_; | 88 unsigned write_data_call_count_; |
89 unsigned begin_write_data_call_count_; | 89 unsigned begin_write_data_call_count_; |
90 unsigned end_write_data_call_count_; | 90 unsigned end_write_data_call_count_; |
91 unsigned read_data_call_count_; | 91 unsigned read_data_call_count_; |
92 unsigned begin_read_data_call_count_; | 92 unsigned begin_read_data_call_count_; |
93 unsigned end_read_data_call_count_; | 93 unsigned end_read_data_call_count_; |
94 unsigned add_waiter_call_count_; | 94 unsigned add_awakable_call_count_; |
95 unsigned remove_waiter_call_count_; | 95 unsigned remove_awakable_call_count_; |
96 unsigned cancel_all_waiters_call_count_; | 96 unsigned cancel_all_awakables_call_count_; |
97 | 97 |
98 DISALLOW_COPY_AND_ASSIGN(CoreTestBase_MockHandleInfo); | 98 DISALLOW_COPY_AND_ASSIGN(CoreTestBase_MockHandleInfo); |
99 }; | 99 }; |
100 | 100 |
101 } // namespace test | 101 } // namespace test |
102 } // namespace system | 102 } // namespace system |
103 } // namespace mojo | 103 } // namespace mojo |
104 | 104 |
105 #endif // MOJO_EDK_SYSTEM_CORE_TEST_BASE_H_ | 105 #endif // MOJO_EDK_SYSTEM_CORE_TEST_BASE_H_ |
OLD | NEW |