OLD | NEW |
---|---|
1 description('Tests that the window.DeviceOrientationEvent and window.ondeviceori entation properties are present.'); | 1 description('Tests that the window.DeviceOrientationEvent and window.ondeviceori entation properties are present.'); |
2 | 2 |
3 function hasDeviceOrientationEventProperty() | 3 function hasDeviceOrientationEventProperty() |
4 { | 4 { |
5 for (var property in window) { | 5 for (var property in window) { |
6 if (property == 'DeviceOrientationEvent') | 6 if (property == 'DeviceOrientationEvent') |
7 return true; | 7 return true; |
8 } | 8 } |
9 return false; | 9 return false; |
10 } | 10 } |
11 | 11 |
12 shouldBeTrue("typeof window.DeviceOrientationEvent == 'object'"); | 12 shouldBeTrue("typeof window.DeviceOrientationEvent == 'object'"); |
13 shouldBeFalse("typeof window.DeviceOrientationEvent == 'function'"); | 13 shouldBeFalse("typeof window.DeviceOrientationEvent == 'function'"); |
14 shouldBeTrue("hasDeviceOrientationEventProperty()"); | 14 // Global constructors should not be enumerable. |
15 shouldBeFalse("hasDeviceOrientationEventProperty()"); | |
arv (Not doing code reviews)
2013/04/24 15:34:08
The test on this line is a bit misleading now. May
| |
15 shouldBeTrue("'DeviceOrientationEvent' in window"); | 16 shouldBeTrue("'DeviceOrientationEvent' in window"); |
16 shouldBeTrue("window.hasOwnProperty('DeviceOrientationEvent')"); | 17 shouldBeTrue("window.hasOwnProperty('DeviceOrientationEvent')"); |
17 | 18 |
18 function hasOnDeviceOrientationProperty() | 19 function hasOnDeviceOrientationProperty() |
19 { | 20 { |
20 for (var property in window) { | 21 for (var property in window) { |
21 if (property == 'ondeviceorientation') | 22 if (property == 'ondeviceorientation') |
22 return true; | 23 return true; |
23 } | 24 } |
24 return false; | 25 return false; |
25 } | 26 } |
26 | 27 |
27 shouldBeTrue("typeof window.ondeviceorientation == 'object'"); | 28 shouldBeTrue("typeof window.ondeviceorientation == 'object'"); |
28 shouldBeTrue("hasOnDeviceOrientationProperty()"); | 29 shouldBeTrue("hasOnDeviceOrientationProperty()"); |
29 shouldBeTrue("'ondeviceorientation' in window"); | 30 shouldBeTrue("'ondeviceorientation' in window"); |
30 shouldBeTrue("window.hasOwnProperty('ondeviceorientation')"); | 31 shouldBeTrue("window.hasOwnProperty('ondeviceorientation')"); |
OLD | NEW |