blob: 0965c14743b00b1bbc617cb971b39bd95ca1a92c [file] [log] [blame]
Tests the optional properties of DeviceOrientationEvent. Each property should be null if not set, or set to null or undefined.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
event = document.createEvent('DeviceOrientationEvent')
PASS event.alpha == null is true
PASS event.beta == null is true
PASS event.gamma == null is true
PASS event.absolute is false
event = new DeviceOrientationEvent('', {alpha: 0, beta: 1, gamma: 2, absolute: false})
PASS event.alpha == 0 is true
PASS event.beta == 1 is true
PASS event.gamma == 2 is true
PASS event.absolute is false
event = new DeviceOrientationEvent('', {alpha: 0, beta: 1, gamma: 2, absolute: true})
PASS event.alpha == 0 is true
PASS event.beta == 1 is true
PASS event.gamma == 2 is true
PASS event.absolute is true
event = new DeviceOrientationEvent('')
PASS event.alpha == null is true
PASS event.beta == null is true
PASS event.gamma == null is true
PASS event.absolute is false
event = new DeviceOrientationEvent('', {alpha: [], beta: [], gamma: [], absolute: []})
PASS event.alpha == 0 is true
PASS event.beta == 0 is true
PASS event.gamma == 0 is true
PASS event.absolute is true
event = new DeviceOrientationEvent('', {alpha: undefined, beta: undefined, gamma: undefined, absolute: undefined})
PASS event.alpha == null is true
PASS event.beta == null is true
PASS event.gamma == null is true
PASS event.absolute is false
event = new DeviceOrientationEvent('', {alpha: '', beta: '', gamma: '', absolute: ''})
PASS event.alpha == 0 is true
PASS event.beta == 0 is true
PASS event.gamma == 0 is true
PASS event.absolute is false
event = new DeviceOrientationEvent('', {alpha: null, beta: null, gamma: null, absolute: null})
PASS event.alpha == null is true
PASS event.beta == null is true
PASS event.gamma == null is true
PASS event.absolute is false
PASS successfullyParsed is true
TEST COMPLETE