create-event.js revision eff69b907ef2cd3a9af0351287a929c66f58e3f6
1description("Tests that document.createEvent() works with DeviceMotinEvent."); 2 3var event = document.createEvent('DeviceMotionEvent'); 4 5shouldBeTrue("typeof event == 'object'"); 6 7shouldBeTrue("'type' in event"); 8shouldBeTrue("'bubbles' in event"); 9shouldBeTrue("'cancelable' in event"); 10shouldBeTrue("'xAcceleration' in event"); 11shouldBeTrue("'yAcceleration' in event"); 12shouldBeTrue("'zAcceleration' in event"); 13shouldBeTrue("'xRotationRate' in event"); 14shouldBeTrue("'yRotationRate' in event"); 15shouldBeTrue("'zRotationRate' in event"); 16shouldBeTrue("'interval' in event"); 17 18shouldBeTrue("typeof event.type == 'string'"); 19shouldBeTrue("typeof event.bubbles == 'boolean'"); 20shouldBeTrue("typeof event.cancelable == 'boolean'"); 21shouldBeTrue("typeof event.xAcceleration == 'object'"); 22shouldBeTrue("typeof event.yAcceleration == 'object'"); 23shouldBeTrue("typeof event.zAcceleration == 'object'"); 24shouldBeTrue("typeof event.xRotationRate == 'object'"); 25shouldBeTrue("typeof event.yRotationRate == 'object'"); 26shouldBeTrue("typeof event.zRotationRate == 'object'"); 27shouldBeTrue("typeof event.interval == 'object'"); 28 29window.successfullyParsed = true; 30