Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector-protocol / heap-profiler / heap-snapshot-with-active-dom-object.html
blob91f4378d0e3889df8951a1d76e3a106672f5d81b
1 <html>
2 <head>
3 <script type="text/javascript" src="../../http/tests/inspector-protocol/inspector-protocol-test.js"></script>
4 <script>
5 if (window.testRunner) {
6 testRunner.dumpAsText();
7 testRunner.waitUntilDone();
10 function onChange(e)
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");
22 runTest();
25 function test()
27 InspectorTest.importScript("../../../../inspector-protocol/heap-profiler/resources/heap-snapshot-common.js");
29 function checkHeapSnapshot(snapshot) {
30 var node;
31 for (var it = snapshot._allNodes(); it.hasNext(); it.next()) {
32 if (it.node.name() === "(Pending activities group)") {
33 node = it.node;
34 break;
37 if (node)
38 InspectorTest.log("SUCCESS: found " + node.name());
39 else
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);
53 } else
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")
66 ++mediaQuryListCount;
68 if (mediaQuryListCount === 2)
69 InspectorTest.log("SUCCESS: found " + mediaQuryListCount + " MediaQueryLists in " + groupNode.name());
70 else
71 return InspectorTest.fail("unexpected MediaQueryLists count: " + mediaQuryListCount);
75 InspectorTest.takeHeapSnapshot(checkHeapSnapshot);
77 </script>
78 </head>
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>
81 </body>
82 </html>