Skip to content

Commit

Permalink
[css-typed-om] Clean up CSSUnparsedValue serialization test
Browse files Browse the repository at this point in the history
This patch cleans up the CSSUnparsedValue serialization tests to make it
more suitable for WPT. We remove the .tentative extension.

Bug: 774887
Change-Id: Ifaca6831f0ee60b1515a719ed13438dc1842134f
Reviewed-on: https://chromium-review.googlesource.com/871990
Reviewed-by: nainar <nainar@chromium.org>
Commit-Queue: Darren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#530072}
  • Loading branch information
darrnshn authored and chromium-wpt-export-bot committed Jan 18, 2018
1 parent 70d0ebb commit 032bae3
Showing 1 changed file with 11 additions and 12 deletions.
Expand Up @@ -2,37 +2,36 @@
<meta charset="utf-8">
<title>IDL-constructed CSSUnparsedValue serialization tests</title>
<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#unparsedvalue-serialization">
<meta name="assert" content="Test CSSUnparsedValue are serialized by concatenating its contents" />
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../resources/testhelper.js"></script>
<body>
<div id="tag">
<script>
'use strict';

test(() => {
assert_equals(new CSSUnparsedValue('auto').toString(), 'auto');
assert_equals(new CSSUnparsedValue('lemon', 'ade').toString(), 'lemonade');
}, 'CSSUnparsedValue constructed from IDL with strings serializes correctly');
assert_equals(new CSSUnparsedValue('lem', 'on', 'ade').toString(), 'lemonade');
}, 'CSSUnparsedValue containing strings serializes to its concatenated contents');

test(() => {
assert_equals(new CSSUnparsedValue(new CSSVariableReferenceValue('--A')).toString(), 'var(--A)');
assert_equals(new CSSUnparsedValue(
new CSSVariableReferenceValue('--A'),
new CSSVariableReferenceValue('--B')).toString(),
'var(--A)var(--B)');
assert_equals(new CSSUnparsedValue(
new CSSVariableReferenceValue('--A',
new CSSUnparsedValue(new CSSVariableReferenceValue('--B'))),
new CSSVariableReferenceValue('--C')).toString(),
'var(--A,var(--B))var(--C)');
}, 'CSSUnparsedValue constructed from IDL with CSSVariableReferenceValues serializes correctly');
}, 'CSSUnparsedValue containing variable references serializes its ' +
'concatenated contents');

test(() => {
assert_equals(new CSSUnparsedValue('foo', 'bar ',
new CSSVariableReferenceValue('--A',
new CSSUnparsedValue('baz ', new CSSVariableReferenceValue('--B'), 'lemon')),
new CSSUnparsedValue('baz ',
new CSSVariableReferenceValue('--B'), 'lemon')),
new CSSVariableReferenceValue('--C',
new CSSUnparsedValue('ade'))).toString(),
'foobar var(--A,baz var(--B)lemon)var(--C,ade)');
}, 'CSSUnparsedValue constructed from IDL with mix of strings and CSSVariableReferenceValues serializes correctly');
}, 'CSSUnparsedValue containing mix of strings and variable references ' +
'serializes to its concatenated contents');

</script>

0 comments on commit 032bae3

Please sign in to comment.