| 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/edk/system/core_test_base.h" | 5 #include "mojo/edk/system/core_test_base.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "mojo/edk/embedder/embedder_internal.h" |
| 14 #include "mojo/edk/system/configuration.h" | 15 #include "mojo/edk/system/configuration.h" |
| 15 #include "mojo/edk/system/core.h" | 16 #include "mojo/edk/system/core.h" |
| 16 #include "mojo/edk/system/dispatcher.h" | 17 #include "mojo/edk/system/dispatcher.h" |
| 17 #include "mojo/public/cpp/system/macros.h" | 18 #include "mojo/public/cpp/system/macros.h" |
| 18 | 19 |
| 19 namespace mojo { | 20 namespace mojo { |
| 20 namespace edk { | 21 namespace edk { |
| 21 namespace test { | 22 namespace test { |
| 22 | 23 |
| 23 namespace { | 24 namespace { |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 152 |
| 152 CoreTestBase::~CoreTestBase() { | 153 CoreTestBase::~CoreTestBase() { |
| 153 } | 154 } |
| 154 | 155 |
| 155 MojoHandle CoreTestBase::CreateMockHandle(CoreTestBase::MockHandleInfo* info) { | 156 MojoHandle CoreTestBase::CreateMockHandle(CoreTestBase::MockHandleInfo* info) { |
| 156 scoped_refptr<MockDispatcher> dispatcher = MockDispatcher::Create(info); | 157 scoped_refptr<MockDispatcher> dispatcher = MockDispatcher::Create(info); |
| 157 return core()->AddDispatcher(dispatcher); | 158 return core()->AddDispatcher(dispatcher); |
| 158 } | 159 } |
| 159 | 160 |
| 160 Core* CoreTestBase::core() { | 161 Core* CoreTestBase::core() { |
| 161 return mojo::edk::internal::GetCore(); | 162 return mojo::edk::internal::g_core; |
| 162 } | 163 } |
| 163 | 164 |
| 164 // CoreTestBase_MockHandleInfo ------------------------------------------------- | 165 // CoreTestBase_MockHandleInfo ------------------------------------------------- |
| 165 | 166 |
| 166 CoreTestBase_MockHandleInfo::CoreTestBase_MockHandleInfo() | 167 CoreTestBase_MockHandleInfo::CoreTestBase_MockHandleInfo() |
| 167 : ctor_call_count_(0), | 168 : ctor_call_count_(0), |
| 168 dtor_call_count_(0), | 169 dtor_call_count_(0), |
| 169 close_call_count_(0), | 170 close_call_count_(0), |
| 170 write_message_call_count_(0), | 171 write_message_call_count_(0), |
| 171 read_message_call_count_(0), | 172 read_message_call_count_(0), |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 } | 335 } |
| 335 | 336 |
| 336 void CoreTestBase_MockHandleInfo::AwakableWasAdded(Awakable* awakable) { | 337 void CoreTestBase_MockHandleInfo::AwakableWasAdded(Awakable* awakable) { |
| 337 base::AutoLock locker(lock_); | 338 base::AutoLock locker(lock_); |
| 338 added_awakables_.push_back(awakable); | 339 added_awakables_.push_back(awakable); |
| 339 } | 340 } |
| 340 | 341 |
| 341 } // namespace test | 342 } // namespace test |
| 342 } // namespace edk | 343 } // namespace edk |
| 343 } // namespace mojo | 344 } // namespace mojo |
| OLD | NEW |