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

Side by Side Diff: ppapi/c/dev/ppb_testing_dev.h

Issue 8920005: Add TestingInstance::EvalScript method which posts a message that the test page can eval(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years 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 5
6 /* From dev/ppb_testing_dev.idl modified Sat Nov 19 15:58:18 2011. */ 6 /* From dev/ppb_testing_dev.idl modified Mon Dec 12 11:28:14 2011. */
7 7
8 #ifndef PPAPI_C_DEV_PPB_TESTING_DEV_H_ 8 #ifndef PPAPI_C_DEV_PPB_TESTING_DEV_H_
9 #define PPAPI_C_DEV_PPB_TESTING_DEV_H_ 9 #define PPAPI_C_DEV_PPB_TESTING_DEV_H_
10 10
11 #include "ppapi/c/pp_bool.h" 11 #include "ppapi/c/pp_bool.h"
12 #include "ppapi/c/pp_instance.h" 12 #include "ppapi/c/pp_instance.h"
13 #include "ppapi/c/pp_macros.h" 13 #include "ppapi/c/pp_macros.h"
14 #include "ppapi/c/pp_point.h" 14 #include "ppapi/c/pp_point.h"
15 #include "ppapi/c/pp_resource.h" 15 #include "ppapi/c/pp_resource.h"
16 #include "ppapi/c/pp_stdint.h" 16 #include "ppapi/c/pp_stdint.h"
17 #include "ppapi/c/pp_var.h"
17 18
18 #define PPB_TESTING_DEV_INTERFACE_0_7 "PPB_Testing(Dev);0.7" 19 #define PPB_TESTING_DEV_INTERFACE_0_7 "PPB_Testing(Dev);0.7"
19 #define PPB_TESTING_DEV_INTERFACE_0_8 "PPB_Testing(Dev);0.8" 20 #define PPB_TESTING_DEV_INTERFACE_0_8 "PPB_Testing(Dev);0.8"
20 #define PPB_TESTING_DEV_INTERFACE PPB_TESTING_DEV_INTERFACE_0_8 21 #define PPB_TESTING_DEV_INTERFACE_0_9 "PPB_Testing(Dev);0.9"
22 #define PPB_TESTING_DEV_INTERFACE PPB_TESTING_DEV_INTERFACE_0_9
21 23
22 /** 24 /**
23 * @file 25 * @file
24 * This file contains interface functions used for unit testing. Do not use in 26 * This file contains interface functions used for unit testing. Do not use in
25 * production code. They are not guaranteed to be available in normal plugin 27 * production code. They are not guaranteed to be available in normal plugin
26 * environments so you should not depend on them. 28 * environments so you should not depend on them.
27 */ 29 */
28 30
29 31
30 /** 32 /**
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 * 107 *
106 * Note that the browser may generate extra input events in order to 108 * Note that the browser may generate extra input events in order to
107 * maintain certain invariants, such as always having a "mouse enter" event 109 * maintain certain invariants, such as always having a "mouse enter" event
108 * before any other mouse event. Furthermore, the event the plugin receives 110 * before any other mouse event. Furthermore, the event the plugin receives
109 * after sending a simulated event will be slightly different from the 111 * after sending a simulated event will be slightly different from the
110 * original event. The browser may change the timestamp, add modifiers, and 112 * original event. The browser may change the timestamp, add modifiers, and
111 * slightly alter the mouse position, due to coordinate transforms it 113 * slightly alter the mouse position, due to coordinate transforms it
112 * performs. 114 * performs.
113 */ 115 */
114 void (*SimulateInputEvent)(PP_Instance instance, PP_Resource input_event); 116 void (*SimulateInputEvent)(PP_Instance instance, PP_Resource input_event);
117 /**
118 * ExecuteScript is a pointer to a function that executes the given
119 * script in the context of the frame containing the module.
120 *
121 * The exception, if any, will be returned in *exception. As with the PPB_Var
122 * interface, the exception parameter, if non-NULL, must be initialized
123 * to a void exception or the function will immediately return. On success,
124 * the exception parameter will be set to a "void" var. On failure, the
125 * return value will be a "void" var.
126 *
127 * @param[in] script A string containing the JavaScript to execute.
128 * @param[in/out] exception PP_Var containing the exception. Initialize
129 * this to NULL if you don't want exception info; initialize this to a void
130 * exception if want exception info.
131 *
132 * @return The result of the script execution, or a "void" var
133 * if execution failed.
134 */
135 struct PP_Var (*ExecuteScript)(PP_Instance instance,
136 struct PP_Var script,
137 struct PP_Var* exception);
115 }; 138 };
116 139
117 struct PPB_Testing_Dev_0_7 { 140 struct PPB_Testing_Dev_0_7 {
118 PP_Bool (*ReadImageData)(PP_Resource device_context_2d, 141 PP_Bool (*ReadImageData)(PP_Resource device_context_2d,
119 PP_Resource image, 142 PP_Resource image,
120 const struct PP_Point* top_left); 143 const struct PP_Point* top_left);
121 void (*RunMessageLoop)(PP_Instance instance); 144 void (*RunMessageLoop)(PP_Instance instance);
122 void (*QuitMessageLoop)(PP_Instance instance); 145 void (*QuitMessageLoop)(PP_Instance instance);
123 uint32_t (*GetLiveObjectsForInstance)(PP_Instance instance); 146 uint32_t (*GetLiveObjectsForInstance)(PP_Instance instance);
124 PP_Bool (*IsOutOfProcess)(); 147 PP_Bool (*IsOutOfProcess)();
125 }; 148 };
149
150 struct PPB_Testing_Dev_0_8 {
151 PP_Bool (*ReadImageData)(PP_Resource device_context_2d,
152 PP_Resource image,
153 const struct PP_Point* top_left);
154 void (*RunMessageLoop)(PP_Instance instance);
155 void (*QuitMessageLoop)(PP_Instance instance);
156 uint32_t (*GetLiveObjectsForInstance)(PP_Instance instance);
157 PP_Bool (*IsOutOfProcess)();
158 void (*SimulateInputEvent)(PP_Instance instance, PP_Resource input_event);
159 };
126 /** 160 /**
127 * @} 161 * @}
128 */ 162 */
129 163
130 #endif /* PPAPI_C_DEV_PPB_TESTING_DEV_H_ */ 164 #endif /* PPAPI_C_DEV_PPB_TESTING_DEV_H_ */
131 165
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698