Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dom/DeviceOrientation/window-property.html

Issue 1416123002: Absolute Device Orientation API: blink implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <body> 3 <body>
4 <script src="../../../resources/js-test.js"></script> 4 <script src="../../../resources/js-test.js"></script>
5 <script> 5 <script>
6 description('Tests that the window.DeviceOrientationEvent and window.ondeviceori entation properties are present.'); 6 description('Tests that the window.DeviceOrientationEvent and window.ondeviceori entation and window.ondeviceorientationabsolute properties are present.');
7 7
8 shouldBeTrue("typeof window.DeviceOrientationEvent == 'object'"); 8 shouldBeTrue("typeof window.DeviceOrientationEvent == 'object'");
9 shouldBeFalse("typeof window.DeviceOrientationEvent == 'function'"); 9 shouldBeFalse("typeof window.DeviceOrientationEvent == 'function'");
10 shouldBeFalse("window.propertyIsEnumerable('DeviceOrientationEvent')"); 10 shouldBeFalse("window.propertyIsEnumerable('DeviceOrientationEvent')");
11 shouldBeTrue("'DeviceOrientationEvent' in window"); 11 shouldBeTrue("'DeviceOrientationEvent' in window");
12 shouldBeTrue("window.hasOwnProperty('DeviceOrientationEvent')"); 12 shouldBeTrue("window.hasOwnProperty('DeviceOrientationEvent')");
13 13
14 function hasOnDeviceOrientationProperty() 14 function hasProperty(orientationProperty)
15 { 15 {
16 for (var property in window) { 16 for (var property in window) {
17 if (property == 'ondeviceorientation') 17 if (property == orientationProperty)
18 return true; 18 return true;
19 } 19 }
20 return false; 20 return false;
21 } 21 }
22 22
23 shouldBeTrue("typeof window.ondeviceorientation == 'object'"); 23 shouldBeTrue("typeof window.ondeviceorientation == 'object'");
24 shouldBeTrue("hasOnDeviceOrientationProperty()"); 24 shouldBeTrue("typeof window.ondeviceorientationabsolute == 'object'");
25 shouldBeTrue("hasProperty('ondeviceorientation')");
26 shouldBeTrue("hasProperty('ondeviceorientationabsolute')");
25 shouldBeTrue("'ondeviceorientation' in window"); 27 shouldBeTrue("'ondeviceorientation' in window");
28 shouldBeTrue("'ondeviceorientationabsolute' in window");
26 shouldBeTrue("window.hasOwnProperty('ondeviceorientation')"); 29 shouldBeTrue("window.hasOwnProperty('ondeviceorientation')");
30 shouldBeTrue("window.hasOwnProperty('ondeviceorientationabsolute')");
27 </script> 31 </script>
28 </body> 32 </body>
29 </html> 33 </html>
34
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698