blob: 81d1cea8ad37c795d273a0177e29c3083ae71b08 [file] [log] [blame]
This tests the constructor for the FocusEvent DOM class.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS new FocusEvent('eventType').bubbles is false
PASS new FocusEvent('eventType').cancelable is false
PASS new FocusEvent('eventType').view is null
PASS new FocusEvent('eventType').detail is 0
PASS new FocusEvent('eventType').relatedTarget is null
PASS new FocusEvent('eventType', { bubbles: false }).bubbles is false
PASS new FocusEvent('eventType', { bubbles: true }).bubbles is true
PASS new FocusEvent('eventType', { cancelable: false }).cancelable is false
PASS new FocusEvent('eventType', { cancelable: true }).cancelable is true
PASS new FocusEvent('eventType', { view: window }).view is window
PASS new FocusEvent('eventType', { view: this }).view is this
PASS new FocusEvent('eventType', { view: testObject }).view threw exception TypeError: Type error.
PASS new FocusEvent('eventType', { view: document }).view threw exception TypeError: Type error.
PASS new FocusEvent('eventType', { view: undefined }).view is null
PASS new FocusEvent('eventType', { view: null }).view is null
PASS new FocusEvent('eventType', { view: false }).view threw exception TypeError: Type error.
PASS new FocusEvent('eventType', { view: true }).view threw exception TypeError: Type error.
PASS new FocusEvent('eventType', { view: '' }).view threw exception TypeError: Type error.
PASS new FocusEvent('eventType', { view: 'chocolate' }).view threw exception TypeError: Type error.
PASS new FocusEvent('eventType', { view: 12345 }).view threw exception TypeError: Type error.
PASS new FocusEvent('eventType', { view: 18446744073709551615 }).view threw exception TypeError: Type error.
PASS new FocusEvent('eventType', { view: NaN }).view threw exception TypeError: Type error.
PASS new FocusEvent('eventType', { view: {valueOf: function () { return window; } } }).view threw exception TypeError: Type error.
PASS new FocusEvent('eventType', { get view() { return 123; } }).view threw exception TypeError: Type error.
PASS new FocusEvent('eventType', { get view() { throw 'FocusEvent Error'; } }) threw exception FocusEvent Error.
PASS new FocusEvent('eventType', { relatedTarget: testDiv }).relatedTarget is testDiv
PASS new FocusEvent('eventType', { relatedTarget: document }).relatedTarget is document
PASS new FocusEvent('eventType', { relatedTarget: xhr }).relatedTarget is xhr
PASS new FocusEvent('eventType', { relatedTarget: window }).relatedTarget is window
PASS new FocusEvent('eventType', { relatedTarget: testObject }) threw exception TypeError: Type error.
PASS new FocusEvent('eventType', { relatedTarget: undefined }).relatedTarget is null
PASS new FocusEvent('eventType', { relatedTarget: null }).relatedTarget is null
PASS new FocusEvent('eventType', { relatedTarget: false }) threw exception TypeError: Type error.
PASS new FocusEvent('eventType', { relatedTarget: true }) threw exception TypeError: Type error.
PASS new FocusEvent('eventType', { relatedTarget: '' }) threw exception TypeError: Type error.
PASS new FocusEvent('eventType', { relatedTarget: 'chocolate' }) threw exception TypeError: Type error.
PASS new FocusEvent('eventType', { relatedTarget: 12345 }) threw exception TypeError: Type error.
PASS new FocusEvent('eventType', { relatedTarget: 18446744073709551615 }) threw exception TypeError: Type error.
PASS new FocusEvent('eventType', { relatedTarget: NaN }) threw exception TypeError: Type error.
PASS new FocusEvent('eventType', { relatedTarget: {valueOf: function () { return testDiv; } } }) threw exception TypeError: Type error.
PASS new FocusEvent('eventType', { get relatedTarget() { return 123; } }) threw exception TypeError: Type error.
PASS new FocusEvent('eventType', { get relatedTarget() { throw 'FocusEvent Error'; } }) threw exception FocusEvent Error.
PASS new FocusEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, relatedTarget: testDiv }).bubbles is true
PASS new FocusEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, relatedTarget: testDiv }).cancelable is true
PASS new FocusEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, relatedTarget: testDiv }).view is window
PASS new FocusEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, relatedTarget: testDiv }).detail is 111
PASS new FocusEvent('eventType', { bubbles: true, cancelable: true, view: window, detail: 111, relatedTarget: testDiv }).relatedTarget is testDiv
PASS successfullyParsed is true
TEST COMPLETE