blob: af5442ed269caf2f434703a474c7814c194334f3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Tests a variety of basic API definition features.
namespace idl_basics {
enum EnumType {
name1,
name2
};
dictionary MyType1 {
long x; // This comment tests "double-quotes".
DOMString y;
};
dictionary MyType2 {
DOMString x;
};
callback Callback1 = void();
callback Callback2 = void(long x);
callback Callback3 = void(MyType1 arg);
callback Callback4 = void(MyType2[] arg);
callback Callback5 = void(EnumType type);
interface Functions {
static void function1();
static void function2(long x);
// This comment should appear in the documentation,
// despite occupying multiple lines.
//
// |arg|: So should this comment
// about the argument.
// <em>HTML</em> is fine too.
static void function3(MyType1 arg);
// This tests if "double-quotes" are escaped correctly.
static void function4(Callback1 cb);
static void function5(Callback2 cb);
static void function6(Callback3 cb);
static void function7(optional long arg);
static void function8(long arg1, optional DOMString arg2);
static void function9(optional MyType1 arg);
static void function10(long x, long[] y);
static void function11(MyType1[] arg);
static void function12(Callback4 cb);
static void function13(EnumType type, Callback5 cb);
static void function14(EnumType[] types);
// "switch" is a reserved word and should cause a C++ compile error if we
// emit code for this declaration.
[nocompile] static void function15(long switch);
};
interface Events {
static void onFoo1();
static void onFoo2(long x);
static void onFoo2(MyType1 arg);
static void onFoo3(EnumType type);
};
};
|