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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/network/network-json-parser-expected.txt

Issue 1912973002: [DevTools] JSONView parsing smarter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
OLDNEW
1 Tests JSON parsing. 1 Tests JSON parsing.
2 2
3 3
4 Input: plain text 4 Input: plain text
5 Invalid JSON 5 Invalid JSON
6 6
7 Input: {"x": 5, "y": false, "z":"foo"} 7 Input: {"x": 5, "y": false, "z":"foo"}
8 Prefix: 8 Prefix:
9 Suffix: 9 Suffix:
10 Data: {"x":5,"y":false,"z":"foo"} 10 Data: {"x":5,"y":false,"z":"foo"}
11 11
12 Input: {"bar": [,,,1, 2, 3,,,], "baz": {"data": []}} 12 Input: {"bar": [,,,1, 2, 3,,,], "baz": {"data": []}}
13 Prefix: 13 Prefix:
14 Suffix: 14 Suffix:
15 Data: {"bar":[null,null,null,1,2,3,null,null],"baz":{"data":[]}} 15 Data: {"bar":[null,null,null,1,2,3,null,null],"baz":{"data":[]}}
16 16
17 Input: [[],[],[]] 17 Input: [[],[],[]]
18 Prefix: 18 Prefix:
19 Suffix: 19 Suffix:
20 Data: [[],[],[]] 20 Data: [[],[],[]]
21 21
22 Input: /* GUARD */callback({"a": []]}); 22 Input: /* GUARD */callback({"a": []]});
23 Prefix: /* GUARD */callback( 23 Invalid JSON
24 Suffix: );
25 Data: {"a":[]}
26 24
27 Input: foo({a = 5}); 25 Input: foo({a = 5});
28 Invalid JSON 26 Invalid JSON
29 27
30 Input: (function(){return {"a": []}})() 28 Input: (function(){return {"a": []}})()
31 Invalid JSON 29 Invalid JSON
32 30
31 Input: {"name": "value"}
32 Prefix:
33 Suffix:
34 Data: {"name":"value"}
35
36 Input: while(1); {"name": "value"}
37 Prefix: while(1);
38 Suffix:
39 Data: {"name":"value"}
40
41 Input: [, "foo", -4.2, true, false, null]
42 Prefix:
43 Suffix:
44 Data: [null,"foo",-4.2,true,false,null]
45
46 Input: [{"foo": {}, "bar": []},[[],{}]]
47 Prefix:
48 Suffix:
49 Data: [{"foo":{},"bar":[]},[[],{}]]
50
51 Input: /* vanilla */ run ( [1, 2, 3] ) ;
52 Prefix: /* vanilla */ run (
53 Suffix: ) ;
54 Data: [1,2,3]
55
56 Input: ["A\"B\u0020C\nD\\E\u04ABF"]
57 Prefix:
58 Suffix:
59 Data: ["A\"B C\nD\\EҫF"]
60
61 Input: Text with with {}) inside
62 Invalid JSON
63
64 Input: <html>404 Page not found with foo({}) inside</html>
65 Invalid JSON
66
67 Input: /* vanilla prefix too large to be considered prefix Ok? */ run([1, 2, 3]) ; // since it is unlikely JSONP
68 Invalid JSON
69
70 Input: ["This is a really long string"]{"This is also a very long string":"short "}
71 Prefix: ["This is a really long string"]
72 Suffix:
73 Data: {"This is also a very long string":"short"}
74
75 Input: {010:4}
76 Prefix:
77 Suffix:
78 Data: {"8":4}
79
80 Input: {"foo":bar}
81 Invalid JSON
82
83 Input: {"foo":<"bar"}
84 Invalid JSON
85
86 Input: {"foo":"b\ar"}
87 Prefix:
88 Suffix:
89 Data: {"foo":"bar"}
90
91 Input: ["foo"]
92 Prefix:
93 Suffix:
94 Data: ["foo"]
95
96 Input: {foo:"bar"}
97 Prefix:
98 Suffix:
99 Data: {"foo":"bar"}
100
101 Input: { 10 : 4 }
102 Prefix:
103 Suffix:
104 Data: {"10":4}
105
106 Input: { "foo" : 010 }
107 Prefix:
108 Suffix:
109 Data: {"foo":8}
110
111 Input: {"foo": 3e3}
112 Prefix:
113 Suffix:
114 Data: {"foo":3000}
115
116 Input: {"foo": 3e3,}
117 Prefix:
118 Suffix:
119 Data: {"foo":3000}
120
121 Input: [,,false, null, true,1,0,,,]
122 Prefix:
123 Suffix:
124 Data: [null,null,false,null,true,1,0,null,null]
125
126 Input: [,,,]
127 Prefix:
128 Suffix:
129 Data: [null,null,null]
130
131 Input: {foo: {bar: null,**CR**},bar: [
132 ],foo1: 1,foo2:**CR**
133 -1,
134 **CR**foo3: -1e-30,foo4: 1E+30,foo5: -1E+1,foo6: "bar","foo7": false,"\"\f\o\o8" : true,'fo\'o9': undefined,"foo10": ["bar", null],"": -Infinity,foo11: {},foo12: [{}],}
135 Prefix:
136 Suffix:
137 Data: {"foo":{"bar":null},"bar":[],"foo1":1,"foo2":-1,"foo3":-1e-30,"foo4":1e+30 ,"foo5":-10,"foo6":"bar","foo7":false,"\"\foo8":true,"fo'o9":"!<undefined>!","fo o10":["bar",null],"":"!<-Infinity>!","foo11":{},"foo12":[{}]}
138
139 Input:
140 Invalid JSON
141
142 Input:
143
144 Invalid JSON
145
146 Input: []
147 Prefix:
148 Suffix:
149 Data: []
150
151 Input: {}
152 Prefix:
153 Suffix:
154 Data: {}
155
156 Input: ()
157 Invalid JSON
158
159 Input: foobar
160 Invalid JSON
161
162 Input: "foobar"
163 Invalid JSON
164
165 Input: "foo" "bar"
166 Invalid JSON
167
168 Input: [010, 10, 0x10]
169 Prefix:
170 Suffix:
171 Data: [8,10,16]
172
173 Input: {010: 010, 0x10: 0x10, 10: 10}
174 Prefix:
175 Suffix:
176 Data: {"8":8,"10":10,"16":16}
177
178 Input: {-010: -010}
179 Invalid JSON
180
181 Input: {-0x10: -0x10}
182 Invalid JSON
183
184 Input: {-10: -10}
185 Invalid JSON
186
187 Input: {010: -010, 0x10: -0x10, 10: -10}
188 Prefix:
189 Suffix:
190 Data: {"8":-8,"10":-10,"16":-16}
191
192 Input: [10000, 0x1000000, 0xfEaB3, 01023456, 1234567901, 123.456, -123.456,12.33 E-5, 123.456e+5, 123.456e5]
193 Prefix:
194 Suffix:
195 Data: [10000,16777216,1043123,272174,1234567901,123.456,-123.456,0.0001233,12345 600,12345600]
196
197 Input: ["S\"0**NULL**me\"teXt"]
198 Prefix:
199 Suffix:
200 Data: ["S\"0\u0000me\"teXt"]
201
202 Input:
203 Invalid JSON
204
205 Input: [ {} ]
206 Prefix:
207 Suffix:
208 Data: [{}]
209
210 Input: var i=0;
211 Invalid JSON
212
213 Input: while(true) {}
214 Prefix: while(true)
215 Suffix:
216 Data: {}
217
218 Input: while(true); {d:5}
219 Prefix: while(true);
220 Suffix:
221 Data: {"d":5}
222
223 Input: while(true); {d:-5}
224 Prefix: while(true);
225 Suffix:
226 Data: {"d":-5}
227
228 Input: while(true); {d:[-5]}
229 Prefix: while(true);
230 Suffix:
231 Data: {"d":[-5]}
232
233 Input: while(true); {d:[-5,-0,03,0xF,0xFF]}
234 Prefix: while(true);
235 Suffix:
236 Data: {"d":[-5,0,3,15,255]}
237
238 Input: {d:function () {var i;}}
239 Invalid JSON
240
241 Input: {5:d}
242 Invalid JSON
243
244 Input: [-{},-[],{},[]]
245 Invalid JSON
246
247 Input: [-foo, foo, -bar, bar]
248 Invalid JSON
249
250 Input: [function(){}, -function(){}]
251 Invalid JSON
252
253 Input: {-true:0}
254 Invalid JSON
255
256 Input: {true: 0}
257 Prefix:
258 Suffix:
259 Data: {"true":0}
260
261 Input: [-true]
262 Invalid JSON
263
264 Input: [true]
265 Prefix:
266 Suffix:
267 Data: [true]
268
269 Input: [!true]
270 Invalid JSON
271
272 Input: [~true]
273 Invalid JSON
274
275 Input: {length: 0}
276 Prefix:
277 Suffix:
278 Data: {"length":0}
279
280 Input: [true, false]
281 Prefix:
282 Suffix:
283 Data: [true,false]
284
285 Input: [true, -false]
286 Invalid JSON
287
288 Input: [true, false, null, undefined, {}, [], "", "1", '', '1', 1, -1, -0, 0]
289 Prefix:
290 Suffix:
291 Data: [true,false,null,"!<undefined>!",{},[],"","1","","1",1,-1,0,0]
292
293 Input: [-{}, !{}, -[{}], ![{}]]
294 Invalid JSON
295
296 Input: [-1, -0, +1, +0, +-1, -!~0]
297 Invalid JSON
298
299 Input: [0xFF, -0xFF, +0xFF, 1e1, -1e1, 1E-1, -1E-1, 010, -010, +010]
300 Prefix:
301 Suffix:
302 Data: [255,-255,255,10,-10,0.1,-0.1,8,-8,8]
303
304 Input: {
305 foo: 'bar',
306 while: true,
307
308 this: 'is a \
309 multi-line string',
310
311 // this is an inline comment
312 here: 'is another', // inline comment
313
314 /* this is a block comment
315 that continues on another line */
316
317 hex: 0xDEADbeef,
318 half: .5,
319 delta: +10,
320 to: Infinity, // and beyond!
321
322 finally: 'a trailing comma',
323 oh: [
324 "we shouldn't forget",
325 'arrays can have',
326 'trailing commas too',
327 ],
328 }
329 Prefix:
330 Suffix:
331 Data: {"foo":"bar","while":true,"this":"is a multi-line string","here":"is anoth er","hex":3735928559,"half":0.5,"delta":10,"to":"!<Infinity>!","finally":"a trai ling comma","oh":["we shouldn't forget","arrays can have","trailing commas too"] }
332
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698