| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "mojo/edk/util/mutex.h" | 10 #include "mojo/edk/util/mutex.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 unsigned GetDtorCallCount() const; | 60 unsigned GetDtorCallCount() const; |
| 61 unsigned GetCloseCallCount() const; | 61 unsigned GetCloseCallCount() const; |
| 62 unsigned GetWriteMessageCallCount() const; | 62 unsigned GetWriteMessageCallCount() const; |
| 63 unsigned GetReadMessageCallCount() const; | 63 unsigned GetReadMessageCallCount() const; |
| 64 unsigned GetWriteDataCallCount() const; | 64 unsigned GetWriteDataCallCount() const; |
| 65 unsigned GetBeginWriteDataCallCount() const; | 65 unsigned GetBeginWriteDataCallCount() const; |
| 66 unsigned GetEndWriteDataCallCount() const; | 66 unsigned GetEndWriteDataCallCount() const; |
| 67 unsigned GetReadDataCallCount() const; | 67 unsigned GetReadDataCallCount() const; |
| 68 unsigned GetBeginReadDataCallCount() const; | 68 unsigned GetBeginReadDataCallCount() const; |
| 69 unsigned GetEndReadDataCallCount() const; | 69 unsigned GetEndReadDataCallCount() const; |
| 70 unsigned GetDuplicateBufferHandleCallCount() const; |
| 71 unsigned GetGetBufferInformationCallCount() const; |
| 72 unsigned GetMapBufferCallCount() const; |
| 70 unsigned GetAddAwakableCallCount() const; | 73 unsigned GetAddAwakableCallCount() const; |
| 71 unsigned GetRemoveAwakableCallCount() const; | 74 unsigned GetRemoveAwakableCallCount() const; |
| 72 unsigned GetCancelAllAwakablesCallCount() const; | 75 unsigned GetCancelAllAwakablesCallCount() const; |
| 73 | 76 |
| 74 size_t GetAddedAwakableSize() const; | 77 size_t GetAddedAwakableSize() const; |
| 75 Awakable* GetAddedAwakableAt(unsigned i) const; | 78 Awakable* GetAddedAwakableAt(unsigned i) const; |
| 76 | 79 |
| 77 // For use by |MockDispatcher|: | 80 // For use by |MockDispatcher|: |
| 78 void IncrementCtorCallCount(); | 81 void IncrementCtorCallCount(); |
| 79 void IncrementDtorCallCount(); | 82 void IncrementDtorCallCount(); |
| 80 void IncrementCloseCallCount(); | 83 void IncrementCloseCallCount(); |
| 81 void IncrementWriteMessageCallCount(); | 84 void IncrementWriteMessageCallCount(); |
| 82 void IncrementReadMessageCallCount(); | 85 void IncrementReadMessageCallCount(); |
| 83 void IncrementWriteDataCallCount(); | 86 void IncrementWriteDataCallCount(); |
| 84 void IncrementBeginWriteDataCallCount(); | 87 void IncrementBeginWriteDataCallCount(); |
| 85 void IncrementEndWriteDataCallCount(); | 88 void IncrementEndWriteDataCallCount(); |
| 86 void IncrementReadDataCallCount(); | 89 void IncrementReadDataCallCount(); |
| 87 void IncrementBeginReadDataCallCount(); | 90 void IncrementBeginReadDataCallCount(); |
| 88 void IncrementEndReadDataCallCount(); | 91 void IncrementEndReadDataCallCount(); |
| 92 void IncrementDuplicateBufferHandleCallCount(); |
| 93 void IncrementGetBufferInformationCallCount(); |
| 94 void IncrementMapBufferCallCount(); |
| 89 void IncrementAddAwakableCallCount(); | 95 void IncrementAddAwakableCallCount(); |
| 90 void IncrementRemoveAwakableCallCount(); | 96 void IncrementRemoveAwakableCallCount(); |
| 91 void IncrementCancelAllAwakablesCallCount(); | 97 void IncrementCancelAllAwakablesCallCount(); |
| 92 | 98 |
| 93 void AllowAddAwakable(bool alllow); | 99 void AllowAddAwakable(bool alllow); |
| 94 bool IsAddAwakableAllowed() const; | 100 bool IsAddAwakableAllowed() const; |
| 95 void AwakableWasAdded(Awakable*); | 101 void AwakableWasAdded(Awakable*); |
| 96 | 102 |
| 97 private: | 103 private: |
| 98 mutable util::Mutex mutex_; | 104 mutable util::Mutex mutex_; |
| 99 unsigned ctor_call_count_ MOJO_GUARDED_BY(mutex_); | 105 unsigned ctor_call_count_ MOJO_GUARDED_BY(mutex_) = 0; |
| 100 unsigned dtor_call_count_ MOJO_GUARDED_BY(mutex_); | 106 unsigned dtor_call_count_ MOJO_GUARDED_BY(mutex_) = 0; |
| 101 unsigned close_call_count_ MOJO_GUARDED_BY(mutex_); | 107 unsigned close_call_count_ MOJO_GUARDED_BY(mutex_) = 0; |
| 102 unsigned write_message_call_count_ MOJO_GUARDED_BY(mutex_); | 108 unsigned write_message_call_count_ MOJO_GUARDED_BY(mutex_) = 0; |
| 103 unsigned read_message_call_count_ MOJO_GUARDED_BY(mutex_); | 109 unsigned read_message_call_count_ MOJO_GUARDED_BY(mutex_) = 0; |
| 104 unsigned write_data_call_count_ MOJO_GUARDED_BY(mutex_); | 110 unsigned write_data_call_count_ MOJO_GUARDED_BY(mutex_) = 0; |
| 105 unsigned begin_write_data_call_count_ MOJO_GUARDED_BY(mutex_); | 111 unsigned begin_write_data_call_count_ MOJO_GUARDED_BY(mutex_) = 0; |
| 106 unsigned end_write_data_call_count_ MOJO_GUARDED_BY(mutex_); | 112 unsigned end_write_data_call_count_ MOJO_GUARDED_BY(mutex_) = 0; |
| 107 unsigned read_data_call_count_ MOJO_GUARDED_BY(mutex_); | 113 unsigned read_data_call_count_ MOJO_GUARDED_BY(mutex_) = 0; |
| 108 unsigned begin_read_data_call_count_ MOJO_GUARDED_BY(mutex_); | 114 unsigned begin_read_data_call_count_ MOJO_GUARDED_BY(mutex_) = 0; |
| 109 unsigned end_read_data_call_count_ MOJO_GUARDED_BY(mutex_); | 115 unsigned end_read_data_call_count_ MOJO_GUARDED_BY(mutex_) = 0; |
| 110 unsigned add_awakable_call_count_ MOJO_GUARDED_BY(mutex_); | 116 unsigned duplicate_buffer_handle_call_count_ MOJO_GUARDED_BY(mutex_) = 0; |
| 111 unsigned remove_awakable_call_count_ MOJO_GUARDED_BY(mutex_); | 117 unsigned get_buffer_information_call_count_ MOJO_GUARDED_BY(mutex_) = 0; |
| 112 unsigned cancel_all_awakables_call_count_ MOJO_GUARDED_BY(mutex_); | 118 unsigned map_buffer_call_count_ MOJO_GUARDED_BY(mutex_) = 0; |
| 119 unsigned add_awakable_call_count_ MOJO_GUARDED_BY(mutex_) = 0; |
| 120 unsigned remove_awakable_call_count_ MOJO_GUARDED_BY(mutex_) = 0; |
| 121 unsigned cancel_all_awakables_call_count_ MOJO_GUARDED_BY(mutex_) = 0; |
| 113 | 122 |
| 114 bool add_awakable_allowed_ MOJO_GUARDED_BY(mutex_); | 123 bool add_awakable_allowed_ MOJO_GUARDED_BY(mutex_) = false; |
| 115 std::vector<Awakable*> added_awakables_ MOJO_GUARDED_BY(mutex_); | 124 std::vector<Awakable*> added_awakables_ MOJO_GUARDED_BY(mutex_); |
| 116 | 125 |
| 117 MOJO_DISALLOW_COPY_AND_ASSIGN(CoreTestBase_MockHandleInfo); | 126 MOJO_DISALLOW_COPY_AND_ASSIGN(CoreTestBase_MockHandleInfo); |
| 118 }; | 127 }; |
| 119 | 128 |
| 120 } // namespace test | 129 } // namespace test |
| 121 } // namespace system | 130 } // namespace system |
| 122 } // namespace mojo | 131 } // namespace mojo |
| 123 | 132 |
| 124 #endif // MOJO_EDK_SYSTEM_CORE_TEST_BASE_H_ | 133 #endif // MOJO_EDK_SYSTEM_CORE_TEST_BASE_H_ |
| OLD | NEW |