Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!doctype html> | |
| 2 <html> | |
| 3 <head> | |
|
Yoav Weiss
2014/10/10 07:33:49
nit: We usually don't include the doctype + html +
rune
2014/10/10 07:52:55
doctype should be there, for sure, preferable upca
| |
| 4 <script> | |
| 5 if (window.testRunner) | |
| 6 testRunner.dumpAsText(); | |
| 7 function log(m) | |
| 8 { | |
| 9 var results = document.getElementById('results'); | |
| 10 results.innerHTML += m + '<br>'; | |
| 11 } | |
| 12 function testQuery(query, expected) | |
|
Yoav Weiss
2014/10/10 07:33:49
nit: Can you add a newline above functions?
| |
| 13 { | |
| 14 var isTrue = window.matchMedia(query).matches; | |
| 15 var message = '\"' + query + '\" evaluates to ' + (isTrue ? 'true' : 'fa lse'); | |
| 16 message += (isTrue == expected) ? ': PASS' : ': FAIL'; | |
| 17 log(message); | |
| 18 } | |
| 19 function runTests() | |
| 20 { | |
| 21 testQuery('(min-width: 9999999999px)', false); | |
| 22 testQuery('(max-width: 9999999999px)', true); | |
| 23 testQuery('(min-device-width: 9999999999px)', false); | |
| 24 testQuery('(max-device-width: 9999999999px)', true); | |
| 25 testQuery('(min-height: 9999999999px)', false); | |
| 26 testQuery('(max-height: 9999999999px)', true); | |
| 27 testQuery('(min-device-height: 9999999999px)', false); | |
| 28 testQuery('(max-device-height: 9999999999px)', true); | |
| 29 } | |
| 30 </script> | |
| 31 </head> | |
| 32 <body onload="runTests()"> | |
| 33 <p>Test MediaQuery values that overflow int range</p> | |
| 34 <div id="results"> | |
| 35 </div> | |
| 36 </body> | |
| 37 </html> | |
| OLD | NEW |