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

Unified Diff: third_party/WebKit/LayoutTests/custom-elements/spec/resources/custom-elements-helpers.js

Issue 2100403002: calling whenDefined with invalid name should throw SyntaxError (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removing assert_throws_dom_exception Created 4 years, 5 months 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/custom-elements/spec/resources/custom-elements-helpers.js
diff --git a/third_party/WebKit/LayoutTests/custom-elements/spec/resources/custom-elements-helpers.js b/third_party/WebKit/LayoutTests/custom-elements/spec/resources/custom-elements-helpers.js
index 885677d54cd183c6226c7dd07a57753aaf3ec9f1..c4a9e6c5ad706f69b376873bdf97bd5e735f8ef4 100644
--- a/third_party/WebKit/LayoutTests/custom-elements/spec/resources/custom-elements-helpers.js
+++ b/third_party/WebKit/LayoutTests/custom-elements/spec/resources/custom-elements-helpers.js
@@ -20,3 +20,16 @@ function test_with_window(f, name) {
});
}, name);
}
+
+function assert_throws_dom_exception(global_context, code, func, description) {
+ let exception;
+ assert_throws(code, () => {
+ try {
+ func.call(this);
+ } catch(e) {
+ exception = e;
+ throw e;
+ }
+ }, description);
+ assert_true(exception instanceof global_context.DOMException, 'DOMException on the appropriate window');
+}

Powered by Google App Engine
This is Rietveld 408576698