https://github.com/web-platform-tests/wpt
Raw File
Tip revision: f94d0b6525c39041274bbc6bf97b1761b96ebe1a authored by Darren Shen on 28 March 2018, 01:47:15 UTC
[css-typed-om] Support some text-decoration properties.
Tip revision: f94d0b6
sameorigin.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=SAMEORIGIN";

    wait_for_message_from(i, t)
      .then(t.step_func_done(e => {
        assert_equals(e.data, "Loaded");
        i.remove();
      }));

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

  async_test(t => {
    var i = document.createElement('iframe');
    i.src = "./support/nested.py?origin=http://{{host}}:{{ports[http][0]}}&value=SAMEORIGIN";

    wait_for_message_from(i, t)
      .then(t.step_func_done(e => {
        assert_equals(e.data, "Loaded");
        i.remove();
      }));

    document.body.appendChild(i);
  }, "`XFO: SAMEORIGIN` allows same-origin nested in 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=SAMEORIGIN";

    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: SAMEORIGIN` blocks cross-origin framing.");

  async_test(t => {
    var i = document.createElement('iframe');
    i.src = "./support/nested.py?origin=http://{{domains[www]}}:{{ports[http][0]}}&value=SAMEORIGIN";

    wait_for_message_from(i, t)
      .then(t.step_func_done(e => {
        assert_equals(e.data, "Failed");
        i.remove();
      }));

    document.body.appendChild(i);
  }, "`XFO: SAMEORIGIN` blocks cross-origin nested in same-origin framing.");

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

    wait_for_message_from(i, t)
      .then(t.step_func_done(e => {
        assert_equals(e.data, "Failed");
        i.remove();
      }));

    document.body.appendChild(i);
  }, "`XFO: SAMEORIGIN` blocks same-origin nested in cross-origin framing.");

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

    wait_for_message_from(i, t)
      .then(t.step_func_done(e => {
        assert_equals(e.data, "Failed");
        i.remove();
      }));

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