blob: a427c4406661a1c87562653e112452e5b528bdf1 [file] [log] [blame]
This tests the constructor for the UIEvent DOM class.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS new UIEvent('eventType').bubbles is false
PASS new UIEvent('eventType').cancelable is false
PASS new UIEvent('eventType').view is null
PASS new UIEvent('eventType').detail is 0
PASS new UIEvent('eventType', { bubbles: false }).bubbles is false
PASS new UIEvent('eventType', { bubbles: true }).bubbles is true
PASS new UIEvent('eventType', { cancelable: false }).cancelable is false
PASS new UIEvent('eventType', { cancelable: true }).cancelable is true
PASS new UIEvent('eventType', { view: window }).view is window
PASS new UIEvent('eventType', { view: this }).view is this
PASS new UIEvent('eventType', { view: testObject }).view threw exception TypeError: Type error.
PASS new UIEvent('eventType', { view: document }).view threw exception TypeError: Type error.
PASS new UIEvent('eventType', { view: undefined }).view is null
PASS new UIEvent('eventType', { view: null }).view is null
PASS new UIEvent('eventType', { view: false }).view threw exception TypeError: Type error.
PASS new UIEvent('eventType', { view: true }).view threw exception TypeError: Type error.
PASS new UIEvent('eventType', { view: '' }).view threw exception TypeError: Type error.
PASS new UIEvent('eventType', { view: 'chocolate' }).view threw exception TypeError: Type error.
PASS new UIEvent('eventType', { view: 12345 }).view threw exception TypeError: Type error.
PASS new UIEvent('eventType', { view: 18446744073709551615 }).view threw exception TypeError: Type error.
PASS new UIEvent('eventType', { view: NaN }).view threw exception TypeError: Type error.
PASS new UIEvent('eventType', { view: {valueOf: function () { return window; } } }).view threw exception TypeError: Type error.
PASS new UIEvent('eventType', { get view() { return 123; } }).view threw exception TypeError: Type error.
PASS new UIEvent('eventType', { get view() { throw 'UIEvent Error'; } }) threw exception UIEvent Error.
PASS new UIEvent('eventType', { detail: 0 }).detail is 0
PASS new UIEvent('eventType', { detail: 2147483647 }).detail is 2147483647
PASS new UIEvent('eventType', { detail: -1 }).detail is -1
PASS new UIEvent('eventType', { detail: -2147483648 }).detail is -2147483648
PASS new UIEvent('eventType', { detail: 4294967295 }).detail is -1
PASS new UIEvent('eventType', { detail: 9007199254740991 }).detail is -1
PASS new UIEvent('eventType', { detail: 18446744073709551615 }).detail is 0
PASS new UIEvent('eventType', { detail: 123.45 }).detail is 123
PASS new UIEvent('eventType', { detail: NaN }).detail is 0
PASS new UIEvent('eventType', { detail: undefined }).detail is 0
PASS new UIEvent('eventType', { detail: null }).detail is 0
PASS new UIEvent('eventType', { detail: '' }).detail is 0
PASS new UIEvent('eventType', { detail: '12345' }).detail is 12345
PASS new UIEvent('eventType', { detail: '12345a' }).detail is 0
PASS new UIEvent('eventType', { detail: 'abc' }).detail is 0
PASS new UIEvent('eventType', { detail: [] }).detail is 0
PASS new UIEvent('eventType', { detail: [12345] }).detail is 12345
PASS new UIEvent('eventType', { detail: [12345, 67890] }).detail is 0
PASS new UIEvent('eventType', { detail: {} }).detail is 0
PASS new UIEvent('eventType', { detail: {moemoe: 12345} }).detail is 0
PASS new UIEvent('eventType', { detail: {valueOf: function () { return 12345; }} }).detail is 12345
PASS new UIEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 123 }).bubbles is true
PASS new UIEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 123 }).cancelable is true
PASS new UIEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 123 }).view is window
PASS new UIEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 123 }).detail is 123
PASS successfullyParsed is true
TEST COMPLETE