OLD | NEW |
1 <!doctype html> | 1 <!doctype html> |
2 <style type="text/css">@media screen { }</style> | 2 <style type="text/css">@media screen { }</style> |
3 <script src="../../resources/testharness.js"></script> | 3 <script src="../../resources/testharness.js"></script> |
4 <script src="../../resources/testharnessreport.js"></script> | 4 <script src="../../resources/testharnessreport.js"></script> |
5 <div id=log></div> | 5 <div id=log></div> |
6 <script> | 6 <script> |
7 var rules = document.styleSheets[0].cssRules; | 7 var rules = document.styleSheets[0].cssRules; |
8 var mediaList = rules.item(0).media; | 8 var mediaList = rules.item(0).media; |
9 | 9 |
10 // - appendMedium() | 10 // - appendMedium() |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 assert_equals(mediaList.mediaText, "screen, tv, not all"); | 77 assert_equals(mediaList.mediaText, "screen, tv, not all"); |
78 }, "Add 'not all' to 'screen, tv'"); | 78 }, "Add 'not all' to 'screen, tv'"); |
79 | 79 |
80 test(function () { | 80 test(function () { |
81 mediaList.mediaText = "screen, tv"; | 81 mediaList.mediaText = "screen, tv"; |
82 mediaList.appendMedium("#?:/"); | 82 mediaList.appendMedium("#?:/"); |
83 assert_equals(mediaList.mediaText, "screen, tv, not all"); | 83 assert_equals(mediaList.mediaText, "screen, tv, not all"); |
84 // Ignored; terminate steps. | 84 // Ignored; terminate steps. |
85 }, "Add '#?:/' to 'screen, tv'"); | 85 }, "Add '#?:/' to 'screen, tv'"); |
86 | 86 |
| 87 test(function () { |
| 88 mediaList.mediaText = "screen, tv"; |
| 89 assert_throws({ name: "TypeError" }, |
| 90 function () { document.appendMedium(); }, |
| 91 "Not enough arguments"); |
| 92 }, "Add without argument"); |
| 93 |
87 // - deleteMedium() | 94 // - deleteMedium() |
88 | 95 |
89 test(function () { | 96 test(function () { |
90 mediaList.mediaText = "screen, tv, not all"; | 97 mediaList.mediaText = "screen, tv, not all"; |
91 mediaList.deleteMedium("&invalid"); | 98 mediaList.deleteMedium("&invalid"); |
92 // Ignored; terminate steps. | 99 // Ignored; terminate steps. |
93 assert_equals(mediaList.mediaText, "screen, tv"); | 100 assert_equals(mediaList.mediaText, "screen, tv"); |
94 }, "Remove '&invalid' from 'screen, tv, not all'"); | 101 }, "Remove '&invalid' from 'screen, tv, not all'"); |
95 | 102 |
96 test(function () { | 103 test(function () { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 // CSSOM 4.1: Parsing media query returns none as | 155 // CSSOM 4.1: Parsing media query returns none as |
149 // there are more than one; terminate steps. | 156 // there are more than one; terminate steps. |
150 }, "Remove 'tv, print' from 'screen, tv, screen'"); | 157 }, "Remove 'tv, print' from 'screen, tv, screen'"); |
151 | 158 |
152 test(function () { | 159 test(function () { |
153 mediaList.mediaText = "screen, tv, not all"; | 160 mediaList.mediaText = "screen, tv, not all"; |
154 mediaList.deleteMedium("#?:/"); | 161 mediaList.deleteMedium("#?:/"); |
155 // Ignored; terminate steps. | 162 // Ignored; terminate steps. |
156 assert_equals(mediaList.mediaText, "screen, tv"); | 163 assert_equals(mediaList.mediaText, "screen, tv"); |
157 }, "Remove '#?:/' from 'screen, tv, not all'"); | 164 }, "Remove '#?:/' from 'screen, tv, not all'"); |
| 165 |
| 166 test(function () { |
| 167 mediaList.mediaText = "tv, print, screen"; |
| 168 assert_throws({ name: "TypeError" }, |
| 169 function () { document.deleteMedium(); }, |
| 170 "Not enough arguments"); |
| 171 }, "Remove without argument"); |
158 </script> | 172 </script> |
OLD | NEW |