[webkit-reviews] review requested: [Bug 108322] Web Inspector: test that references from DOM nodes to event listeners are presented in heap snapshots : [Attachment 185460] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Jan 30 03:42:21 PST 2013
Ilya Tikhonovsky <loislo at chromium.org> has asked for review:
Bug 108322: Web Inspector: test that references from DOM nodes to event
listeners are presented in heap snapshots
https://bugs.webkit.org/show_bug.cgi?id=108322
Attachment 185460: Patch
https://bugs.webkit.org/attachment.cgi?id=185460&action=review
------- Additional Comments from Ilya Tikhonovsky <loislo at chromium.org>
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/H
eapSnapshot.js");
> +
InspectorTest.importScript("../../../../../Source/WebCore/inspector/front-end/J
SHeapSnapshot.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.
More information about the webkit-reviews
mailing list