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
.panels
.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 var action
= new WebInspector
.AdvancedSearchView
.ActionDelegate();
26 action
.handleAction(undefined, "sources.search.toggle");
27 Promise
.resolve().then(function() {
28 InspectorTest
.addResult("Advanced search controller: '" + action
._searchView
._search
.value
+ "'");
29 InspectorTest
.completeTest();
33 function findString(sourceFrame
, string
)
35 for (var i
= 0; i
< sourceFrame
._textEditor
.linesCount
; ++i
) {
36 var line
= sourceFrame
._textEditor
.line(i
);
37 var column
= line
.indexOf(string
);
40 return new WebInspector
.TextRange(i
, column
, i
, column
+ string
.length
);
48 <body onload=
"runTest()">
49 <p>Tests synchronizing the search input field to the editor selection.
</p>