AuditsTestRunner._panel=function(){return(UI.panels).audits;};AuditsTestRunner.getContainerElement=function(){return AuditsTestRunner._panel().contentElement;};AuditsTestRunner.getResultsElement=function(){return AuditsTestRunner._panel()._auditResultsElement;};AuditsTestRunner.getDialogElement=function(){return AuditsTestRunner._panel()._statusView._dialog.contentElement.shadowRoot.querySelector('.audits-view');};AuditsTestRunner.getSettingsElement=function(){return AuditsTestRunner._panel()._settingsPane.element;};AuditsTestRunner.getRunButton=function(){const dialog=AuditsTestRunner.getContainerElement();return dialog&&dialog.querySelectorAll('button')[0];};AuditsTestRunner.getCancelButton=function(){const dialog=AuditsTestRunner.getDialogElement();return dialog&&dialog.querySelectorAll('button')[0];};AuditsTestRunner.openStartAudit=function(){AuditsTestRunner._panel()._renderStartView();};AuditsTestRunner.addStatusListener=function(onMessage){TestRunner.addSniffer(Audits.StatusView.prototype,'updateStatus',onMessage,true);};AuditsTestRunner.waitForResults=function(){return new Promise(resolve=>{TestRunner.addSniffer(Audits.AuditsPanel.prototype,'_buildReportUI',(lhr,artifacts)=>resolve({lhr,artifacts}));});};AuditsTestRunner.forcePageAuditabilityCheck=function(){AuditsTestRunner._panel()._controller.recomputePageAuditability();};AuditsTestRunner._checkboxStateLabel=function(checkboxContainer){if(!checkboxContainer){return'missing';}
const label=checkboxContainer.textElement.textContent;const checkedLabel=checkboxContainer.checkboxElement.checked?'x':' ';return`[${checkedLabel}] ${label}`;};AuditsTestRunner._buttonStateLabel=function(button){if(!button){return'missing';}
const enabledLabel=button.disabled?'disabled':'enabled';const hiddenLabel=window.getComputedStyle(button).getPropertyValue('visibility');return`${button.textContent}: ${enabledLabel} ${hiddenLabel}`;};AuditsTestRunner.dumpStartAuditState=function(){TestRunner.addResult('\n========== Audits Start Audit State ==========');const containerElement=AuditsTestRunner.getContainerElement();const checkboxes=[...containerElement.querySelectorAll('.checkbox')];const toolbarShadowRoot=AuditsTestRunner.getSettingsElement().querySelector('.audits-settings-pane > div').shadowRoot;for(const checkbox of toolbarShadowRoot.querySelectorAll('.checkbox')){checkboxes.push(checkbox);}
checkboxes.forEach(element=>{TestRunner.addResult(AuditsTestRunner._checkboxStateLabel(element));});const helpText=containerElement.querySelector('.audits-help-text');if(!helpText.classList.contains('hidden')){TestRunner.addResult(`Help text: ${helpText.textContent}`);}
TestRunner.addResult(AuditsTestRunner._buttonStateLabel(AuditsTestRunner.getRunButton()));};;