OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <head> |
| 3 <script> |
| 4 if (window.testRunner) |
| 5 testRunner.dumpAsText(); |
| 6 |
| 7 function log(m) |
| 8 { |
| 9 var results = document.getElementById('results'); |
| 10 results.innerHTML += m + '<br>'; |
| 11 } |
| 12 |
| 13 function testQuery(query, expected) |
| 14 { |
| 15 var isTrue = window.matchMedia(query).matches; |
| 16 var message = '\"' + query + '\" evaluates to ' + (isTrue ? 'true' : 'fa
lse'); |
| 17 message += (isTrue == expected) ? ': PASS' : ': FAIL'; |
| 18 log(message); |
| 19 } |
| 20 |
| 21 function runTests() |
| 22 { |
| 23 testQuery('(min-width: 9999999999px)', false); |
| 24 testQuery('(max-width: 9999999999px)', true); |
| 25 testQuery('(min-device-width: 9999999999px)', false); |
| 26 testQuery('(max-device-width: 9999999999px)', true); |
| 27 testQuery('(min-height: 9999999999px)', false); |
| 28 testQuery('(max-height: 9999999999px)', true); |
| 29 testQuery('(min-device-height: 9999999999px)', false); |
| 30 testQuery('(max-device-height: 9999999999px)', true); |
| 31 } |
| 32 </script> |
| 33 </head> |
| 34 <body onload="runTests()"> |
| 35 <p>Test MediaQuery values that overflow int range</p> |
| 36 <div id="results"> |
| 37 </div> |
| 38 </body> |
OLD | NEW |