summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue-invalid.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue-invalid.html')
-rw-r--r--testing/web-platform/tests/css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue-invalid.html23
1 files changed, 23 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue-invalid.html b/testing/web-platform/tests/css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue-invalid.html
new file mode 100644
index 0000000000..4da6a322bd
--- /dev/null
+++ b/testing/web-platform/tests/css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue-invalid.html
@@ -0,0 +1,23 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>CSSVariableReferenceValue Error Handling</title>
+<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#cssvariablereferencevalue">
+<meta name="assert" content="Test CSSVariableReferenceValue constructor and attributes error handling" />
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<body>
+<div id="log">
+<script>
+'use strict';
+
+test(() => {
+ assert_throws_js(TypeError, () => new CSSVariableReferenceValue(''));
+}, 'Constructing a CSSVariableReferenceValue with an empty variable name ' +
+ 'throws a TypeError');
+
+test(() => {
+ assert_throws_js(TypeError, () => new CSSVariableReferenceValue('bar'));
+}, 'Constructing a CSSVariableReferenceValue with an invalid variable name ' +
+ 'throws SyntaxError');
+
+</script>