blob: ef8e9a2cbebfba2eb8e6fe649ac1e6e030b7fbb2 [file] [log] [blame]
This tests the constructor for the CloseEvent DOM class.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS new CloseEvent('eventType').bubbles is false
PASS new CloseEvent('eventType').cancelable is false
PASS new CloseEvent('eventType').wasClean is false
PASS new CloseEvent('eventType').code is 0
PASS new CloseEvent('eventType').reason is ""
PASS new CloseEvent('eventType', { bubbles: false }).bubbles is false
PASS new CloseEvent('eventType', { bubbles: true }).bubbles is true
PASS new CloseEvent('eventType', { cancelable: false }).cancelable is false
PASS new CloseEvent('eventType', { cancelable: true }).cancelable is true
PASS new CloseEvent('eventType', { wasClean: false }).wasClean is false
PASS new CloseEvent('eventType', { wasClean: true }).wasClean is true
PASS new CloseEvent('eventType', { reason: 'koakuma' }).reason is "koakuma"
PASS new CloseEvent('eventType', { reason: '' }).reason is ""
PASS new CloseEvent('eventType', { reason: undefined }).reason is ""
PASS new CloseEvent('eventType', { reason: null }).reason is "null"
PASS new CloseEvent('eventType', { reason: false }).reason is "false"
PASS new CloseEvent('eventType', { reason: true }).reason is "true"
PASS new CloseEvent('eventType', { reason: 12345 }).reason is "12345"
PASS new CloseEvent('eventType', { reason: 18446744073709551615 }).reason is "18446744073709552000"
PASS new CloseEvent('eventType', { reason: NaN }).reason is "NaN"
PASS new CloseEvent('eventType', { reason: [] }).reason is ""
PASS new CloseEvent('eventType', { reason: [1, 2, 3] }).reason is "1,2,3"
PASS new CloseEvent('eventType', { reason: {koakuma: 12345} }).reason is "[object Object]"
PASS new CloseEvent('eventType', { reason: {valueOf: function () { return 'koakuma'; } } }).reason is "[object Object]"
PASS new CloseEvent('eventType', { code: 0 }).code is 0
PASS new CloseEvent('eventType', { code: 1 }).code is 1
PASS new CloseEvent('eventType', { code: 65534 }).code is 65534
PASS new CloseEvent('eventType', { code: 65535 }).code is 65535
PASS new CloseEvent('eventType', { code: 9007199254740991 }).code is 65535
PASS new CloseEvent('eventType', { code: 18446744073709551615 }).code is 0
PASS new CloseEvent('eventType', { code: 12345678901234567890 }).code is 2048
PASS new CloseEvent('eventType', { code: -1 }).code is 65535
PASS new CloseEvent('eventType', { code: 123.45 }).code is 123
PASS new CloseEvent('eventType', { code: NaN }).code is 0
PASS new CloseEvent('eventType', { code: undefined }).code is 0
PASS new CloseEvent('eventType', { code: null }).code is 0
PASS new CloseEvent('eventType', { code: '' }).code is 0
PASS new CloseEvent('eventType', { code: '12345' }).code is 12345
PASS new CloseEvent('eventType', { code: '12345a' }).code is 0
PASS new CloseEvent('eventType', { code: 'abc' }).code is 0
PASS new CloseEvent('eventType', { code: [] }).code is 0
PASS new CloseEvent('eventType', { code: [12345] }).code is 12345
PASS new CloseEvent('eventType', { code: [12345, 67890] }).code is 0
PASS new CloseEvent('eventType', { code: {} }).code is 0
PASS new CloseEvent('eventType', { code: {moemoe: 12345} }).code is 0
PASS new CloseEvent('eventType', { code: {valueOf: function () { return 12345; }} }).code is 12345
PASS new CloseEvent('eventType', { bubbles: true, cancelable: true, wasClean: true, code : 12345, reason: 'koakuma' }).bubbles is true
PASS new CloseEvent('eventType', { bubbles: true, cancelable: true, wasClean: true, code : 12345, reason: 'koakuma' }).cancelable is true
PASS new CloseEvent('eventType', { bubbles: true, cancelable: true, wasClean: true, code : 12345, reason: 'koakuma' }).wasClean is true
PASS new CloseEvent('eventType', { bubbles: true, cancelable: true, wasClean: true, code : 12345, reason: 'koakuma' }).code is 12345
PASS new CloseEvent('eventType', { bubbles: true, cancelable: true, wasClean: true, code : 12345, reason: 'koakuma' }).reason is "koakuma"
PASS successfullyParsed is true
TEST COMPLETE