summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorpolina@google.com <polina@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-02 13:43:33 +0000
committerpolina@google.com <polina@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-02 13:43:33 +0000
commit8231db6b640aad0149ab9bae1ff24399f15aca35 (patch)
tree3e319531d2c27dc80f5e5e8947fefb2acbcf8a6a /ppapi
parentdd210274d48fafc16e6dcf7caad0a5a2456141ec (diff)
downloadchromium_src-8231db6b640aad0149ab9bae1ff24399f15aca35.zip
chromium_src-8231db6b640aad0149ab9bae1ff24399f15aca35.tar.gz
chromium_src-8231db6b640aad0149ab9bae1ff24399f15aca35.tar.bz2
NaCl Proxy: add support and testing for PPB_Fullscreen_Dev.
BUG= http://code.google.com/p/nativeclient/issues/detail?id=908 TEST=scons run_ppapi_ppb_fullscreen_browser_test Review URL: http://codereview.chromium.org/7756021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99359 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/browser_globals.cc9
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/browser_globals.h6
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_fullscreen_rpc_server.cc76
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/build.scons4
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/nacl.scons4
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc4
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.cc88
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.h24
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/ppapi_proxy.gyp3
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/ppb_fullscreen.srpc31
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/ppb_rpc_client.cc57
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/ppb_rpc_server.cc48
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/trusted/srpcgen/ppb_rpc.h27
-rw-r--r--ppapi/native_client/src/shared/ppapi_proxy/untrusted/srpcgen/ppb_rpc.h24
-rw-r--r--ppapi/native_client/src/trusted/plugin/plugin.cc10
-rw-r--r--ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/nacl.scons39
-rw-r--r--ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/ppapi_ppb_fullscreen.cc195
-rw-r--r--ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/ppapi_ppb_fullscreen.html64
-rw-r--r--ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/ppapi_ppb_fullscreen.nmf7
-rw-r--r--ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.cc9
-rw-r--r--ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.h4
-rw-r--r--ppapi/native_client/tests/ppapi_test_lib/nacl.scons15
22 files changed, 726 insertions, 22 deletions
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.cc b/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.cc
index b1fa08e..566dcf6 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.cc
+++ b/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Native Client Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -356,6 +356,13 @@ const PPB_Font_Dev* PPBFontInterface() {
return ppb;
}
+const PPB_Fullscreen_Dev* PPBFullscreenInterface() {
+ static const PPB_Fullscreen_Dev* ppb =
+ static_cast<const PPB_Fullscreen_Dev*>(
+ GetBrowserInterfaceSafe(PPB_FULLSCREEN_DEV_INTERFACE));
+ return ppb;
+}
+
const PPB_Scrollbar_Dev* PPBScrollbarInterface() {
static const PPB_Scrollbar_Dev* ppb =
static_cast<const PPB_Scrollbar_Dev*>(
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.h b/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.h
index b90ee90..e0d17a1 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.h
+++ b/ppapi/native_client/src/shared/ppapi_proxy/browser_globals.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Native Client Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -7,9 +7,10 @@
#include "ppapi/c/dev/ppb_cursor_control_dev.h"
#include "ppapi/c/dev/ppb_find_dev.h"
+#include "ppapi/c/dev/ppb_font_dev.h"
+#include "ppapi/c/dev/ppb_fullscreen_dev.h"
#include "ppapi/c/dev/ppb_graphics_3d_dev.h"
#include "ppapi/c/dev/ppb_graphics_3d_trusted_dev.h"
-#include "ppapi/c/dev/ppb_font_dev.h"
#include "ppapi/c/dev/ppb_memory_dev.h"
#include "ppapi/c/dev/ppb_scrollbar_dev.h"
#include "ppapi/c/dev/ppb_testing_dev.h"
@@ -102,6 +103,7 @@ const PPB_FileRef* PPBFileRefInterface();
const PPB_FileSystem* PPBFileSystemInterface();
const PPB_Find_Dev* PPBFindInterface();
const PPB_Font_Dev* PPBFontInterface();
+const PPB_Fullscreen_Dev* PPBFullscreenInterface();
const PPB_Graphics2D* PPBGraphics2DInterface();
const PPB_Graphics3D_Dev* PPBGraphics3DInterface();
const PPB_Graphics3DTrusted_Dev* PPBGraphics3DTrustedInterface();
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_fullscreen_rpc_server.cc b/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_fullscreen_rpc_server.cc
new file mode 100644
index 0000000..1ac8edd
--- /dev/null
+++ b/ppapi/native_client/src/shared/ppapi_proxy/browser_ppb_fullscreen_rpc_server.cc
@@ -0,0 +1,76 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// SRPC-abstraction wrappers around PPB_Fullscreen_Dev functions.
+
+#include "native_client/src/shared/ppapi_proxy/browser_globals.h"
+#include "native_client/src/shared/ppapi_proxy/utility.h"
+#include "ppapi/c/dev/ppb_fullscreen_dev.h"
+#include "ppapi/c/pp_size.h"
+#include "srpcgen/ppb_rpc.h"
+
+using ppapi_proxy::DebugPrintf;
+using ppapi_proxy::PPBFullscreenInterface;
+
+void PpbFullscreenRpcServer::PPB_Fullscreen_IsFullscreen(
+ NaClSrpcRpc* rpc,
+ NaClSrpcClosure* done,
+ // inputs
+ PP_Instance instance,
+ // outputs
+ int32_t* success) {
+ NaClSrpcClosureRunner runner(done);
+ rpc->result = NACL_SRPC_RESULT_APP_ERROR;
+
+ PP_Bool pp_success = PPBFullscreenInterface()->IsFullscreen(instance);
+ DebugPrintf("PPB_Fullscreen::IsFullscreen: pp_success=%d\n", pp_success);
+
+ *success = (pp_success == PP_TRUE);
+ rpc->result = NACL_SRPC_RESULT_OK;
+}
+
+
+void PpbFullscreenRpcServer::PPB_Fullscreen_SetFullscreen(
+ NaClSrpcRpc* rpc,
+ NaClSrpcClosure* done,
+ // inputs
+ PP_Instance instance,
+ int32_t fullscreen,
+ // outputs
+ int32_t* success) {
+ NaClSrpcClosureRunner runner(done);
+ rpc->result = NACL_SRPC_RESULT_APP_ERROR;
+
+ PP_Bool pp_success = PPBFullscreenInterface()->SetFullscreen(
+ instance,
+ (fullscreen ? PP_TRUE : PP_FALSE));
+ DebugPrintf("PPB_Fullscreen::SetFullscreen: pp_success=%d\n", pp_success);
+
+ *success = (pp_success == PP_TRUE);
+ rpc->result = NACL_SRPC_RESULT_OK;
+}
+
+
+void PpbFullscreenRpcServer::PPB_Fullscreen_GetScreenSize(
+ NaClSrpcRpc* rpc,
+ NaClSrpcClosure* done,
+ // inputs
+ PP_Instance instance,
+ // outputs
+ nacl_abi_size_t* size_bytes, char* size,
+ int32_t* success) {
+ NaClSrpcClosureRunner runner(done);
+ rpc->result = NACL_SRPC_RESULT_APP_ERROR;
+ *success = 0;
+ if (*size_bytes != sizeof(struct PP_Size))
+ return;
+
+ PP_Bool pp_success = PPBFullscreenInterface()->GetScreenSize(
+ instance,
+ reinterpret_cast<struct PP_Size*>(size));
+ DebugPrintf("PPB_Fullscreen::SetFullscreen: pp_success=%d\n", pp_success);
+
+ *success = (pp_success == PP_TRUE);
+ rpc->result = NACL_SRPC_RESULT_OK;
+}
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/build.scons b/ppapi/native_client/src/shared/ppapi_proxy/build.scons
index 4c0286e..1e6158c 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/build.scons
+++ b/ppapi/native_client/src/shared/ppapi_proxy/build.scons
@@ -1,5 +1,5 @@
# -*- python -*-
-# Copyright 2011 The Native Client Authors. All rights reserved.
+# Copyright 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.
@@ -70,6 +70,7 @@ env.TrustedSrpc(is_client=False,
'ppb_file_system.srpc',
'ppb_find.srpc',
'ppb_font.srpc',
+ 'ppb_fullscreen.srpc',
'ppb_graphics_2d.srpc',
'ppb_graphics_3d.srpc',
'ppb_image_data.srpc',
@@ -113,6 +114,7 @@ env.DualLibrary('ppapi_browser',
'browser_ppb_file_system_rpc_server.cc',
'browser_ppb_find_rpc_server.cc',
'browser_ppb_font_rpc_server.cc',
+ 'browser_ppb_fullscreen_rpc_server.cc',
'browser_ppb_graphics_2d_rpc_server.cc',
'browser_ppb_graphics_3d_rpc_server.cc',
'browser_ppb_image_data_rpc_server.cc',
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/nacl.scons b/ppapi/native_client/src/shared/ppapi_proxy/nacl.scons
index ee1531b..248d4c8 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/nacl.scons
+++ b/ppapi/native_client/src/shared/ppapi_proxy/nacl.scons
@@ -1,5 +1,5 @@
# -*- python -*-
-# Copyright (c) 2011 The Native Client Authors. All rights reserved.
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -56,6 +56,7 @@ env.UntrustedSrpc(is_client=True,
'ppb_file_system.srpc',
'ppb_find.srpc',
'ppb_font.srpc',
+ 'ppb_fullscreen.srpc',
'ppb_graphics_2d.srpc',
'ppb_graphics_3d.srpc',
'ppb_image_data.srpc',
@@ -129,6 +130,7 @@ libppruntime = env.NaClSdkLibrary(
'plugin_ppb_file_ref.cc',
'plugin_ppb_find.cc',
'plugin_ppb_font.cc',
+ 'plugin_ppb_fullscreen.cc',
'plugin_ppb_graphics_2d.cc',
'plugin_ppb_graphics_3d.cc',
'plugin_ppb_image_data.cc',
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc
index 1c1140c..8032f84 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc
+++ b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Native Client Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
@@ -17,6 +17,7 @@
#include "native_client/src/shared/ppapi_proxy/plugin_ppb_file_system.h"
#include "native_client/src/shared/ppapi_proxy/plugin_ppb_find.h"
#include "native_client/src/shared/ppapi_proxy/plugin_ppb_font.h"
+#include "native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.h"
#include "native_client/src/shared/ppapi_proxy/plugin_ppb_graphics_2d.h"
#include "native_client/src/shared/ppapi_proxy/plugin_ppb_graphics_3d.h"
#include "native_client/src/shared/ppapi_proxy/plugin_ppb_image_data.h"
@@ -58,6 +59,7 @@ InterfaceMapElement interface_map[] = {
{ PPB_FILESYSTEM_INTERFACE, PluginFileSystem::GetInterface(), true },
{ PPB_FIND_DEV_INTERFACE, PluginFind::GetInterface(), true },
{ PPB_FONT_DEV_INTERFACE, PluginFont::GetInterface(), true },
+ { PPB_FULLSCREEN_DEV_INTERFACE, PluginFullscreen::GetInterface(), true },
{ PPB_GRAPHICS_2D_INTERFACE, PluginGraphics2D::GetInterface(), true },
{ PPB_GRAPHICS_3D_DEV_INTERFACE, PluginGraphics3D::GetInterface(), true },
{ PPB_IMAGEDATA_INTERFACE, PluginImageData::GetInterface(), true },
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.cc b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.cc
new file mode 100644
index 0000000..3890bbb
--- /dev/null
+++ b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.cc
@@ -0,0 +1,88 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.h"
+#include "native_client/src/shared/ppapi_proxy/plugin_globals.h"
+#include "native_client/src/shared/ppapi_proxy/utility.h"
+#include "ppapi/c/dev/ppb_fullscreen_dev.h"
+#include "ppapi/c/pp_size.h"
+#include "srpcgen/ppb_rpc.h"
+
+namespace ppapi_proxy {
+
+namespace {
+
+PP_Bool IsFullscreen(PP_Instance instance) {
+ DebugPrintf("PPB_Fullscreen::IsFullscreen: instance=%"NACL_PRIu32"\n",
+ instance);
+
+ int32_t success;
+ NaClSrpcError srpc_result =
+ PpbFullscreenRpcClient::PPB_Fullscreen_IsFullscreen(
+ GetMainSrpcChannel(), instance, &success);
+ DebugPrintf("PPB_Fullscreen::IsFullscreen: %s\n",
+ NaClSrpcErrorString(srpc_result));
+
+ if (srpc_result == NACL_SRPC_RESULT_OK && success)
+ return PP_TRUE;
+ return PP_FALSE;
+}
+
+
+PP_Bool SetFullscreen(PP_Instance instance, PP_Bool fullscreen) {
+ DebugPrintf("PPB_Fullscreen::SetFullscreen: "
+ "instance=%"NACL_PRIu32" fullscreen=%d\n", instance, fullscreen);
+
+ int32_t success;
+ NaClSrpcError srpc_result =
+ PpbFullscreenRpcClient::PPB_Fullscreen_SetFullscreen(
+ GetMainSrpcChannel(),
+ instance,
+ static_cast<int32_t>(fullscreen),
+ &success);
+ DebugPrintf("PPB_Fullscreen::SetFullscreen: %s\n",
+ NaClSrpcErrorString(srpc_result));
+
+ if (srpc_result == NACL_SRPC_RESULT_OK && success)
+ return PP_TRUE;
+ return PP_FALSE;
+}
+
+
+PP_Bool GetScreenSize(PP_Instance instance, struct PP_Size* size) {
+ DebugPrintf("PPB_Fullscreen::GetScreenSize: instance=%"NACL_PRIu32"\n",
+ instance);
+ if (size == NULL)
+ return PP_FALSE;
+
+ int32_t success;
+ nacl_abi_size_t size_bytes =
+ static_cast<nacl_abi_size_t>(sizeof(struct PP_Size));
+ NaClSrpcError srpc_result =
+ PpbFullscreenRpcClient::PPB_Fullscreen_GetScreenSize(
+ GetMainSrpcChannel(),
+ instance,
+ &size_bytes,
+ reinterpret_cast<char*>(size),
+ &success);
+ DebugPrintf("PPB_Fullscreen::GetScreenSize: %s\n",
+ NaClSrpcErrorString(srpc_result));
+
+ if (srpc_result == NACL_SRPC_RESULT_OK && success)
+ return PP_TRUE;
+ return PP_FALSE;
+}
+
+} // namespace
+
+const PPB_Fullscreen_Dev* PluginFullscreen::GetInterface() {
+ static const PPB_Fullscreen_Dev fullscreen_interface = {
+ IsFullscreen,
+ SetFullscreen,
+ GetScreenSize
+ };
+ return &fullscreen_interface;
+}
+
+} // namespace ppapi_proxy
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.h b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.h
new file mode 100644
index 0000000..02b5503
--- /dev/null
+++ b/ppapi/native_client/src/shared/ppapi_proxy/plugin_ppb_fullscreen.h
@@ -0,0 +1,24 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_PPB_FULLSCREEN_H_
+#define NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_PPB_FULLSCREEN_H_
+
+#include "native_client/src/include/nacl_macros.h"
+#include "ppapi/c/dev/ppb_fullscreen_dev.h"
+
+namespace ppapi_proxy {
+
+// Implements the untrusted side of the PPB_Fullscreen_Dev interface.
+class PluginFullscreen {
+ public:
+ static const PPB_Fullscreen_Dev* GetInterface();
+
+ private:
+ NACL_DISALLOW_COPY_AND_ASSIGN(PluginFullscreen);
+};
+
+} // namespace ppapi_proxy
+
+#endif // NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PLUGIN_PPB_FULLSCREEN_H_
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/ppapi_proxy.gyp b/ppapi/native_client/src/shared/ppapi_proxy/ppapi_proxy.gyp
index 64996bf..186cfea 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/ppapi_proxy.gyp
+++ b/ppapi/native_client/src/shared/ppapi_proxy/ppapi_proxy.gyp
@@ -1,4 +1,4 @@
-# Copyright (c) 2011 The Native Client Authors. All rights reserved.
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -23,6 +23,7 @@
'browser_ppb_file_system_rpc_server.cc',
'browser_ppb_find_rpc_server.cc',
'browser_ppb_font_rpc_server.cc',
+ 'browser_ppb_fullscreen_rpc_server.cc',
'browser_ppb_graphics_2d_rpc_server.cc',
'browser_ppb_graphics_3d_rpc_server.cc',
'browser_ppb_image_data_rpc_server.cc',
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/ppb_fullscreen.srpc b/ppapi/native_client/src/shared/ppapi_proxy/ppb_fullscreen.srpc
new file mode 100644
index 0000000..6dd7186
--- /dev/null
+++ b/ppapi/native_client/src/shared/ppapi_proxy/ppb_fullscreen.srpc
@@ -0,0 +1,31 @@
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# RPC methods used to implement PPB_Fullscreen_Dev interface.
+# See ppapi/c/dev/ppb_fullscreen_dev.h for interface details.
+{
+ 'name': 'PpbFullscreenRpc',
+ 'rpcs': [
+ {'name': 'PPB_Fullscreen_IsFullscreen',
+ 'inputs': [['instance', 'PP_Instance'], # PP_Instance
+ ],
+ 'outputs': [['success', 'int32_t'], # PP_Bool
+ ]
+ },
+ {'name': 'PPB_Fullscreen_SetFullscreen',
+ 'inputs': [['instance', 'PP_Instance'], # PP_Instance
+ ['fullscreen', 'int32_t'], # PP_Bool
+ ],
+ 'outputs': [['success', 'int32_t'], # PP_Bool
+ ]
+ },
+ {'name': 'PPB_Fullscreen_GetScreenSize',
+ 'inputs': [['instance', 'PP_Instance'], # PP_Instance
+ ],
+ 'outputs': [['size', 'char[]'], # PP_Size*
+ ['success', 'int32_t'], # PP_Bool
+ ]
+ },
+ ]
+}
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/ppb_rpc_client.cc b/ppapi/native_client/src/shared/ppapi_proxy/ppb_rpc_client.cc
index c953112..a4b5ead 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/ppb_rpc_client.cc
+++ b/ppapi/native_client/src/shared/ppapi_proxy/ppb_rpc_client.cc
@@ -1120,6 +1120,61 @@ NaClSrpcError PpbFontRpcClient::PPB_Font_PixelOffsetForCharacter(
return retval;
}
+NaClSrpcError PpbFullscreenRpcClient::PPB_Fullscreen_IsFullscreen(
+ NaClSrpcChannel* channel,
+ PP_Instance instance,
+ int32_t* success) {
+ VCHECK(ppapi_proxy::PPBCoreInterface()->IsMainThread(),
+ ("%s: PPAPI calls are not supported off the main thread\n",
+ __FUNCTION__));
+ NaClSrpcError retval;
+ retval = NaClSrpcInvokeBySignature(
+ channel,
+ "PPB_Fullscreen_IsFullscreen:i:i",
+ instance,
+ success
+ );
+ return retval;
+}
+
+NaClSrpcError PpbFullscreenRpcClient::PPB_Fullscreen_SetFullscreen(
+ NaClSrpcChannel* channel,
+ PP_Instance instance,
+ int32_t fullscreen,
+ int32_t* success) {
+ VCHECK(ppapi_proxy::PPBCoreInterface()->IsMainThread(),
+ ("%s: PPAPI calls are not supported off the main thread\n",
+ __FUNCTION__));
+ NaClSrpcError retval;
+ retval = NaClSrpcInvokeBySignature(
+ channel,
+ "PPB_Fullscreen_SetFullscreen:ii:i",
+ instance,
+ fullscreen,
+ success
+ );
+ return retval;
+}
+
+NaClSrpcError PpbFullscreenRpcClient::PPB_Fullscreen_GetScreenSize(
+ NaClSrpcChannel* channel,
+ PP_Instance instance,
+ nacl_abi_size_t* size_bytes, char* size,
+ int32_t* success) {
+ VCHECK(ppapi_proxy::PPBCoreInterface()->IsMainThread(),
+ ("%s: PPAPI calls are not supported off the main thread\n",
+ __FUNCTION__));
+ NaClSrpcError retval;
+ retval = NaClSrpcInvokeBySignature(
+ channel,
+ "PPB_Fullscreen_GetScreenSize:i:Ci",
+ instance,
+ size_bytes, size,
+ success
+ );
+ return retval;
+}
+
NaClSrpcError PpbGraphics2DRpcClient::PPB_Graphics2D_Create(
NaClSrpcChannel* channel,
PP_Instance instance,
@@ -2696,5 +2751,3 @@ NaClSrpcError PpbZoomRpcClient::PPB_Zoom_ZoomLimitsChanged(
);
return retval;
}
-
-
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/ppb_rpc_server.cc b/ppapi/native_client/src/shared/ppapi_proxy/ppb_rpc_server.cc
index dc5c19c..f1268fa 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/ppb_rpc_server.cc
+++ b/ppapi/native_client/src/shared/ppapi_proxy/ppb_rpc_server.cc
@@ -903,6 +903,50 @@ static void PPB_Font_PixelOffsetForCharacterDispatcher(
);
}
+static void PPB_Fullscreen_IsFullscreenDispatcher(
+ NaClSrpcRpc* rpc,
+ NaClSrpcArg** inputs,
+ NaClSrpcArg** outputs,
+ NaClSrpcClosure* done
+) {
+ PpbFullscreenRpcServer::PPB_Fullscreen_IsFullscreen(
+ rpc,
+ done,
+ inputs[0]->u.ival,
+ &(outputs[0]->u.ival)
+ );
+}
+
+static void PPB_Fullscreen_SetFullscreenDispatcher(
+ NaClSrpcRpc* rpc,
+ NaClSrpcArg** inputs,
+ NaClSrpcArg** outputs,
+ NaClSrpcClosure* done
+) {
+ PpbFullscreenRpcServer::PPB_Fullscreen_SetFullscreen(
+ rpc,
+ done,
+ inputs[0]->u.ival,
+ inputs[1]->u.ival,
+ &(outputs[0]->u.ival)
+ );
+}
+
+static void PPB_Fullscreen_GetScreenSizeDispatcher(
+ NaClSrpcRpc* rpc,
+ NaClSrpcArg** inputs,
+ NaClSrpcArg** outputs,
+ NaClSrpcClosure* done
+) {
+ PpbFullscreenRpcServer::PPB_Fullscreen_GetScreenSize(
+ rpc,
+ done,
+ inputs[0]->u.ival,
+ &(outputs[0]->u.count), outputs[0]->arrays.carr,
+ &(outputs[1]->u.ival)
+ );
+}
+
static void PPB_Graphics2D_CreateDispatcher(
NaClSrpcRpc* rpc,
NaClSrpcArg** inputs,
@@ -2234,6 +2278,9 @@ NaClSrpcHandlerDesc PpbRpcs::srpc_methods[] = {
{ "PPB_Font_MeasureText:iCC:i", PPB_Font_MeasureTextDispatcher },
{ "PPB_Font_CharacterOffsetForPixel:iCCi:i", PPB_Font_CharacterOffsetForPixelDispatcher },
{ "PPB_Font_PixelOffsetForCharacter:iCCi:i", PPB_Font_PixelOffsetForCharacterDispatcher },
+ { "PPB_Fullscreen_IsFullscreen:i:i", PPB_Fullscreen_IsFullscreenDispatcher },
+ { "PPB_Fullscreen_SetFullscreen:ii:i", PPB_Fullscreen_SetFullscreenDispatcher },
+ { "PPB_Fullscreen_GetScreenSize:i:Ci", PPB_Fullscreen_GetScreenSizeDispatcher },
{ "PPB_Graphics2D_Create:iCi:i", PPB_Graphics2D_CreateDispatcher },
{ "PPB_Graphics2D_IsGraphics2D:i:i", PPB_Graphics2D_IsGraphics2DDispatcher },
{ "PPB_Graphics2D_Describe:i:Cii", PPB_Graphics2D_DescribeDispatcher },
@@ -2319,4 +2366,3 @@ NaClSrpcHandlerDesc PpbRpcs::srpc_methods[] = {
{ "PPB_Zoom_ZoomLimitsChanged:idd:", PPB_Zoom_ZoomLimitsChangedDispatcher },
{ NULL, NULL }
};
-
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/trusted/srpcgen/ppb_rpc.h b/ppapi/native_client/src/shared/ppapi_proxy/trusted/srpcgen/ppb_rpc.h
index d6413c7..23e33f9c 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/trusted/srpcgen/ppb_rpc.h
+++ b/ppapi/native_client/src/shared/ppapi_proxy/trusted/srpcgen/ppb_rpc.h
@@ -466,6 +466,32 @@ class PpbFontRpcServer {
void operator=(const PpbFontRpcServer);
}; // class PpbFontRpcServer
+class PpbFullscreenRpcServer {
+ public:
+ static void PPB_Fullscreen_IsFullscreen(
+ NaClSrpcRpc* rpc,
+ NaClSrpcClosure* done,
+ PP_Instance instance,
+ int32_t* success);
+ static void PPB_Fullscreen_SetFullscreen(
+ NaClSrpcRpc* rpc,
+ NaClSrpcClosure* done,
+ PP_Instance instance,
+ int32_t fullscreen,
+ int32_t* success);
+ static void PPB_Fullscreen_GetScreenSize(
+ NaClSrpcRpc* rpc,
+ NaClSrpcClosure* done,
+ PP_Instance instance,
+ nacl_abi_size_t* size_bytes, char* size,
+ int32_t* success);
+
+ private:
+ PpbFullscreenRpcServer();
+ PpbFullscreenRpcServer(const PpbFullscreenRpcServer&);
+ void operator=(const PpbFullscreenRpcServer);
+}; // class PpbFullscreenRpcServer
+
class PpbGraphics2DRpcServer {
public:
static void PPB_Graphics2D_Create(
@@ -1097,4 +1123,3 @@ class PpbRpcs {
#endif // GEN_PPAPI_PROXY_PPB_RPC_H_
-
diff --git a/ppapi/native_client/src/shared/ppapi_proxy/untrusted/srpcgen/ppb_rpc.h b/ppapi/native_client/src/shared/ppapi_proxy/untrusted/srpcgen/ppb_rpc.h
index e0ffac3..059d8e0 100644
--- a/ppapi/native_client/src/shared/ppapi_proxy/untrusted/srpcgen/ppb_rpc.h
+++ b/ppapi/native_client/src/shared/ppapi_proxy/untrusted/srpcgen/ppb_rpc.h
@@ -408,6 +408,29 @@ class PpbFontRpcClient {
void operator=(const PpbFontRpcClient);
}; // class PpbFontRpcClient
+class PpbFullscreenRpcClient {
+ public:
+ static NaClSrpcError PPB_Fullscreen_IsFullscreen(
+ NaClSrpcChannel* channel,
+ PP_Instance instance,
+ int32_t* success);
+ static NaClSrpcError PPB_Fullscreen_SetFullscreen(
+ NaClSrpcChannel* channel,
+ PP_Instance instance,
+ int32_t fullscreen,
+ int32_t* success);
+ static NaClSrpcError PPB_Fullscreen_GetScreenSize(
+ NaClSrpcChannel* channel,
+ PP_Instance instance,
+ nacl_abi_size_t* size_bytes, char* size,
+ int32_t* success);
+
+ private:
+ PpbFullscreenRpcClient();
+ PpbFullscreenRpcClient(const PpbFullscreenRpcClient&);
+ void operator=(const PpbFullscreenRpcClient);
+}; // class PpbFullscreenRpcClient
+
class PpbGraphics2DRpcClient {
public:
static NaClSrpcError PPB_Graphics2D_Create(
@@ -953,4 +976,3 @@ class PpbZoomRpcClient {
#endif // GEN_PPAPI_PROXY_PPB_RPC_H_
-
diff --git a/ppapi/native_client/src/trusted/plugin/plugin.cc b/ppapi/native_client/src/trusted/plugin/plugin.cc
index 8e7e6aa..55ec739 100644
--- a/ppapi/native_client/src/trusted/plugin/plugin.cc
+++ b/ppapi/native_client/src/trusted/plugin/plugin.cc
@@ -903,10 +903,10 @@ Plugin::Plugin(PP_Instance pp_instance)
enable_dev_interface_(false),
replayDidChangeView(false),
replayHandleDocumentLoad(false),
- last_event_bytes_received_(0),
init_time_(0),
ready_time_(0),
- nexe_size_(0) {
+ nexe_size_(0),
+ last_event_bytes_received_(0) {
PLUGIN_PRINTF(("Plugin::Plugin (this=%p, pp_instance=%"
NACL_PRId32")\n", static_cast<void*>(this), pp_instance));
NaClSrpcModuleInit();
@@ -1752,9 +1752,9 @@ void Plugin::ReportLoadAbort() {
void Plugin::UpdateNexeDownloadProgress(
PP_Instance pp_instance,
- PP_Resource pp_resource,
- int64_t bytes_sent,
- int64_t total_bytes_to_be_sent,
+ PP_Resource /*pp_resource*/,
+ int64_t /*bytes_sent*/,
+ int64_t /*total_bytes_to_be_sent*/,
int64_t bytes_received,
int64_t total_bytes_to_be_received)
{
diff --git a/ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/nacl.scons b/ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/nacl.scons
new file mode 100644
index 0000000..b732652
--- /dev/null
+++ b/ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/nacl.scons
@@ -0,0 +1,39 @@
+# -*- python -*-
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+#
+# This test uses ppapi_test_lib.
+
+Import('env')
+
+env.Prepend(CPPDEFINES=['XP_UNIX'])
+
+nexe = 'ppapi_ppb_fullscreen_%s' % env.get('TARGET_FULLARCH')
+env.Alias('ppapi_ppb_fullscreen${PROGSUFFIX}',
+ [ '$STAGING_DIR/%s${PROGSUFFIX}' % nexe ])
+
+ppapi_ppb_url_request_info_nexe = env.ComponentProgram(
+ nexe,
+ [ 'ppapi_ppb_fullscreen.cc' ],
+ EXTRA_LIBS=['${PPAPI_LIBS}',
+ 'ppapi_test_lib',
+ 'platform', # for CHECK
+ 'pthread',
+ 'gio',
+ ])
+
+env.Publish(nexe, 'run',
+ ['ppapi_ppb_fullscreen.html',
+ 'ppapi_ppb_fullscreen.nmf',
+ 'ppapi_ppb_fullscreen.js'])
+
+node = env.PPAPIBrowserTester('ppapi_ppb_fullscreen_browser_test.out',
+ url='ppapi_ppb_fullscreen.html',
+ files=env.ExtractPublishedFiles(nexe),
+ browser_flags=['--enable-pepper-testing'])
+
+env.AddNodeToTestSuite(node,
+ ['chrome_browser_tests'],
+ 'run_ppapi_ppb_fullscreen_browser_test',
+ is_broken=env.PPAPIBrowserTesterIsBroken())
diff --git a/ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/ppapi_ppb_fullscreen.cc b/ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/ppapi_ppb_fullscreen.cc
new file mode 100644
index 0000000..17b521f
--- /dev/null
+++ b/ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/ppapi_ppb_fullscreen.cc
@@ -0,0 +1,195 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Tests PPB_Fullscreen_Dev.
+
+#include <string.h>
+
+#include "native_client/src/shared/platform/nacl_check.h"
+#include "native_client/tests/ppapi_test_lib/get_browser_interface.h"
+#include "native_client/tests/ppapi_test_lib/test_interface.h"
+#include "native_client/tests/ppapi_test_lib/testable_callback.h"
+
+#include "ppapi/c/dev/ppb_fullscreen_dev.h"
+#include "ppapi/c/ppb_core.h"
+#include "ppapi/c/ppb_graphics_2d.h"
+#include "ppapi/c/ppb_instance.h"
+#include "ppapi/c/ppp_instance.h"
+#include "ppapi/c/pp_errors.h"
+#include "ppapi/c/pp_rect.h"
+#include "ppapi/c/pp_size.h"
+
+namespace {
+
+// Common display resolutions.
+PP_Size kSize320x200 = PP_MakeSize(320, 200); // CGA
+PP_Size kSize1280x800 = PP_MakeSize(1280, 800); // WXGA: 13" MB Pro
+PP_Size kSize1366x768 = PP_MakeSize(1366, 768); // X2** Lenovo
+PP_Size kSize1440x900 = PP_MakeSize(1440, 900); // 13" MB Air
+PP_Size kSize1600x900 = PP_MakeSize(1600, 900); // T4** Lenovo
+PP_Size kSize1680x1050 = PP_MakeSize(1680, 1050); // WSXGA+: 15" MB Pro
+PP_Size kSize1900x1080 = PP_MakeSize(1900, 1080); // W/T5** Lenovo
+PP_Size kSize1920x1080 = PP_MakeSize(1920, 1080); // HD: 42" Mitsubishi
+PP_Size kSize1920x1200 = PP_MakeSize(1920, 1200); // WUXGA: 24" HP, 17" MB Pro
+PP_Size kSize2560x1600 = PP_MakeSize(2560, 1600); // WQXGA: 30" HP Monitor
+PP_Size kSize2560x2048 = PP_MakeSize(2560, 2048); // QSXGA
+
+bool IsSizeRange(PP_Size size, PP_Size min_size, PP_Size max_size) {
+ return (min_size.width <= size.width && size.width <= max_size.width &&
+ min_size.height <= size.height && size.height <= max_size.height);
+}
+
+PP_Resource g_graphics2d = kInvalidResource;
+
+bool CreateGraphics2D(PP_Resource* graphics2d) {
+ PP_Size size = PP_MakeSize(90, 90);
+ PP_Bool not_always_opaque = PP_FALSE;
+ *graphics2d =
+ PPBGraphics2D()->Create(pp_instance(), &size, not_always_opaque);
+ return (*graphics2d != kInvalidResource);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Test cases
+////////////////////////////////////////////////////////////////////////////////
+
+// Test for the availability of PPB_FULLSCREEN_DEV_INTERFACE.
+void TestGetInterface() {
+ printf("--- TestGetInterface\n");
+ EXPECT(PPBFullscreenDev() != NULL);
+ TEST_PASSED;
+}
+
+// Test
+// PP_Bool (*IsFullscreen)(PP_Instance instance);
+void TestIsFullscreenTrue() {
+ printf("--- TestIsFullscreenTrue\n");
+ EXPECT(PPBFullscreenDev()->IsFullscreen(pp_instance()) == PP_TRUE);
+ TEST_PASSED;
+}
+
+void TestIsFullscreenFalse() {
+ printf("--- TestIsFullscreenFalse\n");
+ EXPECT(PPBFullscreenDev()->IsFullscreen(pp_instance()) == PP_FALSE);
+ TEST_PASSED;
+}
+
+// Test
+// PP_Bool (*SetFullscreen)(PP_Instance instance, PP_Bool fullscreen);
+
+bool g_fullscreen_pending = false;
+
+// TODO(polina): investigate:
+// -- this error
+// ERROR:render_widget_fullscreen_pepper.cc(142)] Not implemented reached in
+// virtual void<unnamed>::PepperWidget::setFocus(bool)
+// -- flakiness: sometimes the screen goes black after this function, sometimes
+// only after the 2nd call or not at all, sometimes there is part of the white
+// window left, sometimes IsFullscreen returns true and sometimes falls after
+// this completes in DidChangeView.
+void TestSetFullscreenTrue() {
+ printf("--- TestSetFullscreenTrue\n");
+ const PPB_Fullscreen_Dev* ppb = PPBFullscreenDev();
+ if (ppb->IsFullscreen(pp_instance()) == PP_FALSE) {
+ EXPECT(CreateGraphics2D(&g_graphics2d));
+ // The transition is asynchronous and ends at the next DidChangeView().
+ g_fullscreen_pending = true;
+ EXPECT(ppb->SetFullscreen(pp_instance(), PP_TRUE) == PP_TRUE);
+ EXPECT(ppb->IsFullscreen(pp_instance()) == PP_FALSE);
+ // No 2D or 3D device can be bound during transition.
+ EXPECT(PPBGraphics2D()->IsGraphics2D(g_graphics2d) == PP_TRUE);
+ EXPECT(PPBInstance()->BindGraphics(pp_instance(), g_graphics2d) ==
+ PP_FALSE);
+ // The transition ends at the next DidChangeView().
+ } else {
+ // No change.
+ EXPECT(ppb->SetFullscreen(pp_instance(), PP_TRUE) == PP_TRUE);
+ EXPECT(ppb->IsFullscreen(pp_instance()) == PP_TRUE);
+ TEST_PASSED;
+ }
+}
+
+void TestSetFullscreenFalse() {
+ printf("--- TestSetFullscreenFalse\n");
+ EXPECT(CreateGraphics2D(&g_graphics2d));
+ // The transition is syncrhonous.
+ EXPECT(PPBFullscreenDev()->SetFullscreen(pp_instance(), PP_FALSE) == PP_TRUE);
+ EXPECT(PPBFullscreenDev()->IsFullscreen(pp_instance()) == PP_FALSE);
+ // 2D and 3D device can be bound right away.
+ EXPECT(PPBInstance()->BindGraphics(pp_instance(), g_graphics2d) == PP_TRUE);
+ PPBCore()->ReleaseResource(g_graphics2d);
+ TEST_PASSED;
+}
+
+// Test
+// PP_Bool (*GetScreenSize)(PP_Instance instance, struct PP_Size* size);
+
+void TestGetScreenSizeHelper(PP_Size min_size, PP_Size max_size) {
+ PP_Size size = PP_MakeSize(0, 0);
+ EXPECT(PPBFullscreenDev()->GetScreenSize(pp_instance(), &size) == PP_TRUE);
+ EXPECT(IsSizeRange(size, min_size, max_size));
+}
+
+void TestGetScreenSize() {
+ printf("--- TestGetScreenSize\n");
+ TestGetScreenSizeHelper(kSize320x200, kSize2560x2048);
+ TEST_PASSED;
+}
+
+void TestGetScreenSize2560x1600() {
+ printf("--- TestGetScreenSize2560x1600\n");
+ TestGetScreenSizeHelper(kSize2560x1600, kSize2560x1600);
+ TEST_PASSED;
+}
+
+void TestGetScreenSize1920x1200() {
+ printf("--- TestGetScreenSize1920x1200\n");
+ TestGetScreenSizeHelper(kSize1920x1200, kSize1920x1200);
+ TEST_PASSED;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// PPP_Instance
+////////////////////////////////////////////////////////////////////////////////
+
+// DidChangeView completes transition to fullscreen mode.
+void DidChangeView(PP_Instance instance,
+ const struct PP_Rect* position,
+ const struct PP_Rect* clip) {
+ if (!g_fullscreen_pending)
+ return;
+ printf("--- PPP_Instance::DidChangeView: fullscreen_pending=true\n");
+ g_fullscreen_pending = false;
+ EXPECT(PPBFullscreenDev()->IsFullscreen(pp_instance()) == PP_TRUE);
+ EXPECT(PPBGraphics2D()->IsGraphics2D(g_graphics2d) == PP_TRUE);
+ // We should not be able to bind 2D and 3D devices.
+ EXPECT(PPBInstance()->BindGraphics(pp_instance(), g_graphics2d) == PP_TRUE);
+ PPBCore()->ReleaseResource(g_graphics2d);
+ PostTestMessage("TestSetFullscreenTrue", "PASSED");
+}
+
+const PPP_Instance ppp_instance_interface = {
+ DidCreateDefault,
+ DidDestroyDefault,
+ DidChangeView,
+ DidChangeFocusDefault,
+ HandleDocumentLoadDefault
+};
+
+} // namespace
+
+void SetupTests() {
+ RegisterTest("TestGetInterface", TestGetInterface);
+ RegisterTest("TestIsFullscreenTrue", TestIsFullscreenTrue);
+ RegisterTest("TestIsFullscreenFalse", TestIsFullscreenFalse);
+ RegisterTest("TestSetFullscreenTrue", TestSetFullscreenTrue);
+ RegisterTest("TestSetFullscreenFalse", TestSetFullscreenFalse);
+ RegisterTest("TestGetScreenSize", TestGetScreenSize);
+ RegisterTest("TestGetScreenSize2560x1600", TestGetScreenSize2560x1600);
+ RegisterTest("TestGetScreenSize1920x1200", TestGetScreenSize1920x1200);
+}
+
+void SetupPluginInterfaces() {
+ RegisterPluginInterface(PPP_INSTANCE_INTERFACE, &ppp_instance_interface);
+}
diff --git a/ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/ppapi_ppb_fullscreen.html b/ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/ppapi_ppb_fullscreen.html
new file mode 100644
index 0000000..78bf957
--- /dev/null
+++ b/ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/ppapi_ppb_fullscreen.html
@@ -0,0 +1,64 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+ <!-- Copyright (c) 2011 Google Inc. All rights reserved. -->
+ <head>
+ <META HTTP-EQUIV="Pragma" CONTENT="no-cache" />
+ <META HTTP-EQUIV="Expires" CONTENT="-1" />
+ <script type="text/javascript" src="nacltest.js"></script>
+ <title>PPAPI PPB_Fullscreen_Dev Test</title>
+ </head>
+ <body>
+ <h1>PPAPI PPB_Fullscreen_Dev Test</h1>
+
+ <embed type="application/x-nacl" id="test_nexe"
+ name="nacl_module"
+ style="background-color:#AA00AA"
+ src="ppapi_ppb_fullscreen.nmf"
+ width="0" height="0" />
+
+ <script type="text/javascript">
+ //<![CDATA[
+ function setupTests(tester, plugin) {
+ function addTest(testName, optionalPause) {
+ tester.addAsyncTest('PPB_Fullscreen::' + testName, function(test) {
+ function HandleMessage(message) {
+ test.assertEqual(message.data, testName + ':PASSED');
+ setTimeout(test.wrap(function() { test.pass(); }),
+ optionalPause * 1000);
+ }
+ test.expectEvent(plugin, 'message', HandleMessage);
+ plugin.postMessage(testName);
+
+ });
+ }
+
+ addTest("TestGetInterface");
+ if (screen.width == 2560 && screen.height == 1600) // 30-inch.
+ addTest("TestGetScreenSize2560x1600");
+ else if (screen.width == 1920 && screen.height == 1200) // 24-inch.
+ addTest("TestGetScreenSize1920x1200");
+ else
+ addTest("TestGetScreenSize");
+ addTest("TestIsFullscreenFalse");
+ // To Fullscreen.
+ // Pause, so it is noticable when running manually.
+ addTest("TestSetFullscreenTrue", 1); // to fullscreen.
+ addTest("TestIsFullscreenTrue");
+ addTest("TestSetFullscreenTrue", 1); // no change.
+ addTest("TestIsFullscreenTrue");
+ // From fullscreen.
+ addTest("TestSetFullscreenFalse"); // from fullscreen.
+ addTest("TestIsFullscreenFalse");
+ addTest("TestSetFullscreenFalse"); // no change.
+ addTest("TestIsFullscreenFalse");
+ }
+
+ var tester = new Tester();
+ setupTests(tester, $('test_nexe'));
+ tester.waitFor($('test_nexe'));
+ tester.run();
+ //]]>
+ </script>
+ </body>
+</html>
diff --git a/ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/ppapi_ppb_fullscreen.nmf b/ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/ppapi_ppb_fullscreen.nmf
new file mode 100644
index 0000000..1c9ad95
--- /dev/null
+++ b/ppapi/native_client/tests/ppapi_browser/ppb_fullscreen/ppapi_ppb_fullscreen.nmf
@@ -0,0 +1,7 @@
+{
+ "program": {
+ "x86-32": { "url": "ppapi_ppb_fullscreen_x86-32.nexe" },
+ "x86-64": { "url": "ppapi_ppb_fullscreen_x86-64.nexe" },
+ "arm": { "url": "ppapi_ppb_fullscreen_arm.nexe" }
+ }
+}
diff --git a/ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.cc b/ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.cc
index 3153e61..c725ba3 100644
--- a/ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.cc
+++ b/ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Native Client Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -7,6 +7,7 @@
#include "ppapi/c/dev/ppb_context_3d_dev.h"
#include "ppapi/c/dev/ppb_cursor_control_dev.h"
#include "ppapi/c/dev/ppb_font_dev.h"
+#include "ppapi/c/dev/ppb_fullscreen_dev.h"
#include "ppapi/c/dev/ppb_graphics_3d_dev.h"
#include "ppapi/c/dev/ppb_memory_dev.h"
#include "ppapi/c/dev/ppb_opengles_dev.h"
@@ -147,6 +148,11 @@ const PPB_Font_Dev* PPBFontDev() {
GetBrowserInterface(PPB_FONT_DEV_INTERFACE));
}
+const PPB_Fullscreen_Dev* PPBFullscreenDev() {
+ return reinterpret_cast<const PPB_Fullscreen_Dev*>(
+ GetBrowserInterface(PPB_FULLSCREEN_DEV_INTERFACE));
+}
+
const PPB_Memory_Dev* PPBMemoryDev() {
return reinterpret_cast<const PPB_Memory_Dev*>(
GetBrowserInterface(PPB_MEMORY_DEV_INTERFACE));
@@ -176,4 +182,3 @@ const PPB_Widget_Dev* PPBWidgetDev() {
return reinterpret_cast<const PPB_Widget_Dev*>(
GetBrowserInterface(PPB_WIDGET_DEV_INTERFACE));
}
-
diff --git a/ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.h b/ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.h
index 2db1e04..405754d 100644
--- a/ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.h
+++ b/ppapi/native_client/tests/ppapi_test_lib/get_browser_interface.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Native Client Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
@@ -20,6 +20,7 @@ struct PPB_FileIO;
struct PPB_FileRef;
struct PPB_FileSystem;
struct PPB_Font_Dev;
+struct PPB_Fullscreen_Dev;
struct PPB_Graphics2D;
struct PPB_Graphics3D_Dev;
struct PPB_ImageData;
@@ -74,6 +75,7 @@ const PPB_WheelInputEvent* PPBWheelInputEvent();
const PPB_Context3D_Dev* PPBContext3DDev();
const PPB_CursorControl_Dev* PPBCursorControlDev();
const PPB_Font_Dev* PPBFontDev();
+const PPB_Fullscreen_Dev* PPBFullscreenDev();
const PPB_Graphics3D_Dev* PPBGraphics3DDev();
const PPB_Memory_Dev* PPBMemoryDev();
const PPB_OpenGLES2_Dev* PPBOpenGLES2Dev();
diff --git a/ppapi/native_client/tests/ppapi_test_lib/nacl.scons b/ppapi/native_client/tests/ppapi_test_lib/nacl.scons
index bb552b0..b782a4f 100644
--- a/ppapi/native_client/tests/ppapi_test_lib/nacl.scons
+++ b/ppapi/native_client/tests/ppapi_test_lib/nacl.scons
@@ -1,5 +1,5 @@
# -*- python -*-
-# Copyright (c) 2011 The Native Client Authors. All rights reserved.
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
@@ -17,6 +17,17 @@
Import('env')
+# Register new tests here as we can no longer add them to the DEPS-ed in
+# native_client/SConstruct in the same CL.
+#
+# TODO(polina, bradnelson): take out this temporary work-around for adding new
+# tests when we have a common place to add these
+# (e.g. ppapi/native_client/nacl.scons) included into native_client/SConstruct.
+env_clone = env.Clone()
+# The test is flaky. Disable for now.
+#env_clone.SConscript('../ppapi_browser/ppb_fullscreen/nacl.scons',
+# exports=['env'])
+
env.Prepend(CPPDEFINES=['XP_UNIX'])
env.ComponentLibrary('ppapi_test_lib',
@@ -24,4 +35,4 @@ env.ComponentLibrary('ppapi_test_lib',
'internal_utils.cc',
'testable_callback.cc',
'module_instance.cc',
- 'test_interface.cc']);
+ 'test_interface.cc'])