Index: third_party/WebKit/LayoutTests/http/tests/css/ignore-pending-style-import.html |
diff --git a/third_party/WebKit/LayoutTests/http/tests/css/ignore-pending-style-import.html b/third_party/WebKit/LayoutTests/http/tests/css/ignore-pending-style-import.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..73aa659f772b821e324fefe7f864ad49cf516e1e |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/http/tests/css/ignore-pending-style-import.html |
@@ -0,0 +1,38 @@ |
+<!DOCTYPE html> |
+<h1 id="h1"></h1> |
+<pre id="res"></pre> |
+<script> |
+ if (window.testRunner) { |
+ testRunner.dumpAsText(); |
+ testRunner.waitUntilDone(); |
+ } |
+ |
+ var result = ""; |
+ |
+ function expectComputedOnH1(name, expected) { |
+ var value = getComputedStyle(h1)[name]; |
+ result += name + ": "; |
+ if (value == expected) |
+ result += "PASS\n"; |
+ else |
+ result += "FAIL - " + value + ", expected " + expected + "\n"; |
+ } |
+ |
+ function sheetLoaded() { |
+ expectComputedOnH1("backgroundColor", "rgb(0, 128, 0)"); |
+ expectComputedOnH1("color", "rgb(0, 128, 0)"); |
+ res.innerHTML = result; |
+ if (window.testRunner) |
+ testRunner.notifyDone(); |
+ } |
+ |
+ var style = document.createElement("style"); |
+ style.appendChild(document.createTextNode("@import url(http://localhost:8080/css/resources/slow-loading-sheet.php?color=green); h1{color:green}")); |
+ style.setAttribute("onload", "sheetLoaded()"); |
+ document.head.appendChild(style); |
+ |
+ document.body.offsetTop; |
+ expectComputedOnH1("backgroundColor", "rgba(0, 0, 0, 0)"); |
+ expectComputedOnH1("color", "rgb(0, 0, 0)"); |
+ |
+</script> |