Title: [90367] trunk/LayoutTests
Revision
90367
Author
[email protected]
Date
2011-07-04 08:53:03 -0700 (Mon, 04 Jul 2011)

Log Message

2011-07-04  Vsevolod Vlasov  <[email protected]>

        Web Inspector: network-preflight-options.html test is flaky.
        https://bugs.webkit.org/show_bug.cgi?id=63904

        Unreviewed test fix.

        * http/tests/inspector/network-preflight-options-expected.txt:
        * http/tests/inspector/network-preflight-options.html:
        * platform/qt/Skipped:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (90366 => 90367)


--- trunk/LayoutTests/ChangeLog	2011-07-04 15:31:58 UTC (rev 90366)
+++ trunk/LayoutTests/ChangeLog	2011-07-04 15:53:03 UTC (rev 90367)
@@ -1,3 +1,14 @@
+2011-07-04  Vsevolod Vlasov  <[email protected]>
+
+        Web Inspector: network-preflight-options.html test is flaky.
+        https://bugs.webkit.org/show_bug.cgi?id=63904
+
+        Unreviewed test fix.
+
+        * http/tests/inspector/network-preflight-options-expected.txt:
+        * http/tests/inspector/network-preflight-options.html:
+        * platform/qt/Skipped:
+
 2011-07-04  Andras Becsi  <[email protected]>
 
         [Qt] http/tests/inspector/network-preflight-options.html fails frequently

Modified: trunk/LayoutTests/http/tests/inspector/network-preflight-options-expected.txt (90366 => 90367)


--- trunk/LayoutTests/http/tests/inspector/network-preflight-options-expected.txt	2011-07-04 15:31:58 UTC (rev 90366)
+++ trunk/LayoutTests/http/tests/inspector/network-preflight-options-expected.txt	2011-07-04 15:53:03 UTC (rev 90367)
@@ -4,6 +4,7 @@
 CONSOLE MESSAGE: line 1: XMLHttpRequest cannot load http://localhost:8000/inspector/resources/cors-target.php?deny=yes. Origin http://127.0.0.1:8000 is not allowed by Access-Control-Allow-Origin.
 Tests that preflight OPTIONS requests appear in Network resources
 
+Bug 63712
 POST http://localhost:8000/inspector/resources/cors-target.php?deny=yes
 OPTIONS http://localhost:8000/inspector/resources/cors-target.php?deny=yes
 OPTIONS http://localhost:8000/inspector/resources/cors-target.php

Modified: trunk/LayoutTests/http/tests/inspector/network-preflight-options.html (90366 => 90367)


--- trunk/LayoutTests/http/tests/inspector/network-preflight-options.html	2011-07-04 15:31:58 UTC (rev 90366)
+++ trunk/LayoutTests/http/tests/inspector/network-preflight-options.html	2011-07-04 15:53:03 UTC (rev 90367)
@@ -2,10 +2,18 @@
 <head>
 <script src=""
 <script type="text/_javascript_">
-
-function sendXHR(url, forcePreflight, async)
+function sendXHR(url, forcePreflight, async, callback)
 {
     var xhr = new XMLHttpRequest();
+
+    xhr._onreadystatechange_ = function()
+    {
+        if (xhr.readyState === XMLHttpRequest.DONE) {
+            if (typeof(callback) === "function")
+                callback();
+        }
+    };
+
     xhr.open("POST", url, async);
     xhr.setRequestHeader("Content-Type", forcePreflight ? "application/xml" : "text/plain");
     try {
@@ -14,10 +22,9 @@
     }
 }
 
+var targetURL = "http://localhost:8000/inspector/resources/cors-target.php";
 function doCrossOriginXHR()
 {
-    var targetURL = "http://localhost:8000/inspector/resources/cors-target.php";
-
     // Failed POSTs with no preflight check should result in a POST request being logged
     sendXHR(targetURL + "?deny=yes", false, false);
     // Failed POSTs with preflight check should result in an OPTIONS request being logged
@@ -28,8 +35,16 @@
 
     // And now send the same requests asynchronously
     // Add redundant async parameter to ensure this request differs from the one above.
-    sendXHR(targetURL + "?deny=yes", false, true);
-    sendXHR(targetURL + "?deny=yes", true, true);
+    sendXHR(targetURL + "?deny=yes", false, true, step2);
+}
+
+function step2()
+{
+    sendXHR(targetURL + "?deny=yes", true, true, step3);
+}
+
+function step3()
+{
     sendXHR(targetURL + "?async=yes&date=" + Date.now(), true, true);
 }
 
@@ -39,17 +54,17 @@
     function onResource(event)
     {
         var resource = event.data;
-        InspectorTest.addResult(resource.requestMethod + " " +  resource.url.replace(/[&?]date=\d+/, ""));
-        if (resource.requestMethod === "POST" && ++postRequestsCount == 4)
+        InspectorTest.addResult(resource.requestMethod + " " + resource.url.replace(/[&?]date=\d+/, ""));
+        if (resource.requestMethod === "POST" && ++postRequestsCount === 4)
             InspectorTest.completeTest();
     }
     WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceFinished, onResource);
     InspectorTest.evaluateInPage("doCrossOriginXHR();");
 }
-
 </script>
 </head>
 <body _onload_="runTest()">
 <p>Tests that preflight OPTIONS requests appear in Network resources</p>
+<a href="" 63712</a>
 </body>
 </html>

Modified: trunk/LayoutTests/platform/qt/Skipped (90366 => 90367)


--- trunk/LayoutTests/platform/qt/Skipped	2011-07-04 15:31:58 UTC (rev 90366)
+++ trunk/LayoutTests/platform/qt/Skipped	2011-07-04 15:53:03 UTC (rev 90367)
@@ -482,10 +482,6 @@
 
 transitions/change-values-during-transition.html
 
-# [Qt] http/tests/inspector/network-preflight-options.html fails frequently
-# https://bugs.webkit.org/show_bug.cgi?id=63910
-http/tests/inspector/network-preflight-options.html
-
 # http/tests/inspector/resource-har-conversion.html is failing on the release bot after r63191
 # webkit.org/b/42162
 http/tests/inspector/resource-har-conversion.html
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to