From f91ac8eab3399adb5325701bebe0590a77e49df7 Mon Sep 17 00:00:00 2001 From: Leon Clarke Date: Tue, 9 Mar 2010 14:12:21 +0000 Subject: Link prefetch support http://b/issue?id=2268353 --- .../level2/html/HTMLLinkElement10-expected.txt | 2 + .../html/level2/html/HTMLLinkElement10-link.file | 12 +++++ .../dom/html/level2/html/HTMLLinkElement10.html | 18 ++++++++ .../dom/html/level2/html/HTMLLinkElement10.js | 51 ++++++++++++++++++++++ .../level2/html/HTMLLinkElement11-expected.txt | 2 + .../dom/html/level2/html/HTMLLinkElement11.css | 1 + .../dom/html/level2/html/HTMLLinkElement11.html | 15 +++++++ .../dom/html/level2/html/HTMLLinkElement11.js | 51 ++++++++++++++++++++++ 8 files changed, 152 insertions(+) create mode 100644 LayoutTests/dom/html/level2/html/HTMLLinkElement10-expected.txt create mode 100644 LayoutTests/dom/html/level2/html/HTMLLinkElement10-link.file create mode 100644 LayoutTests/dom/html/level2/html/HTMLLinkElement10.html create mode 100644 LayoutTests/dom/html/level2/html/HTMLLinkElement10.js create mode 100644 LayoutTests/dom/html/level2/html/HTMLLinkElement11-expected.txt create mode 100644 LayoutTests/dom/html/level2/html/HTMLLinkElement11.css create mode 100644 LayoutTests/dom/html/level2/html/HTMLLinkElement11.html create mode 100644 LayoutTests/dom/html/level2/html/HTMLLinkElement11.js (limited to 'LayoutTests') diff --git a/LayoutTests/dom/html/level2/html/HTMLLinkElement10-expected.txt b/LayoutTests/dom/html/level2/html/HTMLLinkElement10-expected.txt new file mode 100644 index 0000000..6f009e8 --- /dev/null +++ b/LayoutTests/dom/html/level2/html/HTMLLinkElement10-expected.txt @@ -0,0 +1,2 @@ +Test: http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLLinkElement10 +Status: Success diff --git a/LayoutTests/dom/html/level2/html/HTMLLinkElement10-link.file b/LayoutTests/dom/html/level2/html/HTMLLinkElement10-link.file new file mode 100644 index 0000000..4a94b89 --- /dev/null +++ b/LayoutTests/dom/html/level2/html/HTMLLinkElement10-link.file @@ -0,0 +1,12 @@ + + + + +NIST DOM HTML Test - LINK + +

+This is the test link that's pre-fetched by the prefetch test. +

+ + + diff --git a/LayoutTests/dom/html/level2/html/HTMLLinkElement10.html b/LayoutTests/dom/html/level2/html/HTMLLinkElement10.html new file mode 100644 index 0000000..dcf20e1 --- /dev/null +++ b/LayoutTests/dom/html/level2/html/HTMLLinkElement10.html @@ -0,0 +1,18 @@ + + + + +NIST DOM HTML Test - LINK + + + + + + +

+
+

+ + + diff --git a/LayoutTests/dom/html/level2/html/HTMLLinkElement10.js b/LayoutTests/dom/html/level2/html/HTMLLinkElement10.js new file mode 100644 index 0000000..c0ac4a7 --- /dev/null +++ b/LayoutTests/dom/html/level2/html/HTMLLinkElement10.js @@ -0,0 +1,51 @@ + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLLinkElement10"; + } + +var docsLoaded = 0; +var mainLoaded = false; +var prefetchLoaded = false; + +function finishTest() { + if (mainLoaded && prefetchLoaded) { + setResult(null, null); + } else { + if (!prefetchLoaded) { + setResult("fail", "No prefetch onload fired"); + } else { + setResult("fail", "Prefetch fired, but maybe the document onload didn't"); + } + } + if (window.layoutTestController) { + layoutTestController.notifyDone(); + } +} + +function loadComplete() { + mainLoaded = true; + if (++docsLoaded == 2) { + finishTest(); + } +} + +function prefetchComplete() { + prefetchLoaded = true; + if (++docsLoaded == 2) { + finishTest(); + } +} + + + +function startTest10() { + if (window.layoutTestController) { + layoutTestController.dumpAsText(); + layoutTestController.waitUntilDone(); + } +} diff --git a/LayoutTests/dom/html/level2/html/HTMLLinkElement11-expected.txt b/LayoutTests/dom/html/level2/html/HTMLLinkElement11-expected.txt new file mode 100644 index 0000000..d53710a --- /dev/null +++ b/LayoutTests/dom/html/level2/html/HTMLLinkElement11-expected.txt @@ -0,0 +1,2 @@ +Test: http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLLinkElement11 +Status: Success diff --git a/LayoutTests/dom/html/level2/html/HTMLLinkElement11.css b/LayoutTests/dom/html/level2/html/HTMLLinkElement11.css new file mode 100644 index 0000000..6a5dab8 --- /dev/null +++ b/LayoutTests/dom/html/level2/html/HTMLLinkElement11.css @@ -0,0 +1 @@ +div { font-family: Arial, Helvetica, sans-serif; color: red; } diff --git a/LayoutTests/dom/html/level2/html/HTMLLinkElement11.html b/LayoutTests/dom/html/level2/html/HTMLLinkElement11.html new file mode 100644 index 0000000..9b9a5e4 --- /dev/null +++ b/LayoutTests/dom/html/level2/html/HTMLLinkElement11.html @@ -0,0 +1,15 @@ + + + + +NIST DOM HTML Test - LINK + + + + +

+
+

+ + + diff --git a/LayoutTests/dom/html/level2/html/HTMLLinkElement11.js b/LayoutTests/dom/html/level2/html/HTMLLinkElement11.js new file mode 100644 index 0000000..b8bf1cb --- /dev/null +++ b/LayoutTests/dom/html/level2/html/HTMLLinkElement11.js @@ -0,0 +1,51 @@ + + + /** + * Gets URI that identifies the test. + * @return uri identifier of test + */ +function getTargetURI() { + return "http://www.w3.org/2001/DOM-Test-Suite/level2/html/HTMLLinkElement11"; + } + +var docsLoaded = 0; +var mainLoaded = false; +var cssLoaded = false; + +function finishTest() { + if (mainLoaded && cssLoaded) { + setResult(null, null); + } else { + if (!cssLoaded) { + setResult("fail", "No css onload fired"); + } else { + setResult("fail", "Css fired, but maybe the document onload didn't"); + } + } + if (window.layoutTestController) { + layoutTestController.notifyDone(); + } +} + +function loadComplete() { + mainLoaded = true; + if (++docsLoaded == 2) { + finishTest(); + } +} + +function cssComplete() { + cssLoaded = true; + if (++docsLoaded == 2) { + finishTest(); + } +} + + + +function startTest11() { + if (window.layoutTestController) { + layoutTestController.dumpAsText(); + layoutTestController.waitUntilDone(); + } +} -- cgit v1.1