chromium/third_party/blink/web_tests/fast/dom/HTMLStyleElement/style-onload-before-page-load.html

<!DOCTYPE html>
<html>
<head>
<script src="../HTMLLinkElement/resources/link-load-utilities.js"></script>
<script>
var expectedLoadEventTargets = ["style", "body"];

function didReceiveLoadEvent(elementName)
{
  var expectedTarget = expectedLoadEventTargets.shift();
  if (expectedTarget === elementName)
    testPassedAndNotifyDone("Fired Load event at " + elementName + ".");
  else {
    // We don't call testFailedAndNotifyDone() or testFinished() because we want to log additional Load events as it
    // may help towards debugging this test case.
    testFailed("Fired Load event at " + elementName + ", but should have fired it at " + expectedTarget + ".");
  }
}
</script>
<style onload="didReceiveLoadEvent('style')"></style>
</head>
<body onload="didReceiveLoadEvent('body')">
<p>This tests that a Load event for an HTML Style element comes before the Load event for the window. This test PASSED if you see the word PASS below. Otherwise, it FAILED.</p>
<pre id="console"></pre>
</body>
</html>