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

Side by Side Diff: LayoutTests/imported/web-platform-tests/IndexedDB/value_recursive.htm

Issue 560893005: First checked-in import of the W3C's test suites. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: add new expectations for newly failing w3c tests Created 6 years, 3 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <meta charset="utf-8">
3 <title>Recursive value</title>
4 <link rel="author" href="mailto:odinho@opera.com" title="Odin Hørthe Omdal">
5 <script src="../../../resources/testharness.js"></script>
6 <script src="../../../resources/testharnessreport.js"></script>
7 <script src="support.js"></script>
8
9 <script>
10 function recursive_value(desc, value) {
11 var db, t = async_test(document.title + " - " + desc);
12
13 createdb(t).onupgradeneeded = function(e) {
14 db = e.target.result
15 db.createObjectStore("store")
16 .add(value, 1);
17
18 e.target.onsuccess = t.step_func(function(e) {
19 db.transaction('store')
20 .objectStore('store')
21 .get(1)
22 .onsuccess = t.step_func(function(e)
23 {
24
25 try
26 {
27 var fresh_value = JSON.stringify(value);
28 assert_unreached("Testcase is written wrongly, must supply s omething recursive (that JSON won't stringify).");
29 }
30 catch (e)
31 {
32 if (e.name == 'TypeError')
33 {
34 try
35 {
36 JSON.stringify(e.target.result);
37 assert_unreached("Expected a non-JSON-serializable v alue back, didn't get that.");
38 }
39 catch (e)
40 {
41 t.done();
42 return;
43 }
44 }
45 else
46 throw e;
47 }
48 });
49 });
50 };
51 }
52
53 var recursive = [];
54 recursive.push(recursive);
55 recursive_value('array directly contains self', recursive);
56
57 var recursive2 = [];
58 recursive2.push([recursive2]);
59 recursive_value('array indirectly contains self', recursive2);
60
61 var recursive3 = [recursive];
62 recursive_value('array member contains self', recursive3);
63
64 </script>
65
66 <div id="log"></div>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698