https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 34dfe32379a4e905b318f825fd6eab4c96bfc8c4 authored by Luke Bjerring on 11 May 2018, 19:30:08 UTC
Merge branch 'master' into idlharness-dependencies
Tip revision: 34dfe32
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(() => document.exitFullscreen());

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