OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ppapi/proxy/ppapi_proxy_test.h" | 5 #include "ppapi/proxy/ppapi_proxy_test.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
269 Dispatcher* HostProxyTestHarness::GetDispatcher() { | 269 Dispatcher* HostProxyTestHarness::GetDispatcher() { |
270 return host_dispatcher_.get(); | 270 return host_dispatcher_.get(); |
271 } | 271 } |
272 | 272 |
273 void HostProxyTestHarness::SetUpHarness() { | 273 void HostProxyTestHarness::SetUpHarness() { |
274 // These must be first since the dispatcher set-up uses them. | 274 // These must be first since the dispatcher set-up uses them. |
275 PpapiGlobals::SetPpapiGlobalsOnThreadForTest(GetGlobals()); | 275 PpapiGlobals::SetPpapiGlobalsOnThreadForTest(GetGlobals()); |
276 host_dispatcher_.reset(new HostDispatcher( | 276 host_dispatcher_.reset(new HostDispatcher( |
277 pp_module(), | 277 pp_module(), |
278 &MockGetInterface, | 278 &MockGetInterface, |
279 status_receiver_.get())); | 279 status_receiver_.release())); |
dmichael (off chromium)
2012/06/12 21:25:46
This was causing a crash when I tried to run the u
| |
280 host_dispatcher_->InitWithTestSink(&sink()); | 280 host_dispatcher_->InitWithTestSink(&sink()); |
281 HostDispatcher::SetForInstance(pp_instance(), host_dispatcher_.get()); | 281 HostDispatcher::SetForInstance(pp_instance(), host_dispatcher_.get()); |
282 } | 282 } |
283 | 283 |
284 void HostProxyTestHarness::SetUpHarnessWithChannel( | 284 void HostProxyTestHarness::SetUpHarnessWithChannel( |
285 const IPC::ChannelHandle& channel_handle, | 285 const IPC::ChannelHandle& channel_handle, |
286 base::MessageLoopProxy* ipc_message_loop, | 286 base::MessageLoopProxy* ipc_message_loop, |
287 base::WaitableEvent* shutdown_event, | 287 base::WaitableEvent* shutdown_event, |
288 bool is_client) { | 288 bool is_client) { |
289 // These must be first since the dispatcher set-up uses them. | 289 // These must be first since the dispatcher set-up uses them. |
290 PpapiGlobals::SetPpapiGlobalsOnThreadForTest(GetGlobals()); | 290 PpapiGlobals::SetPpapiGlobalsOnThreadForTest(GetGlobals()); |
291 delegate_mock_.Init(ipc_message_loop, shutdown_event); | 291 delegate_mock_.Init(ipc_message_loop, shutdown_event); |
292 | 292 |
293 host_dispatcher_.reset(new HostDispatcher( | 293 host_dispatcher_.reset(new HostDispatcher( |
294 pp_module(), | 294 pp_module(), |
295 &MockGetInterface, | 295 &MockGetInterface, |
296 status_receiver_.get())); | 296 status_receiver_.release())); |
297 ppapi::Preferences preferences; | 297 ppapi::Preferences preferences; |
298 host_dispatcher_->InitHostWithChannel(&delegate_mock_, channel_handle, | 298 host_dispatcher_->InitHostWithChannel(&delegate_mock_, channel_handle, |
299 is_client, preferences); | 299 is_client, preferences); |
300 HostDispatcher::SetForInstance(pp_instance(), host_dispatcher_.get()); | 300 HostDispatcher::SetForInstance(pp_instance(), host_dispatcher_.get()); |
301 } | 301 } |
302 | 302 |
303 void HostProxyTestHarness::TearDownHarness() { | 303 void HostProxyTestHarness::TearDownHarness() { |
304 HostDispatcher::RemoveForInstance(pp_instance()); | 304 HostDispatcher::RemoveForInstance(pp_instance()); |
305 host_dispatcher_.reset(); | 305 host_dispatcher_.reset(); |
306 } | 306 } |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
398 remote_harness_torn_down.Wait(); | 398 remote_harness_torn_down.Wait(); |
399 | 399 |
400 local_harness_->TearDownHarness(); | 400 local_harness_->TearDownHarness(); |
401 | 401 |
402 io_thread_.Stop(); | 402 io_thread_.Stop(); |
403 } | 403 } |
404 | 404 |
405 | 405 |
406 } // namespace proxy | 406 } // namespace proxy |
407 } // namespace ppapi | 407 } // namespace ppapi |
OLD | NEW |