chromium/third_party/blink/web_tests/http/tests/preload/dynamic_adding_preload.html

<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script>
    var t = async_test('Makes sure that dynamically added preloaded resource is downloaded');
</script>
<body>
<script>
    var link = document.createElement("link");
    link.as = "script";
    link.rel = "preload";
    link.href = "../resources/dummy.js";
    link.onload = t.step_func(function() {
        assert_equals(performance.getEntriesByType("resource").length, 3);
        t.done();
    });
    document.body.appendChild(link);
</script>
</body>