Bug 1495444 [wpt PR 5149] - ondeviceorientationabsolute event attribute, a=testonly
authorPhilippe Le Hegaret <plh@w3.org>
Fri, 05 Oct 2018 14:28:46 +0000
changeset 495824 f1fd405865b01f1d184cd4f0a89cf2412f87cc8b
parent 495823 5c0a92ee9367e61ef52ecdb5ab40e63933b01639
child 495825 553bec69c39039e57d500084790aa40d93b533cc
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1495444
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1495444 [wpt PR 5149] - ondeviceorientationabsolute event attribute, a=testonly Automatic update from web-platform-testsondeviceorientationabsolute event attribute (#5149) * ondeviceorientationabsolute event attribute * Use the interface instead * Fail if event isn't supported * Removed console.log -- wpt-commits: dd6990a1f9c2e04323f5fae50be57c712a5869d7 wpt-pr: 5149
testing/web-platform/tests/orientation-event/ondeviceorientationabsolute.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/orientation-event/ondeviceorientationabsolute.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>User agents must also provide an event handler IDL attribute named ondeviceorientationabsolute on the window object</title>
+    <meta name=viewport content="width=device-width, maximum-scale=1.0">
+    <script src="/resources/testharness.js"></script>
+    <script src="/resources/testharnessreport.js"></script>
+  </head>
+  <body>
+    <p>Rotate the device to run the tests.</p>
+    <div id="log"></div>
+    <script>
+      var t1 = async_test("Provide an event handler IDL attribute named ondeviceorientationabsolute");
+      var t2 = async_test("The type of this event handler must be 'DeviceOrientationEvent'");
+      var t3 = async_test("The absolute property must be set to true.");
+      var run = false;
+      if (window.ondeviceorientationabsolute === undefined) {
+        t1.step(t1.unreached_func("ondeviceorientationabsolute not supported"));
+        t2.step(t2.unreached_func("ondeviceorientationabsolute not supported"));
+        t3.step(t3.unreached_func("ondeviceorientationabsolute not supported"));
+      } else {
+        window.ondeviceorientationabsolute = function(e) {
+          if (!run) {
+            run = true;
+            t1.step(function() {
+              assert_equals(e.type, "deviceorientationabsolute");
+            });
+            t1.done();
+            t2.step(function() {
+              assert_true(e instanceof DeviceOrientationEvent);
+           });
+            t2.done();
+            t3.step(function() {
+              assert_true(e.absolute);
+            });
+            t3.done();
+          }
+        };
+      }
+    </script>
+  </body>
+</html>
+