Title: [104598] trunk/LayoutTests
Revision
104598
Author
vse...@chromium.org
Date
2012-01-10 10:49:36 -0800 (Tue, 10 Jan 2012)

Log Message

http/tests/inspector/network-preflight-options.html is flaky on linux
https://bugs.webkit.org/show_bug.cgi?id=75917

Reviewed by Yury Semikhatsky.

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

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (104597 => 104598)


--- trunk/LayoutTests/ChangeLog	2012-01-10 18:46:30 UTC (rev 104597)
+++ trunk/LayoutTests/ChangeLog	2012-01-10 18:49:36 UTC (rev 104598)
@@ -1,3 +1,13 @@
+2012-01-10  Vsevolod Vlasov  <vse...@chromium.org>
+
+        http/tests/inspector/network-preflight-options.html is flaky on linux
+        https://bugs.webkit.org/show_bug.cgi?id=75917
+
+        Reviewed by Yury Semikhatsky.
+
+        * http/tests/inspector/network-preflight-options-expected.txt:
+        * http/tests/inspector/network-preflight-options.html:
+
 2012-01-10  Mario Sanchez Prada  <msanc...@igalia.com>
 
         AX: support helpText() in DumpRenderTree

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


--- trunk/LayoutTests/http/tests/inspector/network-preflight-options-expected.txt	2012-01-10 18:46:30 UTC (rev 104597)
+++ trunk/LayoutTests/http/tests/inspector/network-preflight-options-expected.txt	2012-01-10 18:49:36 UTC (rev 104598)
@@ -1,16 +1,16 @@
-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.
-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.
-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.
-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.
+CONSOLE MESSAGE: line 1: XMLHttpRequest cannot load http://localhost:8000/inspector/resources/cors-target.php?id=0&deny=yes. Origin http://127.0.0.1:8000 is not allowed by Access-Control-Allow-Origin.
+CONSOLE MESSAGE: line 1: XMLHttpRequest cannot load http://localhost:8000/inspector/resources/cors-target.php?id=1&deny=yes. Origin http://127.0.0.1:8000 is not allowed by Access-Control-Allow-Origin.
+CONSOLE MESSAGE: line 1: XMLHttpRequest cannot load http://localhost:8000/inspector/resources/cors-target.php?id=3&deny=yes. Origin http://127.0.0.1:8000 is not allowed by Access-Control-Allow-Origin.
+CONSOLE MESSAGE: line 1: XMLHttpRequest cannot load http://localhost:8000/inspector/resources/cors-target.php?id=4&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
-POST http://localhost:8000/inspector/resources/cors-target.php
-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?async=yes
-POST http://localhost:8000/inspector/resources/cors-target.php?async=yes
+0:POST http://localhost:8000/inspector/resources/cors-target.php?id=0&deny=yes
+1:OPTIONS http://localhost:8000/inspector/resources/cors-target.php?id=1&deny=yes
+2:OPTIONS http://localhost:8000/inspector/resources/cors-target.php?id=2
+2:POST http://localhost:8000/inspector/resources/cors-target.php?id=2
+3:POST http://localhost:8000/inspector/resources/cors-target.php?id=3&deny=yes
+4:OPTIONS http://localhost:8000/inspector/resources/cors-target.php?id=4&deny=yes
+5:OPTIONS http://localhost:8000/inspector/resources/cors-target.php?id=5
+5:POST http://localhost:8000/inspector/resources/cors-target.php?id=5
 

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


--- trunk/LayoutTests/http/tests/inspector/network-preflight-options.html	2012-01-10 18:46:30 UTC (rev 104597)
+++ trunk/LayoutTests/http/tests/inspector/network-preflight-options.html	2012-01-10 18:49:36 UTC (rev 104598)
@@ -22,41 +22,60 @@
     }
 }
 
-var targetURL = "http://localhost:8000/inspector/resources/cors-target.php";
+var baseTargetURL = "http://localhost:8000/inspector/resources/cors-target.php";
+
+function targetURL(id, deny, addTimestamp)
+{
+    var result = baseTargetURL + "?id=" + id;
+    if (deny)
+        result += "&deny=yes";
+    if (addTimestamp)
+        result += "&date=" + Date.now();
+    return result;
+}
+
 function doCrossOriginXHR()
 {
     // Failed POSTs with no preflight check should result in a POST request being logged
-    sendXHR(targetURL + "?deny=yes", false, false);
+    sendXHR(targetURL(0, true, false), false, false);
     // Failed POSTs with preflight check should result in an OPTIONS request being logged
-    sendXHR(targetURL + "?deny=yes", true, false);
+    sendXHR(targetURL(1, true, false), true, false);
     // Successful POSTs with preflight check should result in an OPTIONS request followed by POST request being logged
     // Generate request name based on timestamp to defeat OPTIONS request caching (this is only relevant for repeated invocations of the test in signle instance of DRT)
-    sendXHR(targetURL + "?date=" + Date.now(), true, false);
+    sendXHR(targetURL(2, false, true), true, false);
 
     // 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, step2);
+    sendXHR(targetURL(3, true, false), false, true, step2);
 }
 
 function step2()
 {
-    sendXHR(targetURL + "?deny=yes", true, true, step3);
+    sendXHR(targetURL(4, true, false), true, true, step3);
 }
 
 function step3()
 {
-    sendXHR(targetURL + "?async=yes&date=" + Date.now(), true, true);
+    sendXHR(targetURL(5, false, true), true, true);
 }
 
 var test = function()
 {
+    var requestMessages = [];
     var postRequestsCount = 0;
     function onResource(event)
     {
         var resource = event.data;
-        InspectorTest.addResult(resource.requestMethod + " " + resource.url.replace(/[&?]date=\d+/, ""));
-        if (resource.requestMethod === "POST" && ++postRequestsCount === 4)
+        var idMatch = /\?id=([0-9]*)&/.exec(resource.url);
+        var requestId = idMatch[1];
+        var requestMessage = requestId + ":" + resource.requestMethod + " " + resource.url.replace(/[&?]date=\d+/, "");
+        requestMessages.push(requestMessage);
+        if (resource.requestMethod === "POST" && ++postRequestsCount === 4) {
+            requestMessages.sort();
+            for (var i = 0; i < requestMessages.length; i++)
+                InspectorTest.addResult(requestMessages[i]);
             InspectorTest.completeTest();
+        }
     }
     WebInspector.networkManager.addEventListener(WebInspector.NetworkManager.EventTypes.ResourceFinished, onResource);
     InspectorTest.evaluateInPage("doCrossOriginXHR();");
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to