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

Side by Side Diff: mojo/edk/system/core_test_base.h

Issue 2060943007: Make it possible to remove an Awakable with a specific "context" from a Dispatcher. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 6 months 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
« no previous file with comments | « mojo/edk/system/awakable_list_unittest.cc ('k') | mojo/edk/system/core_test_base.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 unsigned GetBeginWriteDataCallCount() const; 74 unsigned GetBeginWriteDataCallCount() const;
75 unsigned GetEndWriteDataCallCount() const; 75 unsigned GetEndWriteDataCallCount() const;
76 unsigned GetReadDataCallCount() const; 76 unsigned GetReadDataCallCount() const;
77 unsigned GetBeginReadDataCallCount() const; 77 unsigned GetBeginReadDataCallCount() const;
78 unsigned GetEndReadDataCallCount() const; 78 unsigned GetEndReadDataCallCount() const;
79 unsigned GetDuplicateBufferHandleCallCount() const; 79 unsigned GetDuplicateBufferHandleCallCount() const;
80 unsigned GetGetBufferInformationCallCount() const; 80 unsigned GetGetBufferInformationCallCount() const;
81 unsigned GetMapBufferCallCount() const; 81 unsigned GetMapBufferCallCount() const;
82 unsigned GetAddAwakableCallCount() const; 82 unsigned GetAddAwakableCallCount() const;
83 unsigned GetRemoveAwakableCallCount() const; 83 unsigned GetRemoveAwakableCallCount() const;
84 unsigned GetRemoveAwakableWithContextCallCount() const;
84 unsigned GetCancelAllStateCallCount() const; 85 unsigned GetCancelAllStateCallCount() const;
85 86
86 size_t GetAddedAwakableSize() const; 87 size_t GetAddedAwakableSize() const;
87 Awakable* GetAddedAwakableAt(unsigned i) const; 88 Awakable* GetAddedAwakableAt(unsigned i) const;
88 89
89 // For use by |MockDispatcher|: 90 // For use by |MockDispatcher|:
90 void IncrementCtorCallCount(); 91 void IncrementCtorCallCount();
91 void IncrementDtorCallCount(); 92 void IncrementDtorCallCount();
92 void IncrementCloseCallCount(); 93 void IncrementCloseCallCount();
93 void IncrementDuplicateDispatcherCallCount(); 94 void IncrementDuplicateDispatcherCallCount();
94 void IncrementWriteMessageCallCount(); 95 void IncrementWriteMessageCallCount();
95 void IncrementReadMessageCallCount(); 96 void IncrementReadMessageCallCount();
96 void IncrementWriteDataCallCount(); 97 void IncrementWriteDataCallCount();
97 void IncrementBeginWriteDataCallCount(); 98 void IncrementBeginWriteDataCallCount();
98 void IncrementEndWriteDataCallCount(); 99 void IncrementEndWriteDataCallCount();
99 void IncrementReadDataCallCount(); 100 void IncrementReadDataCallCount();
100 void IncrementBeginReadDataCallCount(); 101 void IncrementBeginReadDataCallCount();
101 void IncrementEndReadDataCallCount(); 102 void IncrementEndReadDataCallCount();
102 void IncrementDuplicateBufferHandleCallCount(); 103 void IncrementDuplicateBufferHandleCallCount();
103 void IncrementGetBufferInformationCallCount(); 104 void IncrementGetBufferInformationCallCount();
104 void IncrementMapBufferCallCount(); 105 void IncrementMapBufferCallCount();
105 void IncrementAddAwakableCallCount(); 106 void IncrementAddAwakableCallCount();
106 void IncrementRemoveAwakableCallCount(); 107 void IncrementRemoveAwakableCallCount();
108 void IncrementRemoveAwakableWithContextCallCount();
107 void IncrementCancelAllStateCallCount(); 109 void IncrementCancelAllStateCallCount();
108 110
109 void AllowAddAwakable(bool alllow); 111 void AllowAddAwakable(bool alllow);
110 bool IsAddAwakableAllowed() const; 112 bool IsAddAwakableAllowed() const;
111 void AwakableWasAdded(Awakable*); 113 void AwakableWasAdded(Awakable*);
112 114
113 private: 115 private:
114 mutable util::Mutex mutex_; 116 mutable util::Mutex mutex_;
115 unsigned ctor_call_count_ MOJO_GUARDED_BY(mutex_) = 0; 117 unsigned ctor_call_count_ MOJO_GUARDED_BY(mutex_) = 0;
116 unsigned dtor_call_count_ MOJO_GUARDED_BY(mutex_) = 0; 118 unsigned dtor_call_count_ MOJO_GUARDED_BY(mutex_) = 0;
117 unsigned close_call_count_ MOJO_GUARDED_BY(mutex_) = 0; 119 unsigned close_call_count_ MOJO_GUARDED_BY(mutex_) = 0;
118 unsigned duplicate_dispatcher_call_count_ MOJO_GUARDED_BY(mutex_) = 0; 120 unsigned duplicate_dispatcher_call_count_ MOJO_GUARDED_BY(mutex_) = 0;
119 unsigned write_message_call_count_ MOJO_GUARDED_BY(mutex_) = 0; 121 unsigned write_message_call_count_ MOJO_GUARDED_BY(mutex_) = 0;
120 unsigned read_message_call_count_ MOJO_GUARDED_BY(mutex_) = 0; 122 unsigned read_message_call_count_ MOJO_GUARDED_BY(mutex_) = 0;
121 unsigned write_data_call_count_ MOJO_GUARDED_BY(mutex_) = 0; 123 unsigned write_data_call_count_ MOJO_GUARDED_BY(mutex_) = 0;
122 unsigned begin_write_data_call_count_ MOJO_GUARDED_BY(mutex_) = 0; 124 unsigned begin_write_data_call_count_ MOJO_GUARDED_BY(mutex_) = 0;
123 unsigned end_write_data_call_count_ MOJO_GUARDED_BY(mutex_) = 0; 125 unsigned end_write_data_call_count_ MOJO_GUARDED_BY(mutex_) = 0;
124 unsigned read_data_call_count_ MOJO_GUARDED_BY(mutex_) = 0; 126 unsigned read_data_call_count_ MOJO_GUARDED_BY(mutex_) = 0;
125 unsigned begin_read_data_call_count_ MOJO_GUARDED_BY(mutex_) = 0; 127 unsigned begin_read_data_call_count_ MOJO_GUARDED_BY(mutex_) = 0;
126 unsigned end_read_data_call_count_ MOJO_GUARDED_BY(mutex_) = 0; 128 unsigned end_read_data_call_count_ MOJO_GUARDED_BY(mutex_) = 0;
127 unsigned duplicate_buffer_handle_call_count_ MOJO_GUARDED_BY(mutex_) = 0; 129 unsigned duplicate_buffer_handle_call_count_ MOJO_GUARDED_BY(mutex_) = 0;
128 unsigned get_buffer_information_call_count_ MOJO_GUARDED_BY(mutex_) = 0; 130 unsigned get_buffer_information_call_count_ MOJO_GUARDED_BY(mutex_) = 0;
129 unsigned map_buffer_call_count_ MOJO_GUARDED_BY(mutex_) = 0; 131 unsigned map_buffer_call_count_ MOJO_GUARDED_BY(mutex_) = 0;
130 unsigned add_awakable_call_count_ MOJO_GUARDED_BY(mutex_) = 0; 132 unsigned add_awakable_call_count_ MOJO_GUARDED_BY(mutex_) = 0;
131 unsigned remove_awakable_call_count_ MOJO_GUARDED_BY(mutex_) = 0; 133 unsigned remove_awakable_call_count_ MOJO_GUARDED_BY(mutex_) = 0;
134 unsigned remove_awakable_with_context_call_count_ MOJO_GUARDED_BY(mutex_) = 0;
132 unsigned cancel_all_awakables_call_count_ MOJO_GUARDED_BY(mutex_) = 0; 135 unsigned cancel_all_awakables_call_count_ MOJO_GUARDED_BY(mutex_) = 0;
133 136
134 bool add_awakable_allowed_ MOJO_GUARDED_BY(mutex_) = false; 137 bool add_awakable_allowed_ MOJO_GUARDED_BY(mutex_) = false;
135 std::vector<Awakable*> added_awakables_ MOJO_GUARDED_BY(mutex_); 138 std::vector<Awakable*> added_awakables_ MOJO_GUARDED_BY(mutex_);
136 139
137 MOJO_DISALLOW_COPY_AND_ASSIGN(CoreTestBase_MockHandleInfo); 140 MOJO_DISALLOW_COPY_AND_ASSIGN(CoreTestBase_MockHandleInfo);
138 }; 141 };
139 142
140 } // namespace test 143 } // namespace test
141 } // namespace system 144 } // namespace system
142 } // namespace mojo 145 } // namespace mojo
143 146
144 #endif // MOJO_EDK_SYSTEM_CORE_TEST_BASE_H_ 147 #endif // MOJO_EDK_SYSTEM_CORE_TEST_BASE_H_
OLDNEW
« no previous file with comments | « mojo/edk/system/awakable_list_unittest.cc ('k') | mojo/edk/system/core_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698