Web Inspector: extend UI perf tests coverage. Elements panel opens first time.
authorloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Sep 2011 14:04:24 +0000 (14:04 +0000)
committerloislo@chromium.org <loislo@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Sep 2011 14:04:24 +0000 (14:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=68432

Reviewed by Pavel Feldman.

* inspector/performance/resources/first-open-elements.html: Added.
* inspector/performance/resources/performance-test.js:

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

LayoutTests/ChangeLog
LayoutTests/inspector/performance/resources/first-open-elements.html [new file with mode: 0644]
LayoutTests/inspector/performance/resources/performance-test.js

index 9f08444a17e9f47544324427a6b5b172c6028a01..5950bbdcbc0a1e607710cebe674761cd0b5a5030 100644 (file)
@@ -1,3 +1,13 @@
+2011-09-21  Ilya Tikhonovsky  <loislo@chromium.org>
+
+        Web Inspector: extend UI perf tests coverage. Elements panel opens first time.
+        https://bugs.webkit.org/show_bug.cgi?id=68432
+
+        Reviewed by Pavel Feldman.
+
+        * inspector/performance/resources/first-open-elements.html: Added.
+        * inspector/performance/resources/performance-test.js:
+
 2011-09-21  Philippe Normand  <pnormand@igalia.com>
 
         Unreviewed, skip some more flaky SVG tests on GTK.
diff --git a/LayoutTests/inspector/performance/resources/first-open-elements.html b/LayoutTests/inspector/performance/resources/first-open-elements.html
new file mode 100644 (file)
index 0000000..cfa1272
--- /dev/null
@@ -0,0 +1,42 @@
+<html>
+<head>
+<script src="../../../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("elements-panel-show");
+        InspectorTest.addBackendResponseSniffer(DOMAgent, "requestChildNodes", function() {
+            timer.finish(showPanelTimerCookie);
+            timer.done();
+        });
+        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>
index e84c11033617dec4c4763790458211d5d4dc566c..9eac9aefb8c50998adb0f965a71340ef2913b1dd 100644 (file)
@@ -70,4 +70,20 @@ InspectorTest.runPerformanceTest = function(perfTest, executeTime, callback)
     timer._runTest();
 }
 
+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);
+    }
+}
+
+
 }