OLD | NEW |
---|---|
1 module js_to_cpp; | 1 module js_to_cpp; |
2 | 2 |
3 // This struct encompasses all of the basic types, so that they | 3 // This struct encompasses all of the basic types, so that they |
4 // may be sent from C++ to JS and back for validation. | 4 // may be sent from C++ to JS and back for validation. |
5 struct EchoArgs { | 5 struct EchoArgs { |
6 int64 si64; | 6 int64 si64; |
7 int32 si32; | 7 int32 si32; |
8 int16 si16; | 8 int16 si16; |
9 int8 si8; | 9 int8 si8; |
10 uint64 ui64; | 10 uint64 ui64; |
(...skipping 10 matching lines...) Expand all Loading... | |
21 array<string>? string_array; | 21 array<string>? string_array; |
22 handle<message_pipe>? message_handle; | 22 handle<message_pipe>? message_handle; |
23 handle<data_pipe_consumer>? data_handle; | 23 handle<data_pipe_consumer>? data_handle; |
24 }; | 24 }; |
25 | 25 |
26 struct EchoArgsList { | 26 struct EchoArgsList { |
27 EchoArgsList? next; | 27 EchoArgsList? next; |
28 EchoArgs? item; | 28 EchoArgs? item; |
29 }; | 29 }; |
30 | 30 |
31 interface NotUsed {}; | |
Tom Sepez
2017/04/27 16:10:36
nit: maybe call it AssociatedForTesting, as it is
yzshen1
2017/04/27 17:15:33
Good point, done.
| |
32 | |
31 // Note: For messages which control test flow, pick numbers that are unlikely | 33 // Note: For messages which control test flow, pick numbers that are unlikely |
32 // to be hit as a result of our deliberate corruption of response messages. | 34 // to be hit as a result of our deliberate corruption of response messages. |
33 interface CppSide { | 35 interface CppSide { |
34 // Sent for all tests to notify that the JS side is now ready. | 36 // Sent for all tests to notify that the JS side is now ready. |
35 StartTest@88888888(); | 37 StartTest@88888888(); |
36 | 38 |
37 // Indicates end for echo, bit-flip, and back-pointer tests. | 39 // Indicates end for echo, bit-flip, and back-pointer tests. |
38 TestFinished@99999999(); | 40 TestFinished@99999999(); |
39 | 41 |
40 // Responses from specific tests. | 42 // Responses from specific tests. |
41 PingResponse(); | 43 PingResponse(); |
42 EchoResponse(EchoArgsList list); | 44 EchoResponse(EchoArgsList list); |
43 BitFlipResponse(EchoArgsList arg); | 45 |
46 // Having an associated interface pointer in the message makes sure the | |
47 // message header version 2 is tested. | |
48 BitFlipResponse(EchoArgsList arg, associated NotUsed? not_used); | |
49 | |
44 BackPointerResponse(EchoArgsList arg); | 50 BackPointerResponse(EchoArgsList arg); |
45 }; | 51 }; |
46 | 52 |
47 interface JsSide { | 53 interface JsSide { |
48 SetCppSide(CppSide cpp); | 54 SetCppSide(CppSide cpp); |
49 | 55 |
50 Ping(); | 56 Ping(); |
51 Echo(int32 numIterations, EchoArgs arg); | 57 Echo(int32 numIterations, EchoArgs arg); |
52 BitFlip(EchoArgs arg); | 58 BitFlip(EchoArgs arg); |
53 BackPointer(EchoArgs arg); | 59 BackPointer(EchoArgs arg); |
54 }; | 60 }; |
OLD | NEW |