https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 9f65d811032d205ffa4cebf3449c1e8e3fecd5c4 authored by Ting-Yu Lin on 26 December 2018, 18:48:28 UTC
Shrink columns width in column-span reftests to fit the window on wpt.
Tip revision: 9f65d81
element-ready-check-allowed-cross-origin-manual.sub.html
<!DOCTYPE html>
<title>Element ready check with allowfullscreen attribute</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../trusted-click.js"></script>
<iframe src="http://{{domains[www1]}}:{{ports[http][0]}}/fullscreen/api/resources/attempt-fullscreen.html" name="cross-origin-allowed" allowfullscreen></iframe>
<script>

async_test((t) => {
  t.add_cleanup(() => {
    Promise.resolve(document.exitFullscreen()).catch(() => {});
  });

  // When a message is received from a child frame, ensure that the report
  // matches the expectations.
  window.addEventListener('message', t.step_func(e => {
    if (e.data.report && e.data.report.api == "fullscreen") {
      assert_equals(e.data.report.result, true,
          e.data.report.frame + " frame did enter fullscreen");
      t.done();
    }
  }));

  // 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"}, "*");
    }, elem.contentDocument.body);
    // TODO(mustaq): The click above should activate the subframe.  But
    // elem.contentDocument is inaccessible (null) from a cross origin parent!
  });
});
</script>
back to top