Philip Jägenstedt | b344fa7 | 2017-04-06 12:08:20 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <title>CSSOM View - 4.2 - screen.width range tests</title> |
| 5 | <link rel="author" title="Neils Christoffersen" href="mailto:neils.christoffersen@gmail.com"> |
| 6 | <link rel="help" href="http://www.w3.org/TR/cssom-view/#the-screen-interface"> |
| 7 | <meta name="flags" content="dom"> |
| 8 | <meta name="assert" content="window.screen.width has sensible values"> |
| 9 | <script src="/resources/testharness.js"></script> |
| 10 | <script src="/resources/testharnessreport.js"></script> |
| 11 | </head> |
| 12 | <body> |
| 13 | <div id="myDiv"></div> |
| 14 | <div id="log"></div> |
| 15 | <script> |
| 16 | var upperBound = 50000; |
| 17 | |
| 18 | test( |
| 19 | function() { |
| 20 | assert_not_equals(window.screen.width, 0, "window.screen.width is zero") |
| 21 | }, "zero check" |
| 22 | ); |
| 23 | |
| 24 | test( |
| 25 | function() { |
| 26 | assert_true(window.screen.width > 0, "window.screen.width shouldn't be negative") |
| 27 | }, "positive check" |
| 28 | ); |
| 29 | |
| 30 | test( |
| 31 | function() { |
| 32 | assert_true(window.screen.width < upperBound, "window.screen.width shouldn't be so large") |
| 33 | }, "upper bound check" |
| 34 | ); |
| 35 | </script> |
| 36 | </body> |
| 37 | </html> |