1a86274cbcd04b4b8c5118f2cd5468138e7787a4
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / storage / indexeddb / cursor-continue-expected.txt
1 Test IndexedDB's IDBCursor.continue() with a key parameter.
2
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6 indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
7
8 dbname = "cursor-continue.html"
9 indexedDB.deleteDatabase(dbname)
10 indexedDB.open(dbname)
11 db.createObjectStore('someObjectStore')
12 objectStore.createIndex('someIndex', 'x')
13 objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
14 objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
15 objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
16 objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
17 objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
18 objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
19 objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
20 objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
21 objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
22 objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
23 objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
24 objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
25 objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
26 objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
27 objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
28 objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
29 objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
30 objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
31
32 indexObject.openKeyCursor(null, 'next')
33 PASS event.target.result.primaryKey is 0
34 event.target.result.continue(3.14159)
35 PASS event.target.result.primaryKey is 3
36 event.target.result.continue()
37 PASS event.target.result.primaryKey is 4
38 event.target.result.continue()
39 PASS event.target.result.primaryKey is 5
40 event.target.result.continue(12)
41 PASS event.target.result.primaryKey is 7
42 event.target.result.continue(date)
43 PASS event.target.result.primaryKey is 9
44 event.target.result.continue()
45 PASS event.target.result.primaryKey is 10
46 event.target.result.continue()
47 PASS event.target.result.primaryKey is 11
48 event.target.result.continue('A bit1')
49 PASS event.target.result.primaryKey is 14
50 event.target.result.continue('A bit3')
51 PASS event.target.result.primaryKey is 16
52 event.target.result.continue('the BIGGEST string')
53 PASS event.target.result.primaryKey is 17
54 event.target.result.continue()
55 PASS event.target.result is null
56
57 indexObject.openKeyCursor(null, 'prev')
58 PASS event.target.result.primaryKey is 17
59 event.target.result.continue('A bit2')
60 PASS event.target.result.primaryKey is 15
61 event.target.result.continue()
62 PASS event.target.result.primaryKey is 14
63 event.target.result.continue(date)
64 PASS event.target.result.primaryKey is 10
65 event.target.result.continue()
66 PASS event.target.result.primaryKey is 9
67 event.target.result.continue(1)
68 PASS event.target.result.primaryKey is 2
69 event.target.result.continue()
70 PASS event.target.result.primaryKey is 1
71 event.target.result.continue()
72 PASS event.target.result.primaryKey is 0
73 event.target.result.continue()
74 PASS event.target.result is null
75
76 indexObject.openKeyCursor(null, 'next')
77 PASS event.target.result.primaryKey is 0
78 event.target.result.continue(3.14159)
79 PASS event.target.result.primaryKey is 3
80 Expecting exception from event.target.result.continue(1)
81 PASS Exception was thrown.
82 PASS code is 0
83 PASS ename is 'DataError'
84 Exception message: Failed to execute 'continue' on 'IDBCursor': The parameter is less than or equal to this cursor's position.
85
86 indexObject.openKeyCursor(null, 'next')
87 PASS event.target.result.primaryKey is 0
88 event.target.result.continue(3.14159)
89 PASS event.target.result.primaryKey is 3
90 Expecting exception from event.target.result.continue(3.14159)
91 PASS Exception was thrown.
92 PASS code is 0
93 PASS ename is 'DataError'
94 Exception message: Failed to execute 'continue' on 'IDBCursor': The parameter is less than or equal to this cursor's position.
95
96 indexObject.openKeyCursor(null, 'prev')
97 PASS event.target.result.primaryKey is 17
98 event.target.result.continue('A bit2')
99 PASS event.target.result.primaryKey is 15
100 Expecting exception from event.target.result.continue('A bit3')
101 PASS Exception was thrown.
102 PASS code is 0
103 PASS ename is 'DataError'
104 Exception message: Failed to execute 'continue' on 'IDBCursor': The parameter is greater than or equal to this cursor's position.
105
106 indexObject.openKeyCursor(null, 'prev')
107 PASS event.target.result.primaryKey is 17
108 event.target.result.continue('A bit2')
109 PASS event.target.result.primaryKey is 15
110 cursor = event.target.result
111 Expecting exception from event.target.result.continue('A bit2')
112 PASS Exception was thrown.
113 PASS code is 0
114 PASS ename is 'DataError'
115 Exception message: Failed to execute 'continue' on 'IDBCursor': The parameter is greater than or equal to this cursor's position.
116 Expecting exception from cursor.continue()
117 PASS Exception was thrown.
118 PASS code is 0
119 PASS ename is 'TransactionInactiveError'
120 Exception message: Failed to execute 'continue' on 'IDBCursor': The transaction has finished.
121 PASS successfullyParsed is true
122
123 TEST COMPLETE
124