| 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 // force the loading of NetworkPanel code. | 8 // force the loading of NetworkPanel code. |
| 9 var networkPanel = WebInspector.inspectorView.showPanel("network"); | 9 var networkPanel = WebInspector.inspectorView.showPanel("network"); |
| 10 | 10 |
| 11 function createNetworkRequestWithJSONMIMEType(type) | 11 function createNetworkRequestWithJSONMIMEType(type) |
| 12 { | 12 { |
| 13 InspectorTest.addResult("Creating a NetworkRequest with type: " + type); | 13 InspectorTest.addResult("Creating a NetworkRequest with type: " + type); |
| 14 var request = new WebInspector.NetworkRequest(WebInspector.targetManager
.activeTarget(), 0, 'http://localhost'); | 14 var request = new WebInspector.NetworkRequest(WebInspector.targetManager
.mainTarget(), 0, 'http://localhost'); |
| 15 request.mimeType = type; | 15 request.mimeType = type; |
| 16 request._content = '{"number": 42}'; | 16 request._content = '{"number": 42}'; |
| 17 return request; | 17 return request; |
| 18 } | 18 } |
| 19 | 19 |
| 20 function testPreviewer(request) | 20 function testPreviewer(request) |
| 21 { | 21 { |
| 22 var previewView = new WebInspector.RequestPreviewView(request, null); | 22 var previewView = new WebInspector.RequestPreviewView(request, null); |
| 23 var previewer = previewView._createPreviewView(); | 23 var previewer = previewView._createPreviewView(); |
| 24 InspectorTest.addResult("Its previewer is the JSON previewer: " + (previ
ewer && previewer instanceof WebInspector.RequestJSONView)); | 24 InspectorTest.addResult("Its previewer is the JSON previewer: " + (previ
ewer && previewer instanceof WebInspector.RequestJSONView)); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 40 testType("application/vnd.document+json", next); | 40 testType("application/vnd.document+json", next); |
| 41 }, | 41 }, |
| 42 ]); | 42 ]); |
| 43 } | 43 } |
| 44 </script> | 44 </script> |
| 45 </head> | 45 </head> |
| 46 <body onload="runTest()"> | 46 <body onload="runTest()"> |
| 47 <p>Tests that resources with JSON MIME types are previewed with the JSON viewer.
</p> | 47 <p>Tests that resources with JSON MIME types are previewed with the JSON viewer.
</p> |
| 48 </body> | 48 </body> |
| 49 </html> | 49 </html> |
| OLD | NEW |