chromium/third_party/blink/web_tests/http/tests/doc-write-intervention/doc-write-async-third-party-script.html

<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script>
    var t = async_test('Cross origin but asynchronous doc.written scripts are not blocked');
    var src = 'http://localhost:8000/loading/resources/js-loaded.js?async-third-party-script';
    var jsLoaded = false;
    var loadSuccess = false;
    if (window.internals) {
        internals.settings.setDisallowFetchForDocWrittenScriptsInMainFrameOnSlowConnections(true);
        internals.setNetworkConnectionInfoOverride(true, 'cellular2g', '4g', 100, 2.0);
        internals.evictAllResources();

        window.addEventListener('beforeunload', function() {
            internals.clearNetworkConnectionInfoOverride();
            internals.settings.setDisallowFetchForDocWrittenScriptsInMainFrameOnSlowConnections(false);
        }, false);
    }
    document.write('<scr' + 'ipt src="' + src + '"  onload="loadSuccess=true" async></scr' + 'ipt>');
</script>
<script>
    window.addEventListener("load", t.step_func(function() {
        assert_true(loadSuccess, "Script loaded successfully");
        assert_true(jsLoaded, "Cross origin but asynchronous doc.written scripts are not blocked");
        t.done();
    }));
</script>