https://github.com/web-platform-tests/wpt
Revision 9b96b146321b9f6cf2391225e3b936e4a68ca5a8 authored by Anne van Kesteren on 08 May 2018, 17:30:48 UTC, committed by Anne van Kesteren on 09 May 2018, 07:00:34 UTC
This also improves checking for the correct exception by a bit.
1 parent da28291
Raw File
Tip revision: 9b96b146321b9f6cf2391225e3b936e4a68ca5a8 authored by Anne van Kesteren on 08 May 2018, 17:30:48 UTC
XHR: reduce try/catch usage
Tip revision: 9b96b14
image-tainting-in-cross-origin-iframe.sub.html
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
</body>
<script>
async_test(t => {
  const img = document.createElement('img');
  img.onload = t.step_func(() => {
    const iframe = document.createElement('iframe');
    window.onmessage = t.step_func_done(e => {
      assert_equals(e.data, 'DONE');
    });
    iframe.src = 'http://{{domains[www1]}}:{{ports[http][0]}}/cors/resources/image-tainting-checker.sub.html';
    document.body.appendChild(iframe);
  });
  img.src = '/images/blue-png-cachable.py';
  document.body.appendChild(img);
}, 'An image resource that is same-origin to the top-level frame loaded in ' +
  'the frame is not treated as same-origin for an iframe that is ' +
  'cross-origin to the top-level frame, and therefore a canvas where the ' +
  'image is drawn gets tainted.');
</script>
back to top