Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / http / tests / inspector / network / network-preview-json.html
1 <html>
2 <head>
3 <script src="../inspector-test.js"></script>
4 <script src="../network-test.js"></script>
5 <script>
6
7 function test()
8 {
9     function check(text) {
10         InspectorTest.addResult("");
11         InspectorTest.addResult("Input: " + text);
12         var parsedJSON = WebInspector.RequestJSONView.parseJSON(text);
13         if (!parsedJSON) {
14             InspectorTest.addResult("Can't parse");
15             return;
16         }
17         InspectorTest.addResult("Prefix: " + parsedJSON.prefix);
18         InspectorTest.addResult("Data: " + JSON.stringify(parsedJSON.data));
19         InspectorTest.addResult("Suffix: " + parsedJSON.suffix);
20     }
21
22     check("{\"name\": \"value\"}");
23     check("while(1); {\"name\": \"value\"}");
24     check("[,\"foo\", -4.2, true, false, null]");
25     check("[{\"foo\": {}, \"bar\": []},[[],{}]]");
26     check("/* vanilla */ run([1, 2, 3]);");
27     check("[\"A\\\"B\\u0020C\\nD\\\\E\\u04ABF\"]");
28
29     check("<html>404 Page not found</html>");
30
31     InspectorTest.completeTest();
32 }
33 </script>
34 </head>
35 <body onload="runTest()">
36 <p>Tests RequestJSONView ability to parse JSON passed in XHR, JSONP</p>
37 <a href="https://bugs.webkit.org/show_bug.cgi?id=65559">Bug 65559</a>
38 </body>
39 </html>