blob: 2ce96846e309fbd52f46af7e0b0a2d3ccadaebf1 [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 successfullyParsed is true
TEST COMPLETE