Bug 1526700 [wpt PR 15267] - Add screen orientation test: fire event before promise is resolved, a=testonly
☠☠ backed out by 749b314d6c28 ☠ ☠
authorJohanna <Johanna-hub@users.noreply.github.com>
Tue, 19 Feb 2019 14:39:38 +0000
changeset 460346 4551719aa85938916312d039c381895f42f7a23d
parent 460345 5addc6c0ced0b2d041f260892ca11364da7d6996
child 460347 09ce1b8d983181cd72d1dc01cc3f39d204667ccd
push id112074
push userwptsync@mozilla.com
push dateThu, 21 Feb 2019 19:59:15 +0000
treeherdermozilla-inbound@a15983fcecca [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1526700, 15267
milestone67.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 1526700 [wpt PR 15267] - Add screen orientation test: fire event before promise is resolved, a=testonly Automatic update from web-platform-tests Add screen orientation test: fire event before promise is resolved (#15267) -- wpt-commits: 8ed64687560332642c7b34ebd16011ae5b01d99a wpt-pr: 15267
testing/web-platform/tests/screen-orientation/event-before-promise.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/screen-orientation/event-before-promise.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/resources/testdriver.js"></script>
+<script src="/resources/testdriver-vendor.js"></script>
+<script>
+  promise_test(async t => {
+    await test_driver.bless("request full screen", () => {
+      return document.documentElement.requestFullscreen();
+    });
+
+    const promiseToChange = new Promise(resolve => {
+      screen.orientation.addEventListener("change", resolve);
+    });
+
+    const result = await Promise.race([
+      screen.orientation.lock("landscape"),
+      promiseToChange
+    ]);
+
+    assert_true(result instanceof Event, "Expected an instance of Event");
+  }, "The 'change' event must fire before the [[orientationPendingPromise]] is resolved.");
+</script>