| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 [DartPackage="_mojo_for_test_only", | |
| 6 JavaPackage="org.chromium.mojo.bindings.test.mojom.mojo"] | |
| 7 module mojo.test; | |
| 8 | |
| 9 struct StructA { | |
| 10 uint64 i; | |
| 11 }; | |
| 12 | |
| 13 struct StructB { | |
| 14 StructA struct_a; | |
| 15 }; | |
| 16 | |
| 17 struct StructC { | |
| 18 array<uint8> data; | |
| 19 }; | |
| 20 | |
| 21 struct StructD { | |
| 22 array<handle<message_pipe>> message_pipes; | |
| 23 }; | |
| 24 | |
| 25 struct StructE { | |
| 26 StructD struct_d; | |
| 27 handle<data_pipe_consumer> data_pipe_consumer; | |
| 28 }; | |
| 29 | |
| 30 struct StructF { | |
| 31 array<uint8, 3> fixed_size_array; | |
| 32 }; | |
| 33 | |
| 34 struct StructG { | |
| 35 int32 i; | |
| 36 [MinVersion=1] StructA? struct_a; | |
| 37 [MinVersion=3] string? str; | |
| 38 [MinVersion=3] bool b; | |
| 39 }; | |
| 40 | |
| 41 struct StructH { | |
| 42 bool a; | |
| 43 uint8 b; | |
| 44 UnionA? c; | |
| 45 array<UnionA>? d; | |
| 46 map<uint8, UnionA>? e; | |
| 47 }; | |
| 48 | |
| 49 union UnionA { | |
| 50 uint16 a; | |
| 51 uint32 b; | |
| 52 StructA? c; | |
| 53 array<uint8>? d; | |
| 54 map<string, uint8>? e; | |
| 55 UnionB? f; | |
| 56 StructA g; | |
| 57 array<uint8> h; | |
| 58 map<string, uint8> i; | |
| 59 UnionB j; | |
| 60 }; | |
| 61 | |
| 62 union UnionB { | |
| 63 uint16 a; | |
| 64 uint32 b; | |
| 65 uint64 c; | |
| 66 uint32 d; | |
| 67 }; | |
| 68 | |
| 69 interface InterfaceA {}; | |
| 70 | |
| 71 // This interface is used for testing bounds-checking in the mojom | |
| 72 // binding code. If you add a method please update the files | |
| 73 // ./data/validation/boundscheck_*. If you add a response please update | |
| 74 // ./data/validation/resp_boundscheck_*. | |
| 75 [ServiceName="this.is.the.service.name.for.BoundsCheckTestInterface"] | |
| 76 interface BoundsCheckTestInterface { | |
| 77 Method0(uint8 param0) => (uint8 param0); | |
| 78 Method1(uint8 param0); | |
| 79 }; | |
| 80 | |
| 81 interface ConformanceTestInterface { | |
| 82 Method0(float param0); | |
| 83 Method1(StructA param0); | |
| 84 Method2(StructB param0, StructA param1); | |
| 85 Method3(array<bool> param0); | |
| 86 Method4(StructC param0, array<uint8> param1); | |
| 87 Method5(StructE param0, handle<data_pipe_producer> param1); | |
| 88 Method6(array<array<uint8>> param0); | |
| 89 Method7(StructF param0, array<array<uint8, 3>?, 2> param1); | |
| 90 Method8(array<array<string>?> param0); | |
| 91 Method9(array<array<handle?>>? param0); | |
| 92 Method10(map<string, uint8> param0); | |
| 93 Method11(StructG param0); | |
| 94 Method12(float param0) => (float param0); | |
| 95 Method13(InterfaceA? param0, uint32 param1, InterfaceA? param2); | |
| 96 Method14(UnionA param0); | |
| 97 Method15(StructH param0); | |
| 98 }; | |
| 99 | |
| 100 struct BasicStruct { | |
| 101 int32 a; | |
| 102 }; | |
| 103 | |
| 104 interface IntegrationTestInterface { | |
| 105 Method0(BasicStruct param0) => (array<uint8> param0); | |
| 106 }; | |
| 107 | |
| 108 // An enum generates a enum-value validation function, so we want to test it. | |
| 109 // E.g., valid enum values for this enum should be: -3, 0, 1, 10 | |
| 110 enum BasicEnum { | |
| 111 A, | |
| 112 B, | |
| 113 C = A, | |
| 114 D = -3, | |
| 115 E = 0xA, | |
| 116 }; | |
| 117 | |
| 118 // The enum validation function should be generated within the scope of this | |
| 119 // struct. | |
| 120 struct StructWithEnum { | |
| 121 enum EnumWithin { | |
| 122 A, | |
| 123 B, | |
| 124 C, | |
| 125 D, | |
| 126 }; | |
| 127 }; | |
| OLD | NEW |