summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/content-security-policy/unsafe-hashes/script_event_handlers_allowed.html
blob: 7d50941d368eabd0677382108d181e1661971ba8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<!DOCTYPE HTML>
<html>

<head>
    <meta http-equiv="Content-Security-Policy" content="script-src 'unsafe-hashes' 'nonce-abc' 'sha256-wmuLCpoj8EMqfQlPnt5NIMgKkCK62CxAkAiewI0zZps='; img-src *;">
    <title>Event handlers should be allowed if a matching hash and 'unsafe-hashes' are present</title>
    <script src='/resources/testharness.js' nonce='abc'></script>
    <script src='/resources/testharnessreport.js' nonce='abc'></script>
</head>

<body>
    <div id='log'></div>
    <script nonce='abc'>
        var t1 = async_test("Test that the inline event handler is allowed to run");

        window.addEventListener('securitypolicyviolation', t1.unreached_func("Should have not raised any event"));
    </script>
    <img src='../support/pass.png'
         onload='t1.done();'>
</body>

</html>