Web Inspector: UI performance test for network panel is incorrect. The time is includ...
authorloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Sep 2011 14:30:38 +0000 (14:30 +0000)
committerloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Sep 2011 14:30:38 +0000 (14:30 +0000)
https://bugs.webkit.org/show_bug.cgi?id=69087

The fix has the changes for the test and minor perf framework improvements.

Reviewed by Yury Semikhatsky.

Source/WebCore:

* inspector/front-end/NetworkPanel.js:
(WebInspector.NetworkLogView.prototype._defaultRefreshDelay.500._scheduleRefresh):

LayoutTests:

* inspector/performance/resources/network-append-30-requests.html:
* inspector/performance/resources/performance-test.js:
(initialize_TimeTracker.InspectorTest.runPerformanceTest.Timer.prototype.done):
(initialize_TimeTracker.InspectorTest.runPerformanceTest):
(initialize_TimeTracker.InspectorTest.mark):

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

LayoutTests/ChangeLog
LayoutTests/inspector/performance/resources/network-append-30-requests.html
LayoutTests/inspector/performance/resources/performance-test.js
Source/WebCore/ChangeLog
Source/WebCore/inspector/front-end/NetworkPanel.js

index fe3c33e7d0b02952e3524ab150d9b8e608a533c0..75e6b7d21f38b9622beed2dff9479a9ab0e59312 100644 (file)
@@ -1,3 +1,18 @@
+2011-09-29  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Web Inspector: UI performance test for network panel is incorrect. The time is including a timeout between scheduled refresh and actual refresh.
+        https://bugs.webkit.org/show_bug.cgi?id=69087
+
+        The fix has the changes for the test and minor perf framework improvements.
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/performance/resources/network-append-30-requests.html:
+        * inspector/performance/resources/performance-test.js:
+        (initialize_TimeTracker.InspectorTest.runPerformanceTest.Timer.prototype.done):
+        (initialize_TimeTracker.InspectorTest.runPerformanceTest):
+        (initialize_TimeTracker.InspectorTest.mark):
+
 2011-09-29  Vsevolod Vlasov  <vsevik@chromium.org>
 
         Web Inspector: Make search-in-resource test simpler.
index 644db5d9c302a6dde13d5e8e7549262e26845142..01ccf191b8ba56ac7971d5a50b265a38ed1a7e05 100644 (file)
@@ -17,18 +17,22 @@ function test()
 {
     WebInspector.showPanel("network");
 
+    var originalRefresh = InspectorTest.override(WebInspector.panels.network._networkLogView, "refresh", timeTrackingRefresh, true);
+    WebInspector.panels.network._networkLogView._defaultRefreshDelay = 30;
+    function timeTrackingRefresh()
+    {
+        var cookie = InspectorTest.timer.start("network-append-30-requests");
+        originalRefresh.call(this);
+        InspectorTest.timer.finish(cookie);
+        InspectorTest.timer.done();
+    }
+
     function test(timer)
     {
         WebInspector.panels.network._networkLogView._reset();
-        var cookie = timer.start("network-append-30-requests");
         InspectorTest.evaluateInPage("makeXHRRequests(30)");
-        function finish()
-        {
-            timer.finish(cookie);
-            timer.done();
-        }
-        InspectorTest.addSniffer(WebInspector.panels.network._networkLogView, "refresh", finish);
     }
+
     InspectorTest.runPerformanceTest(test, 15000);
 }
 
index 95d8a5ece09e558c42c61ea6f8b2cc290c00e61e..3f014640c11d4699c579c9f4177d227060f46aef 100644 (file)
@@ -43,6 +43,10 @@ InspectorTest.runPerformanceTest = function(perfTest, executeTime, callback)
             if (time - this._testStartTime < executeTime)
                 this._runTest();
             else {
+                if (this._complete)
+                    return;
+                this._complete = true;
+
                 this._dump();
                 if (this._callback)
                     this._callback();
@@ -77,8 +81,20 @@ InspectorTest.runPerformanceTest = function(perfTest, executeTime, callback)
 
     }
 
-    var timer = new Timer(perfTest, callback);
-    timer._runTest();
+    InspectorTest.timer = new Timer(perfTest, callback);
+    InspectorTest.timer._runTest();
+}
+
+InspectorTest.mark = function(markerName)
+{
+    var timer = InspectorTest.timer;
+    if (!timer)
+        return;
+
+    if (InspectorTest.lastMarkCookie)
+        timer.finish(InspectorTest.lastMarkCookie);
+
+    InspectorTest.lastMarkCookie = markerName ? timer.start(markerName) : null;
 }
 
 InspectorTest.dumpTestStats = function(testName, samples, divider)
index b767fdcc4221a6db3425ef6c2e4b59f0a3254058..972730c83f99429d4b4ea06af2575a4c8b403c34 100644 (file)
@@ -1,3 +1,15 @@
+2011-09-29  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Web Inspector: UI performance test for network panel is incorrect. The time is including a timeout between scheduled refresh and actual refresh.
+        https://bugs.webkit.org/show_bug.cgi?id=69087
+
+        The fix has the changes for the test and minor perf framework improvements.
+
+        Reviewed by Yury Semikhatsky.
+
+        * inspector/front-end/NetworkPanel.js:
+        (WebInspector.NetworkLogView.prototype._defaultRefreshDelay.500._scheduleRefresh):
+
 2011-09-29  Vsevolod Vlasov  <vsevik@chromium.org>
 
         Web Inspector: Make search-in-resource test simpler.
index 531cc4889344836f42fb0964adbc57e0bf7ccf02..5bbb59b49227c9c8e09a6a0e2a8a4383d98ae931 100644 (file)
@@ -496,6 +496,8 @@ WebInspector.NetworkLogView.prototype = {
         this._updateOffscreenRows();
     },
 
+    _defaultRefreshDelay: 500,
+
     _scheduleRefresh: function()
     {
         if (this._needsRefresh)
@@ -504,7 +506,7 @@ WebInspector.NetworkLogView.prototype = {
         this._needsRefresh = true;
 
         if (this.visible && !("_refreshTimeout" in this))
-            this._refreshTimeout = setTimeout(this.refresh.bind(this), 500);
+            this._refreshTimeout = setTimeout(this.refresh.bind(this), this._defaultRefreshDelay);
     },
 
     _updateDividersIfNeeded: function(force)