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 namespace ppapi { | 12 namespace ppapi { |
13 namespace proxy { | 13 namespace proxy { |
14 | 14 |
15 class HostDispatcherTest : public HostProxyTest { | 15 class HostDispatcherTest : public HostProxyTest { |
16 public: | 16 public: |
17 HostDispatcherTest() {} | 17 HostDispatcherTest() {} |
18 | 18 |
19 bool HasTargetProxy(InterfaceID id) { | 19 bool HasTargetProxy(InterfaceID id) { |
20 return !!host_dispatcher()->target_proxies_[id].get(); | 20 return !!host_dispatcher()->proxies_[id].get(); |
21 } | 21 } |
22 }; | 22 }; |
23 | 23 |
24 // TODO(brettw): Make and register an implementation of TrackerBase for this | 24 // TODO(brettw): Make and register an implementation of TrackerBase for this |
25 // test. Possibly fix other failures too, once that's resolved. | 25 // test. Possibly fix other failures too, once that's resolved. |
26 TEST_F(HostDispatcherTest, FAILS_PPBCreation) { | 26 TEST_F(HostDispatcherTest, FAILS_PPBCreation) { |
27 RegisterTestInterface(PPB_AUDIO_INTERFACE, | 27 RegisterTestInterface(PPB_AUDIO_INTERFACE, |
28 reinterpret_cast<void*>(0xdeadbeef)); | 28 reinterpret_cast<void*>(0xdeadbeef)); |
29 | 29 |
30 // 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 |
31 // that interface in the plugin. | 31 // that interface in the plugin. |
32 EXPECT_FALSE(HasTargetProxy(INTERFACE_ID_PPB_AUDIO)); | 32 EXPECT_FALSE(HasTargetProxy(INTERFACE_ID_PPB_AUDIO)); |
33 PpapiMsg_PPBAudio_NotifyAudioStreamCreated audio_msg( | 33 PpapiMsg_PPBAudio_NotifyAudioStreamCreated audio_msg( |
34 INTERFACE_ID_PPB_AUDIO, HostResource(), 0, | 34 INTERFACE_ID_PPB_AUDIO, HostResource(), 0, |
35 IPC::PlatformFileForTransit(), base::SharedMemoryHandle(), 0); | 35 IPC::PlatformFileForTransit(), base::SharedMemoryHandle(), 0); |
36 host_dispatcher()->OnMessageReceived(audio_msg); | 36 host_dispatcher()->OnMessageReceived(audio_msg); |
37 EXPECT_TRUE(HasTargetProxy(INTERFACE_ID_PPB_AUDIO)); | 37 EXPECT_TRUE(HasTargetProxy(INTERFACE_ID_PPB_AUDIO)); |
38 } | 38 } |
39 | 39 |
40 } // namespace proxy | 40 } // namespace proxy |
41 } // namespace ppapi | 41 } // namespace ppapi |
42 | 42 |
OLD | NEW |