blob: 346033e5f8b7f7780f1d0e3ca47a2afb1e56274b [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 is null
PASS new FocusEvent('eventType', { view: document }).view is null
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 is null
PASS new FocusEvent('eventType', { view: true }).view is null
PASS new FocusEvent('eventType', { view: '' }).view is null
PASS new FocusEvent('eventType', { view: 'chocolate' }).view is null
PASS new FocusEvent('eventType', { view: 12345 }).view is null
PASS new FocusEvent('eventType', { view: 18446744073709551615 }).view is null
PASS new FocusEvent('eventType', { view: NaN }).view is null
PASS new FocusEvent('eventType', { view: {valueOf: function () { return window; } } }).view == window is false
PASS new FocusEvent('eventType', { get view() { return 123; } }).view is null
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 }).relatedTarget is null
PASS new FocusEvent('eventType', { relatedTarget: undefined }).relatedTarget is null
PASS new FocusEvent('eventType', { relatedTarget: null }).relatedTarget is null
PASS new FocusEvent('eventType', { relatedTarget: false }).relatedTarget is null
PASS new FocusEvent('eventType', { relatedTarget: true }).relatedTarget is null
PASS new FocusEvent('eventType', { relatedTarget: '' }).relatedTarget is null
PASS new FocusEvent('eventType', { relatedTarget: 'chocolate' }).relatedTarget is null
PASS new FocusEvent('eventType', { relatedTarget: 12345 }).relatedTarget is null
PASS new FocusEvent('eventType', { relatedTarget: 18446744073709551615 }).relatedTarget is null
PASS new FocusEvent('eventType', { relatedTarget: NaN }).relatedTarget is null
PASS new FocusEvent('eventType', { relatedTarget: {valueOf: function () { return testDiv; } } }).relatedTarget == testDiv is false
PASS new FocusEvent('eventType', { get relatedTarget() { return 123; } }).relatedTarget is null
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