| 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 #include "mojo/system/core_test_base.h" | 5 #include "mojo/system/core_test_base.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 } | 169 } |
| 170 | 170 |
| 171 void CoreTestBase::TearDown() { | 171 void CoreTestBase::TearDown() { |
| 172 delete core_; | 172 delete core_; |
| 173 core_ = NULL; | 173 core_ = NULL; |
| 174 } | 174 } |
| 175 | 175 |
| 176 MojoHandle CoreTestBase::CreateMockHandle(CoreTestBase::MockHandleInfo* info) { | 176 MojoHandle CoreTestBase::CreateMockHandle(CoreTestBase::MockHandleInfo* info) { |
| 177 CHECK(core_); | 177 CHECK(core_); |
| 178 scoped_refptr<MockDispatcher> dispatcher(new MockDispatcher(info)); | 178 scoped_refptr<MockDispatcher> dispatcher(new MockDispatcher(info)); |
| 179 base::AutoLock locker(core_->handle_table_lock_); | 179 return core_->AddDispatcher(dispatcher); |
| 180 return core_->AddDispatcherNoLock(dispatcher); | |
| 181 } | 180 } |
| 182 | 181 |
| 183 // CoreTestBase_MockHandleInfo ------------------------------------------------- | 182 // CoreTestBase_MockHandleInfo ------------------------------------------------- |
| 184 | 183 |
| 185 CoreTestBase_MockHandleInfo::CoreTestBase_MockHandleInfo() | 184 CoreTestBase_MockHandleInfo::CoreTestBase_MockHandleInfo() |
| 186 : ctor_call_count_(0), | 185 : ctor_call_count_(0), |
| 187 dtor_call_count_(0), | 186 dtor_call_count_(0), |
| 188 close_call_count_(0), | 187 close_call_count_(0), |
| 189 write_message_call_count_(0), | 188 write_message_call_count_(0), |
| 190 read_message_call_count_(0), | 189 read_message_call_count_(0), |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 } | 337 } |
| 339 | 338 |
| 340 void CoreTestBase_MockHandleInfo::IncrementCancelAllWaitersCallCount() { | 339 void CoreTestBase_MockHandleInfo::IncrementCancelAllWaitersCallCount() { |
| 341 base::AutoLock locker(lock_); | 340 base::AutoLock locker(lock_); |
| 342 cancel_all_waiters_call_count_++; | 341 cancel_all_waiters_call_count_++; |
| 343 } | 342 } |
| 344 | 343 |
| 345 } // namespace test | 344 } // namespace test |
| 346 } // namespace system | 345 } // namespace system |
| 347 } // namespace mojo | 346 } // namespace mojo |
| OLD | NEW |