Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Unified Diff: LayoutTests/fast/dom/StyleSheet/detached-style-pi-2.xhtml

Issue 722093002: Handle case when XSL stylesheet node is removed during load (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: refine layout test. Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/dom/ProcessingInstruction.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/StyleSheet/detached-style-pi-2.xhtml
diff --git a/LayoutTests/fast/dom/StyleSheet/detached-style-pi-2.xhtml b/LayoutTests/fast/dom/StyleSheet/detached-style-pi-2.xhtml
index a18026e3bd5aa53c24142094a9a47cfb2417c25e..5b0e7c3d97f84409f5e22251bd1253a884c44a8f 100644
--- a/LayoutTests/fast/dom/StyleSheet/detached-style-pi-2.xhtml
+++ b/LayoutTests/fast/dom/StyleSheet/detached-style-pi-2.xhtml
@@ -8,8 +8,11 @@
Test that &lt;xml-stylesheet> processing instructions only have stylesheets when in document.</p>
<pre id="result"></pre>
<script>
-if (window.testRunner)
+<![CDATA[
+if (window.testRunner) {
testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+}
sheet = document.styleSheets[0];
pi = document.firstChild;
@@ -22,13 +25,25 @@ function finishTest()
result.innerHTML += "Not in document: " + ((pi.sheet === null) ? "PASS" : ("FAIL: " + pi.sheet)) + "\n";
document.appendChild(pi);
+ window.requestAnimationFrame(finishTest2);
+}
- // This subtest fails in Firefox 4.0b8 - apparently, adding a processing instruction doens't trigger load.
- result.innerHTML += "After adding to document: " + ((pi.sheet === null) ? ("FAIL: " + pi.sheet) : "PASS") + "\n";
+var retryCount = 0;
+function finishTest2() {
+ // This subtest may fail because loading the resource may not complete immediately after
+ // appendChild().
+ if (pi.sheet === null && ++retryCount < 10) {
+ window.requestAnimationFrame(finishTest2);
+ return;
+ }
+
+ result.innerHTML += "After adding to document: " + ((pi.sheet === null) ? ("FAIL: " + pi.sheet) : "PASS") + "\n";
result.innerHTML += "DONE";
+ if (window.testRunner)
+ testRunner.notifyDone();
}
-
+]]>
</script>
</body>
</html>
« no previous file with comments | « no previous file | Source/core/dom/ProcessingInstruction.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698