3 <script type=
"text/javascript" src=
"../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
5 if (window
.testRunner
) {
6 testRunner
.dumpAsText();
7 testRunner
.waitUntilDone();
12 console
.log("onChange " + e
.matches
);
15 function createTwoActiveDOMObjectsAndRunTest()
17 var m
= window
.matchMedia("(min-width: 1400px)");
18 m
.addListener(onChange
);
19 m
= window
.matchMedia("(min-height: 1800px)");
20 m
.addListener(onChange
);
21 console
.log("Created 2 MediaQueryList eleements");
27 InspectorTest
.importScript("../../../../inspector-protocol/heap-profiler/resources/heap-snapshot-common.js");
29 function checkHeapSnapshot(snapshot
) {
31 for (var it
= snapshot
._allNodes(); it
.hasNext(); it
.next()) {
32 if (it
.node
.name() === "(Pending activities group)") {
38 InspectorTest
.log("SUCCESS: found " + node
.name());
40 return InspectorTest
.fail("cannot find '(Pending activities group)'");
42 var pendingActivitiesRE
= /^Pending activities/;
43 var pendingActivitiesFound
= false;
44 for (var iter
= node
.edges(); iter
.hasNext(); iter
.next()) {
45 var node
= iter
.edge
.node();
46 if (pendingActivitiesRE
.test(node
.className())) {
47 if ("Pending activities / 3 entries" === node
.name()) {
48 if (pendingActivitiesFound
)
49 return InspectorTest
.fail("second " + node
.name());
50 pendingActivitiesFound
= true;
51 InspectorTest
.log("SUCCESS: found " + node
.name());
52 checkPendingActivities(node
);
54 return InspectorTest
.fail("unexpected 'Pending activities': " + node
.name());
57 InspectorTest
.completeTest();
60 function checkPendingActivities(groupNode
)
62 var mediaQuryListCount
= 0;
63 for (var iter
= groupNode
.edges(); iter
.hasNext(); iter
.next()) {
64 var node
= iter
.edge
.node();
65 if (node
.name() === "MediaQueryList")
68 if (mediaQuryListCount
=== 2)
69 InspectorTest
.log("SUCCESS: found " + mediaQuryListCount
+ " MediaQueryLists in " + groupNode
.name());
71 return InspectorTest
.fail("unexpected MediaQueryLists count: " + mediaQuryListCount
);
75 InspectorTest
.takeHeapSnapshot(checkHeapSnapshot
);
79 <body onload=
"createTwoActiveDOMObjectsAndRunTest()">
80 <p>Test that all ActiveDOMObjects with pending activities will get into one group in the heap snapshot.
<a href=
"https://crbug.com/426809">Bug
426809.
</p>