Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / inspector / editor / text-editor-selection-to-search.html
blobbbe25b0d36f8ffdaa4c9ef84f0b35eb25f97bd9d
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="../sources/debugger/resources/edit-me.js"></script>
7 <script>
9 function test()
11 var panel = WebInspector.panels.sources;
13 InspectorTest.showScriptSource("edit-me.js", step1);
15 function step1(sourceFrame)
17 sourceFrame._textEditor.setSelection(findString(sourceFrame, "return"));
18 setTimeout(step2);
21 function step2()
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();
30 });
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);
38 if (column === -1)
39 continue;
40 return new WebInspector.TextRange(i, column, i, column + string.length);
44 </script>
46 </head>
48 <body onload="runTest()">
49 <p>Tests synchronizing the search input field to the editor selection.</p>
51 </body>
52 </html>