| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // Tests a variety of basic API definition features. | |
| 6 | |
| 7 [internal] namespace idl_basics { | |
| 8 // Enum description | |
| 9 enum EnumType { | |
| 10 name1, | |
| 11 name2 | |
| 12 }; | |
| 13 | |
| 14 dictionary MyType1 { | |
| 15 // This comment tests "double-quotes". | |
| 16 [legalValues=(1,2)] long x; | |
| 17 DOMString y; | |
| 18 DOMString z; | |
| 19 DOMString a; | |
| 20 DOMString b; | |
| 21 DOMString c; | |
| 22 }; | |
| 23 | |
| 24 dictionary MyType2 { | |
| 25 DOMString x; | |
| 26 }; | |
| 27 | |
| 28 callback Callback1 = void(); | |
| 29 callback Callback2 = void(long x); | |
| 30 callback Callback3 = void(MyType1 arg); | |
| 31 callback Callback4 = void(MyType2[] arg); | |
| 32 callback Callback5 = void(EnumType type); | |
| 33 // A comment on a callback. | |
| 34 // |x|: A parameter. | |
| 35 callback Callback6 = void(long x); | |
| 36 // |x|: Just a parameter comment, with no comment on the callback. | |
| 37 callback Callback7 = void(long x); | |
| 38 | |
| 39 interface Functions { | |
| 40 static void function1(); | |
| 41 static void function2(long x); | |
| 42 // This comment should appear in the documentation, | |
| 43 // despite occupying multiple lines. | |
| 44 // | |
| 45 // |arg|: So should this comment | |
| 46 // about the argument. | |
| 47 // <em>HTML</em> is fine too. | |
| 48 static void function3(MyType1 arg); | |
| 49 | |
| 50 // This tests if "double-quotes" are escaped correctly. | |
| 51 // | |
| 52 // It also tests a comment with two newlines. | |
| 53 static void function4(Callback1 cb); | |
| 54 static void function5(Callback2 cb); | |
| 55 static void function6(Callback3 cb); | |
| 56 | |
| 57 static void function7(optional long arg); | |
| 58 static void function8(long arg1, optional DOMString arg2); | |
| 59 static void function9(optional MyType1 arg); | |
| 60 | |
| 61 static void function10(long x, long[] y); | |
| 62 static void function11(MyType1[] arg); | |
| 63 | |
| 64 static void function12(Callback4 cb); | |
| 65 | |
| 66 static void function13(EnumType type, Callback5 cb); | |
| 67 static void function14(EnumType[] types); | |
| 68 | |
| 69 // "switch" is a reserved word and should cause a C++ compile error if we | |
| 70 // emit code for this declaration. | |
| 71 [nocompile] static void function15(long switch); | |
| 72 | |
| 73 static void function16(Callback6 cb); | |
| 74 static void function17(Callback7 cb); | |
| 75 // |cb|: Override callback comment. | |
| 76 static void function18(Callback7 cb); | |
| 77 }; | |
| 78 | |
| 79 interface Events { | |
| 80 static void onFoo1(); | |
| 81 static void onFoo2(long x); | |
| 82 static void onFoo2(MyType1 arg); | |
| 83 static void onFoo3(EnumType type); | |
| 84 }; | |
| 85 }; | |
| OLD | NEW |