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

Side by Side Diff: test/webkit/run-json-stringify-expected.txt

Issue 254673005: Move JSON-stringify webkit test to V8. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « test/webkit/run-json-stringify.js ('k') | tools/blink_tests/TestExpectations » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 function (jsonObject){
2 return jsonObject.stringify(1);
3 }
4 PASS tests[i](nativeJSON) is tests[i](JSON)
5 function (jsonObject){
6 return jsonObject.stringify(1.5);
7 }
8 PASS tests[i](nativeJSON) is tests[i](JSON)
9 function (jsonObject){
10 return jsonObject.stringify(-1);
11 }
12 PASS tests[i](nativeJSON) is tests[i](JSON)
13 function (jsonObject){
14 return jsonObject.stringify(-1.5);
15 }
16 PASS tests[i](nativeJSON) is tests[i](JSON)
17 function (jsonObject){
18 return jsonObject.stringify(null);
19 }
20 PASS tests[i](nativeJSON) is tests[i](JSON)
21 function (jsonObject){
22 return jsonObject.stringify("string");
23 }
24 PASS tests[i](nativeJSON) is tests[i](JSON)
25 function (jsonObject){
26 return jsonObject.stringify(new Number(0));
27 }
28 PASS tests[i](nativeJSON) is tests[i](JSON)
29 function (jsonObject){
30 return jsonObject.stringify(new Number(1));
31 }
32 PASS tests[i](nativeJSON) is tests[i](JSON)
33 function (jsonObject){
34 return jsonObject.stringify(new Number(1.5));
35 }
36 PASS tests[i](nativeJSON) is tests[i](JSON)
37 function (jsonObject){
38 return jsonObject.stringify(new Number(-1));
39 }
40 PASS tests[i](nativeJSON) is tests[i](JSON)
41 function (jsonObject){
42 return jsonObject.stringify(new Number(-1.5));
43 }
44 PASS tests[i](nativeJSON) is tests[i](JSON)
45 function (jsonObject){
46 return jsonObject.stringify(new String("a string object"));
47 }
48 PASS tests[i](nativeJSON) is tests[i](JSON)
49 function (jsonObject){
50 return jsonObject.stringify(new Boolean(true));
51 }
52 PASS tests[i](nativeJSON) is tests[i](JSON)
53 function (jsonObject){
54 var value = new Number(1);
55 value.valueOf = function() { return 2; }
56 return jsonObject.stringify(value);
57 }
58 PASS tests[i](nativeJSON) is tests[i].expected
59 function (jsonObject){
60 var value = new Boolean(true);
61 value.valueOf = function() { return 2; }
62 return jsonObject.stringify(value);
63 }
64 FAIL tests[i](nativeJSON) should be 2. Was true.
65 function (jsonObject){
66 var value = new String("fail");
67 value.toString = function() { return "converted string"; }
68 return jsonObject.stringify(value);
69 }
70 PASS tests[i](nativeJSON) is tests[i].expected
71 function (jsonObject){
72 return jsonObject.stringify(true);
73 }
74 PASS tests[i](nativeJSON) is tests[i](JSON)
75 function (jsonObject){
76 return jsonObject.stringify(false);
77 }
78 PASS tests[i](nativeJSON) is tests[i](JSON)
79 function (jsonObject){
80 return jsonObject.stringify(new Date(0));
81 }
82 PASS tests[i](nativeJSON) is tests[i](JSON)
83 function (jsonObject){
84 return jsonObject.stringify({toJSON: Date.prototype.toJSON});
85 }
86 PASS tests[i](nativeJSON) threw exception TypeError: undefined is not a function .
87 function (jsonObject){
88 return jsonObject.stringify({toJSON: Date.prototype.toJSON, toISOString: function(){ return "custom toISOString"; }});
89 }
90 PASS tests[i](nativeJSON) is tests[i](JSON)
91 function (jsonObject){
92 return jsonObject.stringify({toJSON: Date.prototype.toJSON, toISOString: function(){ return {}; }});
93 }
94 FAIL tests[i](nativeJSON) should throw an exception. Was {}.
95 function (jsonObject){
96 return jsonObject.stringify({toJSON: Date.prototype.toJSON, toISOString: function(){ throw "An exception"; }});
97 }
98 PASS tests[i](nativeJSON) threw exception An exception.
99 function (jsonObject){
100 var d = new Date(0);
101 d.toISOString = null;
102 return jsonObject.stringify(d);
103 }
104 PASS tests[i](nativeJSON) threw exception TypeError: object is not a function.
105 function (jsonObject){
106 var d = new Date(0);
107 d.toJSON = undefined;
108 return jsonObject.stringify(d);
109 }
110 PASS tests[i](nativeJSON) is tests[i](JSON)
111 function (jsonObject){
112 return jsonObject.stringify({get Foo() { return "bar"; }});
113 }
114 PASS tests[i](nativeJSON) is tests[i](JSON)
115 function (jsonObject){
116 return jsonObject.stringify({get Foo() { this.foo="wibble"; return "bar" ; }});
117 }
118 PASS tests[i](nativeJSON) is tests[i](JSON)
119 function (jsonObject){
120 var count = 0;
121 jsonObject.stringify({get Foo() { count++; return "bar"; }});
122 return count;
123 }
124 PASS tests[i](nativeJSON) is tests[i](JSON)
125 function (jsonObject){
126 var count = 0;
127 return jsonObject.stringify({get Foo() { count++; delete this.bar; retur n "bar"; }, bar: "wibble"});
128 }
129 PASS tests[i](nativeJSON) is tests[i](JSON)
130 function (jsonObject){
131 var count = 0;
132 return jsonObject.stringify({a:"1", b:"2", c:"3", 5:4, 4:5, 2:6, 1:7});
133 }
134 PASS tests[i](nativeJSON) is tests[i](JSON)
135 function (jsonObject){
136 var allString = true;
137 jsonObject.stringify({a:"1", b:"2", c:"3", 5:4, 4:5, 2:6, 1:7}, function (k,v){allString = allString && (typeof k == "string"); return v});
138 return allString;
139 }
140 PASS tests[i](nativeJSON) is tests[i](JSON)
141 function (jsonObject){
142 var allString = true;
143 jsonObject.stringify([1,2,3,4,5], function(k,v){allString = allString && (typeof k == "string"); return v});
144 return allString;
145 }
146 FAIL tests[i](nativeJSON) should be false. Was true.
147 function (jsonObject){
148 var allString = true;
149 var array = [];
150 return jsonObject.stringify({a:"1", b:"2", c:"3", 5:4, 4:5, 2:6, 1:7}, a rray);
151 }
152 PASS tests[i](nativeJSON) is tests[i](JSON)
153 function (jsonObject){
154 var allString = true;
155 var array = ["a"];
156 return jsonObject.stringify({get a(){return 1;array[1]="b";array[2]="c"} , b:"2", c:"3"}, array);
157 }
158 PASS tests[i](nativeJSON) is tests[i](JSON)
159 function (jsonObject){
160 var allString = true;
161 var array = [{toString:function(){array[0]='a'; array[1]='c'; array[2]=' b'; return 'a'}}];
162 return jsonObject.stringify(simpleObject, array);
163 }
164 PASS tests[i](nativeJSON) is tests[i](JSON)
165 function (jsonObject){
166 var allString = true;
167 var array = [{toString:function(){array[0]='a'; array[1]='c'; array[2]=' b'; return 'a'}}];
168 return jsonObject.stringify(simpleObjectWithProto, array);
169 }
170 PASS tests[i](nativeJSON) is tests[i](JSON)
171 function (jsonObject){
172 var allString = true;
173 var array = [1, new Number(2), NaN, Infinity, -Infinity, new String("str ")];
174 return jsonObject.stringify({"1":"1","2":"2","NaN":"NaN","Infinity":"Inf inity","-Infinity":"-Infinity","str":"str"}, array);
175 }
176 PASS tests[i](nativeJSON) is tests[i].expected
177 function (jsonObject){
178 var allString = true;
179 var array = ["1","2","3"];
180 return jsonObject.stringify({1:'a', 2:'b', 3:'c'}, array);
181 }
182 PASS tests[i](nativeJSON) is tests[i](JSON)
183 function (jsonObject){
184 var allString = true;
185 var array = ["1","2","3"];
186 return jsonObject.stringify(simpleArray, array);
187 }
188 PASS tests[i](nativeJSON) is tests[i](JSON)
189 function (jsonObject){
190 return jsonObject.stringify(simpleArray, null, " ");
191 }
192 PASS tests[i](nativeJSON) is tests[i](JSON)
193 function (jsonObject){
194 return jsonObject.stringify(simpleArray, null, 4);
195 }
196 PASS tests[i](nativeJSON) is tests[i](JSON)
197 function (jsonObject){
198 return jsonObject.stringify(simpleArray, null, "ab");
199 }
200 PASS tests[i](nativeJSON) is tests[i](JSON)
201 function (jsonObject){
202 return jsonObject.stringify(simpleArray, null, 4);
203 }
204 PASS tests[i](nativeJSON) is tests[i](JSON)
205 function (jsonObject){
206 return jsonObject.stringify(simpleObject, null, " ");
207 }
208 PASS tests[i](nativeJSON) is tests[i](JSON)
209 function (jsonObject){
210 return jsonObject.stringify(simpleObject, null, 4);
211 }
212 PASS tests[i](nativeJSON) is tests[i](JSON)
213 function (jsonObject){
214 return jsonObject.stringify(simpleObject, null, "ab");
215 }
216 PASS tests[i](nativeJSON) is tests[i](JSON)
217 function (jsonObject){
218 return jsonObject.stringify(simpleObject, null, 4);
219 }
220 PASS tests[i](nativeJSON) is tests[i](JSON)
221 function (jsonObject){
222 return jsonObject.stringify(simpleObject, null, 10);
223 }
224 PASS tests[i](nativeJSON) is tests[i](JSON)
225 function (jsonObject){
226 return jsonObject.stringify(simpleObject, null, 11);
227 }
228 PASS tests[i](nativeJSON) is tests[i].expected
229 function (jsonObject){
230 return jsonObject.stringify(simpleObject, null, " ");
231 }
232 PASS tests[i](nativeJSON) is tests[i].expected
233 function (jsonObject){
234 return jsonObject.stringify(simpleObject, null, " ");
235 }
236 PASS tests[i](nativeJSON) is tests[i].expected
237 function (jsonObject){
238 return jsonObject.stringify(complexArray, null, " ");
239 }
240 PASS tests[i](nativeJSON) is tests[i](JSON)
241 function (jsonObject){
242 return jsonObject.stringify(complexArray, null, 4);
243 }
244 PASS tests[i](nativeJSON) is tests[i](JSON)
245 function (jsonObject){
246 return jsonObject.stringify(complexArray, null, "ab");
247 }
248 PASS tests[i](nativeJSON) is tests[i](JSON)
249 function (jsonObject){
250 return jsonObject.stringify(complexArray, null, 4);
251 }
252 PASS tests[i](nativeJSON) is tests[i](JSON)
253 function (jsonObject){
254 return jsonObject.stringify(complexObject, null, " ");
255 }
256 PASS tests[i](nativeJSON) is tests[i](JSON)
257 function (jsonObject){
258 return jsonObject.stringify(complexObject, null, 4);
259 }
260 PASS tests[i](nativeJSON) is tests[i](JSON)
261 function (jsonObject){
262 return jsonObject.stringify(complexObject, null, "ab");
263 }
264 PASS tests[i](nativeJSON) is tests[i](JSON)
265 function (jsonObject){
266 return jsonObject.stringify(complexObject, null, 4);
267 }
268 PASS tests[i](nativeJSON) is tests[i](JSON)
269 function (jsonObject){
270 var allString = true;
271 var array = ["1","2","3"];
272 return jsonObject.stringify(simpleArrayWithProto, array);
273 }
274 PASS tests[i](nativeJSON) is tests[i](JSON)
275 function (jsonObject){
276 return jsonObject.stringify(simpleArrayWithProto, null, " ");
277 }
278 PASS tests[i](nativeJSON) is tests[i](JSON)
279 function (jsonObject){
280 return jsonObject.stringify(simpleArrayWithProto, null, 4);
281 }
282 PASS tests[i](nativeJSON) is tests[i](JSON)
283 function (jsonObject){
284 return jsonObject.stringify(simpleArrayWithProto, null, "ab");
285 }
286 PASS tests[i](nativeJSON) is tests[i](JSON)
287 function (jsonObject){
288 return jsonObject.stringify(simpleArrayWithProto, null, 4);
289 }
290 PASS tests[i](nativeJSON) is tests[i](JSON)
291 function (jsonObject){
292 return jsonObject.stringify(simpleObjectWithProto, null, " ");
293 }
294 PASS tests[i](nativeJSON) is tests[i](JSON)
295 function (jsonObject){
296 return jsonObject.stringify(simpleObjectWithProto, null, 4);
297 }
298 PASS tests[i](nativeJSON) is tests[i](JSON)
299 function (jsonObject){
300 return jsonObject.stringify(simpleObjectWithProto, null, "ab");
301 }
302 PASS tests[i](nativeJSON) is tests[i](JSON)
303 function (jsonObject){
304 return jsonObject.stringify(simpleObjectWithProto, null, 4);
305 }
306 PASS tests[i](nativeJSON) is tests[i](JSON)
307 function (jsonObject){
308 return jsonObject.stringify(simpleObjectWithProto, null, 10);
309 }
310 PASS tests[i](nativeJSON) is tests[i](JSON)
311 function (jsonObject){
312 return jsonObject.stringify(simpleObjectWithProto, null, 11);
313 }
314 PASS tests[i](nativeJSON) is tests[i].expected
315 function (jsonObject){
316 return jsonObject.stringify(simpleObjectWithProto, null, " ");
317 }
318 PASS tests[i](nativeJSON) is tests[i].expected
319 function (jsonObject){
320 return jsonObject.stringify(simpleObjectWithProto, null, " ");
321 }
322 PASS tests[i](nativeJSON) is tests[i].expected
323 function (jsonObject){
324 return jsonObject.stringify(complexArrayWithProto, null, " ");
325 }
326 PASS tests[i](nativeJSON) is tests[i](JSON)
327 function (jsonObject){
328 return jsonObject.stringify(complexArrayWithProto, null, 4);
329 }
330 PASS tests[i](nativeJSON) is tests[i](JSON)
331 function (jsonObject){
332 return jsonObject.stringify(complexArrayWithProto, null, "ab");
333 }
334 PASS tests[i](nativeJSON) is tests[i](JSON)
335 function (jsonObject){
336 return jsonObject.stringify(complexArrayWithProto, null, 4);
337 }
338 PASS tests[i](nativeJSON) is tests[i](JSON)
339 function (jsonObject){
340 return jsonObject.stringify(complexObjectWithProto, null, " ");
341 }
342 PASS tests[i](nativeJSON) is tests[i](JSON)
343 function (jsonObject){
344 return jsonObject.stringify(complexObjectWithProto, null, 4);
345 }
346 PASS tests[i](nativeJSON) is tests[i](JSON)
347 function (jsonObject){
348 return jsonObject.stringify(complexObjectWithProto, null, "ab");
349 }
350 PASS tests[i](nativeJSON) is tests[i](JSON)
351 function (jsonObject){
352 return jsonObject.stringify(complexObjectWithProto, null, 4);
353 }
354 PASS tests[i](nativeJSON) is tests[i](JSON)
355 function (jsonObject){
356 return jsonObject.stringify(objectWithSideEffectGetter);
357 }
358 FAIL tests[i](nativeJSON) should be {"foo":1}. Was {}.
359 function (jsonObject){
360 return jsonObject.stringify(objectWithSideEffectGetterAndProto);
361 }
362 FAIL tests[i](nativeJSON) should be {"foo":1}. Was {}.
363 function (jsonObject){
364 return jsonObject.stringify(arrayWithSideEffectGetter);
365 }
366 PASS tests[i](nativeJSON) is tests[i](JSON)
367 function (jsonObject){
368 return jsonObject.stringify(arrayWithSideEffectGetterAndProto);
369 }
370 PASS tests[i](nativeJSON) is tests[i](JSON)
371 function (jsonObject){
372 replaceTracker = "";
373 jsonObject.stringify([1,2,3,,,,4,5,6], replaceFunc);
374 return replaceTracker;
375 }
376 FAIL tests[i](nativeJSON) should be (string)[1,2,3,null,null,null,4,5,6];0(numbe r)1;1(number)2;2(number)3;3(number)undefined;4(number)undefined;5(number)undefin ed;6(number)4;7(number)5;8(number)6;. Was (string)[1,2,3,null,null,null,4,5,6];0 (string)1;1(string)2;2(string)3;3(string)undefined;4(string)undefined;5(string)u ndefined;6(string)4;7(string)5;8(string)6;.
377 function (jsonObject){
378 replaceTracker = "";
379 jsonObject.stringify({a:"a", b:"b", c:"c", 3: "d", 2: "e", 1: "f"}, repl aceFunc);
380 return replaceTracker;
381 }
382 PASS tests[i](nativeJSON) is tests[i].expected
383 function (jsonObject){
384 var count = 0;
385 var array = [{toString:function(){count++; array[0]='a'; array[1]='c'; a rray[2]='b'; return 'a'}}];
386 jsonObject.stringify(simpleObject, array);
387 return count;
388 }
389 PASS tests[i](nativeJSON) is tests[i](JSON)
390 function (jsonObject){
391 var allString = true;
392 var array = [{toString:function(){array[0]='a'; array[1]='c'; array[2]=' b'; return 'a'}}, 'b', 'c'];
393 return jsonObject.stringify(simpleObject, array);
394 }
395 PASS tests[i](nativeJSON) is tests[i](JSON)
396 function (jsonObject){
397 var count = 0;
398 var array = [{toString:function(){count++; array[0]='a'; array[1]='c'; a rray[2]='b'; return 'a'}}, 'b', 'c'];
399 jsonObject.stringify(simpleObject, array);
400 return count;
401 }
402 PASS tests[i](nativeJSON) is tests[i](JSON)
403 function (jsonObject){
404 return jsonObject.stringify({a:"1", get b() { this.a="foo"; return "gett er"; }, c:"3"});
405 }
406 PASS tests[i](nativeJSON) is tests[i](JSON)
407 function (jsonObject){
408 return jsonObject.stringify({a:"1", get b() { this.c="foo"; return "gett er"; }, c:"3"});
409 }
410 PASS tests[i](nativeJSON) is tests[i](JSON)
411 function (jsonObject){
412 var setterCalled = false;
413 jsonObject.stringify({a:"1", set b(s) { setterCalled = true; return "set ter"; }, c:"3"});
414 return setterCalled;
415 }
416 PASS tests[i](nativeJSON) is tests[i](JSON)
417 function (jsonObject){
418 return jsonObject.stringify({a:"1", get b(){ return "getter"; }, set b(s ) { return "setter"; }, c:"3"});
419 }
420 PASS tests[i](nativeJSON) is tests[i](JSON)
421 function (jsonObject){
422 return jsonObject.stringify(new Array(10));
423 }
424 PASS tests[i](nativeJSON) is tests[i](JSON)
425 function (jsonObject){
426 return jsonObject.stringify([undefined,,null,0,false]);
427 }
428 PASS tests[i](nativeJSON) is tests[i](JSON)
429 function (jsonObject){
430 return jsonObject.stringify({p1:undefined,p2:null,p3:0,p4:false});
431 }
432 PASS tests[i](nativeJSON) is tests[i](JSON)
433 function (jsonObject){
434 cycleTracker = "";
435 return jsonObject.stringify(cyclicObject);
436 }
437 PASS tests[i](nativeJSON) threw exception TypeError: Converting circular structu re to JSON.
438 function (jsonObject){
439 cycleTracker = "";
440 try { jsonObject.stringify(cyclicObject); } catch(e) { cycleTracker += " -> exception" }
441 return cycleTracker;
442 }
443 PASS tests[i](nativeJSON) is tests[i].expected
444 function (jsonObject){
445 cycleTracker = "";
446 return jsonObject.stringify(cyclicArray);
447 }
448 PASS tests[i](nativeJSON) threw exception TypeError: Converting circular structu re to JSON.
449 function (jsonObject){
450 cycleTracker = "";
451 try { jsonObject.stringify(cyclicArray); } catch(e) { cycleTracker += " -> exception" }
452 return cycleTracker;
453 }
454 FAIL tests[i](nativeJSON) should be 0(number):[object Object]first, -> exception . Was 0(string):[object Object]first, -> exception.
455 function (jsonObject){
456 getterCalls = 0;
457 return jsonObject.stringify(magicObject) + " :: getter calls = " + gette rCalls;
458 }
459 PASS tests[i](nativeJSON) is tests[i](JSON)
460 function (jsonObject){
461 return jsonObject.stringify(undefined);
462 }
463 PASS tests[i](nativeJSON) is tests[i](JSON)
464 function (jsonObject){
465 return jsonObject.stringify(null);
466 }
467 PASS tests[i](nativeJSON) is tests[i](JSON)
468 function (jsonObject){
469 return jsonObject.stringify({toJSON:function(){ return undefined; }});
470 }
471 PASS tests[i](nativeJSON) is tests[i](JSON)
472 function (jsonObject){
473 return jsonObject.stringify({toJSON:function(){ return null; }});
474 }
475 PASS tests[i](nativeJSON) is tests[i](JSON)
476 function (jsonObject){
477 return jsonObject.stringify([{toJSON:function(){ return undefined; }}]);
478 }
479 PASS tests[i](nativeJSON) is tests[i](JSON)
480 function (jsonObject){
481 return jsonObject.stringify([{toJSON:function(){ return null; }}]);
482 }
483 PASS tests[i](nativeJSON) is tests[i](JSON)
484 function (jsonObject){
485 return jsonObject.stringify({a:{toJSON:function(){ return undefined; }}} );
486 }
487 PASS tests[i](nativeJSON) is tests[i](JSON)
488 function (jsonObject){
489 return jsonObject.stringify({a:{toJSON:function(){ return null; }}});
490 }
491 PASS tests[i](nativeJSON) is tests[i](JSON)
492 function (jsonObject){
493 return jsonObject.stringify({a:{toJSON:function(){ return function(){}; }}});
494 }
495 PASS tests[i](nativeJSON) is tests[i](JSON)
496 function (jsonObject){
497 return jsonObject.stringify({a:function(){}});
498 }
499 PASS tests[i](nativeJSON) is tests[i](JSON)
500 function (jsonObject){
501 var deepObject = {};
502 for (var i = 0; i < 1024; i++)
503 deepObject = {next:deepObject};
504 return jsonObject.stringify(deepObject);
505 }
506 PASS tests[i](nativeJSON) is tests[i](JSON)
507 function (jsonObject){
508 var deepArray = [];
509 for (var i = 0; i < 1024; i++)
510 deepArray = [deepArray];
511 return jsonObject.stringify(deepArray);
512 }
513 PASS tests[i](nativeJSON) is tests[i](JSON)
514 function (jsonObject){
515 var depth = 0;
516 function toDeepVirtualJSONObject() {
517 if (++depth >= 1024)
518 return {};
519 var r = {};
520 r.toJSON = toDeepVirtualJSONObject;
521 return {recurse: r};
522 }
523 return jsonObject.stringify(toDeepVirtualJSONObject());
524 }
525 PASS tests[i](nativeJSON) is tests[i](JSON)
526 function (jsonObject){
527 var depth = 0;
528 function toDeepVirtualJSONArray() {
529 if (++depth >= 1024)
530 return [];
531 var r = [];
532 r.toJSON = toDeepJSONArray;
533 return [r];
534 }
535 return jsonObject.stringify(toDeepVirtualJSONArray());
536 }
537 function (jsonObject){
538 return jsonObject.stringify(fullCharsetString);
539 }
540 PASS tests[i](nativeJSON) is tests[i](JSON)
541 PASS successfullyParsed is true
542
543 TEST COMPLETE
544
OLDNEW
« no previous file with comments | « test/webkit/run-json-stringify.js ('k') | tools/blink_tests/TestExpectations » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698