chromium/third_party/blink/web_tests/fast/preloader/style.html

<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<body>
<script>
async_test(test => {
  window.addEventListener('DOMContentLoaded', test.step_func(function() {
    assert_own_property(window, 'internals', 'This test requires internals.isPreloaded()');
    assert_true(internals.isPreloaded('resources/style1.css'), 'resources/style1.css should be preloaded');
    assert_false(internals.isPreloaded('resources/fail.css'), 'resources/fail.css should not be preloaded');
    test.done();
  }));
}, 'Preload scanner should preload resources/style1.css but not resources/fail.css');
</script>
This test requires DumpRenderTree to see the log of what resources are loaded.
<script src=resources/non-existant.js></script>
<script>document.write("<plaintext>");</script>
<style>
@charset "ascii";
/* */
@import "resources/style1.css";
em {
    @import "resources/fail.css";
}
@import "resources/fail.css";
</style>
<style>
@media print {
    @import "resources/fail.css";
}
@import "resources/fail.css";
</style>