OLD | NEW |
(Empty) | |
| 1 <html> |
| 2 <head> |
| 3 <script src="../../../resources/js-test.js"></script> |
| 4 </head> |
| 5 <body> |
| 6 <script> |
| 7 description("Tests that the window.DeviceLightEvent and window.ondevicelight pro
perties are present."); |
| 8 |
| 9 function hasDeviceLightEventProperty() |
| 10 { |
| 11 for (var property in window) { |
| 12 if (property == "DeviceLightEvent") |
| 13 return true; |
| 14 } |
| 15 return false; |
| 16 } |
| 17 |
| 18 shouldBeTrue("typeof window.DeviceLightEvent == 'object'"); |
| 19 shouldBeFalse("typeof window.DeviceLightEvent == 'function'"); |
| 20 shouldBeTrue("hasDeviceLightEventProperty()"); |
| 21 shouldBeTrue("'DeviceLightEvent' in window"); |
| 22 shouldBeTrue("window.hasOwnProperty('DeviceLightEvent')"); |
| 23 |
| 24 function hasOnDeviceLightProperty() |
| 25 { |
| 26 for (var property in window) { |
| 27 if (property == "ondevicelight") |
| 28 return true; |
| 29 } |
| 30 } |
| 31 |
| 32 shouldBeTrue("typeof window.ondevicelight == 'object'"); |
| 33 shouldBeTrue("hasOnDeviceLightProperty()"); |
| 34 shouldBeTrue("'ondevicelight' in window"); |
| 35 shouldBeTrue("window.hasOwnProperty('ondevicelight')"); |
| 36 |
| 37 </script> |
| 38 </body> |
| 39 </html> |
OLD | NEW |