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

Side by Side Diff: LayoutTests/fast/dom/shadow/css-hostrule-api.html

Issue 23531015: Make CSSHostRule.addRule() / deleteRule() arguments mandatory (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/fast/dom/shadow/css-hostrule-api-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 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../js/resources/js-test-pre.js"></script> 4 <script src="../../js/resources/js-test-pre.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <div id="host">This div is a shadow host.</div> 7 <div id="host">This div is a shadow host.</div>
8 </body> 8 </body>
9 <script> 9 <script>
10 description("Test whether CSSHostRule API works correctly or not."); 10 description("Test whether CSSHostRule API works correctly or not.");
(...skipping 24 matching lines...) Expand all
35 shouldBe("hostRule.cssRules[0].cssText", '"#host { border-color: green; }"'); 35 shouldBe("hostRule.cssRules[0].cssText", '"#host { border-color: green; }"');
36 shouldBe("hostRule.cssRules[1].cssText", '"div { border-color: blue; }"'); 36 shouldBe("hostRule.cssRules[1].cssText", '"div { border-color: blue; }"');
37 37
38 debug("After deleting the border rule with an id selector from @host @-rules:"); 38 debug("After deleting the border rule with an id selector from @host @-rules:");
39 hostRule.deleteRule(0); 39 hostRule.deleteRule(0);
40 shouldBe("getComputedStyle(host).borderColor", '"rgb(0, 0, 255)"'); 40 shouldBe("getComputedStyle(host).borderColor", '"rgb(0, 0, 255)"');
41 shouldBe("hostRule.cssRules.length", '1'); 41 shouldBe("hostRule.cssRules.length", '1');
42 shouldBe("hostRule.cssText", '"@host { \\n div { border-color: blue; }\\n}"'); 42 shouldBe("hostRule.cssText", '"@host { \\n div { border-color: blue; }\\n}"');
43 shouldBe("hostRule.cssRules[0].cssText", '"div { border-color: blue; }"'); 43 shouldBe("hostRule.cssRules[0].cssText", '"div { border-color: blue; }"');
44 44
45 debug("Error cases");
46 shouldBe("hostRule.cssRules.length", '1');
47 shouldThrow("hostRule.insertRule('#host { border-color: green; }')", "'TypeError : Not enough arguments'");
48 shouldBe("hostRule.cssRules.length", '1');
49 shouldThrow("hostRule.insertRule()", "'TypeError: Not enough arguments'");
50 shouldBe("hostRule.cssRules.length", '1');
51 shouldThrow("hostRule.deleteRule()", "'TypeError: Not enough arguments'");
52 shouldBe("hostRule.cssRules.length", '1');
53
45 </script> 54 </script>
46 <script src="../../js/resources/js-test-post.js"></script> 55 <script src="../../js/resources/js-test-post.js"></script>
47 </html> 56 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/dom/shadow/css-hostrule-api-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698