Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/DeviceMotion/create-event.html

Issue 2677603003: Move DeviceMotion and DeviceOrientation out from fast/dom/. (Closed)
Patch Set: device_orientation Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../../../resources/js-test.js"></script>
5 <script>
6 description("Tests that document.createEvent() works with DeviceMotionEvent.");
7
8 var event = document.createEvent('DeviceMotionEvent');
9 var newEvent = new CustomEvent("devicemotion", {
10 bubbles: false, cancelable: false,
11 acceleration: {x:1.5,y:2.5,z:3.5},
12 accelerationIncludingGravity: {x:4.5,y:5.5,z:6.5},
13 rotationRate: {alpha:7.5,beta:8.5,gamma:9.5},
14 interval: 0.5
15 });
16
17 shouldBeTrue("typeof event == 'object'");
18 shouldBe("event.__proto__", "DeviceMotionEvent.prototype");
19
20 shouldBeTrue("'type' in event");
21 shouldBeTrue("'bubbles' in event");
22 shouldBeTrue("'cancelable' in event");
23 shouldBeTrue("'acceleration' in event");
24 shouldBeTrue("'accelerationIncludingGravity' in event");
25 shouldBeTrue("'rotationRate' in event");
26 shouldBeTrue("'interval' in event");
27
28 shouldBeTrue("typeof newEvent.type == 'string'");
29 shouldBeEqualToString("newEvent.type", "devicemotion");
30 shouldBeTrue("typeof newEvent.bubbles == 'boolean'");
31 shouldBeFalse("event.bubbles");
32 shouldBeFalse("newEvent.bubbles");
33 shouldBeTrue("typeof newEvent.cancelable == 'boolean'");
34 shouldBeFalse("event.cancelable");
35 shouldBeFalse("newEvent.cancelable");
36 shouldBeTrue("typeof event.acceleration == 'object'");
37 shouldBeTrue("typeof event.accelerationIncludingGravity == 'object'");
38 shouldBeTrue("typeof event.rotationRate == 'object'");
39 shouldBeTrue("typeof event.interval == 'object'");
40
41 </script>
42 </body>
43 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698