https://github.com/web-platform-tests/wpt
Raw File
Tip revision: e343b5de1627f1b1df5290254821ad1202bc11f0 authored by Marcos Cáceres on 28 March 2018, 03:52:58 UTC
Add @edenchuang again 🎊
Tip revision: e343b5d
deny.sub.html
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="./support/helper.js"></script>
<body>
<script>
  async_test(t => {
    var i = document.createElement('iframe');
    i.src = "./support/xfo.py?value=DENY";

    assert_no_message_from(i, t);

    i.onload = t.step_func_done(_ => {
      assert_throws("SecurityError", function () { return i.contentDocument; });
      i.remove();
    });

    document.body.appendChild(i);
  }, "`XFO: DENY` blocks same-origin framing.");

  async_test(t => {
    var i = document.createElement('iframe');
    i.src = "http://{{domains[www]}}:{{ports[http][0]}}/x-frame-options/support/xfo.py?value=DENY";

    assert_no_message_from(i, t);

    i.onload = t.step_func_done(_ => {
      assert_throws("SecurityError", function () { return i.contentDocument; });
      i.remove();
    });

    document.body.appendChild(i);
  }, "`XFO: DENY` blocks cross-origin framing.");
</script>
back to top