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 <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" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "mojo/edk/embedder/simple_platform_support.h" | |
13 #include "mojo/edk/system/configuration.h" | 12 #include "mojo/edk/system/configuration.h" |
14 #include "mojo/edk/system/core.h" | 13 #include "mojo/edk/system/core.h" |
15 #include "mojo/edk/system/dispatcher.h" | 14 #include "mojo/edk/system/dispatcher.h" |
16 #include "mojo/edk/system/memory.h" | 15 #include "mojo/edk/system/memory.h" |
17 | 16 |
18 namespace mojo { | 17 namespace mojo { |
19 namespace system { | 18 namespace system { |
20 namespace test { | 19 namespace test { |
21 | 20 |
22 namespace { | 21 namespace { |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 | 165 |
167 // CoreTestBase ---------------------------------------------------------------- | 166 // CoreTestBase ---------------------------------------------------------------- |
168 | 167 |
169 CoreTestBase::CoreTestBase() { | 168 CoreTestBase::CoreTestBase() { |
170 } | 169 } |
171 | 170 |
172 CoreTestBase::~CoreTestBase() { | 171 CoreTestBase::~CoreTestBase() { |
173 } | 172 } |
174 | 173 |
175 void CoreTestBase::SetUp() { | 174 void CoreTestBase::SetUp() { |
176 core_ = new Core(make_scoped_ptr(new embedder::SimplePlatformSupport())); | 175 core_ = new Core(&platform_support_); |
177 } | 176 } |
178 | 177 |
179 void CoreTestBase::TearDown() { | 178 void CoreTestBase::TearDown() { |
180 delete core_; | 179 delete core_; |
181 core_ = nullptr; | 180 core_ = nullptr; |
182 } | 181 } |
183 | 182 |
184 MojoHandle CoreTestBase::CreateMockHandle(CoreTestBase::MockHandleInfo* info) { | 183 MojoHandle CoreTestBase::CreateMockHandle(CoreTestBase::MockHandleInfo* info) { |
185 CHECK(core_); | 184 CHECK(core_); |
186 scoped_refptr<MockDispatcher> dispatcher(new MockDispatcher(info)); | 185 scoped_refptr<MockDispatcher> dispatcher(new MockDispatcher(info)); |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 } | 370 } |
372 | 371 |
373 void CoreTestBase_MockHandleInfo::AwakableWasAdded(Awakable* awakable) { | 372 void CoreTestBase_MockHandleInfo::AwakableWasAdded(Awakable* awakable) { |
374 base::AutoLock locker(lock_); | 373 base::AutoLock locker(lock_); |
375 added_awakables_.push_back(awakable); | 374 added_awakables_.push_back(awakable); |
376 } | 375 } |
377 | 376 |
378 } // namespace test | 377 } // namespace test |
379 } // namespace system | 378 } // namespace system |
380 } // namespace mojo | 379 } // namespace mojo |
OLD | NEW |