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

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

Issue 1426343002: EDK: Move mutex.*, cond_var.*, and thread_annotations.h to //mojo/edk/util. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: oops Created 5 years, 1 month 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/core.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 "mojo/edk/embedder/simple_platform_support.h" 8 #include "mojo/edk/embedder/simple_platform_support.h"
9 #include "mojo/edk/system/mutex.h" 9 #include "mojo/edk/util/mutex.h"
10 #include "mojo/edk/util/thread_annotations.h"
10 #include "mojo/public/c/system/types.h" 11 #include "mojo/public/c/system/types.h"
11 #include "mojo/public/cpp/system/macros.h" 12 #include "mojo/public/cpp/system/macros.h"
12 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
13 14
14 namespace mojo { 15 namespace mojo {
15 namespace system { 16 namespace system {
16 17
17 class Core; 18 class Core;
18 class Awakable; 19 class Awakable;
19 20
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 void IncrementEndReadDataCallCount(); 82 void IncrementEndReadDataCallCount();
82 void IncrementAddAwakableCallCount(); 83 void IncrementAddAwakableCallCount();
83 void IncrementRemoveAwakableCallCount(); 84 void IncrementRemoveAwakableCallCount();
84 void IncrementCancelAllAwakablesCallCount(); 85 void IncrementCancelAllAwakablesCallCount();
85 86
86 void AllowAddAwakable(bool alllow); 87 void AllowAddAwakable(bool alllow);
87 bool IsAddAwakableAllowed() const; 88 bool IsAddAwakableAllowed() const;
88 void AwakableWasAdded(Awakable*); 89 void AwakableWasAdded(Awakable*);
89 90
90 private: 91 private:
91 mutable Mutex mutex_; 92 mutable util::Mutex mutex_;
92 unsigned ctor_call_count_ MOJO_GUARDED_BY(mutex_); 93 unsigned ctor_call_count_ MOJO_GUARDED_BY(mutex_);
93 unsigned dtor_call_count_ MOJO_GUARDED_BY(mutex_); 94 unsigned dtor_call_count_ MOJO_GUARDED_BY(mutex_);
94 unsigned close_call_count_ MOJO_GUARDED_BY(mutex_); 95 unsigned close_call_count_ MOJO_GUARDED_BY(mutex_);
95 unsigned write_message_call_count_ MOJO_GUARDED_BY(mutex_); 96 unsigned write_message_call_count_ MOJO_GUARDED_BY(mutex_);
96 unsigned read_message_call_count_ MOJO_GUARDED_BY(mutex_); 97 unsigned read_message_call_count_ MOJO_GUARDED_BY(mutex_);
97 unsigned write_data_call_count_ MOJO_GUARDED_BY(mutex_); 98 unsigned write_data_call_count_ MOJO_GUARDED_BY(mutex_);
98 unsigned begin_write_data_call_count_ MOJO_GUARDED_BY(mutex_); 99 unsigned begin_write_data_call_count_ MOJO_GUARDED_BY(mutex_);
99 unsigned end_write_data_call_count_ MOJO_GUARDED_BY(mutex_); 100 unsigned end_write_data_call_count_ MOJO_GUARDED_BY(mutex_);
100 unsigned read_data_call_count_ MOJO_GUARDED_BY(mutex_); 101 unsigned read_data_call_count_ MOJO_GUARDED_BY(mutex_);
101 unsigned begin_read_data_call_count_ MOJO_GUARDED_BY(mutex_); 102 unsigned begin_read_data_call_count_ MOJO_GUARDED_BY(mutex_);
102 unsigned end_read_data_call_count_ MOJO_GUARDED_BY(mutex_); 103 unsigned end_read_data_call_count_ MOJO_GUARDED_BY(mutex_);
103 unsigned add_awakable_call_count_ MOJO_GUARDED_BY(mutex_); 104 unsigned add_awakable_call_count_ MOJO_GUARDED_BY(mutex_);
104 unsigned remove_awakable_call_count_ MOJO_GUARDED_BY(mutex_); 105 unsigned remove_awakable_call_count_ MOJO_GUARDED_BY(mutex_);
105 unsigned cancel_all_awakables_call_count_ MOJO_GUARDED_BY(mutex_); 106 unsigned cancel_all_awakables_call_count_ MOJO_GUARDED_BY(mutex_);
106 107
107 bool add_awakable_allowed_ MOJO_GUARDED_BY(mutex_); 108 bool add_awakable_allowed_ MOJO_GUARDED_BY(mutex_);
108 std::vector<Awakable*> added_awakables_ MOJO_GUARDED_BY(mutex_); 109 std::vector<Awakable*> added_awakables_ MOJO_GUARDED_BY(mutex_);
109 110
110 MOJO_DISALLOW_COPY_AND_ASSIGN(CoreTestBase_MockHandleInfo); 111 MOJO_DISALLOW_COPY_AND_ASSIGN(CoreTestBase_MockHandleInfo);
111 }; 112 };
112 113
113 } // namespace test 114 } // namespace test
114 } // namespace system 115 } // namespace system
115 } // namespace mojo 116 } // namespace mojo
116 117
117 #endif // MOJO_EDK_SYSTEM_CORE_TEST_BASE_H_ 118 #endif // MOJO_EDK_SYSTEM_CORE_TEST_BASE_H_
OLDNEW
« no previous file with comments | « mojo/edk/system/core.cc ('k') | mojo/edk/system/core_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698