Title: [88480] trunk/LayoutTests
Revision
88480
Author
[email protected]
Date
2011-06-09 13:53:58 -0700 (Thu, 09 Jun 2011)

Log Message

2011-06-09  Vsevolod Vlasov  <[email protected]>

        Reviewed by James Robinson.

        Web Inspector: Inspector layout tests - extract method for sending XHR
        https://bugs.webkit.org/show_bug.cgi?id=62391

        * http/tests/inspector/console-xhr-logging.html:
        * http/tests/inspector/network-test.js:
        (doXHR.xhr.onreadystatechange):
        (doXHR):
        * http/tests/inspector/network/network-size-sync.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (88479 => 88480)


--- trunk/LayoutTests/ChangeLog	2011-06-09 20:33:20 UTC (rev 88479)
+++ trunk/LayoutTests/ChangeLog	2011-06-09 20:53:58 UTC (rev 88480)
@@ -1,3 +1,16 @@
+2011-06-09  Vsevolod Vlasov  <[email protected]>
+
+        Reviewed by James Robinson.
+
+        Web Inspector: Inspector layout tests - extract method for sending XHR
+        https://bugs.webkit.org/show_bug.cgi?id=62391
+
+        * http/tests/inspector/console-xhr-logging.html:
+        * http/tests/inspector/network-test.js:
+        (doXHR.xhr.onreadystatechange):
+        (doXHR):
+        * http/tests/inspector/network/network-size-sync.html:
+
 2011-06-09  Julien Chaffraix  <[email protected]>
 
         Reviewed by Antti Koivisto.

Modified: trunk/LayoutTests/http/tests/inspector/console-xhr-logging.html (88479 => 88480)


--- trunk/LayoutTests/http/tests/inspector/console-xhr-logging.html	2011-06-09 20:33:20 UTC (rev 88479)
+++ trunk/LayoutTests/http/tests/inspector/console-xhr-logging.html	2011-06-09 20:53:58 UTC (rev 88480)
@@ -2,15 +2,13 @@
 <head>
 <script src=""
 <script src=""
+<script src=""
 <script>
-
 function requestHelper(method, url)
 {
     // Make synchronous requests for simplicity.
     console.log("sending a %s request to %s", method, url);
-    var xhr = new XMLHttpRequest();
-    xhr.open(method, url, false);
-    xhr.send();
+    doXHR(method, url, false);
 }
 
 function makeRequests()

Modified: trunk/LayoutTests/http/tests/inspector/network/network-size-sync.html (88479 => 88480)


--- trunk/LayoutTests/http/tests/inspector/network/network-size-sync.html	2011-06-09 20:33:20 UTC (rev 88479)
+++ trunk/LayoutTests/http/tests/inspector/network/network-size-sync.html	2011-06-09 20:53:58 UTC (rev 88480)
@@ -1,17 +1,11 @@
 <html>
 <head>
 <script src=""
+<script src=""
 <script>
 function loadData()
 {
-    var xhr = new XMLHttpRequest();
-    xhr._onreadystatechange_ = function()
-    {
-        if (xhr.readyState  == 4)
-            resourceLoaded();
-    };
-    xhr.open('GET', 'resources/resource.php?type=image&size=500&gzip=true&chunked=true', false);
-    xhr.send(null);
+    doXHR("GET", "resources/resource.php?type=image&size=500&gzip=true&chunked=true", false, resourceLoaded);
 }
 
 function resourceLoaded()

Modified: trunk/LayoutTests/http/tests/inspector/network-test.js (88479 => 88480)


--- trunk/LayoutTests/http/tests/inspector/network-test.js	2011-06-09 20:33:20 UTC (rev 88479)
+++ trunk/LayoutTests/http/tests/inspector/network-test.js	2011-06-09 20:53:58 UTC (rev 88480)
@@ -24,3 +24,18 @@
 }
 
 };
+
+function doXHR(method, url, async, callback)
+{
+    var xhr = new XMLHttpRequest();
+    xhr._onreadystatechange_ = function()
+    {
+        if (xhr.readyState === XMLHttpRequest.DONE) {
+            if (typeof(callback) === "function")
+                callback();
+        }
+    };
+    xhr.open(method, url, async);
+    xhr.send(null);
+}
+
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to