OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Tests a variety of basic API definition features. | 5 // Tests a variety of basic API definition features. |
6 | 6 |
7 namespace idl_basics { | 7 namespace idl_basics { |
8 dictionary MyType1 { | 8 dictionary MyType1 { |
9 long x; | 9 long x; |
10 DOMString y; | 10 DOMString y; |
11 }; | 11 }; |
12 | 12 |
13 dictionary MyType2 { | 13 dictionary MyType2 { |
14 DOMString x; | 14 DOMString x; |
15 }; | 15 }; |
16 | 16 |
17 callback Callback1 = void(); | 17 callback Callback1 = void(); |
18 callback Callback2 = void(long x); | 18 callback Callback2 = void(long x); |
19 callback Callback3 = void(MyType1 arg); | 19 callback Callback3 = void(MyType1 arg); |
| 20 callback Callback4 = void(MyType2[] arg); |
20 | 21 |
21 interface Functions { | 22 interface Functions { |
22 static void function1(); | 23 static void function1(); |
23 static void function2(long x); | 24 static void function2(long x); |
24 static void function3(MyType1 arg); | 25 static void function3(MyType1 arg); |
25 | 26 |
26 static void function4(Callback1 cb); | 27 static void function4(Callback1 cb); |
27 static void function5(Callback2 cb); | 28 static void function5(Callback2 cb); |
28 static void function6(Callback3 cb); | 29 static void function6(Callback3 cb); |
29 | 30 |
30 static void function7(optional long arg); | 31 static void function7(optional long arg); |
31 static void function8(long arg1, optional DOMString arg2); | 32 static void function8(long arg1, optional DOMString arg2); |
32 static void function9(optional MyType1 arg); | 33 static void function9(optional MyType1 arg); |
| 34 |
| 35 static void function10(long x, long[] y); |
| 36 static void function11(MyType1[] arg); |
| 37 |
| 38 static void function12(Callback4 cb); |
33 }; | 39 }; |
34 | 40 |
35 interface Events { | 41 interface Events { |
36 static void onFoo1(); | 42 static void onFoo1(); |
37 static void onFoo2(long x); | 43 static void onFoo2(long x); |
38 static void onFoo2(MyType1 arg); | 44 static void onFoo2(MyType1 arg); |
39 }; | 45 }; |
40 }; | 46 }; |
OLD | NEW |