| Index: ppapi/native_client/tests/ppapi_simple_tests/ppapi_emu_file.stdin
|
| ===================================================================
|
| --- ppapi/native_client/tests/ppapi_simple_tests/ppapi_emu_file.stdin (revision 0)
|
| +++ ppapi/native_client/tests/ppapi_simple_tests/ppapi_emu_file.stdin (revision 0)
|
| @@ -0,0 +1,52 @@
|
| +# define a bunch of variables for readability
|
| +
|
| +set_variable MODULE i(4444)
|
| +set_variable INSTANCE i(5555)
|
| +# NOTE: width and height must match the image_data and
|
| +# graphic_2d object requests that the nexe makes
|
| +set_variable WIDTH 1000
|
| +set_variable HEIGHT 700
|
| +
|
| +echo
|
| +echo "*** INITIALIZE PEPPER EMULATION"
|
| +# this registers the currently supported PPB_xxx rpcs
|
| +pepper_emu_initialize ${INSTANCE} ${WIDTH} ${HEIGHT} demo
|
| +echo
|
| +
|
| +echo
|
| +echo "*** CREATE UPCALL SERVICE"
|
| +# advertise the registered rpcs to the nexe
|
| +install_upcalls service_string pepper_desc
|
| +# the variable service string is very long and might change so we suppress it
|
| +nondeterministic s("${service_string}") @LENGTHY_SERVICE_STRING
|
| +
|
| +echo
|
| +echo "*** INIT MODULE"
|
| +rpc PPP_InitializeModule hide-results i(0) ${MODULE} h(pepper_desc) s("${service_string}") * i(0) i(0)
|
| +
|
| +echo
|
| +echo "*** CHECK INSTANCE CREATION"
|
| +# many nexes uses this to trigger instance initialization
|
| +set_variable TAGS C(30,url\000to_file\000chunk_size\000pdebug\000)
|
| +set_variable VALUES C(18,test.txt\0000\0001024\0001\000)
|
| +set_variable NUM_TAGS i(4)
|
| +rpc PPP_Instance_DidCreate ${INSTANCE} ${NUM_TAGS} ${TAGS} ${VALUES} * i(0)
|
| +
|
| +echo
|
| +echo "*** TRIGGER REPAINT"
|
| +rpc PPP_Instance_DidChangeView ${INSTANCE} I(4,8,79,${WIDTH},${HEIGHT}) I(4,0,0,${WIDTH},${HEIGHT}) *
|
| +
|
| +# make sure we terminate when seeing the string "5555: COMPLETE" send via
|
| +# PostMessage by the nexe when it has fully read the file
|
| +echo
|
| +echo "REGISTER TERMINATION MESSAGE"
|
| +pepper_emu_set_quit_message "5555: COMPLETE"
|
| +
|
| +echo
|
| +echo "*** ENTER EVENT LOOP"
|
| +# wait for events and handle them until we see the "quit_message"
|
| +pepper_emu_event_loop 0 100000
|
| +
|
| +######################################################################
|
| +## EPILOG
|
| +######################################################################
|
|
|