Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(580)

Side by Side Diff: mojo/public/interfaces/bindings/tests/validation_test_interfaces.mojom

Issue 2741943002: mojo bindings: Support enums with no values (Closed)
Patch Set: new test & template change Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 5
6 [JavaPackage="org.chromium.mojo.bindings.test.mojom.mojo"] 6 [JavaPackage="org.chromium.mojo.bindings.test.mojom.mojo"]
7 module mojo.test; 7 module mojo.test;
8 8
9 struct StructA { 9 struct StructA {
10 uint64 i; 10 uint64 i;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 ENUM_A_1 49 ENUM_A_1
50 }; 50 };
51 51
52 [Extensible] 52 [Extensible]
53 enum EnumB { 53 enum EnumB {
54 ENUM_B_0, 54 ENUM_B_0,
55 ENUM_B_1, 55 ENUM_B_1,
56 ENUM_B_2 56 ENUM_B_2
57 }; 57 };
58 58
59 // A non-extensible enum with no values is valid, but about as useless as
60 // you would expect: it will fail validation for all values.
61 enum EmptyEnum {};
62
63 [Extensible]
64 enum ExtensibleEmptyEnum {};
65
59 union UnionA { 66 union UnionA {
60 StructA struct_a; 67 StructA struct_a;
61 bool b; 68 bool b;
62 }; 69 };
63 70
64 // This interface is used for testing bounds-checking in the mojom 71 // This interface is used for testing bounds-checking in the mojom
65 // binding code. If you add a method please update the files 72 // binding code. If you add a method please update the files
66 // ./data/validation/boundscheck_*. If you add a response please update 73 // ./data/validation/boundscheck_*. If you add a response please update
67 // ./data/validation/resp_boundscheck_*. 74 // ./data/validation/resp_boundscheck_*.
68 interface BoundsCheckTestInterface { 75 interface BoundsCheckTestInterface {
(...skipping 16 matching lines...) Expand all
85 Method11(StructG param0); 92 Method11(StructG param0);
86 Method12(float param0) => (float param0); 93 Method12(float param0) => (float param0);
87 Method13(InterfaceA? param0, uint32 param1, InterfaceA? param2); 94 Method13(InterfaceA? param0, uint32 param1, InterfaceA? param2);
88 Method14(EnumA param0, EnumB param1); 95 Method14(EnumA param0, EnumB param1);
89 Method15(array<EnumA>? param0, array<EnumB>? param1); 96 Method15(array<EnumA>? param0, array<EnumB>? param1);
90 Method16(map<EnumA, EnumA>? param0); 97 Method16(map<EnumA, EnumA>? param0);
91 Method17(array<InterfaceA> param0); 98 Method17(array<InterfaceA> param0);
92 Method18(UnionA? param0); 99 Method18(UnionA? param0);
93 Method19(Recursive recursive); 100 Method19(Recursive recursive);
94 Method20(map<StructB, uint8> param0); 101 Method20(map<StructB, uint8> param0);
102 Method21(ExtensibleEmptyEnum param0);
103 Method22(EmptyEnum param0);
95 }; 104 };
96 105
97 struct BasicStruct { 106 struct BasicStruct {
98 int32 a; 107 int32 a;
99 }; 108 };
100 109
101 interface IntegrationTestInterface { 110 interface IntegrationTestInterface {
102 Method0(BasicStruct param0) => (array<uint8> param0); 111 Method0(BasicStruct param0) => (array<uint8> param0);
103 }; 112 };
104 113
(...skipping 12 matching lines...) Expand all
117 struct StructWithEnum { 126 struct StructWithEnum {
118 enum EnumWithin { 127 enum EnumWithin {
119 A, B, C, D 128 A, B, C, D
120 }; 129 };
121 }; 130 };
122 131
123 // This is used to test that deeply recursive structures don't blow the stack. 132 // This is used to test that deeply recursive structures don't blow the stack.
124 struct Recursive { 133 struct Recursive {
125 Recursive? recursive; 134 Recursive? recursive;
126 }; 135 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698