create-event.https.html (1319B)
1 <!DOCTYPE html> 2 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharnessreport.js"></script> 4 <script> 5 'use strict'; 6 7 test(test => { 8 const event = document.createEvent('DeviceOrientationEvent'); 9 const newEvent = new CustomEvent("deviceorientation", { 10 bubbles: false, cancelable: false, 11 alpha: 1.0, 12 beta: 2.0, 13 gama: 3.0, 14 absolute: false 15 }); 16 17 assert_equals(typeof event, 'object'); 18 assert_equals(Object.getPrototypeOf(event), DeviceOrientationEvent.prototype); 19 20 assert_true('type' in event); 21 assert_true('bubbles' in event); 22 assert_true('cancelable' in event); 23 assert_true('alpha' in event); 24 assert_true('beta' in event); 25 assert_true('gamma' in event); 26 assert_true('absolute' in event); 27 28 assert_equals(typeof event.type, 'string'); 29 assert_equals(typeof event.bubbles, 'boolean'); 30 assert_equals(typeof event.cancelable, 'boolean'); 31 assert_equals(typeof event.alpha, 'object'); 32 assert_equals(typeof event.beta, 'object'); 33 assert_equals(typeof event.gamma, 'object'); 34 assert_equals(typeof event.absolute, 'boolean'); 35 36 assert_equals(newEvent.type, "deviceorientation"); 37 assert_false(newEvent.bubbles); 38 assert_false(newEvent.cancelable); 39 }, 'Tests that document.createEvent() works with DeviceOrientationEvent.'); 40 </script>