blob: ad3a304e2fccd79da95eb3b424548fae45e0aacc [file] [log] [blame]
# To be used with
# sel_universal_ppapi_replay_prolog.stdin
# define a bunch of variables for readability
# NOTE: this test exercises the request.SetStreamToFile(false) case
set_variable MODULE i(4444)
set_variable INSTANCE i(5555)
# Tags used by pepper/srpc to marshall js parameters
set_variable JS_STR 4:5
set_variable JS_INT 4:2
# NOTE: the strings below must not contain unescaped spaces or commas
set_variable FILE_DATA1 C(6,hello\x20)
set_variable FILE_SIZE1 i(6)
set_variable FILE_DATA2 C(6,world!)
set_variable FILE_SIZE2 i(6)
set_variable PARAM_STR_URL R(24,${JS_STR},4:10,"myurl.html",6:0)
set_variable PARAM_STR_GET R(16,${JS_STR},4:3,"GET",5:0)
set_variable PARAM_NUM_0 R(8,${JS_INT},4:0)
set_variable PARAM_NUM_1 R(8,${JS_INT},4:1)
set_variable PARAM_STATUS R(8,4:3,4:200)
set_variable NUM_TAGS i(3)
set_variable TAGS C(23,chunk_size\000url\000to_file\000)
set_variable VALUES C(16,10\000myurl.html\0000\000)
set_variable COMPLETE R(24,${JS_STR},4:14,"5555: COMPLETE",2:0)
######################################################################
# These replays are too common to list them separately
# TODO(robertm): make the counts tight, eliminate PPB_Var ASAP
replay 1 PPB_GetInterface:s:i s("PPB_Messaging;1.0") * i(1)
replay 1 PPB_GetInterface:s:i s("PPB_Core;1.0") * i(1)
replay 1 PPB_GetInterface:s:i s("PPB_Var;1.0") * i(1)
replay 1 PPB_GetInterface:s:i s("PPB_URLRequestInfo;1.0") * i(1)
replay 1 PPB_GetInterface:s:i s("PPB_URLResponseInfo;1.0") * i(1)
replay 1 PPB_GetInterface:s:i s("PPB_URLLoader;1.0") * i(1)
######################################################################
echo
echo "*** INIT MODULE"
# the results contain a process id which is non-determinisitic
rpc PPP_InitializeModule hide-results i(0) ${MODULE} h(pepper_desc) s("${service_string}") * i(0) i(0)
echo
echo "*** Load URL"
replay 1 PPB_URLRequestInfo_Create:i:i ${INSTANCE} * i(30)
replay 1 PPB_URLLoader_Create:i:i ${INSTANCE} * i(34)
replay 1 PPB_URLRequestInfo_SetProperty:iiC:i i(30) i(0) ${PARAM_STR_URL} * i(1)
replay 1 PPB_URLRequestInfo_SetProperty:iiC:i i(30) i(1) ${PARAM_STR_GET} * i(1)
replay 1 PPB_URLRequestInfo_SetProperty:iiC:i i(30) i(3) ${PARAM_NUM_0} * i(1)
replay 1 PPB_URLLoader_Open:iii:i i(34) i(30) i(1) * i(-1)
replay 1 PPB_Core_ReleaseResource:i: i(30) *
rpc PPP_Instance_DidCreate ${INSTANCE} ${NUM_TAGS} ${TAGS} ${VALUES} * i(0)
echo
echo "*** async Open Callback"
replay 1 PPB_URLLoader_GetResponseInfo:i:i i(34) * i(38)
replay 1 PPB_URLResponseInfo_GetProperty:ii:C i(38) i(3) * ${PARAM_STATUS}
replay 1 PPB_URLLoader_ReadResponseBody:iii:Ci i(34) i(10) i(2) * C(0,) i(-1)
replay 1 PPB_Core_ReleaseResource:i: i(38) *
rpc RunCompletionCallback i(1) i(0) C(0,) *
echo
echo "*** async ReaderResponseBody Callback (first 6 bytes)"
replay 1 PPB_URLLoader_ReadResponseBody:iii:Ci i(34) i(10) i(3) * C(0,) i(-1)
rpc RunCompletionCallback i(2) ${FILE_SIZE1} ${FILE_DATA1} *
echo
echo "*** async ReaderResponseBody Callback (second 6 bytes)"
replay 1 PPB_URLLoader_ReadResponseBody:iii:Ci i(34) i(10) i(4) * C(0,) i(-1)
rpc RunCompletionCallback i(3) ${FILE_SIZE2} ${FILE_DATA2} *
echo
echo "*** async ReaderResponseBody Callback (eof - 0 bytes)"
replay 1 PPB_Messaging_PostMessage:iC: ${INSTANCE} ${COMPLETE} *
rpc RunCompletionCallback i(4) i(0) C(0,) *
echo
echo "*** DONE"
rpc PPP_ShutdownModule *