LayoutTests/ChangeLog

 12013-01-30 Yury Semikhatsky <yurys@chromium.org>
 2
 3 Web Inspector: test that references from DOM nodes to event listeners are presented in heap snapshots
 4 https://bugs.webkit.org/show_bug.cgi?id=108322
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 Test that links from DOM node wrappers to event listener functions are presented
 9 in heap snapshots.
 10
 11 * inspector-protocol/heap-snapshot-with-event-listener-expected.txt: Added.
 12 * inspector-protocol/heap-snapshot-with-event-listener.html: Added.
 13 * platform/chromium/TestExpectations:
 14 * platform/efl/TestExpectations:
 15 * platform/gtk/TestExpectations:
 16 * platform/mac/TestExpectations:
 17 * platform/qt/TestExpectations:
 18 * platform/win/TestExpectations:
 19 * platform/wincairo/TestExpectations:
 20
1212013-01-29 Yury Semikhatsky <yurys@chromium.org>
222
323 Web Inspector: test that nodes from the same detached DOM tree will get into one group in heap snapshot

LayoutTests/inspector-protocol/heap-snapshot-with-event-listener-expected.txt

 1Test that all nodes from the detached DOM tree will get into one group in the heap snapshot. Bug 107819.
 2
 3 SUCCESS: found myEventListener
 4SUCCESS: found link from HTMLBodyElement to HTMLBodyElement
 5SUCCESS: didGetHeapSnapshot
 6

LayoutTests/inspector-protocol/heap-snapshot-with-event-listener.html

 1<html>
 2<head>
 3<script type="text/javascript" src="../http/tests/inspector-protocol/resources/protocol-test.js"></script>
 4<script>
 5if (window.testRunner) {
 6 testRunner.dumpAsText();
 7 testRunner.waitUntilDone();
 8}
 9
 10function addEventListenerAndRunTest()
 11{
 12 function myEventListener(e) {
 13 console.log("myEventListener");
 14 }
 15 document.body.addEventListener("click", myEventListener, true);
 16
 17 runTest();
 18}
 19
 20function test()
 21{
 22 if (!window.WebInspector)
 23 window.WebInspector = {};
 24 InspectorTest.importScript("../../../../../Source/WebCore/inspector/front-end/HeapSnapshot.js");
 25 InspectorTest.importScript("../../../../../Source/WebCore/inspector/front-end/JSHeapSnapshot.js");
 26
 27 InspectorTest.eventHandler["Profiler.addProfileHeader"] = function(messageObject)
 28 {
 29 var profileId = messageObject["params"]["header"]["uid"];
 30 InspectorTest.sendCommand("Profiler.getHeapSnapshot", { "uid": profileId }, didGetHeapSnapshot);
 31
 32 function didGetHeapSnapshot(messageObject)
 33 {
 34 InspectorTest.log("SUCCESS: didGetHeapSnapshot");
 35 InspectorTest.completeTest();
 36 }
 37 }
 38
 39 var chunks = [];
 40 InspectorTest.eventHandler["Profiler.addHeapSnapshotChunk"] = function(messageObject)
 41 {
 42 chunks.push(messageObject["params"]["chunk"]);
 43 }
 44 InspectorTest.eventHandler["Profiler.finishHeapSnapshot"] = function(messageObject)
 45 {
 46 var serializedSnapshot = chunks.join("");
 47 var parsed = JSON.parse(serializedSnapshot);
 48 var snapshot = new WebInspector.JSHeapSnapshot(parsed);
 49
 50 var node;
 51 for (var it = snapshot._allNodes(); it.hasNext(); it.next()) {
 52 if (it.node.type() === "closure" && it.node.name() === "myEventListener") {
 53 node = it.node;
 54 break;
 55 }
 56 }
 57 if (node)
 58 InspectorTest.log("SUCCESS: found " + node.name());
 59 else {
 60 InspectorTest.log("FAIL: cannot find detached DOM trees root");
 61 InspectorTest.completeTest();
 62 return;
 63 }
 64
 65 var nativeRetainers = 0;
 66 for (var iter = node.retainers(); iter.hasNext(); iter.next()) {
 67 var node = iter.retainer.node();
 68 var retainingEdge = iter.retainer;
 69 if (retainingEdge.isInternal() && retainingEdge.name() === "native") {
 70 if (++nativeRetainers === 1) {
 71 var retainerName = retainingEdge.node().name();
 72 if (retainerName === "HTMLBodyElement")
 73 InspectorTest.log("SUCCESS: found link from HTMLBodyElement to " + node.name());
 74 else
 75 return fail("unexpected retainer of " + node.name() + ": " + retainerName);
 76 } else
 77 return fail("too many retainers of " + node.name());
 78 } else if (!retainingEdge.isWeak())
 79 return fail("unexpected retaining edge of " + node.name() + " type: " + retainingEdge.type() + ", name: " + retainingEdge.name());
 80 }
 81 if (!nativeRetainers)
 82 return fail("cannot find HTMLBodyElement among retainers of " + node.name());
 83 }
 84
 85 function fail(message) {
 86 InspectorTest.log("FAIL: " + message);
 87 InspectorTest.completeTest();
 88 }
 89
 90 InspectorTest.sendCommand("Profiler.takeHeapSnapshot", {});
 91}
 92</script>
 93</head>
 94<body onload="addEventListenerAndRunTest()">
 95<p>Test that all nodes from the detached DOM tree will get into one group in the heap snapshot. <a href="https://bugs.webkit.org/show_bug.cgi?id=107819">Bug 107819.</p>
 96</body>
 97</html>

LayoutTests/platform/chromium/TestExpectations

@@webkit.org/b/75647 http/tests/inspector/network/download.html [ Pass Timeout Fai
10711071
10721072webkit.org/b/104800 [ Debug ] inspector-protocol/take-heap-snapshot.html [ Crash ]
10731073webkit.org/b/104800 [ Debug ] inspector-protocol/heap-snapshot-with-detached-dom-tree.html [ Crash ]
 1074webkit.org/b/104800 [ Debug ] inspector-protocol/heap-snapshot-with-event-listener.html [ Crash ]
10741075
10751076# -----------------------------------------------------------------
10761077# Editing tests

LayoutTests/platform/efl/TestExpectations

@@webkit.org/b/50485 inspector/profiler/heap-snapshot-summary-show-ranges.html [ S
14671467webkit.org/b/50485 inspector/profiler/heap-snapshot-summary-sorting-fields.html [ Skip ]
14681468webkit.org/b/50485 inspector/profiler/heap-snapshot-summary-sorting.html [ Skip ]
14691469webkit.org/b/50485 inspector/profiler/heap-snapshot-summary-sorting-instances.html [ Skip ]
1470 webkit.org/b/50485 inspector-protocol/heap-snapshot-with-detached-dom-tree.html [ Skip ]
 1470webkit.org/b/50485 inspector-protocol/heap-snapshot-with-event-listener.html [ Skip ]
14711471webkit.org/b/50485 inspector-protocol/take-heap-snapshot.html [ Skip ]
14721472
14731473# ENABLE(INPUT_MULTIPLE_FIELDS_UI) is disabled

LayoutTests/platform/gtk/TestExpectations

@@webkit.org/b/50485 inspector/profiler/heap-snapshot-summary-show-ranges.html [ F
997997webkit.org/b/50485 inspector/profiler/heap-snapshot-summary-sorting-fields.html [ Failure ]
998998webkit.org/b/50485 inspector/profiler/heap-snapshot-summary-sorting-instances.html [ Failure ]
999999webkit.org/b/50485 inspector-protocol/heap-snapshot-with-detached-dom-tree.html [ Skip ]
 1000webkit.org/b/50485 inspector-protocol/heap-snapshot-with-event-listener.html [ Skip ]
10001001webkit.org/b/50485 inspector-protocol/take-heap-snapshot.html [ Skip ]
10011002
10021003webkit.org/b/99001 inspector/profiler/memory-instrumentation-canvas.html [ Failure ]

LayoutTests/platform/mac/TestExpectations

@@inspector/profiler/heap-snapshot-summary-sorting-fields.html
264264inspector/profiler/heap-snapshot-summary-sorting.html
265265inspector/profiler/heap-snapshot-summary-sorting-instances.html
266266webkit.org/b/50485 inspector-protocol/heap-snapshot-with-detached-dom-tree.html [ Skip ]
 267webkit.org/b/50485 inspector-protocol/heap-snapshot-with-event-listener.html [ Skip ]
267268webkit.org/b/50485 inspector-protocol/take-heap-snapshot.html [ Skip ]
268269
269270# New inspector/profiler/memory-instrumentation-canvas.html fails on JSC platforms

LayoutTests/platform/qt/TestExpectations

@@inspector/profiler/heap-snapshot-summary-sorting-fields.html
273273inspector/profiler/heap-snapshot-summary-sorting.html
274274inspector/profiler/heap-snapshot-summary-sorting-instances.html
275275webkit.org/b/50485 inspector-protocol/heap-snapshot-with-detached-dom-tree.html [ Skip ]
 276webkit.org/b/50485 inspector-protocol/heap-snapshot-with-event-listener.html [ Skip ]
276277webkit.org/b/50485 inspector-protocol/take-heap-snapshot.html [ Skip ]
277278
278279# https://bugs.webkit.org/show_bug.cgi?id=40300

LayoutTests/platform/win/TestExpectations

@@inspector/profiler/heap-snapshot-summary-sorting-fields.html
12941294inspector/profiler/heap-snapshot-summary-sorting.html
12951295inspector/profiler/heap-snapshot-summary-sorting-instances.html
12961296webkit.org/b/50485 inspector-protocol/heap-snapshot-with-detached-dom-tree.html [ Skip ]
 1297webkit.org/b/50485 inspector-protocol/heap-snapshot-with-event-listener.html [ Skip ]
12971298webkit.org/b/50485 inspector-protocol/take-heap-snapshot.html [ Skip ]
12981299
12991300# New inspector/profiler/memory-instrumentation-canvas.html fails on JSC platforms

LayoutTests/platform/wincairo/TestExpectations

@@inspector/profiler/heap-snapshot-summary-sorting-fields.html
18211821inspector/profiler/heap-snapshot-summary-sorting.html
18221822inspector/profiler/heap-snapshot-summary-sorting-instances.html
18231823webkit.org/b/50485 inspector-protocol/heap-snapshot-with-detached-dom-tree.html [ Skip ]
 1824webkit.org/b/50485 inspector-protocol/heap-snapshot-with-event-listener.html [ Skip ]
18241825
18251826# New inspector/profiler/memory-instrumentation-canvas.html fails on JSC platforms
18261827webkit.org/b/99001 inspector/profiler/memory-instrumentation-canvas.html