Bug 68234 - Web Inspector: UI performance tests are required.
Summary: Web Inspector: UI performance tests are required.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Ilya Tikhonovsky
URL:
Keywords:
Depends on: 68242
Blocks:
  Show dependency treegraph
 
Reported: 2011-09-16 01:29 PDT by Ilya Tikhonovsky
Modified: 2011-09-16 09:25 PDT (History)
10 users (show)

See Also:


Attachments
[patch] initial version (18.49 KB, patch)
2011-09-16 01:37 PDT, Ilya Tikhonovsky
pfeldman: review-
Details | Formatted Diff | Diff
[patch] initial version (6.36 KB, patch)
2011-09-16 05:51 PDT, Ilya Tikhonovsky
pfeldman: review-
Details | Formatted Diff | Diff
[patch] third version (6.62 KB, patch)
2011-09-16 07:10 PDT, Ilya Tikhonovsky
pfeldman: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ilya Tikhonovsky 2011-09-16 01:29:21 PDT
The idea is to create a set of tests which cover the frequently used UI actions and print the average time of these actions.
Comment 1 Ilya Tikhonovsky 2011-09-16 01:37:47 PDT
Created attachment 107624 [details]
[patch] initial version
Comment 2 Pavel Feldman 2011-09-16 02:17:09 PDT
Comment on attachment 107624 [details]
[patch] initial version

View in context: https://bugs.webkit.org/attachment.cgi?id=107624&action=review

> LayoutTests/inspector/performance/show-panel-network.html:19
> +    RuntimeAgent.evaluate("makeXHRRequests(30)");

You should do InspectorTest.evaluateInPage("...", callback)

> LayoutTests/inspector/performance/show-panel-network.html:21
> +    var Test = function() {

I don't think declarative notation will be flexible enough for this kind of tests. I'd suggest to stick with imperative form:

InspectorTest.runPerformanceTest({
    setUp: function(done)
    {
        WebInspector.showPanel("audits");
        done();
    },

    run: function(done)
    {
        WebInspector.showPanel("network");
        WebInspector.panels.network.refresh();
        done();
    }
}, "show-network-panel", 1000);

Or

InspectorTest.runPerformanceTest({
    run: function(timer, done)
    {
        WebInspector.showPanel("audits");

        var timer = startTimer("show-network-panel");
        WebInspector.showPanel("network");
        WebInspector.panels.network.refresh();
        timer.endTimer();

        done();
    }
}, 1000);

> LayoutTests/inspector/performance/show-panel-network.html:23
> +        this.object = WebInspector;

This is too generic.

> LayoutTests/inspector/performance/show-panel-network.html:27
> +            WebInspector.showPanel("console");

console is animating, choose audits over it.

> LayoutTests/platform/chromium/test_expectations.txt:582
> +WONTFIX SKIP : inspector/performance = TEXT TIMEOUT

If you put the test to under inspector/performance/resources, they won't run automatically.

> Source/WebCore/inspector/front-end/ElementsPanel.js:300
> +        WebInspector.setCurrentPanel(this);

I'd suggest that you land this change separately + convert currentPanel getter to a function (currentPanel()).
Comment 3 Ilya Tikhonovsky 2011-09-16 05:51:49 PDT
Created attachment 107641 [details]
[patch] initial version
Comment 4 Pavel Feldman 2011-09-16 06:55:48 PDT
Comment on attachment 107641 [details]
[patch] initial version

View in context: https://bugs.webkit.org/attachment.cgi?id=107641&action=review

> LayoutTests/inspector/performance/resources/show-panel-network.html:29
> +            timer.finish(timerCookie);

Either you should use cookie to refer to timer or you should make finish mark test as completed.
Comment 5 Ilya Tikhonovsky 2011-09-16 07:10:56 PDT
Created attachment 107645 [details]
[patch] third version
Comment 6 Pavel Feldman 2011-09-16 08:48:43 PDT
Comment on attachment 107645 [details]
[patch] third version

View in context: https://bugs.webkit.org/attachment.cgi?id=107645&action=review

> LayoutTests/inspector/performance/resources/performance-test.js:10
> +        this._testStartTime = new Date().valueOf();

no need for valueOf

> LayoutTests/inspector/performance/resources/performance-test.js:29
> +            var time = new Date().valueOf();

ditto

> LayoutTests/inspector/performance/resources/performance-test.js:44
> +                setTimeout(this._runTest.bind(this), 0);

You should queue execution instead.

> LayoutTests/inspector/performance/resources/performance-test.js:59
> +                samples.sort( function(a, b) { return a - b; });

erroneous " " between ( and function
Comment 7 Ilya Tikhonovsky 2011-09-16 09:25:49 PDT
Committed r95296: <http://trac.webkit.org/changeset/95296>