OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../../http/tests/inspector/inspector-test.js"></script> | 3 <script src="../../http/tests/inspector/inspector-test.js"></script> |
4 <script src="../../http/tests/inspector/debugger-test.js"></script> | 4 <script src="../../http/tests/inspector/debugger-test.js"></script> |
5 <script src="../sources/debugger/resources/edit-me.js"></script> | 5 <script src="../sources/debugger/resources/edit-me.js"></script> |
6 | 6 |
7 <script> | 7 <script> |
8 | 8 |
9 function test() | 9 function test() |
10 { | 10 { |
11 WebInspector.moduleManager.loadModule("search"); | 11 WebInspector.moduleManager.loadModule("search"); |
12 var panel = WebInspector.inspectorView.showPanel("sources"); | 12 var panel = WebInspector.inspectorView.showPanel("sources"); |
13 | 13 |
14 InspectorTest.showScriptSource("edit-me.js", step1); | 14 InspectorTest.showScriptSource("edit-me.js", step1); |
15 | 15 |
16 function step1(sourceFrame) | 16 function step1(sourceFrame) |
17 { | 17 { |
18 sourceFrame._textEditor.setSelection(findString(sourceFrame, "return")); | 18 sourceFrame._textEditor.setSelection(findString(sourceFrame, "return")); |
19 setTimeout(step2); | 19 setTimeout(step2); |
20 } | 20 } |
21 | 21 |
22 function step2() | 22 function step2() |
23 { | 23 { |
24 panel.searchableView().showSearchField(); | 24 panel.searchableView().showSearchField(); |
25 InspectorTest.addResult("Search controller: '" + panel.searchableView().
_searchInputElement.value + "'"); | 25 InspectorTest.addResult("Search controller: '" + panel.searchableView().
_searchInputElement.value + "'"); |
26 WebInspector.advancedSearchController.show(); | 26 var extensions = WebInspector.moduleManager.extensions("drawer-view"); |
27 InspectorTest.addResult("Advanced search controller: '" + WebInspector.a
dvancedSearchController._searchView._search.value + "'"); | 27 var searchView; |
| 28 for (var i = 0; i < extensions.length; ++i) { |
| 29 if (extensions[i].descriptor()["name"] === "search") { |
| 30 searchView = extensions[i].instance(); |
| 31 break; |
| 32 } |
| 33 } |
| 34 searchView.toggle(); |
| 35 InspectorTest.addResult("Advanced search controller: '" + searchView._se
arch.value + "'"); |
28 InspectorTest.completeTest(); | 36 InspectorTest.completeTest(); |
29 } | 37 } |
30 | 38 |
31 function findString(sourceFrame, string) | 39 function findString(sourceFrame, string) |
32 { | 40 { |
33 for (var i = 0; i < sourceFrame._textEditor.linesCount; ++i) { | 41 for (var i = 0; i < sourceFrame._textEditor.linesCount; ++i) { |
34 var line = sourceFrame._textEditor.line(i); | 42 var line = sourceFrame._textEditor.line(i); |
35 var column = line.indexOf(string); | 43 var column = line.indexOf(string); |
36 if (column === -1) | 44 if (column === -1) |
37 continue; | 45 continue; |
38 return new WebInspector.TextRange(i, column, i, column + string.leng
th); | 46 return new WebInspector.TextRange(i, column, i, column + string.leng
th); |
39 } | 47 } |
40 } | 48 } |
41 } | 49 } |
42 </script> | 50 </script> |
43 | 51 |
44 </head> | 52 </head> |
45 | 53 |
46 <body onload="runTest()"> | 54 <body onload="runTest()"> |
47 <p>Tests synchronizing the search input field to the editor selection.</p> | 55 <p>Tests synchronizing the search input field to the editor selection.</p> |
48 | 56 |
49 </body> | 57 </body> |
50 </html> | 58 </html> |
OLD | NEW |