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

Side by Side Diff: LayoutTests/fast/media/mq-append-delete.html

Issue 23621013: Make MediaList API 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
OLDNEW
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
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
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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698