diff options
Diffstat (limited to 'LayoutTests/fast/dom/HTMLLinkElement')
4 files changed, 47 insertions, 0 deletions
diff --git a/LayoutTests/fast/dom/HTMLLinkElement/prefetch-beforeload-expected.txt b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-beforeload-expected.txt new file mode 100644 index 0000000..c7fb018 --- /dev/null +++ b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-beforeload-expected.txt @@ -0,0 +1,2 @@ +PASS beforeload called +This test will only print "PASS" or "FAIL" if link prefetches are enabled, otherwise it will show nothing below. diff --git a/LayoutTests/fast/dom/HTMLLinkElement/prefetch-beforeload.html b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-beforeload.html new file mode 100644 index 0000000..27a62af --- /dev/null +++ b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-beforeload.html @@ -0,0 +1,14 @@ +<body> +<div id="console"></div> +<script src="../../js/resources/js-test-pre.js"></script> +<script> +if (window.layoutTestController) { + layoutTestController.dumpAsText(); +} +</script> +<html> +<p>This test will only print "PASS" or "FAIL" if link prefetches are +enabled, otherwise it will show nothing below.</p> +<link href="prefetch.link" rel="prefetch" onbeforeload="testPassed('beforeload called');return false" onload="testFailed('onload')" onerror="testFailed('onerror')" /> +</html> + diff --git a/LayoutTests/fast/dom/HTMLLinkElement/prefetch-onerror-expected.txt b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-onerror-expected.txt new file mode 100644 index 0000000..47fc987 --- /dev/null +++ b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-onerror-expected.txt @@ -0,0 +1,6 @@ +This tests that onerror events can be attached to link elements with rel=prefetch. Since prefetch links are just there as a performance optimization, the onerror/onload event is their only programatic side-effect. + +If it works you should see a message below saying the test has passed. + +PASS onerror was called + diff --git a/LayoutTests/fast/dom/HTMLLinkElement/prefetch-onerror.html b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-onerror.html new file mode 100644 index 0000000..07ced9e --- /dev/null +++ b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-onerror.html @@ -0,0 +1,25 @@ +<html> +<head> +<script src="../../js/resources/js-test-pre.js"></script> +<script type="text/javascript"> +function done() +{ + testPassed('onerror was called'); + if (window.layoutTestController) + layoutTestController.notifyDone(); +} +if (window.layoutTestController) { + layoutTestController.dumpAsText(); + layoutTestController.waitUntilDone(); +} +</script> +</head> +<body> +<p>This tests that onerror events can be attached to link elements with rel=prefetch. Since prefetch links are just there as a performance optimization, the onerror/onload event is their only programatic side-effect.</p> +<p>If it works you should see a message below saying the test has passed.</p> +<link href="prefetch-noexisty.link" rel="prefetch" onload="testFailed('onload event should not occur')" onerror="done()"> +<hr> +<div id="console"></div> +</body> +</html> + |