Web Inspector: tests in PerformanceTests/inspector/ are timing out
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 May 2013 10:43:06 +0000 (10:43 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 May 2013 10:43:06 +0000 (10:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=77024

Reviewed by Andreas Kling.

PerformanceTests:

These tests have been disabled for ages and don't conform to the standard format.

* Skipped:
* inspector: Removed.
* inspector/console-300-lines.html: Removed.
* inspector/first-open-elements.html: Removed.
* inspector/first-open-resources.html: Removed.
* inspector/first-open-scripts.html.broken: Removed.
* inspector/heap-snapshot-advanced.html: Removed.
* inspector/heap-snapshot-performance-test.js: Removed.
* inspector/heap-snapshot.html: Removed.
* inspector/inspector-startup-time.html: Removed.
* inspector/network-append-30-requests.html.broken: Removed.
* inspector/performance-test.js: Removed.
* inspector/show-panel.html.broken: Removed.

Tools:

Remove inspector performance tests since they have been disabled for ages,
and they don't use the standard parser-style performance output.

It's adding a lot of code complexity to our infrastructure.

* Scripts/webkitpy/performance_tests/perftest.py:
(SingleProcessPerfTest.__init__):
(PerfTestFactory):
* Scripts/webkitpy/performance_tests/perftest_unittest.py:
(TestPerfTestFactory.test_regular_test):
* Scripts/webkitpy/performance_tests/perftestsrunner_integrationtest.py:
(TestDriver.run_test):
(MainTest.run_test):
(MainTest._tests_for_runner):
(MainTest.test_run_test_set_kills_drt_per_run):
(MainTest._test_run_with_json_output):
(MainTest):
(MainTest.test_run_with_upload_json_should_generate_perf_webkit_json):

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

17 files changed:
PerformanceTests/ChangeLog
PerformanceTests/Skipped
PerformanceTests/inspector/console-300-lines.html [deleted file]
PerformanceTests/inspector/first-open-elements.html [deleted file]
PerformanceTests/inspector/first-open-resources.html [deleted file]
PerformanceTests/inspector/first-open-scripts.html.broken [deleted file]
PerformanceTests/inspector/heap-snapshot-advanced.html [deleted file]
PerformanceTests/inspector/heap-snapshot-performance-test.js [deleted file]
PerformanceTests/inspector/heap-snapshot.html [deleted file]
PerformanceTests/inspector/inspector-startup-time.html [deleted file]
PerformanceTests/inspector/network-append-30-requests.html.broken [deleted file]
PerformanceTests/inspector/performance-test.js [deleted file]
PerformanceTests/inspector/show-panel.html.broken [deleted file]
Tools/ChangeLog
Tools/Scripts/webkitpy/performance_tests/perftest.py
Tools/Scripts/webkitpy/performance_tests/perftest_unittest.py
Tools/Scripts/webkitpy/performance_tests/perftestsrunner_integrationtest.py

index d24af56..950e89b 100644 (file)
@@ -1,3 +1,26 @@
+2013-05-30  Ryosuke Niwa  <rniwa@webkit.org>
+
+        Web Inspector: tests in PerformanceTests/inspector/ are timing out
+        https://bugs.webkit.org/show_bug.cgi?id=77024
+
+        Reviewed by Andreas Kling.
+
+        These tests have been disabled for ages and don't conform to the standard format.
+
+        * Skipped:
+        * inspector: Removed.
+        * inspector/console-300-lines.html: Removed.
+        * inspector/first-open-elements.html: Removed.
+        * inspector/first-open-resources.html: Removed.
+        * inspector/first-open-scripts.html.broken: Removed.
+        * inspector/heap-snapshot-advanced.html: Removed.
+        * inspector/heap-snapshot-performance-test.js: Removed.
+        * inspector/heap-snapshot.html: Removed.
+        * inspector/inspector-startup-time.html: Removed.
+        * inspector/network-append-30-requests.html.broken: Removed.
+        * inspector/performance-test.js: Removed.
+        * inspector/show-panel.html.broken: Removed.
+
 2013-05-27  Benjamin Poulain  <benjamin@webkit.org>
 
         Add a balanced benchmark for QuerySelector
index c70b77c..8524969 100644 (file)
@@ -62,9 +62,6 @@ Dromaeo/v8-earley-boyer.html
 Dromaeo/v8-raytrace.html
 Dromaeo/v8-richards.html
 
-# Bug 77024 - Web Inspector: tests in PerformanceTests/inspector/ are timing out
-inspector
-
 # Bug 100262 - REGRESSION(r131982): this test is crashing
 SVG/SvgNestedUse.html
 
diff --git a/PerformanceTests/inspector/console-300-lines.html b/PerformanceTests/inspector/console-300-lines.html
deleted file mode 100644 (file)
index 6e54ca3..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-<html>
-<head>
-<script src="../../LayoutTests/http/tests/inspector/inspector-test.js"></script>
-<script src="performance-test.js"></script>
-<script>
-
-function makeConsoleEvents(count)
-{
-    for (var i = 0; i < count; ++i)
-        console.log("Console log: " + i);
-}
-
-function test()
-{
-    var message = {
-        "method":"Console.messageAdded",
-        "params":{
-            "message":{
-                "source":"console-api",
-                "level":"log",
-                "text":"Console log message",
-                "type":"log",
-                "line":10,
-                "url":"file://./console-300-lines.html",
-                "repeatCount":1,
-                "parameters":[{
-                    "type":"string",
-                    "value":"Console log: 42"
-                }],
-                "stackTrace":[
-                    {
-                        "functionName":"makeConsoleEvents",
-                        "url":"file://./console-300-lines.html",
-                        "lineNumber":10,
-                        "columnNumber":17
-                    },
-                    {
-                        "functionName":"",
-                        "url":"file://./console-300-lines.html",
-                        "lineNumber":37,
-                        "columnNumber":9
-                    }
-                ]
-            }
-        }
-    };
-
-    WebInspector.showPanel("console");
-
-    function test(timer)
-    {
-        WebInspector.console.clearMessages();
-        InspectorTest.addSniffer(WebInspector.consoleView.promptElement, "scrollIntoView", finish);
-
-        var cookie = timer.start("console-300-lines");
-        for (var i = 0; i < 300; ++i)
-            InspectorBackend.dispatch(message);
-
-        function finish()
-        {
-            timer.finish(cookie);
-            timer.done("panel-update");
-        }
-    }
-
-    InspectorTest.runPerformanceTest(test, 10000);
-}
-
-if (!window.testRunner) {
-    setTimeout(function() {
-        makeConsoleEvents(300);
-    }, 3000);
-}
-
-</script>
-</head>
-
-<body onload="runTest()">
-</body>
-</html>
diff --git a/PerformanceTests/inspector/first-open-elements.html b/PerformanceTests/inspector/first-open-elements.html
deleted file mode 100644 (file)
index 6924e8d..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<html>
-<head>
-<script src="../../LayoutTests/http/tests/inspector/inspector-test.js"></script>
-<script src="performance-test.js"></script>
-<script>
-
-function test()
-{
-    WebInspector.showPanel("audits");
-
-
-    function test(timer)
-    {
-        WebInspector.showPanel("audits");
-        WebInspector.domAgent._setDocument(null);
-
-        var showPanelTimerCookie = timer.start("first-open-elements");
-        InspectorTest.addBackendResponseSniffer(DOMAgent, "requestChildNodes", function() {
-            timer.finish(showPanelTimerCookie);
-            timer.done("first-open");
-        });
-        WebInspector.showPanel("elements");
-    }
-
-    InspectorTest.runPerformanceTest(test, 5000);
-}
-
-</script>
-</head>
-
-<body onload="runTest()">
-
-<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
-<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
-<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
-<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
-<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
-<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
-
-</body>
-</body>
-</html>
diff --git a/PerformanceTests/inspector/first-open-resources.html b/PerformanceTests/inspector/first-open-resources.html
deleted file mode 100644 (file)
index cb96af6..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-<html>
-<head>
-<script src="../../LayoutTests/http/tests/inspector/inspector-test.js"></script>
-<script src="performance-test.js"></script>
-<script>
-
-function test()
-{
-    WebInspector.showPanel("resources");
-    WebInspector.settings.resourcesLastSelectedItem.set(WebInspector.inspectedPageURL);
-
-    function test(timer)
-    {
-        WebInspector.showPanel("audits");
-        var resources = WebInspector.panels.resources;
-        resources.reset();
-        var treeModel = WebInspector.resourceTreeModel;
-        treeModel.removeEventListener(WebInspector.ResourceTreeModel.EventTypes.FrameAdded, resources._frameAdded, resources);
-        treeModel.removeEventListener(WebInspector.ResourceTreeModel.EventTypes.FrameNavigated, resources._frameNavigated, resources);
-        treeModel.removeEventListener(WebInspector.ResourceTreeModel.EventTypes.FrameDetached, resources._frameDetached, resources);
-        treeModel.removeEventListener(WebInspector.ResourceTreeModel.EventTypes.ResourceAdded, resources._resourceAdded, resources);
-        resources._initialized = false;
-
-        InspectorTest.addBackendResponseSniffer(ApplicationCacheAgent, "getFramesWithManifests", finish);
-        var showPanelTimerCookie = timer.start("first-open-resources");
-        treeModel._fetchResourceTree();
-        WebInspector.showPanel("resources");
-
-        function finish()
-        {
-            timer.finish(showPanelTimerCookie);
-            timer.done("first-open");
-        }
-    }
-    InspectorTest.runPerformanceTest(test, 5000);
-}
-
-</script>
-</head>
-<body onload="runTest()">
-</body>
-</body>
-</html>
-
diff --git a/PerformanceTests/inspector/first-open-scripts.html.broken b/PerformanceTests/inspector/first-open-scripts.html.broken
deleted file mode 100644 (file)
index 357dd3d..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-<html>
-<head>
-<script src="../../LayoutTests/http/tests/inspector/inspector-test.js"></script>
-<script src="performance-test.js"></script>
-<script>
-
-function test()
-{
-    WebInspector.showPanel("scripts");
-    var files = WebInspector.panels.scripts._fileSelector._filesSelectElement;
-    for (var i = 0; i < files.options.length; ++i) {
-         if (files.options[i].value.indexOf("inspector-test.js") !== -1) {
-             files.selectedIndex = i;
-             WebInspector.panels.scripts._fileSelector._filesSelectChanged();
-             break;
-         }
-    }
-
-    function test(timer)
-    {
-        WebInspector.showPanel("audits");
-        var showPanelTimerCookie = timer.start("first-open-scripts");
-        WebInspector.showPanel("scripts");
-        var count = WebInspector.panels.scripts.visibleView._textEditor._mainPanel._textChunks.length;
-        WebInspector.panels.scripts.visibleView._textEditor._mainPanel._expandChunks(0, count);
-        WebInspector.panels.scripts.visibleView._textEditor._mainPanel._paintScheduledLines();
-        timer.finish(showPanelTimerCookie);
-        timer.done("first-open");
-    }
-
-    InspectorTest.runAfterPendingDispatches(InspectorTest.runPerformanceTest.bind(null, test, 5000));
-}
-
-</script>
-</head>
-<body onload="runTest()">
-</body>
-</html>
-
diff --git a/PerformanceTests/inspector/heap-snapshot-advanced.html b/PerformanceTests/inspector/heap-snapshot-advanced.html
deleted file mode 100644 (file)
index 58b48f0..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<html>
-<head>
-  <script src="../../LayoutTests/http/tests/inspector/inspector-test.js"></script>
-  <script src="../../LayoutTests/inspector/profiler/heap-snapshot-test.js"></script>
-  <script src="performance-test.js"></script>
-  <script src="heap-snapshot-performance-test.js"></script>
-<script>
-
-function makeLinkedList(n)
-{
-    var node = {};
-    while (--n)
-        node = { next: node };
-    return node;
-}
-
-function makeDoubleLinkedList(n)
-{
-  var tail = {};
-  var head = tail;
-  while (--n) {
-    head = { next: head };
-    head.next.prev = head;
-  }
-  return { head: head, tail: tail };
-}
-
-var list = makeLinkedList(20000);
-var double_list = makeDoubleLinkedList(5000);
-
-</script>
-</head>
-<body onload="runTest()">
-</body>
-</html>
diff --git a/PerformanceTests/inspector/heap-snapshot-performance-test.js b/PerformanceTests/inspector/heap-snapshot-performance-test.js
deleted file mode 100644 (file)
index b59a5e0..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-function test()
-{
-    WebInspector.showPanel("profiles");
-    InspectorTest.measureFunction(WebInspector.JSHeapSnapshot.prototype, "_buildEdgeIndexes");
-    InspectorTest.measureFunction(WebInspector.JSHeapSnapshot.prototype, "_buildRetainers");
-    InspectorTest.measureFunction(WebInspector.JSHeapSnapshot.prototype, "_buildDominatedNodes");
-    InspectorTest.measureFunction(WebInspector.JSHeapSnapshot.prototype, "_calculateFlags");
-    InspectorTest.measureFunction(WebInspector.JSHeapSnapshot.prototype, "_buildAggregates");
-    InspectorTest.measureFunction(WebInspector.JSHeapSnapshot.prototype, "_calculateClassesRetainedSize");
-    InspectorTest.measureFunction(WebInspector.JSHeapSnapshot.prototype, "_calculateDistances");
-    InspectorTest.measureFunction(WebInspector.JSHeapSnapshot.prototype, "_calculateRetainedSizes");
-    InspectorTest.measureFunction(WebInspector.JSHeapSnapshot.prototype, "_markDetachedDOMTreeNodes");
-    InspectorTest.measureFunction(WebInspector.JSHeapSnapshot.prototype, "_markQueriableHeapObjects");
-    InspectorTest.measureFunction(WebInspector.JSHeapSnapshot.prototype, "_markPageOwnedNodes");
-    InspectorTest.measureFunction(WebInspector.JSHeapSnapshot.prototype, "_splitNodesAndContainmentEdges");
-    InspectorTest.measureFunction(WebInspector.JSHeapSnapshot.prototype, "_buildPostOrderIndex");
-    InspectorTest.measureFunction(WebInspector.JSHeapSnapshot.prototype, "_buildDominatorTree");
-    InspectorTest.measureFunction(WebInspector.HeapSnapshotConstructorsDataGrid.prototype, "_aggregatesReceived");
-
-    function performanceTest(timer)
-    {
-        var transferTimerCookie;
-        var showTimerCookie;
-        var changeViewTimerCookie;
-        var clearTimerCookie;
-
-        var testName = /([^\/]+)\.html$/.exec(WebInspector.inspectedPageURL)[1];
-        var fullTimerCookie = timer.start("full-summary-snapshot-time");
-        var backendTimerCookie = timer.start("take-snapshot");
-        HeapProfilerAgent.takeHeapSnapshot(step0);
-
-        function step0()
-        {
-            timer.finish(backendTimerCookie);
-            transferTimerCookie = timer.start("transfer-snapshot");
-            var type = WebInspector.panels.profiles.getProfileType("HEAP");
-            var profiles = type.getProfiles();
-            WebInspector.panels.profiles._showProfile(profiles[profiles.length - 1]);
-            InspectorTest.addSniffer(type, "finishHeapSnapshot", step1);
-        }
-
-        function step1(uid)
-        {
-            timer.finish(transferTimerCookie);
-            showTimerCookie = timer.start("show-snapshot");
-            var panel = WebInspector.panels.profiles;
-            var profile = panel.getProfile("HEAP", uid);
-            profile.load(step2); // Add load callback.
-        }
-
-        function step2()
-        {
-            timer.finish(showTimerCookie);
-            changeViewTimerCookie = timer.start("switch-to-containment-view");
-            InspectorTest.switchToView("Containment", cleanup);
-        }
-
-        function cleanup()
-        {
-            timer.finish(changeViewTimerCookie);
-            timer.finish(fullTimerCookie);
-            clearTimerCookie = timer.start("clear-snapshot");
-            HeapProfilerAgent.clearProfiles(done);
-            WebInspector.panels.profiles._reset();
-        }
-
-        function done()
-        {
-            timer.finish(clearTimerCookie);
-            timer.done(testName);
-        }
-    }
-
-    InspectorTest.runPerformanceTest(performanceTest, 60000);
-}
diff --git a/PerformanceTests/inspector/heap-snapshot.html b/PerformanceTests/inspector/heap-snapshot.html
deleted file mode 100644 (file)
index 0fabb21..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<html>
-<head>
-  <script src="../../LayoutTests/http/tests/inspector/inspector-test.js"></script>
-  <script src="../../LayoutTests/inspector/profiler/heap-snapshot-test.js"></script>
-  <script src="performance-test.js"></script>
-  <script src="heap-snapshot-performance-test.js"></script>
-<script>
-
-var counter = 0;
-
-function makeObjectsTree(deep)
-{
-    var node = {};
-    node.text = "some text " + counter;
-    if (deep === 0)
-        return node;
-    for (var i = 0; i < 2; ++i)
-        node[counter++] = makeObjectsTree(deep - 1);
-    return node;
-}
-
-function makeObjectsTree2(name, deep)
-{
-    window[name] = makeObjectsTree(deep);
-}
-
-makeObjectsTree2("t", 16);
-
-</script>
-</head>
-<body onload="runTest()">
-</body>
-</html>
diff --git a/PerformanceTests/inspector/inspector-startup-time.html b/PerformanceTests/inspector/inspector-startup-time.html
deleted file mode 100644 (file)
index 43e9d0b..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script src="../../LayoutTests/http/tests/inspector/inspector-test.js"></script>
-<script src="performance-test.js"></script>
-<script>
-
-function onload()
-{
-    testRunner.waitUntilDone();
-    times = [];
-    startTime = Date.now();
-    testStartTime = startTime;
-    runTest();
-}
-
-function inspectorIsReady()
-{
-    times.push(Date.now() - startTime);
-    if (Date.now() - testStartTime > 20000) {
-        testRunner.evaluateInWebInspector(2, "InspectorTest.dumpTestStats('inspector-startup-time', 'time', " + JSON.stringify(times) + ", 'ms')")
-        testRunner.evaluateInWebInspector(3, "(InspectorTest.completeTest())")
-        return;
-    }
-    testRunner.closeWebInspector();
-    startTime = Date.now();
-    testRunner.showWebInspector();
-    runTest();
-}
-
-function test()
-{
-    WebInspector.domAgent._setDocument(null);
-
-    InspectorTest.addBackendResponseSniffer(DOMAgent, "requestChildNodes", function() {
-        WebInspector.settings.lastActivePanel.set("audits");
-        InspectorTest.evaluateInPage("inspectorIsReady()");
-    });
-    WebInspector.showPanel("elements");
-}
-
-</script>
-
-</head>
-<body onload="onload()">
-<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
-<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
-<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
-<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
-<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
-<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
-<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
-<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
-<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
-<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
-</body>
-</html>
diff --git a/PerformanceTests/inspector/network-append-30-requests.html.broken b/PerformanceTests/inspector/network-append-30-requests.html.broken
deleted file mode 100644 (file)
index 357cbc9..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-<html>
-<head>
-<script src="../../LayoutTests/http/tests/inspector/inspector-test.js"></script>
-<script src="performance-test.js"></script>
-<script>
-
-function makeXHRRequests(count)
-{
-    for (var i = 0; i < count; ++i) {
-        var xhr = new XMLHttpRequest();
-        xhr.open("GET", document.URL, true);
-        xhr.send();
-    }
-}
-
-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);
-        WebInspector.panels.network._networkLogView._reset();
-        // In real life this array is cleaning up at navigation event.
-        WebInspector.networkLog._resources = [];
-        InspectorTest.timer.done("panel-update");
-    }
-
-    function test(timer)
-    {
-        InspectorTest.evaluateInPage("makeXHRRequests(30)");
-    }
-
-    InspectorTest.runPerformanceTest(test, 15000);
-}
-
-if (!window.testRunner) {
-    setTimeout(function() {
-        makeXHRRequests(30);
-    }, 3000);
-}
-
-</script>
-</head>
-
-<body onload="runTest()">
-</body>
-</html>
diff --git a/PerformanceTests/inspector/performance-test.js b/PerformanceTests/inspector/performance-test.js
deleted file mode 100644 (file)
index fbb5ec2..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-var initialize_TimeTracker = function() {
-
-InspectorTest.runPerformanceTest = function(perfTest, executeTime, callback)
-{
-    var Timer = function(test, callback)
-    {
-        this._callback = callback;
-        this._test = test;
-        this._times = {};
-        this._testStartTime = new Date();
-        this._heapSizeDeltas = [];
-        this._jsHeapSize = this._getJSHeapSize();
-    }
-
-    Timer.prototype = {
-        start: function(name)
-        {
-            return {name: name, startTime: new Date()};
-        },
-
-        finish: function(cookie)
-        {
-            var endTime = new Date();
-            if (!this._times[cookie.name])
-                this._times[cookie.name] = [];
-            this._times[cookie.name].push(endTime - cookie.startTime);
-        },
-
-        _getJSHeapSize: function()
-        {
-            if (window.gc) {
-                window.gc();
-                window.gc();
-            }
-            return console.memory.usedJSHeapSize;
-        },
-
-        done: function(groupName)
-        {
-            var newJSHeapSize = this._getJSHeapSize();
-            this._heapSizeDeltas.push(newJSHeapSize - this._jsHeapSize);
-            this._jsHeapSize = newJSHeapSize;
-
-            var time = new Date();
-            if (time - this._testStartTime < executeTime)
-                this._runTest();
-            else {
-                if (this._complete)
-                    return;
-                this._complete = true;
-
-                this._dump(groupName);
-                if (this._callback)
-                    this._callback();
-                else
-                    InspectorTest.completeTest();
-            }
-        },
-
-        _runTest: function()
-        {
-            if (this._guard) {
-                setTimeout(this._runTest.bind(this), 0);
-                return;
-            }
-
-            this._guard = true;
-            var safeTest = InspectorTest.safeWrap(this._test);
-            safeTest(this);
-            this._guard = false;
-        },
-
-        _dump: function(groupName)
-        {
-            for (var testName in this._times)
-                InspectorTest.dumpTestStats(groupName, testName, this._times[testName], "ms");
-
-            var url = WebInspector.inspectedPageURL;
-            var regExp = /([^\/]+)\.html/;
-            var matches = regExp.exec(url);
-            InspectorTest.dumpTestStats("heap-delta", matches[1], this._heapSizeDeltas, "kB", 1024);
-        },
-    }
-
-    InspectorTest.timer = new Timer(perfTest, callback);
-    InspectorTest.timer._runTest();
-}
-
-InspectorTest.measureFunction = function(object, functionName)
-{
-    function measure() {
-        var timer = InspectorTest.timer;
-        var cookie;
-        if (timer)
-            cookie = timer.start(functionName);
-        var result = func.apply(this, arguments);
-
-        if (timer)
-            timer.finish(cookie);
-        return result;
-    }
-    var func = object[functionName];
-    object[functionName] = measure;
-}
-
-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(groupName, testName, samples, units, divider)
-{
-    divider = divider || 1;
-    var stripNResults = Math.floor(samples.length / 10);
-    samples.sort(function(a, b) { return a - b; });
-    var sum = 0;
-    for (var i = stripNResults; i < samples.length - stripNResults; ++i)
-        sum += samples[i];
-    InspectorTest.addResult("RESULT " + groupName + ': ' + testName + "= " + Math.floor(sum / (samples.length - stripNResults * 2) / divider) + " " + units);
-}
-
-InspectorTest.addBackendResponseSniffer = function(object, methodName, override, opt_sticky)
-{
-    var originalMethod = InspectorTest.override(object, methodName, backendCall, opt_sticky);
-    function backendCall()
-    {
-        var args = Array.prototype.slice.call(arguments);
-        var callback = (args.length && typeof args[args.length - 1] === "function") ? args.pop() : 0;
-        args.push(function() {
-            callback.apply(null, arguments);
-            override.apply(null, arguments);
-        });
-        originalMethod.apply(object, args);
-    }
-}
-
-}
diff --git a/PerformanceTests/inspector/show-panel.html.broken b/PerformanceTests/inspector/show-panel.html.broken
deleted file mode 100644 (file)
index b59f062..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-<html>
-<head>
-<script src="../../LayoutTests/http/tests/inspector/inspector-test.js"></script>
-<script src="performance-test.js"></script>
-<script>
-
-function makeXHRRequests(count)
-{
-    for (var i = 0; i < count; ++i) {
-        var xhr = new XMLHttpRequest();
-        xhr.open("GET", document.URL, true);
-        xhr.send();
-    }
-}
-
-function test()
-{
-    WebInspector.showPanel("scripts");
-    var files = WebInspector.panels.scripts._fileSelector._filesSelectElement;
-    for (var i = 0; i < files.options.length; ++i) {
-         if (files.options[i].value.indexOf("inspector-test.js") !== -1) {
-             files.selectedIndex = i;
-             WebInspector.panels.scripts._fileSelector._filesSelectChanged();
-             break;
-         }
-    }
-
-    WebInspector.showPanel("resources");
-    WebInspector.settings.resourcesLastSelectedItem.set(WebInspector.inspectedPageURL);
-
-    WebInspector.showPanel("network");
-    InspectorTest.evaluateInPage("makeXHRRequests(200)", runTest);
-
-    function runTest()
-    {
-        InspectorTest.runPerformanceTest(perfTest, 10000);
-    }
-
-    function perfTest(timer)
-    {
-        WebInspector.showPanel("audits");
-        for (var panelName in WebInspector.panels) {
-            var timerCookie = timer.start("show-panel-" + panelName);
-            WebInspector.showPanel(panelName);
-            InspectorTest.evaluateInPage("testRunner.display();");
-            timer.finish(timerCookie);
-        }
-        timer.done("panel-switch");
-    }
-}
-</script>
-</head>
-
-<body onload="runTest()">
-<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
-<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
-<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
-<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
-<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
-<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
-<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
-<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
-<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
-<div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div>
-</body>
-</html>
index 41e9339..53db1d2 100644 (file)
@@ -1,5 +1,31 @@
 2013-05-30  Ryosuke Niwa  <rniwa@webkit.org>
 
+        Web Inspector: tests in PerformanceTests/inspector/ are timing out
+        https://bugs.webkit.org/show_bug.cgi?id=77024
+
+        Reviewed by Andreas Kling.
+
+        Remove inspector performance tests since they have been disabled for ages,
+        and they don't use the standard parser-style performance output.
+
+        It's adding a lot of code complexity to our infrastructure.
+
+        * Scripts/webkitpy/performance_tests/perftest.py:
+        (SingleProcessPerfTest.__init__):
+        (PerfTestFactory):
+        * Scripts/webkitpy/performance_tests/perftest_unittest.py:
+        (TestPerfTestFactory.test_regular_test):
+        * Scripts/webkitpy/performance_tests/perftestsrunner_integrationtest.py:
+        (TestDriver.run_test):
+        (MainTest.run_test):
+        (MainTest._tests_for_runner):
+        (MainTest.test_run_test_set_kills_drt_per_run):
+        (MainTest._test_run_with_json_output):
+        (MainTest):
+        (MainTest.test_run_with_upload_json_should_generate_perf_webkit_json):
+
+2013-05-30  Ryosuke Niwa  <rniwa@webkit.org>
+
         Remove requires_http_server as Chromium Android was the only port that needed this
         https://bugs.webkit.org/show_bug.cgi?id=117018
 
index 2c365c3..0df3cc0 100644 (file)
@@ -268,40 +268,6 @@ class SingleProcessPerfTest(PerfTest):
         super(SingleProcessPerfTest, self).__init__(port, test_name, test_path, test_runner_count)
 
 
-class ChromiumStylePerfTest(PerfTest):
-    _chromium_style_result_regex = re.compile(r'^RESULT\s+(?P<name>[^=]+)\s*=\s+(?P<value>\d+(\.\d+)?)\s*(?P<unit>\w+)$')
-
-    def __init__(self, port, test_name, test_path, test_runner_count=DEFAULT_TEST_RUNNER_COUNT):
-        super(ChromiumStylePerfTest, self).__init__(port, test_name, test_path, test_runner_count)
-
-    def run(self, time_out_ms):
-        driver = self._create_driver()
-        try:
-            output = self.run_single(driver, self.test_path(), time_out_ms)
-        finally:
-            driver.stop()
-
-        self._filter_output(output)
-        if self.run_failed(output):
-            return None
-
-        return self.parse_and_log_output(output)
-
-    def parse_and_log_output(self, output):
-        test_failed = False
-        results = {}
-        for line in re.split('\n', output.text):
-            resultLine = ChromiumStylePerfTest._chromium_style_result_regex.match(line)
-            if resultLine:
-                # FIXME: Store the unit
-                results[resultLine.group('name').replace(' ', '')] = float(resultLine.group('value'))
-                _log.info(line)
-            elif not len(line) == 0:
-                test_failed = True
-                _log.error(line)
-        return results if results and not test_failed else None
-
-
 class ReplayServer(object):
     def __init__(self, archive, record):
         self._process = None
@@ -456,7 +422,6 @@ class PerfTestFactory(object):
 
     _pattern_map = [
         (re.compile(r'^Dromaeo/'), SingleProcessPerfTest),
-        (re.compile(r'^inspector/'), ChromiumStylePerfTest),
         (re.compile(r'(.+)\.replay$'), ReplayPerfTest),
     ]
 
index 010a300..b904b97 100644 (file)
@@ -36,7 +36,6 @@ from webkitpy.common.system.outputcapture import OutputCapture
 from webkitpy.port.driver import DriverOutput
 from webkitpy.port.test import TestDriver
 from webkitpy.port.test import TestPort
-from webkitpy.performance_tests.perftest import ChromiumStylePerfTest
 from webkitpy.performance_tests.perftest import PerfTest
 from webkitpy.performance_tests.perftest import PerfTestMetric
 from webkitpy.performance_tests.perftest import PerfTestFactory
@@ -471,7 +470,3 @@ class TestPerfTestFactory(unittest.TestCase):
     def test_regular_test(self):
         test = PerfTestFactory.create_perf_test(MockPort(), 'some-dir/some-test', '/path/some-dir/some-test')
         self.assertEqual(test.__class__, PerfTest)
-
-    def test_inspector_test(self):
-        test = PerfTestFactory.create_perf_test(MockPort(), 'inspector/some-test', '/path/inspector/some-test')
-        self.assertEqual(test.__class__, ChromiumStylePerfTest)
index 3f9625d..a0832a9 100644 (file)
@@ -38,20 +38,10 @@ from webkitpy.common.host_mock import MockHost
 from webkitpy.common.system.outputcapture import OutputCapture
 from webkitpy.port.driver import DriverOutput
 from webkitpy.port.test import TestPort
-from webkitpy.performance_tests.perftest import ChromiumStylePerfTest
 from webkitpy.performance_tests.perftest import PerfTest
 from webkitpy.performance_tests.perftestsrunner import PerfTestsRunner
 
 
-class InspectorPassTestData:
-    text = 'RESULT group_name: test_name= 42 ms'
-    output = """Running inspector/pass.html (2 of 2)
-RESULT group_name: test_name= 42 ms
-Finished: 0.1 s
-
-"""
-
-
 class EventTargetWrapperTestData:
     text = """Running 20 times
 Ignoring warm-up run (1502)
@@ -116,6 +106,9 @@ Finished: 0.1 s
 
 """
 
+    results = {'url': 'http://trac.webkit.org/browser/trunk/PerformanceTests/Parser/some-parser.html',
+        'metrics': {'Time': {'current': [[1080.0, 1120.0, 1095.0, 1101.0, 1104.0]] * 4}}}
+
 
 class MemoryTestData:
     text = """Running 20 times
@@ -168,7 +161,7 @@ class TestDriver:
         timeout = False
         crash = False
         if driver_input.test_name.endswith('pass.html'):
-            text = InspectorPassTestData.text
+            text = SomeParserTestData.text
         elif driver_input.test_name.endswith('timeout.html'):
             timeout = True
         elif driver_input.test_name.endswith('failed.html'):
@@ -214,7 +207,7 @@ class MainTest(unittest.TestCase):
 
     def run_test(self, test_name):
         runner, port = self.create_runner()
-        tests = [ChromiumStylePerfTest(port, test_name, runner._host.filesystem.join('some-dir', test_name))]
+        tests = [PerfTest(port, test_name, runner._host.filesystem.join('some-dir', test_name))]
         return runner._run_tests_set(tests) == 0
 
     def test_run_passing_test(self):
@@ -241,25 +234,9 @@ class MainTest(unittest.TestCase):
         for test in test_names:
             path = filesystem.join(runner._base_path, test)
             dirname = filesystem.dirname(path)
-            if test.startswith('inspector/'):
-                tests.append(ChromiumStylePerfTest(runner._port, test, path))
-            else:
-                tests.append(PerfTest(runner._port, test, path))
+            tests.append(PerfTest(runner._port, test, path))
         return tests
 
-    def test_run_test_set(self):
-        runner, port = self.create_runner()
-        tests = self._tests_for_runner(runner, ['inspector/pass.html', 'inspector/silent.html', 'inspector/failed.html',
-            'inspector/tonguey.html', 'inspector/timeout.html', 'inspector/crash.html'])
-        output = OutputCapture()
-        output.capture_output()
-        try:
-            unexpected_result_count = runner._run_tests_set(tests)
-        finally:
-            stdout, stderr, log = output.restore_output()
-        self.assertEqual(unexpected_result_count, len(tests) - 1)
-        self.assertTrue('\nRESULT group_name: test_name= 42 ms\n' in log)
-
     def test_run_test_set_kills_drt_per_run(self):
 
         class TestDriverWithStopCount(TestDriver):
@@ -273,7 +250,7 @@ class MainTest(unittest.TestCase):
             'inspector/tonguey.html', 'inspector/timeout.html', 'inspector/crash.html'])
         unexpected_result_count = runner._run_tests_set(tests)
 
-        self.assertEqual(TestDriverWithStopCount.stop_count, 6)
+        self.assertEqual(TestDriverWithStopCount.stop_count, 9)
 
     def test_run_test_set_for_parser_tests(self):
         runner, port = self.create_runner()
@@ -306,7 +283,7 @@ class MainTest(unittest.TestCase):
         self.assertEqual(parser_tests['memory-test']['metrics']['Malloc'], MemoryTestData.malloc_results)
 
     def _test_run_with_json_output(self, runner, filesystem, upload_succeeds=False, results_shown=True, expected_exit_code=0, repeat=1, compare_logs=True):
-        filesystem.write_text_file(runner._base_path + '/inspector/pass.html', 'some content')
+        filesystem.write_text_file(runner._base_path + '/Parser/some-parser.html', 'some content')
         filesystem.write_text_file(runner._base_path + '/Bindings/event-target-wrapper.html', 'some content')
 
         uploaded = [False]
@@ -333,7 +310,7 @@ class MainTest(unittest.TestCase):
             expected_logs = ''
             for i in xrange(repeat):
                 runs = ' (Run %d of %d)' % (i + 1, repeat) if repeat > 1 else ''
-                expected_logs += 'Running 2 tests%s\n' % runs + EventTargetWrapperTestData.output + InspectorPassTestData.output
+                expected_logs += 'Running 2 tests%s\n' % runs + EventTargetWrapperTestData.output + SomeParserTestData.output
             if results_shown:
                 expected_logs += 'MOCK: user.open_url: file://...\n'
             self.assertEqual(self._normalize_output(logs), expected_logs)
@@ -345,7 +322,10 @@ class MainTest(unittest.TestCase):
     _event_target_wrapper_and_inspector_results = {
         "Bindings":
             {"url": "http://trac.webkit.org/browser/trunk/PerformanceTests/Bindings",
-            "tests": {"event-target-wrapper": EventTargetWrapperTestData.results}}}
+            "tests": {"event-target-wrapper": EventTargetWrapperTestData.results}},
+        "Parser":
+            {"url": "http://trac.webkit.org/browser/trunk/PerformanceTests/Parser",
+            "tests": {"some-parser": SomeParserTestData.results}}}
 
     def test_run_with_json_output(self):
         runner, port = self.create_runner_and_setup_results_template(args=['--output-json-path=/mock-checkout/output.json',
@@ -538,7 +518,7 @@ class MainTest(unittest.TestCase):
         self.assertEqual(output['builderName'], 'builder1')
         self.assertEqual(output['builderKey'], 'value1')
         self.assertEqual(output['revisions'], {'WebKit': {'revision': '5678', 'timestamp': '2013-02-01 08:48:05 +0000'}})
-        self.assertEqual(output['tests'].keys(), ['Bindings'])
+        self.assertEqual(output['tests'].keys(), ['Bindings', 'Parser'])
         self.assertEqual(sorted(output['tests']['Bindings'].keys()), ['tests', 'url'])
         self.assertEqual(output['tests']['Bindings']['url'], 'http://trac.webkit.org/browser/trunk/PerformanceTests/Bindings')
         self.assertEqual(output['tests']['Bindings']['tests'].keys(), ['event-target-wrapper'])