summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/dom/DeviceMotion/script-tests/create-event.js
blob: 167329d3c3610f4a9d9328cae81fa8546164ede5 (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
description("Tests that document.createEvent() works with DeviceMotinEvent.");

var event = document.createEvent('DeviceMotionEvent');

shouldBeTrue("typeof event == 'object'");

shouldBeTrue("'type' in event");
shouldBeTrue("'bubbles' in event");
shouldBeTrue("'cancelable' in event");
shouldBeTrue("'xAcceleration' in event");
shouldBeTrue("'yAcceleration' in event");
shouldBeTrue("'zAcceleration' in event");
shouldBeTrue("'xRotationRate' in event");
shouldBeTrue("'yRotationRate' in event");
shouldBeTrue("'zRotationRate' in event");
shouldBeTrue("'interval' in event");

shouldBeTrue("typeof event.type == 'string'");
shouldBeTrue("typeof event.bubbles == 'boolean'");
shouldBeTrue("typeof event.cancelable == 'boolean'");
shouldBeTrue("typeof event.xAcceleration == 'object'");
shouldBeTrue("typeof event.yAcceleration == 'object'");
shouldBeTrue("typeof event.zAcceleration == 'object'");
shouldBeTrue("typeof event.xRotationRate == 'object'");
shouldBeTrue("typeof event.yRotationRate == 'object'");
shouldBeTrue("typeof event.zRotationRate == 'object'");
shouldBeTrue("typeof event.interval == 'object'");

window.successfullyParsed = true;