Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(594)

Side by Side Diff: ppapi/native_client/tests/ppapi_browser/ppb_dev/ppapi_ppb_dev.cc

Issue 8301006: Packaged (CRX) extensions shouldn't be able to get 'dev' interfaces in NaCl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 // Test cases for PPAPI Dev interfaces. 5 // Test cases for PPAPI Dev interfaces.
6 // 6 //
7 7
8 #include <string.h> 8 #include <string.h>
9 9
10 #include "native_client/src/include/nacl_macros.h" 10 #include "native_client/src/include/nacl_macros.h"
11 #include "native_client/src/shared/platform/nacl_check.h" 11 #include "native_client/src/shared/platform/nacl_check.h"
12 #include "native_client/src/shared/ppapi_proxy/plugin_nacl_file.h" 12 #include "native_client/src/shared/ppapi_proxy/plugin_nacl_file.h"
13 #include "native_client/tests/ppapi_test_lib/get_browser_interface.h" 13 #include "native_client/tests/ppapi_test_lib/get_browser_interface.h"
14 #include "native_client/tests/ppapi_test_lib/test_interface.h" 14 #include "native_client/tests/ppapi_test_lib/test_interface.h"
15 #include "ppapi/c/pp_bool.h" 15 #include "ppapi/c/pp_bool.h"
16 #include "ppapi/c/pp_errors.h" 16 #include "ppapi/c/pp_errors.h"
17 #include "ppapi/c/ppb_core.h" 17 #include "ppapi/c/ppb_core.h"
18 18
19 #include "ppapi/c/dev/ppb_buffer_dev.h"
20 #include "ppapi/c/dev/ppb_char_set_dev.h"
21 #include "ppapi/c/dev/ppb_console_dev.h"
22 #include "ppapi/c/dev/ppb_context_3d_dev.h"
23 #include "ppapi/c/dev/ppb_context_3d_trusted_dev.h"
24 #include "ppapi/c/dev/ppb_crypto_dev.h"
25 #include "ppapi/c/dev/ppb_cursor_control_dev.h" 19 #include "ppapi/c/dev/ppb_cursor_control_dev.h"
26 #include "ppapi/c/dev/ppb_directory_reader_dev.h"
27 #include "ppapi/c/dev/ppb_file_chooser_dev.h"
28 #include "ppapi/c/dev/ppb_find_dev.h"
29 #include "ppapi/c/dev/ppb_font_dev.h"
30 #include "ppapi/c/dev/ppb_fullscreen_dev.h"
31 #include "ppapi/c/dev/ppb_gles_chromium_texture_mapping_dev.h"
32 #include "ppapi/c/dev/ppb_layer_compositor_dev.h"
33 #include "ppapi/c/dev/ppb_memory_dev.h"
34 #include "ppapi/c/dev/ppb_scrollbar_dev.h"
35 #include "ppapi/c/dev/ppb_surface_3d_dev.h"
36 #include "ppapi/c/dev/ppb_testing_dev.h"
37 #include "ppapi/c/dev/ppb_transport_dev.h"
38 #include "ppapi/c/dev/ppb_url_util_dev.h"
39 #include "ppapi/c/dev/ppb_var_deprecated.h"
40 #include "ppapi/c/dev/ppb_video_decoder_dev.h"
41 #include "ppapi/c/dev/ppb_widget_dev.h"
42 #include "ppapi/c/dev/ppb_zoom_dev.h"
43
44 20
45 namespace { 21 namespace {
46 22
47 //////////////////////////////////////////////////////////////////////////////// 23 ////////////////////////////////////////////////////////////////////////////////
48 // Test Cases 24 // Test Cases
49 //////////////////////////////////////////////////////////////////////////////// 25 ////////////////////////////////////////////////////////////////////////////////
50 26
51 void TestGetDevInterfaces() { 27 void TestGetDevInterfaces() {
52 // This test is run only w/ NACL_ENABLE_PPAPI_DEV=0, which should 28 // This test is run as a simple embedded .nexe with --enable-nacl. It should
53 // turn off and disable the PPAPI developer interfaces. When they are 29 // have access to all dev interfaces. Only test one to make the test more
54 // disabled, the interface should return NULL. 30 // robust as interfaces change.
55 CHECK(GetBrowserInterface(PPB_BUFFER_DEV_INTERFACE) == NULL); 31 EXPECT(GetBrowserInterface(PPB_CURSOR_CONTROL_DEV_INTERFACE) != NULL);
56 CHECK(GetBrowserInterface(PPB_CHAR_SET_DEV_INTERFACE) == NULL);
57 CHECK(GetBrowserInterface(PPB_CONSOLE_DEV_INTERFACE) == NULL);
58 CHECK(GetBrowserInterface(PPB_CONTEXT_3D_DEV_INTERFACE) == NULL);
59 CHECK(GetBrowserInterface(PPB_CRYPTO_DEV_INTERFACE) == NULL);
60 CHECK(GetBrowserInterface(PPB_CURSOR_CONTROL_DEV_INTERFACE) == NULL);
61 CHECK(GetBrowserInterface(PPB_DIRECTORYREADER_DEV_INTERFACE) == NULL);
62 CHECK(GetBrowserInterface(PPB_FILECHOOSER_DEV_INTERFACE) == NULL);
63 CHECK(GetBrowserInterface(PPB_FIND_DEV_INTERFACE) == NULL);
64 CHECK(GetBrowserInterface(PPB_FONT_DEV_INTERFACE) == NULL);
65 CHECK(GetBrowserInterface(PPB_FULLSCREEN_DEV_INTERFACE) == NULL);
66 CHECK(GetBrowserInterface(
67 PPB_GLES_CHROMIUM_TEXTURE_MAPPING_DEV_INTERFACE) == NULL);
68 CHECK(GetBrowserInterface(PPB_LAYER_COMPOSITOR_DEV_INTERFACE) == NULL);
69 CHECK(GetBrowserInterface(PPB_MEMORY_DEV_INTERFACE) == NULL);
70 CHECK(GetBrowserInterface(PPB_SCROLLBAR_DEV_INTERFACE) == NULL);
71 CHECK(GetBrowserInterface(PPB_SURFACE_3D_DEV_INTERFACE) == NULL);
72 CHECK(GetBrowserInterface(PPB_TESTING_DEV_INTERFACE) == NULL);
73 CHECK(GetBrowserInterface(PPB_TRANSPORT_DEV_INTERFACE) == NULL);
74 CHECK(GetBrowserInterface(PPB_URLUTIL_DEV_INTERFACE) == NULL);
75 CHECK(GetBrowserInterface(PPB_VAR_DEPRECATED_INTERFACE) == NULL);
76 CHECK(GetBrowserInterface(PPB_VIDEODECODER_DEV_INTERFACE) == NULL);
77 CHECK(GetBrowserInterface(PPB_WIDGET_DEV_INTERFACE) == NULL);
78 CHECK(GetBrowserInterface(PPB_ZOOM_DEV_INTERFACE) == NULL);
79 32
80 TEST_PASSED; 33 TEST_PASSED;
81 } 34 }
82 35
83 } // namespace 36 } // namespace
84 37
85 void SetupTests() { 38 void SetupTests() {
86 RegisterTest("TestGetDevInterfaces", TestGetDevInterfaces); 39 RegisterTest("TestGetDevInterfaces", TestGetDevInterfaces);
87 } 40 }
88 41
89 void SetupPluginInterfaces() { 42 void SetupPluginInterfaces() {
90 // none 43 // none
91 } 44 }
OLDNEW
« no previous file with comments | « ppapi/native_client/src/trusted/plugin/plugin.cc ('k') | ppapi/native_client/tests/ppapi_browser/ppb_dev/ppapi_ppb_dev.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698