Bug 108322 - Web Inspector: test that references from DOM nodes to event listeners are presented in heap snapshots
Summary: Web Inspector: test that references from DOM nodes to event listeners are pre...
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: Yury Semikhatsky
URL:
Keywords:
Depends on: 107819 108324
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-30 03:36 PST by Yury Semikhatsky
Modified: 2013-02-01 03:17 PST (History)
12 users (show)

See Also:


Attachments
Patch (11.70 KB, patch)
2013-01-30 03:38 PST, Yury Semikhatsky
no flags Details | Formatted Diff | Diff
Patch (11.61 KB, patch)
2013-01-30 03:41 PST, Yury Semikhatsky
no flags Details | Formatted Diff | Diff
Patch (4.66 KB, patch)
2013-01-30 06:15 PST, Yury Semikhatsky
vsevik: review+
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yury Semikhatsky 2013-01-30 03:36:25 PST
The links are external to the JS heap and reported using a special mechanism. We should have a test that would check presence of the references in JS heap snapshots.
Comment 1 Yury Semikhatsky 2013-01-30 03:38:04 PST
Created attachment 185460 [details]
Patch
Comment 2 Yury Semikhatsky 2013-01-30 03:39:31 PST
(In reply to comment #1)
> Created an attachment (id=185460) [details]
> Patch

This patch depends on V8 change https://code.google.com/p/v8/source/detail?r=13486 which is not rolled yet.
Comment 3 Yury Semikhatsky 2013-01-30 03:41:50 PST
Created attachment 185461 [details]
Patch
Comment 4 Ilya Tikhonovsky 2013-01-30 03:44:21 PST
Comment on attachment 185460 [details]
Patch

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

> LayoutTests/inspector-protocol/heap-snapshot-with-event-listener.html:64
> +    if (!window.WebInspector)
> +        window.WebInspector = {};
> +    InspectorTest.importScript("../../../../../Source/WebCore/inspector/front-end/HeapSnapshot.js");
> +    InspectorTest.importScript("../../../../../Source/WebCore/inspector/front-end/JSHeapSnapshot.js");
> +
> +    InspectorTest.eventHandler["Profiler.addProfileHeader"] = function(messageObject)
> +    {
> +        var profileId = messageObject["params"]["header"]["uid"];
> +        InspectorTest.sendCommand("Profiler.getHeapSnapshot", { "uid": profileId }, didGetHeapSnapshot);
> +
> +        function didGetHeapSnapshot(messageObject)
> +        {
> +            InspectorTest.log("SUCCESS: didGetHeapSnapshot");
> +            InspectorTest.completeTest();
> +        }
> +    }
> +
> +    var chunks = [];
> +    InspectorTest.eventHandler["Profiler.addHeapSnapshotChunk"] = function(messageObject)
> +    {
> +        chunks.push(messageObject["params"]["chunk"]);
> +    }
> +    InspectorTest.eventHandler["Profiler.finishHeapSnapshot"] = function(messageObject)
> +    {
> +        var serializedSnapshot = chunks.join("");
> +        var parsed = JSON.parse(serializedSnapshot);
> +        var snapshot = new WebInspector.JSHeapSnapshot(parsed);
> +
> +        var node;
> +        for (var it = snapshot._allNodes(); it.hasNext(); it.next()) {
> +            if (it.node.type() === "closure" && it.node.name() === "myEventListener") {
> +                node = it.node;
> +                break;
> +            }
> +        }
> +        if (node)
> +            InspectorTest.log("SUCCESS: found " + node.name());
> +        else {
> +            InspectorTest.log("FAIL: cannot find detached DOM trees root");
> +            InspectorTest.completeTest();
> +            return;
> +        }
> +

please extract the common part and put it into separate helper method in the test harness.

> LayoutTests/platform/efl/TestExpectations:1470
> -webkit.org/b/50485 inspector-protocol/heap-snapshot-with-detached-dom-tree.html [ Skip ]
> +webkit.org/b/50485 inspector-protocol/heap-snapshot-with-event-listener.html [ Skip ]

please move all the heap-snapshot tests into a subfolder.
Comment 5 Yury Semikhatsky 2013-01-30 06:15:24 PST
Created attachment 185484 [details]
Patch
Comment 6 Yury Semikhatsky 2013-01-30 06:15:55 PST
(In reply to comment #4)
> (From update of attachment 185460 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=185460&action=review
> 
> please extract the common part and put it into separate helper method in the test harness.
> 
Done.

> > LayoutTests/platform/efl/TestExpectations:1470
> > -webkit.org/b/50485 inspector-protocol/heap-snapshot-with-detached-dom-tree.html [ Skip ]
> > +webkit.org/b/50485 inspector-protocol/heap-snapshot-with-event-listener.html [ Skip ]
> 
> please move all the heap-snapshot tests into a subfolder.
Done.
Comment 7 Ilya Tikhonovsky 2013-01-30 06:18:14 PST
Comment on attachment 185484 [details]
Patch

lgtm
Comment 8 WebKit Review Bot 2013-01-30 10:31:08 PST
Comment on attachment 185484 [details]
Patch

Attachment 185484 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/16217631

New failing tests:
inspector-protocol/heap-profiler/heap-snapshot-with-event-listener.html
Comment 9 Yury Semikhatsky 2013-01-31 03:27:12 PST
Committed r141396: <http://trac.webkit.org/changeset/141396>