blob: 175a657286e14d7550077a0047de975247cac9c6 [file] [log] [blame]
This tests the constructor for the CustomEvent DOM class.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS new CustomEvent('eventType').bubbles is false
PASS new CustomEvent('eventType').cancelable is false
PASS new CustomEvent('eventType').detail is null
PASS new CustomEvent('eventType', { bubbles: true, cancelable: true }).bubbles is true
PASS new CustomEvent('eventType', { bubbles: true, cancelable: true }).cancelable is true
PASS new CustomEvent('eventType', { bubbles: true, cancelable: true }).detail is null
PASS new CustomEvent('eventType', { detail: 10 }).detail is 10
PASS new CustomEvent('eventType', { detail: 'string' }).detail is 'string'
PASS new CustomEvent('eventType', { detail: detailObject }).detail is detailObject
PASS new CustomEvent('eventType', { detail: document }).detail is document
PASS new CustomEvent('eventType', { detail: undefined }).detail is null
PASS new CustomEvent('eventType', { detail: null }).detail is null
PASS new CustomEvent('eventType', { get detail() { return true; } }).detail is true
PASS new CustomEvent('eventType', { get detail() { throw 'Custom Error'; } }) threw exception Custom Error.
PASS event.detail is detailObject
PASS successfullyParsed is true
TEST COMPLETE