1 function initialize_AuditTests()
4 InspectorTest.collectAuditResults = function()
6 WebInspector.panels.audits.showResults(WebInspector.panels.audits.auditResultsTreeElement.children[0].results);
7 var liElements = WebInspector.panels.audits.visibleView.element.getElementsByTagName("li");
8 for (var j = 0; j < liElements.length; ++j) {
9 if (liElements[j].treeElement)
10 liElements[j].treeElement.expand();
12 InspectorTest.collectTextContent(WebInspector.panels.audits.visibleView.element, "");
15 InspectorTest.launchAllAudits = function(shouldReload, callback)
17 var launcherView = WebInspector.panels.audits._launcherView;
18 launcherView._selectAllClicked(true);
19 launcherView._auditPresentStateElement.checked = !shouldReload;
20 launcherView._launchButtonClicked();
21 InspectorTest.runAfterPendingDispatches(callback);
24 InspectorTest.collectTextContent = function(element, indent)
27 var child = element.firstChild;
30 if (child.nodeType === Node.TEXT_NODE) {
31 nodeOutput += child.nodeValue.replace("\u200B", "");
32 } else if (child.nodeType === Node.ELEMENT_NODE) {
33 if (nodeOutput !== "") {
34 InspectorTest.addResult(indent + nodeOutput);
37 if (!child.firstChild && child.className.indexOf("severity") == 0)
38 nodeOutput = "[" + child.className + "] ";
40 InspectorTest.collectTextContent(child, indent + " ");
42 child = child.nextSibling;
44 if (nodeOutput !== "")
45 InspectorTest.addResult(indent + nodeOutput);