Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / profiler / heap-snapshot-summary-search-by-id.html
blobc11a6eedecbd4dd58e88cabdfb89c9951ebbd468
1 <html>
2 <head>
3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="heap-snapshot-test.js"></script>
5 <script>
7 function test()
9 var instanceCount = 200;
10 function createHeapSnapshot()
12 return InspectorTest.createHeapSnapshot(instanceCount, 100);
15 InspectorTest.runHeapSnapshotTestSuite([
16 function testSearch(next)
18 InspectorTest.takeAndOpenSnapshot(createHeapSnapshot, step1);
20 function step0()
22 InspectorTest.switchToView("Summary", step1);
25 var view;
26 function addNodeSelectSniffer(constructorName, nodeId, onSuccess)
28 InspectorTest.addSniffer(view, "_selectRevealedNode", checkNodeIsSelected.bind(view, constructorName, nodeId, onSuccess));
31 function step1()
33 view = InspectorTest.currentProfileView();
34 InspectorTest.addSniffer(view, "_selectRevealedNode", step2);
35 view.performSearch({query: "@1", caseSensitive: false});
38 function step2(callback, node)
40 if (node) {
41 InspectorTest.addResult("FAIL: hidden node @1 was found");
42 return next();
44 InspectorTest.addResult("PASS: hidden node @1 was not found.")
45 view = InspectorTest.currentProfileView();
46 addNodeSelectSniffer("A", "101", step3);
47 view.performSearch({query:"@101", caseSensitive: false});
50 function step3()
52 view.performSearch({query: "@a", caseSensitive: false});
53 if (view._searchResults.length !== 0) {
54 InspectorTest.addResult("FAIL: node @a found");
55 return next();
57 InspectorTest.addResult("PASS: node @a was not found");
58 InspectorTest.addSniffer(view, "_selectRevealedNode", step5);
59 view.performSearch({query: "@999", caseSensitive: false}, step5);
62 function step5(node)
64 if (node) {
65 InspectorTest.addResult("FAIL: found node @999");
66 return next();
68 InspectorTest.addResult("PASS: node @999 was not found");
69 addNodeSelectSniffer("B", "100", step6);
70 view.performSearch({query: "@100", caseSensitive: false});
73 function step6()
75 addNodeSelectSniffer("B", "400", step7);
76 view.performSearch({query: "@400", caseSensitive: false});
79 function step7()
81 addNodeSelectSniffer("A", "401", next);
82 view.performSearch({query: "@401", caseSensitive: false});
85 function checkNodeIsSelected(constructorName, nodeId, onSuccess, node)
87 if (!node) {
88 InspectorTest.addResult("FAIL: node @" + nodeId + " not found");
89 return next();
91 if (constructorName !== node.parent._name) {
92 InspectorTest.addResult("FAIL: constructor name doesn't match. " + constructorName + " !== " + node.parent._name);
93 next();
95 if (nodeId != node.snapshotNodeId) {
96 InspectorTest.addResult("FAIL: snapshot node id doesn't match. " + nodeId + " !== " + node.snapshotNodeId);
97 next();
99 InspectorTest.addResult("PASS: found node @" + nodeId + " with class '" + constructorName + "'");
100 return onSuccess();
106 </script>
107 </head>
108 <body onload="runTest()">
110 Tests search in Summary view of detailed heap snapshots.
111 </p>
112 </body>
113 </html>