OLD | NEW |
(Empty) | |
| 1 module js_to_cpp; |
| 2 |
| 3 // This struct encompasses all of the basic types, so that they |
| 4 // may be sent from C++ to JS and back for validation. |
| 5 struct EchoArgs { |
| 6 int64 si64; |
| 7 int32 si32; |
| 8 int16 si16; |
| 9 int8 si8; |
| 10 uint64 ui64; |
| 11 uint32 ui32; |
| 12 uint16 ui16; |
| 13 uint8 ui8; |
| 14 float float_val; |
| 15 float float_inf; |
| 16 float float_nan; |
| 17 double double_val; |
| 18 double double_inf; |
| 19 double double_nan; |
| 20 string? name; |
| 21 array<string>? string_array; |
| 22 handle<message_pipe>? message_handle; |
| 23 handle<data_pipe_consumer>? data_handle; |
| 24 }; |
| 25 |
| 26 struct EchoArgsList { |
| 27 EchoArgsList? next; |
| 28 EchoArgs? item; |
| 29 }; |
| 30 |
| 31 interface ForTesting {}; |
| 32 |
| 33 // Note: For messages which control test flow, pick numbers that are unlikely |
| 34 // to be hit as a result of our deliberate corruption of response messages. |
| 35 interface CppSide { |
| 36 // Sent for all tests to notify that the JS side is now ready. |
| 37 StartTest@88888888(); |
| 38 |
| 39 // Indicates end for echo, bit-flip, and back-pointer tests. |
| 40 TestFinished@99999999(); |
| 41 |
| 42 // Responses from specific tests. |
| 43 PingResponse(); |
| 44 EchoResponse(EchoArgsList list); |
| 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 ForTesting? not_used); |
| 49 |
| 50 BackPointerResponse(EchoArgsList arg); |
| 51 }; |
| 52 |
| 53 interface JsSide { |
| 54 SetCppSide(CppSide cpp); |
| 55 |
| 56 Ping(); |
| 57 Echo(int32 numIterations, EchoArgs arg); |
| 58 BitFlip(EchoArgs arg); |
| 59 BackPointer(EchoArgs arg); |
| 60 }; |
OLD | NEW |