3 <script src="../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../http/tests/inspector/debugger-test.js"></script>
5 <script src="../sources/debugger/resources/edit-me.js"></script>
11 var panel = WebInspector.showPanel("sources");
13 InspectorTest.showScriptSource("edit-me.js", step1);
15 function step1(sourceFrame)
17 sourceFrame._textEditor.setSelection(findString(sourceFrame, "return"));
23 panel.searchableView().showSearchField();
24 InspectorTest.addResult("Search controller: '" + panel.searchableView()._searchInputElement.value + "'");
25 WebInspector.advancedSearchController.show();
26 InspectorTest.addResult("Advanced search controller: '" + WebInspector.advancedSearchController._searchView._search.value + "'");
27 InspectorTest.completeTest();
30 function findString(sourceFrame, string)
32 for (var i = 0; i < sourceFrame._textEditor.linesCount; ++i) {
33 var line = sourceFrame._textEditor.line(i);
34 var column = line.indexOf(string);
37 return new WebInspector.TextRange(i, column, i, column + string.length);
45 <body onload="runTest()">
46 <p>Tests synchronizing the search input field to the editor selection.</p>