Bug 1509422 [wpt PR 14194] - Fix two fullscreen wpt tests for UAv2., a=testonly
authorMustaq Ahmed <mustaq@google.com>
Fri, 30 Nov 2018 18:01:12 +0000
changeset 449998 a517bb8630aa8c1b305a2a8bb7a5787b8be18ff4
parent 449997 e751223a98da4a80147797f0937912d62c9cb56e
child 449999 6a3c745ff36ea04be5a1077b51fe3807d989086d
push id35189
push userccoroiu@mozilla.com
push dateTue, 11 Dec 2018 21:33:05 +0000
treeherdermozilla-central@ac7f3beb6333 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1509422, 14194, 906791, 1347092, 610651
milestone66.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 1509422 [wpt PR 14194] - Fix two fullscreen wpt tests for UAv2., a=testonly Automatic update from web-platform-tests Fix two fullscreen wpt tests for UAv2. Also marks one currently untestable test. Bug: 906791 Change-Id: I17fd03f16e93244be80f9572db8c43e8e0b95678 Reviewed-on: https://chromium-review.googlesource.com/c/1347092 Commit-Queue: Mustaq Ahmed <mustaq@chromium.org> Reviewed-by: Philip J├Ągenstedt <foolip@chromium.org> Cr-Commit-Position: refs/heads/master@{#610651} -- wpt-commits: 1700cffc1ede02465c9aca38d06cbad9d634a920 wpt-pr: 14194
testing/web-platform/tests/fullscreen/api/element-ready-check-allowed-cross-origin-manual.sub.html
testing/web-platform/tests/fullscreen/api/element-ready-check-containing-iframe-manual.tentative.html
testing/web-platform/tests/fullscreen/api/element-request-fullscreen-two-iframes-manual.html
--- a/testing/web-platform/tests/fullscreen/api/element-ready-check-allowed-cross-origin-manual.sub.html
+++ b/testing/web-platform/tests/fullscreen/api/element-ready-check-allowed-cross-origin-manual.sub.html
@@ -21,12 +21,14 @@ async_test((t) => {
     }
   }));
 
   // Trigger the child frame to report as soon as its content is loaded.
   var elem = document.querySelector('iframe');
   elem.addEventListener('load', () => {
     trusted_click(t, () => {
       elem.contentWindow.postMessage({"action": "report"}, "*");
-    }, document.body);
+    }, elem.contentDocument.body);
+    // TODO(mustaq): The click above should activate the subframe.  But
+    // elem.contentDocument is inaccessible (null) from a cross origin parent!
   });
 });
 </script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/fullscreen/api/element-ready-check-containing-iframe-manual.tentative.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<!--
+   Tentative,  due to:
+     https://github.com/whatwg/html/issues/1903
+   Once the issue is resolved, this test would replace the corresponding
+   non-tentative test (element-ready-check-containing-iframe-manual.html)
+-->
+<title>Element ready check for containing iframe</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="../trusted-click.js"></script>
+<div id="log"></div>
+<iframe allowfullscreen></iframe>
+<iframe allowfullscreen></iframe>
+<script>
+// wait for load event to avoid https://bugzil.la/1493878
+window.onload = function() {
+  async_test(function(t) {
+      var iframes = document.getElementsByTagName("iframe");
+      trusted_request(t, iframes[0].contentDocument.body, iframes[0].contentDocument.body);
+      iframes[0].contentDocument.onfullscreenchange = t.step_func(function() {
+          assert_equals(document.fullscreenElement, iframes[0]);
+          trusted_request(t, iframes[1].contentDocument.body, iframes[0].contentDocument.body);
+          iframes[1].contentDocument.onfullscreenchange = t.unreached_func("fullscreenchange event");
+          iframes[1].contentDocument.onfullscreenerror = t.step_func_done();
+      });
+  });
+};
+</script>
--- a/testing/web-platform/tests/fullscreen/api/element-request-fullscreen-two-iframes-manual.html
+++ b/testing/web-platform/tests/fullscreen/api/element-request-fullscreen-two-iframes-manual.html
@@ -16,24 +16,32 @@ async_test(t => {
   // Expect two fullscreenchange events, with document.fullscreenElement
   // changing in the same order as the requests. (Events should also fire on the
   // iframes' documents, but this is not covered by this test.)
   const order = [];
   document.onfullscreenchange = t.step_func(() => {
     assert_in_array(document.fullscreenElement, [a, b]);
     order.push(document.fullscreenElement.id);
     if (order.length == 2) {
-      // Since fullscreenchange event occurs at animation frame timing we might
-      // have not seen the transition from null -> 'b' but just see the
-      // resulting 'a' transition twice.
+      // When the second event arrived, the fullscreen element may still be the
+      // old one.
+      //
+      // TODO(mustaq): We need a better explanation here to cover the tree-order
+      // idea of the spec.
       assert_true(order[0] == 'a' || order[0] == 'b', 'first id seen is a or b');
-      assert_true(order[1] == 'a', 'second id seen is b');
+      assert_true(order[1] == 'a', 'second id seen is a');
       t.done();
     }
   });
   document.onfullscreenerror = t.unreached_func('fullscreenerror event');
 
+  // Make a trusted click on frame 'b' to activate it.
   trusted_click(t, () => {
-    b.contentDocument.body.requestFullscreen();
-    a.contentDocument.body.requestFullscreen();
-  }, document.body);
+    // Now queue a trusted click on frame 'a' to make back-to-back calls.
+    setTimeout(() => {
+      trusted_click(t, () => {
+        b.contentDocument.body.requestFullscreen();
+        a.contentDocument.body.requestFullscreen();
+      }, a.contentDocument.body);
+    }, 0);
+  }, b.contentDocument.body);
 });
 </script>