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/synchronization/waitable_event.h" | 5 #include "base/synchronization/waitable_event.h" |
6 #include "ipc/ipc_message_utils.h" | 6 #include "ipc/ipc_message_utils.h" |
7 #include "ppapi/c/dev/ppb_fullscreen_dev.h" | |
8 #include "ppapi/c/pp_var.h" | 7 #include "ppapi/c/pp_var.h" |
9 #include "ppapi/c/ppb_core.h" | 8 #include "ppapi/c/ppb_core.h" |
| 9 #include "ppapi/c/ppb_fullscreen.h" |
10 #include "ppapi/c/ppb_url_loader.h" | 10 #include "ppapi/c/ppb_url_loader.h" |
11 #include "ppapi/c/ppp_instance.h" | 11 #include "ppapi/c/ppp_instance.h" |
12 #include "ppapi/c/private/ppb_flash_fullscreen.h" | 12 #include "ppapi/c/private/ppb_flash_fullscreen.h" |
13 #include "ppapi/proxy/ppapi_messages.h" | 13 #include "ppapi/proxy/ppapi_messages.h" |
14 #include "ppapi/proxy/ppapi_proxy_test.h" | 14 #include "ppapi/proxy/ppapi_proxy_test.h" |
15 | 15 |
16 namespace ppapi { | 16 namespace ppapi { |
17 namespace proxy { | 17 namespace proxy { |
18 | 18 |
19 namespace { | 19 namespace { |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 &DidChangeView, | 88 &DidChangeView, |
89 &DidChangeFocus, | 89 &DidChangeFocus, |
90 &HandleDocumentLoad | 90 &HandleDocumentLoad |
91 }; | 91 }; |
92 | 92 |
93 // PPP_Instance_Proxy::DidChangeView relies on PPB_(Flash)Fullscreen being | 93 // PPP_Instance_Proxy::DidChangeView relies on PPB_(Flash)Fullscreen being |
94 // available with a valid implementation of IsFullScreen, so we mock it. | 94 // available with a valid implementation of IsFullScreen, so we mock it. |
95 PP_Bool IsFullscreen(PP_Instance instance) { | 95 PP_Bool IsFullscreen(PP_Instance instance) { |
96 return PP_FALSE; | 96 return PP_FALSE; |
97 } | 97 } |
98 PPB_Fullscreen_Dev ppb_fullscreen = { &IsFullscreen }; | 98 PPB_Fullscreen ppb_fullscreen = { &IsFullscreen }; |
99 PPB_FlashFullscreen ppb_flash_fullscreen = { &IsFullscreen }; | 99 PPB_FlashFullscreen ppb_flash_fullscreen = { &IsFullscreen }; |
100 | 100 |
101 } // namespace | 101 } // namespace |
102 | 102 |
103 class PPP_Instance_ProxyTest : public TwoWayTest { | 103 class PPP_Instance_ProxyTest : public TwoWayTest { |
104 public: | 104 public: |
105 PPP_Instance_ProxyTest() | 105 PPP_Instance_ProxyTest() |
106 : TwoWayTest(TwoWayTest::TEST_PPP_INTERFACE) { | 106 : TwoWayTest(TwoWayTest::TEST_PPP_INTERFACE) { |
107 } | 107 } |
108 }; | 108 }; |
109 | 109 |
110 TEST_F(PPP_Instance_ProxyTest, PPPInstance1_0) { | 110 TEST_F(PPP_Instance_ProxyTest, PPPInstance1_0) { |
111 plugin().RegisterTestInterface(PPP_INSTANCE_INTERFACE_1_0, &ppp_instance_1_0); | 111 plugin().RegisterTestInterface(PPP_INSTANCE_INTERFACE_1_0, &ppp_instance_1_0); |
112 host().RegisterTestInterface(PPB_FLASHFULLSCREEN_INTERFACE, | 112 host().RegisterTestInterface(PPB_FLASHFULLSCREEN_INTERFACE, |
113 &ppb_flash_fullscreen); | 113 &ppb_flash_fullscreen); |
114 host().RegisterTestInterface(PPB_FULLSCREEN_DEV_INTERFACE, | 114 host().RegisterTestInterface(PPB_FULLSCREEN_INTERFACE, |
115 &ppb_fullscreen); | 115 &ppb_fullscreen); |
116 | 116 |
117 // Grab the host-side proxy for the 1.0 interface. | 117 // Grab the host-side proxy for the 1.0 interface. |
118 const PPP_Instance_1_0* ppp_instance = static_cast<const PPP_Instance_1_0*>( | 118 const PPP_Instance_1_0* ppp_instance = static_cast<const PPP_Instance_1_0*>( |
119 host().host_dispatcher()->GetProxiedInterface( | 119 host().host_dispatcher()->GetProxiedInterface( |
120 PPP_INSTANCE_INTERFACE_1_0)); | 120 PPP_INSTANCE_INTERFACE_1_0)); |
121 | 121 |
122 // Call each function in turn, make sure we get the expected values and | 122 // Call each function in turn, make sure we get the expected values and |
123 // returns. | 123 // returns. |
124 // | 124 // |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 EXPECT_EQ(received_has_focus, expected_has_focus); | 173 EXPECT_EQ(received_has_focus, expected_has_focus); |
174 | 174 |
175 // TODO(dmichael): Need to mock out a resource Tracker to be able to test | 175 // TODO(dmichael): Need to mock out a resource Tracker to be able to test |
176 // HandleResourceLoad. It also requires | 176 // HandleResourceLoad. It also requires |
177 // PPB_Core.AddRefResource and for PPB_URLLoader to be | 177 // PPB_Core.AddRefResource and for PPB_URLLoader to be |
178 // registered. | 178 // registered. |
179 } | 179 } |
180 | 180 |
181 } // namespace proxy | 181 } // namespace proxy |
182 } // namespace ppapi | 182 } // namespace ppapi |
OLD | NEW |