| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 | 3 |
| 4 <link rel="stylesheet" href="resources/css-outline-column.css"> | 4 <link rel="stylesheet" href="resources/css-outline-column.css"> |
| 5 | 5 |
| 6 <script src="../../http/tests/inspector/inspector-test.js"></script> | 6 <script src="../../http/tests/inspector/inspector-test.js"></script> |
| 7 <script src="../../http/tests/inspector/debugger-test.js"></script> | 7 <script src="../../http/tests/inspector/debugger-test.js"></script> |
| 8 <script> | 8 <script> |
| 9 | 9 |
| 10 function test() | 10 function test() |
| 11 { | 11 { |
| 12 InspectorTest.showScriptSource("css-outline-column.css", onSourceShown); | 12 InspectorTest.showScriptSource("css-outline-column.css", onSourceShown); |
| 13 var textEditor; | 13 var textEditor; |
| 14 function onSourceShown(sourceFrame) | 14 function onSourceShown(sourceFrame) |
| 15 { | 15 { |
| 16 textEditor = sourceFrame.textEditor; | 16 textEditor = sourceFrame.textEditor; |
| 17 InspectorTest.addSniffer(Sources.StyleSheetOutlineDialog.prototype, "ref
resh", onDialogFulfilled); | 17 InspectorTest.addSniffer(Sources.OutlineQuickOpen.prototype, "refresh",
onQuickOpenFulfilled); |
| 18 UI.panels.sources._sourcesView._showOutlineDialog(); | 18 UI.panels.sources._sourcesView._showOutlineQuickOpen(); |
| 19 } | 19 } |
| 20 | 20 |
| 21 function onDialogFulfilled() | 21 function onQuickOpenFulfilled() |
| 22 { | 22 { |
| 23 Sources.StyleSheetOutlineDialog._instanceForTests.selectItem(1, ""); | 23 InspectorTest.addSniffer(Common.Revealer, "revealPromise", (revealable,
omitFocus, promise) => promise.then(revealed)); |
| 24 this.selectItem(1, ""); |
| 25 } |
| 26 |
| 27 function revealed() { |
| 24 var selection = textEditor.selection(); | 28 var selection = textEditor.selection(); |
| 25 if (!selection.isEmpty()) { | 29 if (!selection.isEmpty()) { |
| 26 InspectorTest.addResult("ERROR: selection is not empty."); | 30 InspectorTest.addResult("ERROR: selection is not empty."); |
| 27 InspectorTest.completeTest(); | 31 InspectorTest.completeTest(); |
| 28 return; | 32 return; |
| 29 } | 33 } |
| 30 InspectorTest.addResult(String.sprintf("Cursor position: line %d, column
%d", selection.startLine, selection.startColumn)); | 34 InspectorTest.addResult(String.sprintf("Cursor position: line %d, column
%d", selection.startLine, selection.startColumn)); |
| 31 InspectorTest.completeTest(); | 35 InspectorTest.completeTest(); |
| 32 } | 36 } |
| 33 } | 37 } |
| 34 | 38 |
| 35 </script> | 39 </script> |
| 36 | 40 |
| 37 </head> | 41 </head> |
| 38 | 42 |
| 39 <body onload="runTest()"> | 43 <body onload="runTest()"> |
| 40 <p>Top-down test to verify css outline dialog.</p> | 44 <p>Top-down test to verify css outline dialog.</p> |
| 41 </body> | 45 </body> |
| 42 </html> | 46 </html> |
| OLD | NEW |