https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 948619e9aa2e43a6ca81d3bfc78669a721207523 authored by Philip Jägenstedt on 12 November 2018, 21:22:18 UTC
Find manifest for download by tags instead of commits
Tip revision: 948619e
element-ready-check-not-allowed-cross-origin-manual.sub.html
<!DOCTYPE html>
<title>Element ready check with no 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-default"></iframe>
<script>

async_test((t) => {
  document.onfullscreenchange = t.unreached_func("document fullscreenchange event");
  document.onfullscreenerror = t.unreached_func("document fullscreenerror event");

  // 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, false,
          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"}, "*");
    }, document.body);
  });
});
</script>
back to top