summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/content-security-policy/script-src/support/inline-script-should-be-blocked.js
blob: f32d25074bd3c906de734fcf65cc3b23a8637e81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
var t;
async_test(t => {
  self.t = t;
  const s = document.createElement('script');
  s.onerror = t.step_func(function() {
    assert_unreached('Script error event should not be fired.');
  });
  s.onload = t.step_func(function() {
    assert_unreached('Script load event should not be fired.');
  });
  s.innerText = 'self.t.assert_unreached("Script should not run.");'
  document.body.appendChild(s);
  setTimeout(() => t.done(), 2000);
});