3 <script src=
"../../../http/tests/inspector/inspector-test.js"></script>
4 <script src=
"../../../http/tests/inspector/debugger-test.js"></script>
5 <script src=
"../../../http/tests/inspector/search/search-test.js"></script>
8 function nonFormattedFunction() { var i
= 2 + 2; var a
= 4; return a
+ i
; }
13 var shouldRequestContent
= false;
14 InspectorTest
.scriptFormatter().then(startDebuggerTest
);
17 function startDebuggerTest(sf
)
20 InspectorTest
.startDebuggerTest(started
);
25 InspectorTest
.showScriptSource("script-formatter-search.html", didShowScriptSource
);
28 function didShowScriptSource(frame
)
30 scriptSource
= frame
._uiSourceCode
;
31 scriptSource
.searchInContent("magic-string", true, false, dump1
);
34 function dump1(matches
)
36 InspectorTest
.addResult("Pre-format search results:");
37 InspectorTest
.dumpSearchMatches(matches
);
38 shouldRequestContent
= true;
39 InspectorTest
.addSniffer(WebInspector
.ScriptFormatterEditorAction
.prototype, "_updateButton", uiSourceCodeScriptFormatted
);
40 scriptFormatter
._toggleFormatScriptSource();
43 function uiSourceCodeScriptFormatted()
45 scriptSource
.searchInContent("magic-string", true, false, dump2
);
48 function dump2(matches
)
50 InspectorTest
.addResult("Post-format search results:");
51 InspectorTest
.dumpSearchMatches(matches
);
52 InspectorTest
.completeTest();
60 <body onload=
"runTest()">
61 <p>Tests that search across files works with formatted scripts.