summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/images/image-error-event-not-firing.html
blob: 0bfcdeca24cb0eb111c7b0f7a4829981ff308c4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<meta http-equiv="Content-Security-Policy" content="img-src 'self'">
<script src="../../resources/js-test.js"></script>
<script>
description(
    "This tests onerror event is fired if we change image src to a url blocked by content-security-policy."
)

jsTestIsAsync = true;

function load()
{
    var image = document.getElementById('test');
    image.onerror = function() {
        testPassed("error event fired.");
        finishJSTest();
    };
    image.src = 'http://www.myfakesiteabc.com/image.png';

    setTimeout(function() {
        testFailed("error event is not fired.")
        finishJSTest();
    }, 200);
}
</script>

</head>
<body onload='load()'>

<img src="./color-jpeg-with-color-profile-expected.png" id="test"></img>

</body>
</html>