| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
| 6 #include "ipc/ipc_message_utils.h" | 6 #include "ipc/ipc_message_utils.h" |
| 7 #include "ppapi/c/ppb_audio.h" | 7 #include "ppapi/c/ppb_audio.h" |
| 8 #include "ppapi/c/ppp_instance.h" | 8 #include "ppapi/c/ppp_instance.h" |
| 9 #include "ppapi/proxy/ppapi_messages.h" | 9 #include "ppapi/proxy/ppapi_messages.h" |
| 10 #include "ppapi/proxy/ppapi_proxy_test.h" | 10 #include "ppapi/proxy/ppapi_proxy_test.h" |
| 11 | 11 |
| 12 using ppapi::HostResource; | 12 namespace ppapi { |
| 13 | |
| 14 namespace pp { | |
| 15 namespace proxy { | 13 namespace proxy { |
| 16 | 14 |
| 17 class HostDispatcherTest : public HostProxyTest { | 15 class HostDispatcherTest : public HostProxyTest { |
| 18 public: | 16 public: |
| 19 HostDispatcherTest() {} | 17 HostDispatcherTest() {} |
| 20 | 18 |
| 21 bool HasTargetProxy(InterfaceID id) { | 19 bool HasTargetProxy(InterfaceID id) { |
| 22 return !!host_dispatcher()->target_proxies_[id].get(); | 20 return !!host_dispatcher()->target_proxies_[id].get(); |
| 23 } | 21 } |
| 24 }; | 22 }; |
| 25 | 23 |
| 26 // TODO(brettw): Make and register an implementation of TrackerBase for this | 24 // TODO(brettw): Make and register an implementation of TrackerBase for this |
| 27 // test. Possibly fix other failures too, once that's resolved. | 25 // test. Possibly fix other failures too, once that's resolved. |
| 28 TEST_F(HostDispatcherTest, FAILS_PPBCreation) { | 26 TEST_F(HostDispatcherTest, FAILS_PPBCreation) { |
| 29 RegisterTestInterface(PPB_AUDIO_INTERFACE, | 27 RegisterTestInterface(PPB_AUDIO_INTERFACE, |
| 30 reinterpret_cast<void*>(0xdeadbeef)); | 28 reinterpret_cast<void*>(0xdeadbeef)); |
| 31 | 29 |
| 32 // Sending a PPB message out of the blue should create a target proxy for | 30 // Sending a PPB message out of the blue should create a target proxy for |
| 33 // that interface in the plugin. | 31 // that interface in the plugin. |
| 34 EXPECT_FALSE(HasTargetProxy(INTERFACE_ID_PPB_AUDIO)); | 32 EXPECT_FALSE(HasTargetProxy(INTERFACE_ID_PPB_AUDIO)); |
| 35 PpapiMsg_PPBAudio_NotifyAudioStreamCreated audio_msg( | 33 PpapiMsg_PPBAudio_NotifyAudioStreamCreated audio_msg( |
| 36 INTERFACE_ID_PPB_AUDIO, HostResource(), 0, | 34 INTERFACE_ID_PPB_AUDIO, HostResource(), 0, |
| 37 IPC::PlatformFileForTransit(), base::SharedMemoryHandle(), 0); | 35 IPC::PlatformFileForTransit(), base::SharedMemoryHandle(), 0); |
| 38 host_dispatcher()->OnMessageReceived(audio_msg); | 36 host_dispatcher()->OnMessageReceived(audio_msg); |
| 39 EXPECT_TRUE(HasTargetProxy(INTERFACE_ID_PPB_AUDIO)); | 37 EXPECT_TRUE(HasTargetProxy(INTERFACE_ID_PPB_AUDIO)); |
| 40 } | 38 } |
| 41 | 39 |
| 42 } // namespace proxy | 40 } // namespace proxy |
| 43 } // namespace pp | 41 } // namespace ppapi |
| 44 | 42 |
| OLD | NEW |