diff options
author | Steve Block <steveblock@google.com> | 2011-05-20 16:21:44 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-05-24 14:11:39 +0100 |
commit | abd0b16f66097fb5317221db993dafb6bd965965 (patch) | |
tree | 35a99efae402a25abc6b82c3959d958b952ec6bb | |
parent | 10b539940b83c9b7ea6a6ebcf8707d9841b4284f (diff) | |
download | external_webkit-abd0b16f66097fb5317221db993dafb6bd965965.zip external_webkit-abd0b16f66097fb5317221db993dafb6bd965965.tar.gz external_webkit-abd0b16f66097fb5317221db993dafb6bd965965.tar.bz2 |
Add LayoutTests/fast/dom/HTMLLinkElement at r76408
Bug: 2268353
Change-Id: I3c351413cb223af72621b9b9f0336fc66a3d4fbc
15 files changed, 202 insertions, 0 deletions
diff --git a/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test-expected.txt b/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test-expected.txt new file mode 100644 index 0000000..ac1b174 --- /dev/null +++ b/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test-expected.txt @@ -0,0 +1,10 @@ +nick.jpg has MIME type image/jpeg +nick.jpg has MIME type image/jpeg +This test verifies that an image which is prefetched, and which is also contained as a subresource of the current document can be loaded correctly as a subresource. See bug 49236 in which this wasn't working. + +When this test succeeds, you'll see an image of Nick on a sailboat immediately below this text. When this test fails, you will see no images at all. + +NICK_ONLOAD called +NICK_ONLOAD called +SUCCESS. Two loads. + diff --git a/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test.html b/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test.html new file mode 100644 index 0000000..594eafd --- /dev/null +++ b/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test.html @@ -0,0 +1,39 @@ +<html> +<body> +<script> +function log(message) +{ + var item = document.createElement("li"); + item.appendChild(document.createTextNode(message)); + document.getElementById("console").appendChild(item); +} + +nick_load_count = 0 + +function nick_onload() +{ + log("NICK_ONLOAD called"); + ++nick_load_count; + if (nick_load_count == 2) { + log("SUCCESS. Two loads."); + layoutTestController.notifyDone(); + } +} + +if (window.layoutTestController) { + layoutTestController.waitUntilDone(); + layoutTestController.dumpAsText(); + layoutTestController.dumpResourceResponseMIMETypes(); +} +</script> +<p>This test verifies that an image which is prefetched, and which is also contained as a +subresource of the current document can be loaded correctly as a subresource. See +bug 49236 in which this wasn't working. +<p>When this test succeeds, you'll see an image of Nick on a sailboat immediately below +this text. When this test fails, you will see no images at all. +<link rel="prefetch" href="resources/nick.jpg" onload="nick_onload()" /> +<img src="resources/nick.jpg" onload="nick_onload()" /> +<hr> +<p><ol id="console"></ol></p> +</body></html> + diff --git a/LayoutTests/fast/dom/HTMLLinkElement/onload-completion-test-expected.txt b/LayoutTests/fast/dom/HTMLLinkElement/onload-completion-test-expected.txt new file mode 100644 index 0000000..bc6cf74 --- /dev/null +++ b/LayoutTests/fast/dom/HTMLLinkElement/onload-completion-test-expected.txt @@ -0,0 +1,4 @@ +This test verifies that at the time a body onload function is called that the subresources of this page (in particular the image) are already loaded. The page verifies that the image has the expected dimensions at the time of the onload event, and prints its result based on that. This is a regression test for a bug introduced by the patch for bug 3652. + + +SUCCESS. diff --git a/LayoutTests/fast/dom/HTMLLinkElement/onload-completion-test.html b/LayoutTests/fast/dom/HTMLLinkElement/onload-completion-test.html new file mode 100644 index 0000000..6e24184 --- /dev/null +++ b/LayoutTests/fast/dom/HTMLLinkElement/onload-completion-test.html @@ -0,0 +1,27 @@ +<!DOCTYPE html> +<script text="text/javascript"> +function runtest() +{ +var nick=document.getElementById('nick'); +var row=document.getElementById('the_table').insertRow(-1); +var result=row.insertCell(0); +if (nick.naturalWidth == 320 && nick.naturalHeight == 240) + result.innerHTML = "SUCCESS."; +else + result.innerHTML = "FAILURE!"; +if (window.layoutTestController) + layoutTestController.dumpAsText(); +} +</script> +<body onload="runtest()"> +<p>This test verifies that at the time a body onload function is +called that the subresources of this page (in particular the image) +are already loaded. The page verifies that the image has the expected +dimensions at the time of the onload event, and prints its result +based on that. This is a regression test for a bug introduced by the +patch for bug 3652.</p> +<img id=nick src="resources/nick.jpg"> +<table id="the_table" border="1"> +<tr><td></td></tr> +</table> +</body> diff --git a/LayoutTests/fast/dom/HTMLLinkElement/pending-stylesheet-count.html b/LayoutTests/fast/dom/HTMLLinkElement/pending-stylesheet-count.html new file mode 100644 index 0000000..435021b --- /dev/null +++ b/LayoutTests/fast/dom/HTMLLinkElement/pending-stylesheet-count.html @@ -0,0 +1,32 @@ +<html> +<head> +<style type="text/css"> + #square { width: 100px; height: 100px; } + .red { background: red; } + .green { background: green; } +</style> +<script type="text/javascript"> + function test() + { + var linkStr = '<link rel="stylesheet" type="text/css" href="resources/doesnotneedtoexist">'; + var target = document.getElementById('t'); + target.innerHTML = linkStr; + target.innerHTML = ''; + var square = document.getElementById('square'); + square.className = 'green'; + } +</script> +</head> +<body onload="test()"> + <p> + This is a test for <i><a href="https://bugs.webkit.org/show_bug.cgi?id=9252">http://bugzilla.opendarwin.org/show_bug.cgi?id=9252</a> + REGRESSION: Very odd roll-over issues (content disappearing)</i>. + </p> + <p> + There should be a green square below. + </p> + <hr> + <div id="t"></div> + <div id="square" class="red"></div> +</body> +</html> diff --git a/LayoutTests/fast/dom/HTMLLinkElement/prefetch-detached-expected.txt b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-detached-expected.txt new file mode 100644 index 0000000..44311f8 --- /dev/null +++ b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-detached-expected.txt @@ -0,0 +1,3 @@ +This test passes if it doesn't crash. + + diff --git a/LayoutTests/fast/dom/HTMLLinkElement/prefetch-detached.html b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-detached.html new file mode 100644 index 0000000..2d5d76c --- /dev/null +++ b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-detached.html @@ -0,0 +1,20 @@ +<body> +<script> +if (window.layoutTestController) + layoutTestController.dumpAsText(); +</script> +<html> +<p>This test passes if it doesn't crash.</p> +<div id="frag"></div> +<script> +// Fun with innerHTML. +document.getElementById('frag').innerHTML = '<link href="prefetch.link" rel="prefetch">'; + +// Fun with detached documents. +var doc = document.implementation.createDocument('application/html+xml'); +var lnk = doc.createElement('link'); +lnk.setAttribute('rel', 'prefetch'); +lnk.setAttribute('href', 'prefetch.link'); +doc.documentElement.appendChild(lnk); +</script> +</html> diff --git a/LayoutTests/fast/dom/HTMLLinkElement/prefetch-expected.txt b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-expected.txt new file mode 100644 index 0000000..9ea65dc --- /dev/null +++ b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-expected.txt @@ -0,0 +1,4 @@ +prefetch.link has MIME type application/octet-stream +This test requires DumpRenderTree to see the log of what resources are loaded. + +SUCCESS! prefetch onload called. diff --git a/LayoutTests/fast/dom/HTMLLinkElement/prefetch-onload-expected.txt b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-onload-expected.txt new file mode 100644 index 0000000..dac6e93 --- /dev/null +++ b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-onload-expected.txt @@ -0,0 +1,6 @@ +This tests that onload events can be attached to link elements with rel=prefetch. Since prefetch links are just there as a performance optimization, the onload event is their only programatic side-effect. + +If it works you should see a message below saying the test has passed. + +TEST PASSED. + diff --git a/LayoutTests/fast/dom/HTMLLinkElement/prefetch-onload.html b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-onload.html new file mode 100644 index 0000000..37cfdbf --- /dev/null +++ b/LayoutTests/fast/dom/HTMLLinkElement/prefetch-onload.html @@ -0,0 +1,29 @@ +<html> +<head> +<script type="text/javascript"> +function log(message) +{ + var item = document.createElement("li"); + item.appendChild(document.createTextNode(message)); + document.getElementById("console").appendChild(item); +} +function done() +{ + log("TEST PASSED."); + if (window.layoutTestController) + layoutTestController.notifyDone(); + } +if (window.layoutTestController) { + layoutTestController.dumpAsText(); + layoutTestController.waitUntilDone(); +} +</script> +</head> +<body> +<p>This tests that onload events can be attached to link elements with rel=prefetch. Since prefetch links are just there as a performance optimization, the 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.link" rel="prefetch" onload="done()" > +<hr> +<p><ol id="console"></ol></p> +</body> +</html> diff --git a/LayoutTests/fast/dom/HTMLLinkElement/prefetch.html b/LayoutTests/fast/dom/HTMLLinkElement/prefetch.html new file mode 100644 index 0000000..5c223f9 --- /dev/null +++ b/LayoutTests/fast/dom/HTMLLinkElement/prefetch.html @@ -0,0 +1,23 @@ +<body> +<script> +function log(message) { + var item = document.createElement("li"); + item.appendChild(document.createTextNode(message)); + document.getElementById("console").appendChild(item); +} +function prefetch_onload() { + log("SUCCESS! prefetch onload called."); + layoutTestController.notifyDone(); +} +if (window.layoutTestController) { + layoutTestController.waitUntilDone(); + layoutTestController.dumpAsText(); + layoutTestController.dumpResourceResponseMIMETypes(); +} +</script> +<html> +<p>This test requires DumpRenderTree to see the log of what resources are loaded. +<link href="prefetch.link" rel="prefetch" onload="prefetch_onload()"> +<p><ol id="console"></ol> +</html> + diff --git a/LayoutTests/fast/dom/HTMLLinkElement/prefetch.link b/LayoutTests/fast/dom/HTMLLinkElement/prefetch.link new file mode 100644 index 0000000..9051267 --- /dev/null +++ b/LayoutTests/fast/dom/HTMLLinkElement/prefetch.link @@ -0,0 +1 @@ +This is the link that is fetched by the prefetch-onload test diff --git a/LayoutTests/fast/dom/HTMLLinkElement/resources/nick.jpg b/LayoutTests/fast/dom/HTMLLinkElement/resources/nick.jpg Binary files differnew file mode 100644 index 0000000..3d9fb57 --- /dev/null +++ b/LayoutTests/fast/dom/HTMLLinkElement/resources/nick.jpg diff --git a/LayoutTests/platform/android/layout_test_directories.txt b/LayoutTests/platform/android/layout_test_directories.txt index 703c4da..a1288ac 100755 --- a/LayoutTests/platform/android/layout_test_directories.txt +++ b/LayoutTests/platform/android/layout_test_directories.txt @@ -18,6 +18,7 @@ fast/dom/HTMLFormElement fast/dom/HTMLHtmlElement fast/dom/HTMLKeygenElement fast/dom/HTMLLabelElement +fast/dom/HTMLLinklement fast/dom/HTMLMetaElement fast/dom/HTMLTableRowElement fast/dom/HTMLTableSectionElement diff --git a/LayoutTests/platform/android/test_expectations.txt b/LayoutTests/platform/android/test_expectations.txt index d0a039c..c42969c 100644 --- a/LayoutTests/platform/android/test_expectations.txt +++ b/LayoutTests/platform/android/test_expectations.txt @@ -40,6 +40,8 @@ fast/regex/slow.html CRASH // Causes DumpRenderTree to hang with V8 // This first block of tests are for features for which Android // should pass all tests. They are skipped only temporarily. // TODO: Fix these failing tests and remove them from this list. +fast/dom/HTMLLinkElement/link-and-subresource-test.html FAIL // Requires layoutTestController.dumpResourceResponseMIMETypes(), see http://b/issue?id=4470249 +fast/dom/HTMLLinkElement/prefetch.html FAIL // Requires layoutTestController.dumpResourceResponseMIMETypes(), see http://b/issue?id=4470249 fast/encoding/char-decoding.html FAIL // fails in Java HTTP stack, see http://b/issue?id=3047156 fast/encoding/hanarei-blog32-fc2-com.html FAIL // fails in Java HTTP stack, see http://b/issue?id=3046986 fast/encoding/mailto-always-utf-8.html FAIL // Requires waitForPolicyDelegate(), see http://b/issue?id=3043468 @@ -92,6 +94,7 @@ dom/xhtml/level3/core/nodegetbaseuri17.xhtml FAIL dom/xhtml/level3/core/nodegetbaseuri18.xhtml FAIL dom/xhtml/level3/core/nodelookupnamespaceuri01.xhtml FAIL dom/xhtml/level3/core/nodelookupprefix19.xhtml FAIL +fast/dom/HTMLLinkElement/pending-stylesheet-count.html FAIL // Expected failures for pixel tests fast/encoding/denormalised-voiced-japanese-chars.html FAIL |