self.ExtensionsTestRunner=self.ExtensionsTestRunner||{};const extensionsHost="devtools-extensions.oopif.test";function onEvaluate(message,port){function reply(e){self.Extensions.extensionServer._dispatchCallback(message.requestId,port,e)}try{eval(message.expression)}catch(e){TestRunner.addResult("Exception while running: "+message.expression+"\n"+(e.stack||e)),TestRunner.completeTest()}}self.Extensions.extensionServer._registerHandler("evaluateForTestInFrontEnd",onEvaluate),Extensions.extensionsOrigin=`http://${extensionsHost}:8000`,self.Extensions.extensionServer._extensionAPITestHook=function(e,n){window.webInspector=n,window._extensionServerForTests=e,n.panels.themeName="themeNameForTest"},ExtensionsTestRunner._replyToExtension=function(e,n){self.Extensions.extensionServer._dispatchCallback(e,n)},ExtensionsTestRunner.showPanel=function(e){return"extension"===e&&(e=self.UI.inspectorView._tabbedPane._tabs[self.UI.inspectorView._tabbedPane._tabs.length-1].id),self.UI.inspectorView.showPanel(e)},ExtensionsTestRunner.evaluateInExtension=function(e){ExtensionsTestRunner._codeToEvaluateBeforeTests=e},ExtensionsTestRunner.runExtensionTests=async function(e){const n=await TestRunner.RuntimeAgent.evaluate("location.href","console",!1);if(!n)return;ExtensionsTestRunner._pendingTests=(ExtensionsTestRunner._codeToEvaluateBeforeTests||"")+e.join("\n");let s=n.value.replace(/^(https?:\/\/[^\/]*\/).*$/,"$1")+"devtools/resources/extension-main.html";s=s.replace("127.0.0.1",extensionsHost),self.Extensions.extensionServer._addExtension({startPage:s,name:"test extension",exposeWebInspectorNamespace:!0})},console.warn=()=>{};