Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add various tests for error event specialness #5014

Merged
merged 3 commits into from
Mar 9, 2017
Merged

Conversation

domenic
Copy link
Member

@domenic domenic commented Feb 24, 2017

Follows whatwg/html#2398; see also whatwg/html#2296.

@wpt-pr-bot
Copy link
Collaborator

Notifying @Ms2ger, @ayg, @jdm, @jgraham, @zcorpan, and @zqzhang. (Learn how reviewing works.)

@w3c-bots
Copy link

w3c-bots commented Feb 24, 2017

View the complete job log.

Firefox (nightly channel)

Testing web-platform-tests at revision be6e3bca3cfabd6da653db10529ff6d07ae3a003
Using browser at version BuildID 20170306110339; SourceStamp 966464a68a2cb3ca1125808e34abb5c1d34e3797
Starting 10 test iterations
All results were stable

All results

7 tests ran
/html/webappapis/scripting/events/event-handler-processing-algorithm-error/document-synthetic-errorevent.html
Subtest Results Messages
OK
error event is normal (return true does not cancel; one arg) on Document, with a synthetic ErrorEvent FAIL assert_equals: expected false but got true
/html/webappapis/scripting/events/event-handler-processing-algorithm-error/document-synthetic-event.html
Subtest Results Messages
OK
error event is normal (return true does not cancel; one arg) on Document, with a synthetic Event FAIL assert_equals: expected false but got true
/html/webappapis/scripting/events/event-handler-processing-algorithm-error/script-element.html
Subtest Results Messages
OK
error event behaves normally (return true does not cancel; one arg) on a script element, with a 404 error PASS
error event behaves normally (return true does not cancel; one arg) on a script element, with a synthetic Event FAIL assert_equals: expected false but got true
error event behaves normally (return true does not cancel; one arg) on a script element, with a synthetic ErrorEvent FAIL assert_equals: expected false but got true
/html/webappapis/scripting/events/event-handler-processing-algorithm-error/window-runtime-error.html
Subtest Results Messages
OK
error event is weird (return true cancels; many args) on Window, with a runtime error PASS
error event has the right 5 args on Window, with a runtime error PASS
/html/webappapis/scripting/events/event-handler-processing-algorithm-error/window-synthetic-errorevent.html
Subtest Results Messages
OK
error event is weird (return true cancels; many args) on Window, with a synthetic ErrorEvent PASS
error event has the right 5 args on Window, with a synthetic ErrorEvent PASS
/html/webappapis/scripting/events/event-handler-processing-algorithm-error/window-synthetic-event.html
Subtest Results Messages
OK
error event is normal (return true does not cancel; one arg) on Window, with a synthetic Event FAIL assert_equals: expected false but got true
/html/webappapis/scripting/events/event-handler-processing-algorithm-error/worker.html
Subtest Results Messages
OK
error event is normal (return true does not cancel; one arg) on Worker, with a syntax error in the worker code FAIL assert_equals: expected false but got true
error event is normal (return true does not cancel; one arg) on Worker, with a synthetic Event FAIL assert_equals: expected false but got true
error event is normal (return true does not cancel; one arg) on Worker, with a synthetic ErrorEvent FAIL assert_equals: expected false but got true

@w3c-bots
Copy link

w3c-bots commented Feb 24, 2017

View the complete job log.

Chrome (unstable channel)

Testing web-platform-tests at revision be6e3bca3cfabd6da653db10529ff6d07ae3a003
Using browser at version 58.0.3029.6 dev
Starting 10 test iterations
All results were stable

All results

7 tests ran
/html/webappapis/scripting/events/event-handler-processing-algorithm-error/document-synthetic-errorevent.html
Subtest Results Messages
OK
error event is normal (return true does not cancel; one arg) on Document, with a synthetic ErrorEvent PASS
/html/webappapis/scripting/events/event-handler-processing-algorithm-error/document-synthetic-event.html
Subtest Results Messages
OK
error event is normal (return true does not cancel; one arg) on Document, with a synthetic Event PASS
/html/webappapis/scripting/events/event-handler-processing-algorithm-error/script-element.html
Subtest Results Messages
OK
error event behaves normally (return true does not cancel; one arg) on a script element, with a 404 error PASS
error event behaves normally (return true does not cancel; one arg) on a script element, with a synthetic Event PASS
error event behaves normally (return true does not cancel; one arg) on a script element, with a synthetic ErrorEvent PASS
/html/webappapis/scripting/events/event-handler-processing-algorithm-error/window-runtime-error.html
Subtest Results Messages
OK
error event is weird (return true cancels; many args) on Window, with a runtime error PASS
error event has the right 5 args on Window, with a runtime error PASS
/html/webappapis/scripting/events/event-handler-processing-algorithm-error/window-synthetic-errorevent.html
Subtest Results Messages
OK
error event is weird (return true cancels; many args) on Window, with a synthetic ErrorEvent PASS
error event has the right 5 args on Window, with a synthetic ErrorEvent PASS
/html/webappapis/scripting/events/event-handler-processing-algorithm-error/window-synthetic-event.html
Subtest Results Messages
OK
error event is normal (return true does not cancel; one arg) on Window, with a synthetic Event FAIL assert_equals: expected false but got true
/html/webappapis/scripting/events/event-handler-processing-algorithm-error/worker.html
Subtest Results Messages
OK
error event is normal (return true does not cancel; one arg) on Worker, with a syntax error in the worker code PASS
error event is normal (return true does not cancel; one arg) on Worker, with a synthetic Event PASS
error event is normal (return true does not cancel; one arg) on Worker, with a synthetic ErrorEvent PASS

@foolip
Copy link
Member

foolip commented Mar 7, 2017

One failing test for Chrome here, a bunch for Firefox. Won't test further, too time consuming, will wait for the improved tooling to materialize.

Copy link
Member

@foolip foolip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quite comprehensive, changes possibly needed depending on discussion on spec side.


promise_test(t => {
window.onerror = t.step_func((...args) => {
assert_greater_than(args.length, 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a separate test requiring the precise number? I take it this is to avoid failing in Edge because it has 6 arguments?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I don't think there is one, or at least not an easy-to-find one. I'll add some.

return true;
});

const eventWatcher = new EventWatcher(t, window, "error");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding my comments in whatwg/html#2398 about synthetic events, this with one other type would be the test for that behavior.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then it wouldn't trigger .onerror = ..., which is what this section of the spec is about.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes :)

Copy link
Member

@foolip foolip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New tests LGTM, but I think there's still nothing that would fail if there are 6 arguments. I can't remember if that's actually the case anywhere, but I seem to remember an oddity in the number of arguments.

@domenic
Copy link
Member Author

domenic commented Mar 9, 2017

Right, Edge has only 4. Nobody has 6. I guess we might as well add more coverage though...

@domenic domenic merged commit f80f772 into master Mar 9, 2017
@domenic domenic deleted the error-cancelation branch March 9, 2017 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants