<!DOCTYPE html>
<html>
<script>
    if (window.internals)
        internals.settings.setResourceTimingEnabled(true);
    if (window.testRunner) {
        testRunner.dumpAsText()
        testRunner.waitUntilDone();
    }
</script>
<script src="../../resources/js-test-pre.js"></script>
<body>
<style>
    body { background: url("../../resources/square100.png"); }
</style>
<script>
    var initiator;
    var runTest = function() {
        var resources = performance.getEntriesByType('resource');
        for (var i = 0; i < resources.length; ++i) {
            if (resources[i].name.indexOf("square") != -1) {
                initiator = resources[i].initiatorType;
                shouldBeEqualToString("initiator", "css");
            }
        };
        if (window.internals)
            window.internals.settings.setResourceTimingEnabled(false);
        if (window.testRunner)
            testRunner.notifyDone();
    };
    window.addEventListener("load", function() {
        runTest();
    });
</script>
</body>
</html>
