ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / tools / idl_parser / test_parser / interface_web.idl
blob9e69e9f12430849046edeff478539c035073f028
1 /* Copyright (c) 2013 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. */
5 /* Test Interface productions
7 Run with --test to generate an AST and verify that all comments accurately
8 reflect the state of the Nodes.
10 BUILD Type(Name)
11 This comment signals that a node of type <Type> is created with the
12 name <Name>.
14 ERROR Error String
15 This comment signals that a error of <Error String> is generated. The error
16 is not assigned to a node, but are expected in order.
18 PROP Key=Value
19 This comment signals that a property has been set on the Node such that
20 <Key> = <Value>.
22 TREE
23 Type(Name)
24 Type(Name)
25 Type(Name)
26 Type(Name)
27 ...
28 This comment signals that a tree of nodes matching the BUILD comment
29 symatics should exist. This is an exact match.
33 /* TREE
34 *Interface(MyIFace)
36 interface MyIFace { };
38 /* TREE
39 *Interface(MyIFaceInherit)
40 * Inherit(Foo)
42 interface MyIFaceInherit : Foo {};
44 /* TREE
45 *Interface(MyIFacePartial)
47 partial interface MyIFacePartial { };
49 /* ERROR Unexpected ":" after identifier "MyIFaceInherit". */
50 partial interface MyIFaceInherit : Foo {};
52 /* TREE
53 *Interface(MyIFaceMissingArgument)
54 * Operation(foo)
55 * Arguments()
56 * Argument(arg)
57 * Type()
58 * PrimitiveType(DOMString)
59 * Error(Missing argument.)
60 * Type()
61 * PrimitiveType(void)
63 interface MyIFaceMissingArgument {
64 void foo(DOMString arg, );
67 /* TREE
68 *Error(Unexpected keyword "double" after keyword "readonly".)
70 interface MyIFaceMissingAttribute {
71 readonly double foo;
74 /* TREE
75 *Interface(MyIFaceBig)
76 * Const(setString)
77 * PrimitiveType(DOMString)
78 * Value(NULL)
80 interface MyIFaceBig {
81 const DOMString? setString = null;
84 /* TREE
85 *Interface(MyIfaceEmptySequenceDefalutValue)
86 * Operation(foo)
87 * Arguments()
88 * Argument(arg)
89 * Type()
90 * Sequence()
91 * Type()
92 * PrimitiveType(DOMString)
93 * Default()
94 * Type()
95 * PrimitiveType(void)
97 interface MyIfaceEmptySequenceDefalutValue {
98 void foo(optional sequence<DOMString> arg = []);
101 /* TREE
102 *Interface(MyIFaceBig2)
103 * Const(nullValue)
104 * PrimitiveType(DOMString)
105 * Value(NULL)
106 * Const(longValue)
107 * PrimitiveType(long)
108 * Value(123)
109 * Const(longValue2)
110 * PrimitiveType(long long)
111 * Value(123)
112 * Attribute(myString)
113 * Type()
114 * PrimitiveType(DOMString)
115 * Attribute(readOnlyString)
116 * Type()
117 * PrimitiveType(DOMString)
118 * Attribute(staticString)
119 * Type()
120 * PrimitiveType(DOMString)
121 * Operation(myFunction)
122 * Arguments()
123 * Argument(myLong)
124 * Type()
125 * PrimitiveType(long long)
126 * Type()
127 * PrimitiveType(void)
128 * Operation(staticFunction)
129 * Arguments()
130 * Argument(myLong)
131 * Type()
132 * PrimitiveType(long long)
133 * Type()
134 * PrimitiveType(void)
136 interface MyIFaceBig2 {
137 const DOMString? nullValue = null;
138 const long longValue = 123;
139 const long long longValue2 = 123;
140 attribute DOMString myString;
141 readonly attribute DOMString readOnlyString;
142 static attribute DOMString staticString;
143 void myFunction(long long myLong);
144 static void staticFunction(long long myLong);
148 /* TREE
149 *Interface(MyIFaceSpecials)
150 * Operation(set)
151 * Arguments()
152 * Argument(property)
153 * Type()
154 * PrimitiveType(DOMString)
155 * Type()
156 * PrimitiveType(void)
157 * Operation(_unnamed_)
158 * Arguments()
159 * Argument(property)
160 * Type()
161 * PrimitiveType(DOMString)
162 * Type()
163 * PrimitiveType(double)
164 * Operation(GetFiveSix)
165 * Arguments()
166 * Argument(arg)
167 * Type()
168 * Typeref(SomeType)
169 * Type()
170 * PrimitiveType(long long)
171 * Array(5)
172 * Array(6)
174 interface MyIFaceSpecials {
175 setter creator void set(DOMString property);
176 getter double (DOMString property);
177 long long [5][6] GetFiveSix(SomeType arg);
180 /* TREE
181 *Interface(MyIFaceStringifiers)
182 * Stringifier()
183 * Stringifier()
184 * Operation(_unnamed_)
185 * Arguments()
186 * Type()
187 * PrimitiveType(DOMString)
188 * Stringifier()
189 * Operation(namedStringifier)
190 * Arguments()
191 * Type()
192 * PrimitiveType(DOMString)
193 * Stringifier()
194 * Attribute(stringValue)
195 * Type()
196 * PrimitiveType(DOMString)
198 interface MyIFaceStringifiers {
199 stringifier;
200 stringifier DOMString ();
201 stringifier DOMString namedStringifier();
202 stringifier attribute DOMString stringValue;
205 /* TREE
206 *Interface(MyExtendedAttributeInterface)
207 * Operation(method)
208 * Arguments()
209 * Type()
210 * PrimitiveType(void)
211 * ExtAttributes()
212 * ExtAttribute(Attr)
213 * ExtAttribute(MethodIdentList)
214 * ExtAttributes()
215 * ExtAttribute(MyExtendedAttribute)
216 * ExtAttribute(MyExtendedIdentListAttribute)
218 [MyExtendedAttribute,
219 MyExtendedIdentListAttribute=(Foo, Bar, Baz)]
220 interface MyExtendedAttributeInterface {
221 [Attr, MethodIdentList=(Foo, Bar)] void method();
224 /* TREE
225 *Interface(MyIfacePromise)
226 * Operation(method1)
227 * Arguments()
228 * Type()
229 * Promise(Promise)
230 * Type()
231 * PrimitiveType(void)
232 * Operation(method2)
233 * Arguments()
234 * Type()
235 * Promise(Promise)
236 * Type()
237 * PrimitiveType(long)
238 * Operation(method3)
239 * Arguments()
240 * Type()
241 * Promise(Promise)
242 * Type()
243 * Any()
244 * Operation(method4)
245 * Arguments()
246 * Type()
247 * Promise(Promise)
248 * Type()
249 * Any()
251 interface MyIfacePromise {
252 Promise<void> method1();
253 Promise<long> method2();
254 Promise<any> method3();
255 Promise method4();
258 /* TREE
259 *Interface(MyIfaceIterable)
260 * Iterable()
261 * Type()
262 * PrimitiveType(long)
263 * Iterable()
264 * Type()
265 * PrimitiveType(double)
266 * Type()
267 * PrimitiveType(DOMString)
268 * LegacyIterable()
269 * Type()
270 * PrimitiveType(boolean)
272 interface MyIfaceIterable {
273 iterable<long>;
274 iterable<double, DOMString>;
275 legacyiterable<boolean>;
278 /* TREE
279 *Interface(MyIfaceMaplike)
280 * Maplike()
281 * Type()
282 * PrimitiveType(long)
283 * Type()
284 * PrimitiveType(DOMString)
285 * Maplike()
286 * Type()
287 * PrimitiveType(double)
288 * Type()
289 * PrimitiveType(boolean)
291 interface MyIfaceMaplike {
292 readonly maplike<long, DOMString>;
293 maplike<double, boolean>;
296 /* TREE
297 *Interface(MyIfaceSetlike)
298 * Setlike()
299 * Type()
300 * PrimitiveType(long)
301 * Setlike()
302 * Type()
303 * PrimitiveType(double)
305 interface MyIfaceSetlike {
306 readonly setlike<long>;
307 setlike<double>;