2011-06-24 Andrey Kosyakov <caseq@chromium.org>
[WebKit-https.git] / LayoutTests / inspector / extensions / extensions-audits-tests.js
1 function extension_runAudits(callback)
2 {
3     evaluateOnFrontend("InspectorTest.startExtensionAudits(reply);", callback);
4 }
5
6 // runs in front-end
7 var initialize_ExtensionsAuditsTest = function()
8 {
9     InspectorTest.startExtensionAudits = function(callback)
10     {
11         const launcherView = WebInspector.panels.audits._launcherView;
12         launcherView._selectAllClicked(false);
13         launcherView._auditPresentStateElement.checked = true;
14
15         var extensionCategories = document.evaluate("label[starts-with(.,'Extension ')]/input[@type='checkbox']",
16             WebInspector.panels.audits._launcherView._categoriesElement, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
17
18         for (var i = 0; i < extensionCategories.snapshotLength; ++i)
19             extensionCategories.snapshotItem(i).click();
20
21         function onAuditsDone()
22         {
23             InspectorTest.collectAuditResults();
24             callback();
25         }
26         InspectorTest.addSniffer(WebInspector.panels.audits, "_auditFinishedCallback", onAuditsDone, true);
27
28         launcherView._launchButtonClicked();
29     }
30 }