Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(295)

Side by Side Diff: LayoutTests/http/tests/inspector/network/json-preview.html

Issue 94893003: Support for json media types as (non-image) mime types. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Test via synthetic NetworkRequest Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../inspector-test.js"></script>
4 <script src="../network-test.js"></script>
5 <script>
6 function test()
7 {
8 // force the loading of NetworkPanel code.
9 var networkPanel = WebInspector.showPanel("network");
10
11 function createNetworkRequestWithJSONMIMEType(type)
12 {
13 InspectorTest.addResult("Creating a NetworkRequest with type: " + type);
14 var request = new WebInspector.NetworkRequest(0, 'http://localhost');
15 request.mimeType = type;
16 request._content = '{"number": 42}';
17 return request;
18 }
19
20 function testPreviewer(request)
21 {
22 var previewView = new WebInspector.RequestPreviewView(request, null);
23 var previewer = previewView._createPreviewView();
24 InspectorTest.addResult("Its previewer is the JSON previewer: " + (previ ewer && previewer instanceof WebInspector.RequestJSONView));
25 }
26
27 function testType(contentType, callback)
28 {
29 var request = createNetworkRequestWithJSONMIMEType(contentType);
30 testPreviewer(request);
31 callback();
32 }
33 InspectorTest.runTestSuite([
34 function test1(next)
35 {
36 testType("application/json", next);
37 },
38 function test2(next)
39 {
40 testType("application/vnd.document+json", next);
41 },
42 ]);
43 }
44 </script>
45 </head>
46 <body onload="runTest()">
47 <p>Tests that resources with JSON MIME types are previewed with the JSON viewer. </p>
48 </body>
49 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698