Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / sources / debugger-ui / script-formatter-search.html
blobfce8c703a9e6f7a407b25c021db76c3ad333a0d7
1 <html>
2 <head>
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>
6 <script>
8 function nonFormattedFunction() { var i = 2 + 2; var a = 4; return a + i; }
10 var test = function()
12 var scriptSource;
13 var shouldRequestContent = false;
14 InspectorTest.scriptFormatter().then(startDebuggerTest);
15 var scriptFormatter;
17 function startDebuggerTest(sf)
19 scriptFormatter = sf;
20 InspectorTest.startDebuggerTest(started);
23 function 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();
56 </script>
58 </head>
60 <body onload="runTest()">
61 <p>Tests that search across files works with formatted scripts.
62 </p>
64 </body>
65 </html>