Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(431)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/DOMException/resources/dispatch-event-exception.js

Issue 1479063003: Drop [LegacyInterfaceTypeChecking] for EventTarget's dispatchEvent() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 description("Tests the properties of the exception thrown by dispatchEvent.") 1 description("Tests that dispatchEvent's argument is required to be an Event.")
2 2
3 var e; 3 shouldThrow("document.dispatchEvent(null)");
4 try { 4 shouldThrow("document.dispatchEvent(document)");
5 document.dispatchEvent(null);
6 // raises a InvalidStateError
7 } catch (err) {
8 e = err;
9 }
10
11 shouldBeEqualToString("e.toString()", "InvalidStateError: Failed to execute 'dis patchEvent' on 'EventTarget': The event provided is null.");
12 shouldBeEqualToString("Object.prototype.toString.call(e)", "[object DOMException ]");
13 shouldBeEqualToString("Object.prototype.toString.call(e.__proto__)", "[object DO MExceptionPrototype]");
14 shouldBeEqualToString("e.constructor.toString()", "function DOMException() { [na tive code] }");
15 shouldBe("e.constructor", "window.DOMException");
16
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698