self.SourcesTestRunner=self.SourcesTestRunner||{},SourcesTestRunner.dumpSearchResults=function(e){e.sort((function(e,n){e.url.localeCompare(n.url)})),TestRunner.addResult("Search results: ");for(let n=0;n<e.length;n++)TestRunner.addResult("url: "+e[n].url.replace(/VM\d+/,"VMXX")+", matchesCount: "+e[n].matchesCount);TestRunner.addResult("")},SourcesTestRunner.dumpSearchMatches=function(e){TestRunner.addResult("Search matches: ");for(let n=0;n<e.length;n++)TestRunner.addResult("lineNumber: "+e[n].lineNumber+", line: '"+e[n].lineContent+"'");TestRunner.addResult("")},SourcesTestRunner.runSearchAndDumpResults=function(e,n,t){const s=[],r=new Common.Progress;e.performSearch(n,r,(function(e){s.push(e)}),(function(){s.sort((function(e,n){const t=e._uiSourceCode.url(),s=n._uiSourceCode.url();return t>s?1:s>t?-1:0}));for(let e=0;e<s.length;++e){const n=s[e],t=n._uiSourceCode,r=n._searchMatches;if(r.length){TestRunner.addResult("Search result #"+(e+1)+": uiSourceCode.url = "+t.url().replace(/VM\d+/,"VMXX"));for(let e=0;e<r.length;++e){const n=r[e].lineNumber,t=r[e].lineContent;TestRunner.addResult("  search match #"+(e+1)+": lineNumber = "+n+", lineContent = '"+t+"'")}}}t()}))},SourcesTestRunner.replaceAndDumpChange=function(e,n,t,s){const r=[];n.isRegex&&r.push("regex"),n.caseSensitive&&r.push("caseSensitive"),s&&r.push("replaceAll");const u=r.length?" ("+r.join(", ")+")":"";TestRunner.addResult("Running replace test for /"+n.query+"/"+t+"/ "+u+":");const l=e._textEditor,o=[];for(let a=0;a<l.linesCount;++a)o.push(l.line(a));const c=UI.panels.sources.sourcesView().searchableView();c.showSearchField(),c._caseSensitiveButton.setToggled(n.caseSensitive),c._regexButton.setToggled(n.isRegex),c._searchInputElement.value=n.query,c._replaceToggleButton.setToggled(!0),c._updateSecondRowVisibility(),c._replaceInputElement.value=t,c._performSearch(!0,!0),s?c._replaceAll():c._replace();const i=[];for(let a=0;a<l.linesCount;++a)i.push(l.line(a));for(let a=0;a<i.length;++a){if(o[a]===i[a])continue;const e=o[a],n=i[a];let t=0;for(let o=0;o<e.length&&o<n.length&&n[o]===e[o];++o)++t;let s=0;for(let o=0;o<e.length&&o<n.length&&n[n.length-o-1]===e[e.length-o-1];++o)++s;const r=e.substring(0,t),u=e.substring(t,e.length-s),l=n.substring(t,n.length-s),c=e.substring(e.length-s);TestRunner.addResult("  - "+r+"#"+u+"#"+l+"#"+c)}},TestRunner.deprecatedInitAsync("\n  if (window.GCController)\n    GCController.collect();\n");