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

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

Issue 1163523002: DevTools: remove hand-written optimistic JSON parser introduced in r183821. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: bringing relaxed parser back Created 5 years, 6 months 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
« no previous file with comments | « no previous file | LayoutTests/http/tests/inspector/network/network-preview-json-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 6
7 function test() 7 function test()
8 { 8 {
9 function check(text) { 9 function check(text) {
10 InspectorTest.addResult(""); 10 InspectorTest.addResult("");
11 InspectorTest.addResult("Input: " + text); 11 InspectorTest.addResult("Input: " + text);
12 var parsedJSON = WebInspector.RequestJSONView.parseJSON(text); 12 var parsedJSON = WebInspector.RequestJSONView.parseJSON(text);
13 if (!parsedJSON) { 13 if (!parsedJSON) {
14 InspectorTest.addResult("Can't parse"); 14 InspectorTest.addResult("Can't parse");
15 return; 15 return;
16 } 16 }
17 InspectorTest.addResult("Prefix: " + parsedJSON.prefix); 17 InspectorTest.addResult("Prefix: " + parsedJSON.prefix);
18 InspectorTest.addResult("Data: " + JSON.stringify(parsedJSON.data)); 18 InspectorTest.addResult("Data: " + JSON.stringify(parsedJSON.data));
19 InspectorTest.addResult("Suffix: " + parsedJSON.suffix); 19 InspectorTest.addResult("Suffix: " + parsedJSON.suffix);
20 } 20 }
21 21
22 check("{\"name\": \"value\"}"); 22 check("{\"name\": \"value\"}");
23 check("while(1); {\"name\": \"value\"}"); 23 check("while(1); {\"name\": \"value\"}");
24 check("[,\"foo\", -4.2, true, false, null]"); 24 check("[, \"foo\", -4.2, true, false, null]");
25 check("[{\"foo\": {}, \"bar\": []},[[],{}]]"); 25 check("[{\"foo\": {}, \"bar\": []},[[],{}]]");
26 check("/* vanilla */ run([1, 2, 3]);"); 26 check("/* vanilla */ run ( [1, 2, 3] ) ;");
27 check("[\"A\\\"B\\u0020C\\nD\\\\E\\u04ABF\"]"); 27 check("[\"A\\\"B\\u0020C\\nD\\\\E\\u04ABF\"]");
28 28 check("Text with with {}) inside");
29 check("<html>404 Page not found</html>"); 29 check("<html>404 Page not found with foo({}) inside</html>");
30 check("/* vanilla prefix too large to be considered prefix Ok? */ run([1, 2, 3]); // since it is unlikely JSONP");
30 31
31 InspectorTest.completeTest(); 32 InspectorTest.completeTest();
32 } 33 }
33 </script> 34 </script>
34 </head> 35 </head>
35 <body onload="runTest()"> 36 <body onload="runTest()">
36 <p>Tests RequestJSONView ability to parse JSON passed in XHR, JSONP</p> 37 <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 <a href="https://bugs.webkit.org/show_bug.cgi?id=65559">Bug 65559</a>
38 </body> 39 </body>
39 </html> 40 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/inspector/network/network-preview-json-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698