OLD | NEW |
(Empty) | |
| 1 description("Tests that the window.DeviceLightEvent and window.ondevicelight pro
perties are present."); |
| 2 |
| 3 function hasDeviceLightEventProperty() |
| 4 { |
| 5 for (var property in window) { |
| 6 if (property == "DeviceLightEvent") |
| 7 return true; |
| 8 } |
| 9 return false; |
| 10 } |
| 11 |
| 12 shouldBeTrue("typeof window.DeviceLightEvent == 'object'"); |
| 13 shouldBeFalse("typeof window.DeviceLightEvent == 'function'"); |
| 14 shouldBeTrue("hasDeviceLightEventProperty()"); |
| 15 shouldBeTrue("'DeviceLightEvent' in window"); |
| 16 shouldBeTrue("window.hasOwnProperty('DeviceLightEvent')"); |
| 17 |
| 18 function hasOnDeviceLightProperty() |
| 19 { |
| 20 for (var property in window) { |
| 21 if (property == "ondevicelight") |
| 22 return true; |
| 23 } |
| 24 } |
| 25 |
| 26 shouldBeTrue("typeof window.ondevicelight == 'object'"); |
| 27 shouldBeTrue("hasOnDeviceLightProperty()"); |
| 28 shouldBeTrue("'ondevicelight' in window"); |
| 29 shouldBeTrue("window.hasOwnProperty('ondevicelight')"); |
OLD | NEW |