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

Side by Side Diff: third_party/WebKit/LayoutTests/custom-properties/register-property-syntax-parsing.html

Issue 2369813002: Don't depend on unregisterProperty in register-property-syntax-parsing.html (Closed)
Patch Set: fix expected.txt Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/custom-properties/register-property-syntax-parsing-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <script src="../resources/testharness.js"></script> 2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script> 3 <script src="../resources/testharnessreport.js"></script>
4 <script> 4 <script>
5 test_count = 0;
6
5 function assert_valid(syntax, initialValue) { 7 function assert_valid(syntax, initialValue) {
6 // No actual assertions, this just shouldn't throw 8 // No actual assertions, this just shouldn't throw
7 test(function() { 9 test(function() {
8 try { CSS.unregisterProperty('--syntax-test'); } catch(e) { } 10 var name = '--syntax-test-' + (test_count++);
9 CSS.registerProperty({name: '--syntax-test', syntax: syntax, initialValu e: initialValue}); 11 CSS.registerProperty({name: name, syntax: syntax, initialValue: initialV alue});
10 }, "syntax:'" + syntax + "', initialValue:'" + initialValue + "' is valid"); 12 }, "syntax:'" + syntax + "', initialValue:'" + initialValue + "' is valid");
11 } 13 }
12 14
13 function assert_invalid(syntax, initialValue) { 15 function assert_invalid(syntax, initialValue) {
14 test(function(){ 16 test(function(){
15 try { CSS.unregisterProperty('--syntax-test'); } catch(e) { } 17 var name = '--syntax-test-' + (test_count++);
16 assert_throws(new SyntaxError(), 18 assert_throws(new SyntaxError(),
17 () => CSS.registerProperty({name: '--syntax-test', syntax: syntax, i nitialValue: initialValue})); 19 () => CSS.registerProperty({name: name, syntax: syntax, initialValue : initialValue}));
18 }, "syntax:'" + syntax + "', initialValue:'" + initialValue + "' is invalid" ); 20 }, "syntax:'" + syntax + "', initialValue:'" + initialValue + "' is invalid" );
19 } 21 }
20 22
21 assert_valid("*", "a"); 23 assert_valid("*", "a");
22 assert_valid(" * ", "b"); 24 assert_valid(" * ", "b");
23 assert_valid("<length>", "2px"); 25 assert_valid("<length>", "2px");
24 assert_valid(" <number>", "5"); 26 assert_valid(" <number>", "5");
25 assert_valid("<percentage> ", "10%"); 27 assert_valid("<percentage> ", "10%");
26 assert_valid("<color>+", "red"); 28 assert_valid("<color>+", "red");
27 assert_valid(" <length>+ | <percentage>", "2px 8px"); 29 assert_valid(" <length>+ | <percentage>", "2px 8px");
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 assert_invalid("<number>|foo", "foo var(--foo, bla)"); 145 assert_invalid("<number>|foo", "foo var(--foo, bla)");
144 146
145 assert_invalid("<angle>", "10%"); 147 assert_invalid("<angle>", "10%");
146 assert_invalid("<time>", "2px"); 148 assert_invalid("<time>", "2px");
147 assert_invalid("<resolution>", "10"); 149 assert_invalid("<resolution>", "10");
148 assert_invalid("<transform-function>", "scale()"); 150 assert_invalid("<transform-function>", "scale()");
149 assert_invalid("<color>", "fancy-looking"); 151 assert_invalid("<color>", "fancy-looking");
150 assert_invalid("<image>", "banana.png"); 152 assert_invalid("<image>", "banana.png");
151 assert_invalid("<url>", "banana.png"); 153 assert_invalid("<url>", "banana.png");
152 </script> 154 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/custom-properties/register-property-syntax-parsing-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698