| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <script src="../inspector-test.js"></script> | 3 <script src="../inspector-test.js"></script> |
| 4 <script src="../network-test.js"></script> | 4 <script src="../network-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 function test() | 6 function test() |
| 7 { | 7 { |
| 8 function testSearches(view, searches) | 8 function testSearches(view, searches) |
| 9 { | 9 { |
| 10 for (var search of searches) { | 10 for (var search of searches) { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 var compontentView = view; | 29 var compontentView = view; |
| 30 var typeName = "unknown"; | 30 var typeName = "unknown"; |
| 31 if (isSearchable) | 31 if (isSearchable) |
| 32 compontentView = view._searchProvider; | 32 compontentView = view._searchProvider; |
| 33 | 33 |
| 34 if (compontentView instanceof WebInspector.ResourceSourceFrame) { | 34 if (compontentView instanceof WebInspector.ResourceSourceFrame) { |
| 35 typeName = "ResourceSourceFrame"; | 35 typeName = "ResourceSourceFrame"; |
| 36 compontentView._ensureContentLoaded(); | 36 compontentView._ensureContentLoaded(); |
| 37 if (!compontentView.loaded) { | 37 if (!compontentView.loaded) { |
| 38 // try again when content is loaded. | 38 // try again when content is loaded. |
| 39 InspectorTest.addSniffer(compontentView, "onTextEditorContentLoa
ded", previewViewHandled.bind(this, searches, callback, view)); | 39 InspectorTest.addSniffer(compontentView, "onTextEditorContentSet
", previewViewHandled.bind(this, searches, callback, view)); |
| 40 return; | 40 return; |
| 41 } | 41 } |
| 42 } else if (compontentView instanceof WebInspector.XMLView) { | 42 } else if (compontentView instanceof WebInspector.XMLView) { |
| 43 typeName = "XMLView"; | 43 typeName = "XMLView"; |
| 44 } else if(compontentView instanceof WebInspector.JSONView) { | 44 } else if(compontentView instanceof WebInspector.JSONView) { |
| 45 typeName = "JSONView"; | 45 typeName = "JSONView"; |
| 46 } else if(compontentView instanceof WebInspector.RequestHTMLView) { | 46 } else if(compontentView instanceof WebInspector.RequestHTMLView) { |
| 47 typeName = "RequestHTMLView"; | 47 typeName = "RequestHTMLView"; |
| 48 } else if(compontentView instanceof WebInspector.EmptyWidget) { | 48 } else if(compontentView instanceof WebInspector.EmptyWidget) { |
| 49 typeName = "EmptyWidget"; | 49 typeName = "EmptyWidget"; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 testType("text/xml", "{foo0: 'barr', 'barr': 'fooo'}", ["fooo", "bar
"], next); | 113 testType("text/xml", "{foo0: 'barr', 'barr': 'fooo'}", ["fooo", "bar
"], next); |
| 114 } | 114 } |
| 115 ]); | 115 ]); |
| 116 } | 116 } |
| 117 </script> | 117 </script> |
| 118 </head> | 118 </head> |
| 119 <body onload="runTest()"> | 119 <body onload="runTest()"> |
| 120 <p>Tests that resources with JSON MIME types are previewed with the JSON viewer.
</p> | 120 <p>Tests that resources with JSON MIME types are previewed with the JSON viewer.
</p> |
| 121 </body> | 121 </body> |
| 122 </html> | 122 </html> |
| OLD | NEW |