http/tests/css/link-css-disabled-value-with-slow-loading-sheet.html is flaky
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Dec 2014 21:01:10 +0000 (21:01 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 12 Dec 2014 21:01:10 +0000 (21:01 +0000)
https://bugs.webkit.org/show_bug.cgi?id=139591

Reviewed by Antti Koivisto.

* http/tests/css/resources/empty.css: Added.
* http/tests/css/resources/500.php: Copied from LayoutTests/http/tests/css/resources/slow-loading-sheet-in-error.php.
* http/tests/css/resources/slow-loading-sheet-in-error.php: Removed.
* http/tests/css/resources/slow-loading-sheet.php: Removed.
These scripts were not "slow" at all - 100 microseconds is nothing. Furthermore,
slow-loading-sheet-in-error.php wasn't even used, because of a typo in the test.
And worst of all, WebCore has its own ideas about when to load stylesheets - notably,
default stylesheet loading blocks script execution, so we cannot do anything before
the stylesheet loads.

* http/tests/css/link-css-disabled-value-with-slow-loading-sheet-in-error.html:
* http/tests/css/link-css-disabled-value-with-slow-loading-sheet.html:
Removed built-in timeout for the tests, we don't need it. Also, fixed a number of
small stylistic issues.

* http/tests/css/resources/link-css-disabled-value-with-slow-loading-sheet-in-error.js: Removed.
* http/tests/css/resources/link-css-disabled-value-with-slow-loading-sheet.js: Removed.
Moved inside HTML, because having tests in a separate file is useless and harmful.

* platform/mac-wk2/TestExpectations: These tests were always flaky, not 100% failing.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@177231 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/http/tests/css/link-css-disabled-value-with-slow-loading-sheet-in-error.html
LayoutTests/http/tests/css/link-css-disabled-value-with-slow-loading-sheet.html
LayoutTests/http/tests/css/resources/500.php [moved from LayoutTests/http/tests/css/resources/slow-loading-sheet-in-error.php with 100% similarity]
LayoutTests/http/tests/css/resources/empty.css [new file with mode: 0644]
LayoutTests/http/tests/css/resources/link-css-disabled-value-with-slow-loading-sheet-in-error.js [deleted file]
LayoutTests/http/tests/css/resources/link-css-disabled-value-with-slow-loading-sheet.js [deleted file]
LayoutTests/http/tests/css/resources/slow-loading-sheet.php [deleted file]
LayoutTests/platform/mac-wk2/TestExpectations

index 9d601cb..1eb7947 100644 (file)
@@ -1,3 +1,31 @@
+2014-12-12  Alexey Proskuryakov  <ap@apple.com>
+
+        http/tests/css/link-css-disabled-value-with-slow-loading-sheet.html is flaky
+        https://bugs.webkit.org/show_bug.cgi?id=139591
+
+        Reviewed by Antti Koivisto.
+
+        * http/tests/css/resources/empty.css: Added.
+        * http/tests/css/resources/500.php: Copied from LayoutTests/http/tests/css/resources/slow-loading-sheet-in-error.php.
+        * http/tests/css/resources/slow-loading-sheet-in-error.php: Removed.
+        * http/tests/css/resources/slow-loading-sheet.php: Removed.
+        These scripts were not "slow" at all - 100 microseconds is nothing. Furthermore,
+        slow-loading-sheet-in-error.php wasn't even used, because of a typo in the test.
+        And worst of all, WebCore has its own ideas about when to load stylesheets - notably,
+        default stylesheet loading blocks script execution, so we cannot do anything before
+        the stylesheet loads.
+
+        * http/tests/css/link-css-disabled-value-with-slow-loading-sheet-in-error.html:
+        * http/tests/css/link-css-disabled-value-with-slow-loading-sheet.html:
+        Removed built-in timeout for the tests, we don't need it. Also, fixed a number of
+        small stylistic issues.
+
+        * http/tests/css/resources/link-css-disabled-value-with-slow-loading-sheet-in-error.js: Removed.
+        * http/tests/css/resources/link-css-disabled-value-with-slow-loading-sheet.js: Removed.
+        Moved inside HTML, because having tests in a separate file is useless and harmful.
+
+        * platform/mac-wk2/TestExpectations: These tests were always flaky, not 100% failing.
+
 2014-12-12  Radu Stavila  <stavila@adobe.com>
 
         animations/cross-fade-webkit-mask-image.html is flaky
index d16c83d..6ee2290 100644 (file)
@@ -1,14 +1,46 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<!DOCTYPE html>
 <html>
 <head>
-<link rel="stylesheet" href="resources/slow-loading-sheet.php?color=green" media="all" title="Default Style Sheet" type="text/css" />
-<link rel="alternate stylesheet" href="resources/slow-loading-sheet.php-in-error" media="all" title="green" type="text/css" />
+<link rel="stylesheet" href="resources/empty.css?link-css-disabled-value-with-slow-loading-sheet-in-error&default" media="all" title="Default Style Sheet" type="text/css">
+<link rel="alternate stylesheet" href="resources/500.php" media="all" title="green" type="text/css">
 <script src="/js-test-resources/js-test-pre.js"></script>
 </head>
 <body>
 <p id="description"></p>
 <div id="console"></div>
-<script src="resources/link-css-disabled-value-with-slow-loading-sheet-in-error.js"></script>
+<script>
+description("Test that HTMLLinkElement's disabled attribute is properly cached while set when loading a stylesheet.");
+
+window.jsTestIsAsync = true;
+
+mainSheetLink = document.getElementsByTagName("link")[0];
+alternateSheetLink = document.getElementsByTagName("link")[1];
+
+mainSheetLink.disabled = true;
+alternateSheetLink.disabled = false;
+
+debug("Testing value of 'disabled' prior to load just after setting them");
+shouldBeNonNull("mainSheetLink.sheet");
+shouldBeNull("alternateSheetLink.sheet");
+shouldBeTrue("mainSheetLink.disabled");
+shouldBeFalse("alternateSheetLink.disabled");
+
+debug("Testing the values when the alternate sheet is loaded (as this is the only one that has sheet() === null)");
+
+var testTimer = setInterval(function() {
+    if (!alternateSheetLink.sheet)
+        return;
+    shouldBeNonNull("mainSheetLink.sheet");
+    shouldBeNonNull("alternateSheetLink.sheet");
+    shouldBeTrue("mainSheetLink.disabled");
+    shouldBeFalse("alternateSheetLink.disabled");
+
+    clearInterval(testTimer);
+    finishJSTest();
+}, 25);
+
+var successfullyParsed = true;
+</script>
 <script src="/js-test-resources/js-test-post.js"></script>
 </body>
 </html>
index 07ff2cc..9090843 100644 (file)
@@ -1,14 +1,46 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<!DOCTYPE html>
 <html>
 <head>
-<link rel="stylesheet" href="resources/slow-loading-sheet.php?color=red" media="all" title="Default Style Sheet" type="text/css" />
-<link rel="alternate stylesheet" href="resources/slow-loading-sheet.php?color=green" media="all" title="green" type="text/css" />
+<link rel="stylesheet" href="resources/empty.css?link-css-disabled-value-with-slow-loading-sheet&default" media="all" title="Default Style Sheet" type="text/css">
+<link rel="alternate stylesheet" href="resources/empty.css?link-css-disabled-value-with-slow-loading-sheet&alternate" media="all" title="green" type="text/css">
 <script src="/js-test-resources/js-test-pre.js"></script>
 </head>
 <body>
 <p id="description"></p>
 <div id="console"></div>
-<script src="resources/link-css-disabled-value-with-slow-loading-sheet.js"></script>
+<script>
+description("Test that HTMLLinkElement's disabled attribute is properly cached while set when loading a stylesheet.");
+
+window.jsTestIsAsync = true;
+
+mainSheetLink = document.getElementsByTagName("link")[0];
+alternateSheetLink = document.getElementsByTagName("link")[1];
+
+mainSheetLink.disabled = true;
+alternateSheetLink.disabled = false;
+
+debug("Testing value of 'disabled' prior to load just after setting them");
+shouldBeNonNull("mainSheetLink.sheet");
+shouldBeNull("alternateSheetLink.sheet");
+shouldBeTrue("mainSheetLink.disabled");
+shouldBeFalse("alternateSheetLink.disabled");
+
+debug("Testing the values when the alternate sheet is loaded (as this is the only one that has sheet() === null)");
+
+var testTimer = setInterval(function() {
+    if (!alternateSheetLink.sheet)
+        return;
+    shouldBeNonNull("mainSheetLink.sheet");
+    shouldBeNonNull("alternateSheetLink.sheet");
+    shouldBeTrue("mainSheetLink.disabled");
+    shouldBeFalse("alternateSheetLink.disabled");
+
+    clearInterval(testTimer);
+    finishJSTest();
+}, 25);
+
+var successfullyParsed = true;
+</script>
 <script src="/js-test-resources/js-test-post.js"></script>
 </body>
 </html>
diff --git a/LayoutTests/http/tests/css/resources/empty.css b/LayoutTests/http/tests/css/resources/empty.css
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/LayoutTests/http/tests/css/resources/link-css-disabled-value-with-slow-loading-sheet-in-error.js b/LayoutTests/http/tests/css/resources/link-css-disabled-value-with-slow-loading-sheet-in-error.js
deleted file mode 100644 (file)
index 06e4b3f..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-description("Test that HTMLLinkElement's disabled attribute is properly cached while set when loading a stylesheet.");
-
-if (window.testRunner)
-    testRunner.waitUntilDone();
-
-window.jsTestIsAsync = true;
-
-mainSheetLink = document.getElementsByTagName("link")[0];
-alternateSheetLink = document.getElementsByTagName("link")[1];
-
-mainSheetLink.disabled = true;
-alternateSheetLink.disabled = false;
-
-debug("Testing value of 'disabled' prior to load just after setting them");
-shouldBeNonNull("mainSheetLink.sheet");
-shouldBeNull("alternateSheetLink.sheet");
-shouldBeTrue("mainSheetLink.disabled", true);
-shouldBeFalse("alternateSheetLink.disabled");
-
-debug("Testing the values when the alternate sheet is loaded (as this is the only one that has sheet() === null)");
-
-function onSheetLoaded(f, elem, maxtime) {
-    if (elem.sheet || maxtime <= 0)
-        f();
-    else
-        setTimeout(function () { onSheetLoaded(f, elem, maxtime - 25);}, 25);
-}
-
-function testWhenLoaded() {
-        // Those next 2 lines are a sanity check.
-        // If the second check fails, it is likely that the test timed out and thus
-        // you can discard the rest of results as it is not testing what we want
-        // (namely that the disabled value is passed to the final sheet).
-        shouldBeNonNull("mainSheetLink.sheet");
-        shouldBeNonNull("alternateSheetLink.sheet");
-
-        shouldBeTrue("mainSheetLink.disabled");
-        shouldBeFalse("alternateSheetLink.disabled");
-
-        finishJSTest();
-}
-
-onSheetLoaded(testWhenLoaded, alternateSheetLink, 500);
-
-var successfullyParsed = true;
diff --git a/LayoutTests/http/tests/css/resources/link-css-disabled-value-with-slow-loading-sheet.js b/LayoutTests/http/tests/css/resources/link-css-disabled-value-with-slow-loading-sheet.js
deleted file mode 100644 (file)
index 06e4b3f..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-description("Test that HTMLLinkElement's disabled attribute is properly cached while set when loading a stylesheet.");
-
-if (window.testRunner)
-    testRunner.waitUntilDone();
-
-window.jsTestIsAsync = true;
-
-mainSheetLink = document.getElementsByTagName("link")[0];
-alternateSheetLink = document.getElementsByTagName("link")[1];
-
-mainSheetLink.disabled = true;
-alternateSheetLink.disabled = false;
-
-debug("Testing value of 'disabled' prior to load just after setting them");
-shouldBeNonNull("mainSheetLink.sheet");
-shouldBeNull("alternateSheetLink.sheet");
-shouldBeTrue("mainSheetLink.disabled", true);
-shouldBeFalse("alternateSheetLink.disabled");
-
-debug("Testing the values when the alternate sheet is loaded (as this is the only one that has sheet() === null)");
-
-function onSheetLoaded(f, elem, maxtime) {
-    if (elem.sheet || maxtime <= 0)
-        f();
-    else
-        setTimeout(function () { onSheetLoaded(f, elem, maxtime - 25);}, 25);
-}
-
-function testWhenLoaded() {
-        // Those next 2 lines are a sanity check.
-        // If the second check fails, it is likely that the test timed out and thus
-        // you can discard the rest of results as it is not testing what we want
-        // (namely that the disabled value is passed to the final sheet).
-        shouldBeNonNull("mainSheetLink.sheet");
-        shouldBeNonNull("alternateSheetLink.sheet");
-
-        shouldBeTrue("mainSheetLink.disabled");
-        shouldBeFalse("alternateSheetLink.disabled");
-
-        finishJSTest();
-}
-
-onSheetLoaded(testWhenLoaded, alternateSheetLink, 500);
-
-var successfullyParsed = true;
diff --git a/LayoutTests/http/tests/css/resources/slow-loading-sheet.php b/LayoutTests/http/tests/css/resources/slow-loading-sheet.php
deleted file mode 100644 (file)
index 28937d4..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
-// We sleep here so that we are have enough time to test the different attributes before the stylesheet is fully loaded.
-usleep(100);
-
-header("Expires: Thu, 01 Dec 2003 16:00:00 GMT");
-header("Cache-Control: no-cache, no-store, must-revalidate");
-header("Pragma: no-cache");
-header("Content-Type: text/css");
-
-$color = $_GET['color'];
-
-echo "h1 { background-color: $color }\n";
-ob_flush();
-flush();
-?>
index d23d812..c9023fa 100644 (file)
@@ -564,8 +564,8 @@ webkit.org/b/138687 [ Mavericks+ ] http/tests/xmlhttprequest/cross-origin-cookie
 webkit.org/b/138688 [ Mavericks+ ] http/tests/navigation/ping-cookie.html [ Skip ]
 
 # There is no network load scheduling or prioritization with NetworkProcess.
-webkit.org/b/123431 [ Mavericks+ ] http/tests/css/link-css-disabled-value-with-slow-loading-sheet-in-error.html [ Failure ]
-webkit.org/b/123431 [ Mavericks+ ] http/tests/css/link-css-disabled-value-with-slow-loading-sheet.html [ Failure ]
+webkit.org/b/123431 [ Mavericks+ ] http/tests/css/link-css-disabled-value-with-slow-loading-sheet-in-error.html [ Pass Failure ]
+webkit.org/b/123431 [ Mavericks+ ] http/tests/css/link-css-disabled-value-with-slow-loading-sheet.html [ Pass Failure ]
 webkit.org/b/123431 [ Mavericks+ ] http/tests/local/link-stylesheet-load-order-preload.html [ Failure ]
 webkit.org/b/123431 [ Mavericks+ ] http/tests/local/link-stylesheet-load-order.html [ Failure ]