summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/pointerlock/idlharness.html
blob: aa876f58fd82ed3a4a5b3e9b04e96b13d855ab2d (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Pointer Lock IDL tests</title>
<link rel="author" title="W3C" href="http://www.w3.org/" />
<link rel="help" href="http://www.w3.org/TR/pointerlock/#element-interface"/>
<link rel="help" href="http://www.w3.org/TR/pointerlock/#extensions-to-the-document-interface">
<link rel="help" href="http://www.w3.org/TR/pointerlock/#extensions-to-the-mouseevent-interface">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/WebIDLParser.js"></script>
<script src="/resources/idlharness.js"></script>
</head>

<body>
<h1>Pointer Lock IDL tests</h1>

<pre id='untested_idl' style='display:none'>

interface EventTarget {
};

interface Node : EventTarget {
};

interface Element : Node {
};

interface Document : Node {
};

interface Event {
};

interface MouseEvent : Event {
};
</pre>

<pre id='idl'>

partial interface Element {
    void requestPointerLock ();
};

partial interface Document {
                attribute EventHandler onpointerlockchange;
                attribute EventHandler onpointerlockerror;
    readonly    attribute Element?     pointerLockElement;
    void exitPointerLock ();
};

partial interface MouseEvent {
    readonly    attribute long movementX;
    readonly    attribute long movementY;
};

partial dictionary MouseEventInit {
        long movementX = 0;
        long movementY = 0;
};


</pre>

<div id="log"></div>

<script>

var idl_array = new IdlArray();

setup(function() {
	idl_array.add_untested_idls(document.getElementById("untested_idl").textContent);
	idl_array.add_idls(document.getElementById("idl").textContent);

	idl_array.add_objects({ Document: ["window.document"],
                            Element: ["window.document.documentElement"],
                            MouseEvent: ["new MouseEvent('mousemove')", "new MouseEvent('pointerlockchange')"] });
});

idl_array.test();

</script>
</body>
</html>