Changeset 116337 in webkit
- Timestamp:
- May 7, 2012 12:12:00 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 148 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r116335 r116337 1 2012-05-07 Alec Flett <alecflett@chromium.org> 2 3 IndexedDB: Replace numeric constants with strings 4 https://bugs.webkit.org/show_bug.cgi?id=84894 5 6 Reviewed by Tony Chang. 7 8 New test for legacy constants (legacy-constants) and update all 9 other tests to use the new string-based constants. 10 11 * storage/indexeddb/basics-expected.txt: 12 * storage/indexeddb/basics-workers-expected.txt: 13 * storage/indexeddb/constants-expected.txt: 14 * storage/indexeddb/create-object-store-options-expected.txt: 15 * storage/indexeddb/cursor-added-bug-expected.txt: 16 * storage/indexeddb/cursor-advance-expected.txt: 17 * storage/indexeddb/cursor-continue-expected.txt: 18 * storage/indexeddb/cursor-continue-validity-expected.txt: 19 * storage/indexeddb/cursor-delete-expected.txt: 20 * storage/indexeddb/cursor-inconsistency-expected.txt: 21 * storage/indexeddb/cursor-index-delete-expected.txt: 22 * storage/indexeddb/cursor-key-order-expected.txt: 23 * storage/indexeddb/cursor-prev-no-duplicate-expected.txt: 24 * storage/indexeddb/cursor-primary-key-order-expected.txt: 25 * storage/indexeddb/cursor-reverse-bug-expected.txt: 26 * storage/indexeddb/cursor-skip-deleted-expected.txt: 27 * storage/indexeddb/cursor-update-expected.txt: 28 * storage/indexeddb/data-corruption-expected.txt: 29 * storage/indexeddb/database-quota-expected.txt: 30 * storage/indexeddb/delete-range-expected.txt: 31 * storage/indexeddb/error-causes-abort-by-default-expected.txt: 32 * storage/indexeddb/exception-in-event-aborts-expected.txt: 33 * storage/indexeddb/factory-deletedatabase-expected.txt: 34 * storage/indexeddb/index-count-expected.txt: 35 * storage/indexeddb/index-multientry-expected.txt: 36 * storage/indexeddb/index-unique-expected.txt: 37 * storage/indexeddb/key-generator-expected.txt: 38 * storage/indexeddb/key-type-array-expected.txt: 39 * storage/indexeddb/keypath-edges-expected.txt: 40 * storage/indexeddb/keypath-intrinsic-properties-expected.txt: 41 * storage/indexeddb/legacy-constants-expected.txt: Added. 42 * storage/indexeddb/legacy-constants.html: Added. 43 * storage/indexeddb/mozilla/clear-expected.txt: 44 * storage/indexeddb/mozilla/create-index-unique-expected.txt: 45 * storage/indexeddb/mozilla/create-objectstore-basics-expected.txt: 46 * storage/indexeddb/mozilla/cursor-mutation-expected.txt: 47 * storage/indexeddb/mozilla/cursor-mutation-objectstore-only-expected.txt: 48 * storage/indexeddb/mozilla/cursors-expected.txt: 49 * storage/indexeddb/mozilla/index-prev-no-duplicate-expected.txt: 50 * storage/indexeddb/mozilla/index-prev-no-duplicate.html: 51 * storage/indexeddb/mozilla/indexes-expected.txt: 52 * storage/indexeddb/mozilla/odd-result-order-expected.txt: 53 * storage/indexeddb/mozilla/readwrite-transactions-expected.txt: 54 * storage/indexeddb/mozilla/readyState-expected.txt: 55 * storage/indexeddb/mozilla/resources/clear.js: 56 (clear): 57 * storage/indexeddb/mozilla/resources/create-index-unique.js: 58 (createAndVerifyIndex): 59 * storage/indexeddb/mozilla/resources/create-objectstore-basics.js: 60 (cleanDatabase): 61 * storage/indexeddb/mozilla/resources/cursor-mutation-objectstore-only.js: 62 (checkCursorResultsAndSetupMutatingCursor): 63 * storage/indexeddb/mozilla/resources/cursor-mutation.js: 64 (setupMutatingCursor): 65 * storage/indexeddb/mozilla/resources/cursors.js: 66 * storage/indexeddb/mozilla/resources/indexes.js: 67 * storage/indexeddb/mozilla/resources/odd-result-order.js: 68 (addRecord): 69 (deleteRecord): 70 * storage/indexeddb/mozilla/resources/readwrite-transactions.js: 71 (setVersionComplete): 72 (postAdd): 73 (postAdd2): 74 (postPut): 75 (postPut2): 76 (postPut3): 77 (postPut4): 78 (postDelete): 79 (postDelete2): 80 * storage/indexeddb/mozilla/resources/readyState.js: 81 (test): 82 (openSuccess): 83 (setupObjectStore): 84 (getRecord): 85 (finalCheck): 86 * storage/indexeddb/mozilla/resources/versionchange.js: 87 (postSetVersion): 88 (postSetVersion2): 89 * storage/indexeddb/mozilla/versionchange-expected.txt: 90 * storage/indexeddb/mutating-cursor-expected.txt: 91 * storage/indexeddb/noblobs-expected.txt: 92 * storage/indexeddb/noblobs.html: 93 * storage/indexeddb/objectstore-autoincrement-expected.txt: 94 * storage/indexeddb/objectstore-basics-expected.txt: 95 * storage/indexeddb/objectstore-basics-workers-expected.txt: 96 * storage/indexeddb/objectstore-count-expected.txt: 97 * storage/indexeddb/open-cursor-expected.txt: 98 * storage/indexeddb/open-during-transaction-expected.txt: 99 * storage/indexeddb/opencursor-key-expected.txt: 100 * storage/indexeddb/prefetch-bugfix-108071-expected.txt: 101 * storage/indexeddb/readonly-expected.txt: 102 * storage/indexeddb/request-event-propagation-expected.txt: 103 * storage/indexeddb/resources/basics.js: 104 (test): 105 (openCallback): 106 * storage/indexeddb/resources/constants.js: 107 (test): 108 * storage/indexeddb/resources/create-object-store-options.js: 109 (setVersionComplete): 110 * storage/indexeddb/resources/cursor-added-bug.js: 111 (openCursor): 112 * storage/indexeddb/resources/cursor-advance.js: 113 (runTest): 114 (testAdvanceIndexNoDupe): 115 (testAdvanceIndexPrev): 116 (testAdvanceIndexPrevNoDupe): 117 * storage/indexeddb/resources/cursor-continue-validity.js: 118 (continueTest): 119 (continueIndexTest): 120 (testModifyContinueOrder): 121 * storage/indexeddb/resources/cursor-continue.js: 122 (ascendingTest): 123 (descendingTest): 124 * storage/indexeddb/resources/cursor-delete.js: 125 (openCursor): 126 (addObject): 127 * storage/indexeddb/resources/cursor-inconsistency.js: 128 (openBasicCursor): 129 * storage/indexeddb/resources/cursor-index-delete.js: 130 (openCursor): 131 (addObject): 132 * storage/indexeddb/resources/cursor-key-order.js: 133 * storage/indexeddb/resources/cursor-prev-no-duplicate.js: 134 (populateStore): 135 (testFarRangeCursor_closed): 136 (testFarRangeCursor_open): 137 (testFarRangeCursor_indexClosed): 138 (testFarRangeCursor_indexOpen): 139 (testFarRangeCursor_indexKeyOpen): 140 (testFarRangeCursor_indexKeyClosed): 141 (testBoundaryCursor_closed): 142 (testBoundaryCursor_open): 143 (testBoundaryCursor_indexClosed): 144 (testBoundaryCursor_indexOpen): 145 (testBoundaryCursor_indexKeyClosed): 146 (testBoundaryCursor_indexKeyOpen): 147 (testNoDuplicate_closed): 148 (testNoDuplicate_open): 149 (testNoDuplicate_indexKeyClosed): 150 * storage/indexeddb/resources/cursor-primary-key-order.js: 151 (populateStore): 152 * storage/indexeddb/resources/cursor-reverse-bug.js: 153 (populateStore): 154 (testCursor): 155 * storage/indexeddb/resources/cursor-skip-deleted.js: 156 (basicCursorTest): 157 (reverseCursorTest): 158 * storage/indexeddb/resources/cursor-update.js: 159 (openBasicCursor): 160 * storage/indexeddb/resources/data-corruption.js: 161 (addData): 162 (getData): 163 * storage/indexeddb/resources/database-quota.js: 164 (checkQuotaEnforcing): 165 * storage/indexeddb/resources/delete-range.js: 166 (runTests.nextTest): 167 (runTests): 168 * storage/indexeddb/resources/error-causes-abort-by-default.js: 169 (addData): 170 (transactionCompleted): 171 (transactionAborted1): 172 * storage/indexeddb/resources/exception-in-event-aborts.js: 173 (startTest): 174 (transactionAborted1): 175 (transactionAborted2): 176 * storage/indexeddb/resources/factory-deletedatabase.js: 177 (getValue): 178 * storage/indexeddb/resources/index-count.js: 179 * storage/indexeddb/resources/index-cursor.js: 180 (runNextTest): 181 (testNullKeyRange): 182 * storage/indexeddb/resources/index-multientry.js: 183 * storage/indexeddb/resources/index-unique.js: 184 (setVersionCompleted): 185 * storage/indexeddb/resources/key-generator.js: 186 (.): 187 * storage/indexeddb/resources/key-type-array.js: 188 * storage/indexeddb/resources/keypath-edges.js: 189 * storage/indexeddb/resources/keypath-intrinsic-properties.js: 190 * storage/indexeddb/resources/legacy-constants.js: Added. 191 (test): 192 (prepareDatabase.openreq.onsuccess.verreq.onsuccess): 193 (prepareDatabase.openreq.onsuccess): 194 (prepareDatabase): 195 (populateStore): 196 (checkNext.request.onsuccess): 197 (checkNext): 198 (checkNextNoDuplicate.request.onsuccess): 199 (checkNextNoDuplicate): 200 (checkPrev.request.onsuccess): 201 (checkPrev): 202 (checkPrevNoDuplicate.request.onsuccess): 203 (checkPrevNoDuplicate): 204 * storage/indexeddb/resources/mutating-cursor.js: 205 (openForwardCursor): 206 (openReverseCursor): 207 * storage/indexeddb/resources/objectstore-autoincrement.js: 208 (setVersionCompleted): 209 * storage/indexeddb/resources/objectstore-basics.js: 210 (addData): 211 (addAgainFailure): 212 * storage/indexeddb/resources/objectstore-count.js: 213 * storage/indexeddb/resources/objectstore-cursor.js: 214 (runNextTest): 215 (testNullKeyRange): 216 * storage/indexeddb/resources/open-cursor.js: 217 (cursorWithKeySuccess): 218 (cursorSuccess): 219 * storage/indexeddb/resources/open-during-transaction.js: 220 * storage/indexeddb/resources/opencursor-key.js: 221 * storage/indexeddb/resources/prefetch-bugfix-108071.js: 222 * storage/indexeddb/resources/request-event-propagation.js: 223 (startTest): 224 (transactionAborted): 225 (transactionAborted2): 226 * storage/indexeddb/resources/set_version_blocked.js: 227 (blocked): 228 * storage/indexeddb/resources/transaction-abort.js: 229 (startTest): 230 * storage/indexeddb/resources/transaction-after-close.js: 231 (runFirstRegularTransaction): 232 (firstTransactionComplete): 233 (onSecondOpen): 234 * storage/indexeddb/resources/transaction-basics.js: 235 (testInvalidMode): 236 * storage/indexeddb/resources/transaction-event-propagation.js: 237 (startTest): 238 (dbAbortBubbleCallback): 239 * storage/indexeddb/resources/transaction-rollback.js: 240 (setVersionComplete): 241 (abortCallback): 242 * storage/indexeddb/set_version_blocked-expected.txt: 243 * storage/indexeddb/structured-clone-expected.txt: 244 * storage/indexeddb/structured-clone.html: 245 * storage/indexeddb/transaction-abort-expected.txt: 246 * storage/indexeddb/transaction-abort-with-js-recursion-cross-frame-expected.txt: 247 * storage/indexeddb/transaction-abort-with-js-recursion-cross-frame.html: 248 * storage/indexeddb/transaction-abort-with-js-recursion-expected.txt: 249 * storage/indexeddb/transaction-abort-with-js-recursion.html: 250 * storage/indexeddb/transaction-after-close-expected.txt: 251 * storage/indexeddb/transaction-basics-expected.txt: 252 * storage/indexeddb/transaction-event-propagation-expected.txt: 253 * storage/indexeddb/transaction-rollback-expected.txt: 254 * storage/indexeddb/tutorial.html: 255 1 256 2012-05-07 Adam Barth <abarth@webkit.org> 2 257 -
trunk/LayoutTests/http/tests/inspector/indexeddb/indexeddb-test.js
r116051 r116337 154 154 function step2(db) 155 155 { 156 var transaction = db.transaction([objectStoreName], IDBTransaction.READ_WRITE);156 var transaction = db.transaction([objectStoreName], 'readwrite'); 157 157 var objectStore = transaction.objectStore(objectStoreName); 158 158 callback(objectStore, innerCommitCallback); -
trunk/LayoutTests/storage/indexeddb/basics-expected.txt
r116051 r116337 24 24 PASS request.transaction is null 25 25 PASS 'readyState' in request is true 26 PASS request.readyState is IDBRequest.LOADING26 PASS request.readyState is 'pending' 27 27 PASS 'onsuccess' in request is true 28 28 PASS request.onsuccess is null 29 29 PASS 'onerror' in request is true 30 30 PASS request.onerror is null 31 PASS request.LOADING is 132 PASS request.DONE is 233 31 PASS 'result' in event.target is true 34 32 PASS !!event.target.result is true … … 42 40 PASS event.target.transaction is null 43 41 PASS 'readyState' in request is true 44 PASS event.target.readyState is IDBRequest.DONE42 PASS event.target.readyState is 'done' 45 43 PASS 'onsuccess' in event.target is true 46 44 PASS 'onerror' in event.target is true 47 PASS event.target.LOADING is 148 PASS event.target.DONE is 249 45 PASS successfullyParsed is true 50 46 -
trunk/LayoutTests/storage/indexeddb/basics-shared-workers-expected.txt
r112490 r116337 25 25 PASS [Worker] request.transaction is null 26 26 PASS [Worker] 'readyState' in request is true 27 PASS [Worker] request.readyState is IDBRequest.LOADING27 PASS [Worker] request.readyState is 'pending' 28 28 PASS [Worker] 'onsuccess' in request is true 29 29 PASS [Worker] request.onsuccess is null 30 30 PASS [Worker] 'onerror' in request is true 31 31 PASS [Worker] request.onerror is null 32 PASS [Worker] request.LOADING is 133 PASS [Worker] request.DONE is 234 32 PASS [Worker] 'result' in event.target is true 35 33 PASS [Worker] !!event.target.result is true … … 43 41 PASS [Worker] event.target.transaction is null 44 42 PASS [Worker] 'readyState' in request is true 45 PASS [Worker] event.target.readyState is IDBRequest.DONE43 PASS [Worker] event.target.readyState is 'done' 46 44 PASS [Worker] 'onsuccess' in event.target is true 47 45 PASS [Worker] 'onerror' in event.target is true 48 PASS [Worker] event.target.LOADING is 149 PASS [Worker] event.target.DONE is 250 46 PASS successfullyParsed is true 51 47 -
trunk/LayoutTests/storage/indexeddb/basics-workers-expected.txt
r116051 r116337 25 25 PASS [Worker] request.transaction is null 26 26 PASS [Worker] 'readyState' in request is true 27 PASS [Worker] request.readyState is IDBRequest.LOADING27 PASS [Worker] request.readyState is 'pending' 28 28 PASS [Worker] 'onsuccess' in request is true 29 29 PASS [Worker] request.onsuccess is null 30 30 PASS [Worker] 'onerror' in request is true 31 31 PASS [Worker] request.onerror is null 32 PASS [Worker] request.LOADING is 133 PASS [Worker] request.DONE is 234 32 PASS [Worker] 'result' in event.target is true 35 33 PASS [Worker] !!event.target.result is true … … 43 41 PASS [Worker] event.target.transaction is null 44 42 PASS [Worker] 'readyState' in request is true 45 PASS [Worker] event.target.readyState is IDBRequest.DONE43 PASS [Worker] event.target.readyState is 'done' 46 44 PASS [Worker] 'onsuccess' in event.target is true 47 45 PASS [Worker] 'onerror' in event.target is true 48 PASS [Worker] event.target.LOADING is 149 PASS [Worker] event.target.DONE is 250 46 PASS successfullyParsed is true 51 47 -
trunk/LayoutTests/storage/indexeddb/constants-expected.txt
r116051 r116337 18 18 PASS IDBDatabaseException.QUOTA_ERR is 11 19 19 PASS IDBDatabaseException.VER_ERR is 12 20 PASS IDBRequest.LOADING is 121 PASS IDBRequest.DONE is 222 20 PASS IDBCursor.NEXT is 0 23 21 PASS IDBCursor.NEXT_NO_DUPLICATE is 1 -
trunk/LayoutTests/storage/indexeddb/create-object-store-options-expected.txt
r116051 r116337 13 13 db.createObjectStore('b') 14 14 db.createObjectStore('c', {autoIncrement: true}); 15 trans = db.transaction(['a', 'b'], IDBTransaction.READ_WRITE)16 PASS trans.mode is IDBTransaction.READ_WRITE15 trans = db.transaction(['a', 'b'], 'readwrite') 16 PASS trans.mode is 'readwrite' 17 17 trans.objectStore('a').put({'a': 0}) 18 18 Expecting TypeError exception from db.createObjectStore('d', 'bar'); -
trunk/LayoutTests/storage/indexeddb/cursor-added-bug-expected.txt
r116051 r116337 16 16 objectStore.add(2, 2) 17 17 objectStore.add(3, 3) 18 trans = db.transaction(['test'], IDBTransaction.READ_WRITE)18 trans = db.transaction(['test'], 'readwrite') 19 19 trans.objectStore('test').openCursor() 20 20 PASS event.target.result.key is 1 -
trunk/LayoutTests/storage/indexeddb/cursor-advance-expected.txt
r116051 r116337 34 34 trans = db.transaction(objectStoreName) 35 35 store = trans.objectStore(objectStoreName) 36 request = store.openCursor( null, null)36 request = store.openCursor() 37 37 cursor.advance(1) 38 PASS '{"key":"237-23-7733","value":{"name":"Ann","height":52,"weight":110},"primaryKey":"237-23-7733"}'is '{"key":"237-23-7733","value":{"name":"Ann","height":52,"weight":110},"primaryKey":"237-23-7733"}'38 PASS expected is '{"key":"237-23-7733","value":{"name":"Ann","height":52,"weight":110},"primaryKey":"237-23-7733"}' 39 39 testContinueThenAdvance() 40 40 trans = db.transaction(objectStoreName) 41 41 store = trans.objectStore(objectStoreName) 42 request = store.openCursor( null, null)42 request = store.openCursor() 43 43 cursor.continue(); 44 44 cursor.continue(); 45 45 cursor.continue(); 46 46 cursor.advance(1) 47 PASS '{"key":"237-23-7736","value":{"name":"Joe","height":65,"weight":150},"primaryKey":"237-23-7736"}'is '{"key":"237-23-7736","value":{"name":"Joe","height":65,"weight":150},"primaryKey":"237-23-7736"}'47 PASS expected is '{"key":"237-23-7736","value":{"name":"Joe","height":65,"weight":150},"primaryKey":"237-23-7736"}' 48 48 testAdvanceMultiple() 49 49 trans = db.transaction(objectStoreName) 50 50 store = trans.objectStore(objectStoreName) 51 request = store.openCursor( null, null)51 request = store.openCursor() 52 52 cursor.advance(3) 53 PASS '{"key":"237-23-7735","value":{"name":"Sue","height":58,"weight":130},"primaryKey":"237-23-7735"}'is '{"key":"237-23-7735","value":{"name":"Sue","height":58,"weight":130},"primaryKey":"237-23-7735"}'53 PASS expected is '{"key":"237-23-7735","value":{"name":"Sue","height":58,"weight":130},"primaryKey":"237-23-7735"}' 54 54 testAdvanceIndex() 55 55 trans = db.transaction(objectStoreName) 56 56 store = trans.objectStore(objectStoreName) 57 request = store.openCursor( null, null)57 request = store.openCursor() 58 58 cursor.advance(3) 59 PASS '{"key":"Jef","value":{"name":"Jef","height":65,"weight":120},"primaryKey":"237-23-7739"}'is '{"key":"Jef","value":{"name":"Jef","height":65,"weight":120},"primaryKey":"237-23-7739"}'59 PASS expected is '{"key":"Jef","value":{"name":"Jef","height":65,"weight":120},"primaryKey":"237-23-7739"}' 60 60 testAdvanceIndexNoDupe() 61 61 trans = db.transaction(objectStoreName) 62 62 store = trans.objectStore(objectStoreName) 63 request = store.openCursor(null, 1)63 request = store.openCursor(null, 'nextunique') 64 64 cursor.advance(3) 65 PASS '{"key":130,"value":{"name":"Sue","height":58,"weight":130},"primaryKey":"237-23-7735"}'is '{"key":130,"value":{"name":"Sue","height":58,"weight":130},"primaryKey":"237-23-7735"}'65 PASS expected is '{"key":130,"value":{"name":"Sue","height":58,"weight":130},"primaryKey":"237-23-7735"}' 66 66 testAdvanceIndexPrev() 67 67 trans = db.transaction(objectStoreName) 68 68 store = trans.objectStore(objectStoreName) 69 request = store.openCursor(null, 2)69 request = store.openCursor(null, 'prev') 70 70 cursor.advance(3) 71 PASS '{"key":150,"value":{"name":"Joe","height":65,"weight":150},"primaryKey":"237-23-7736"}'is '{"key":150,"value":{"name":"Joe","height":65,"weight":150},"primaryKey":"237-23-7736"}'71 PASS expected is '{"key":150,"value":{"name":"Joe","height":65,"weight":150},"primaryKey":"237-23-7736"}' 72 72 testAdvanceIndexPrevNoDupe() 73 73 trans = db.transaction(objectStoreName) 74 74 store = trans.objectStore(objectStoreName) 75 request = store.openCursor(null, 3)75 request = store.openCursor(null, 'prevunique') 76 76 cursor.advance(3) 77 PASS '{"key":120,"value":{"name":"Bob","height":60,"weight":120},"primaryKey":"237-23-7732"}'is '{"key":120,"value":{"name":"Bob","height":60,"weight":120},"primaryKey":"237-23-7732"}'77 PASS expected is '{"key":120,"value":{"name":"Bob","height":60,"weight":120},"primaryKey":"237-23-7732"}' 78 78 testAdvanceToEnd() 79 79 trans = db.transaction(objectStoreName) 80 80 store = trans.objectStore(objectStoreName) 81 request = store.openCursor( null, null)81 request = store.openCursor() 82 82 cursor.advance(100) 83 PASS 'null'is 'null'83 PASS expected is 'null' 84 84 testPrefetchInRange() 85 85 trans = db.transaction(objectStoreName) 86 86 objectStore = trans.objectStore(objectStoreName) 87 87 request = objectStore.openCursor() 88 PASS '{"key":"237-23-7732","value":{"name":"Bob","height":60,"weight":120},"primaryKey":"237-23-7732"}'is '{"key":"237-23-7732","value":{"name":"Bob","height":60,"weight":120},"primaryKey":"237-23-7732"}'88 PASS expected is '{"key":"237-23-7732","value":{"name":"Bob","height":60,"weight":120},"primaryKey":"237-23-7732"}' 89 89 cursor.continue() 90 PASS '{"key":"237-23-7733","value":{"name":"Ann","height":52,"weight":110},"primaryKey":"237-23-7733"}'is '{"key":"237-23-7733","value":{"name":"Ann","height":52,"weight":110},"primaryKey":"237-23-7733"}'90 PASS expected is '{"key":"237-23-7733","value":{"name":"Ann","height":52,"weight":110},"primaryKey":"237-23-7733"}' 91 91 cursor.continue() 92 PASS '{"key":"237-23-7734","value":{"name":"Ron","height":73,"weight":180},"primaryKey":"237-23-7734"}'is '{"key":"237-23-7734","value":{"name":"Ron","height":73,"weight":180},"primaryKey":"237-23-7734"}'92 PASS expected is '{"key":"237-23-7734","value":{"name":"Ron","height":73,"weight":180},"primaryKey":"237-23-7734"}' 93 93 cursor.continue() 94 PASS '{"key":"237-23-7735","value":{"name":"Sue","height":58,"weight":130},"primaryKey":"237-23-7735"}'is '{"key":"237-23-7735","value":{"name":"Sue","height":58,"weight":130},"primaryKey":"237-23-7735"}'94 PASS expected is '{"key":"237-23-7735","value":{"name":"Sue","height":58,"weight":130},"primaryKey":"237-23-7735"}' 95 95 cursor.advance(2) 96 PASS '{"key":"237-23-7737","value":{"name":"Pat","height":65,"weight":100},"primaryKey":"237-23-7737"}'is '{"key":"237-23-7737","value":{"name":"Pat","height":65,"weight":100},"primaryKey":"237-23-7737"}'96 PASS expected is '{"key":"237-23-7737","value":{"name":"Pat","height":65,"weight":100},"primaryKey":"237-23-7737"}' 97 97 cursor.continue() 98 PASS '{"key":"237-23-7738","value":{"name":"Leo","height":65,"weight":180},"primaryKey":"237-23-7738"}'is '{"key":"237-23-7738","value":{"name":"Leo","height":65,"weight":180},"primaryKey":"237-23-7738"}'98 PASS expected is '{"key":"237-23-7738","value":{"name":"Leo","height":65,"weight":180},"primaryKey":"237-23-7738"}' 99 99 cursor.continue() 100 PASS '{"key":"237-23-7739","value":{"name":"Jef","height":65,"weight":120},"primaryKey":"237-23-7739"}'is '{"key":"237-23-7739","value":{"name":"Jef","height":65,"weight":120},"primaryKey":"237-23-7739"}'100 PASS expected is '{"key":"237-23-7739","value":{"name":"Jef","height":65,"weight":120},"primaryKey":"237-23-7739"}' 101 101 cursor.continue() 102 PASS '{"key":"237-23-7740","value":{"name":"Sam","height":71,"weight":110},"primaryKey":"237-23-7740"}'is '{"key":"237-23-7740","value":{"name":"Sam","height":71,"weight":110},"primaryKey":"237-23-7740"}'102 PASS expected is '{"key":"237-23-7740","value":{"name":"Sam","height":71,"weight":110},"primaryKey":"237-23-7740"}' 103 103 cursor.continue() 104 PASS '{"key":"237-23-7741","value":{"name":"Bug","height":63,"weight":100},"primaryKey":"237-23-7741"}'is '{"key":"237-23-7741","value":{"name":"Bug","height":63,"weight":100},"primaryKey":"237-23-7741"}'104 PASS expected is '{"key":"237-23-7741","value":{"name":"Bug","height":63,"weight":100},"primaryKey":"237-23-7741"}' 105 105 cursor.continue() 106 PASS '{"key":"237-23-7742","value":{"name":"Tub","height":69,"weight":180},"primaryKey":"237-23-7742"}'is '{"key":"237-23-7742","value":{"name":"Tub","height":69,"weight":180},"primaryKey":"237-23-7742"}'106 PASS expected is '{"key":"237-23-7742","value":{"name":"Tub","height":69,"weight":180},"primaryKey":"237-23-7742"}' 107 107 cursor.continue() 108 PASS '{"key":"237-23-7743","value":{"name":"Rug","height":77,"weight":120},"primaryKey":"237-23-7743"}'is '{"key":"237-23-7743","value":{"name":"Rug","height":77,"weight":120},"primaryKey":"237-23-7743"}'108 PASS expected is '{"key":"237-23-7743","value":{"name":"Rug","height":77,"weight":120},"primaryKey":"237-23-7743"}' 109 109 cursor.continue() 110 PASS '{"key":"237-23-7744","value":{"name":"Pug","height":66,"weight":110},"primaryKey":"237-23-7744"}'is '{"key":"237-23-7744","value":{"name":"Pug","height":66,"weight":110},"primaryKey":"237-23-7744"}'110 PASS expected is '{"key":"237-23-7744","value":{"name":"Pug","height":66,"weight":110},"primaryKey":"237-23-7744"}' 111 111 cursor.continue() 112 112 testPrefetchOutOfRange() … … 114 114 objectStore = trans.objectStore(objectStoreName) 115 115 request = objectStore.openCursor() 116 PASS '{"key":"237-23-7732","value":{"name":"Bob","height":60,"weight":120},"primaryKey":"237-23-7732"}'is '{"key":"237-23-7732","value":{"name":"Bob","height":60,"weight":120},"primaryKey":"237-23-7732"}'116 PASS expected is '{"key":"237-23-7732","value":{"name":"Bob","height":60,"weight":120},"primaryKey":"237-23-7732"}' 117 117 cursor.continue() 118 PASS '{"key":"237-23-7733","value":{"name":"Ann","height":52,"weight":110},"primaryKey":"237-23-7733"}'is '{"key":"237-23-7733","value":{"name":"Ann","height":52,"weight":110},"primaryKey":"237-23-7733"}'118 PASS expected is '{"key":"237-23-7733","value":{"name":"Ann","height":52,"weight":110},"primaryKey":"237-23-7733"}' 119 119 cursor.continue() 120 PASS '{"key":"237-23-7734","value":{"name":"Ron","height":73,"weight":180},"primaryKey":"237-23-7734"}'is '{"key":"237-23-7734","value":{"name":"Ron","height":73,"weight":180},"primaryKey":"237-23-7734"}'120 PASS expected is '{"key":"237-23-7734","value":{"name":"Ron","height":73,"weight":180},"primaryKey":"237-23-7734"}' 121 121 cursor.continue() 122 PASS '{"key":"237-23-7735","value":{"name":"Sue","height":58,"weight":130},"primaryKey":"237-23-7735"}'is '{"key":"237-23-7735","value":{"name":"Sue","height":58,"weight":130},"primaryKey":"237-23-7735"}'122 PASS expected is '{"key":"237-23-7735","value":{"name":"Sue","height":58,"weight":130},"primaryKey":"237-23-7735"}' 123 123 cursor.advance(7) 124 PASS '{"key":"237-23-7742","value":{"name":"Tub","height":69,"weight":180},"primaryKey":"237-23-7742"}'is '{"key":"237-23-7742","value":{"name":"Tub","height":69,"weight":180},"primaryKey":"237-23-7742"}'124 PASS expected is '{"key":"237-23-7742","value":{"name":"Tub","height":69,"weight":180},"primaryKey":"237-23-7742"}' 125 125 cursor.continue() 126 PASS '{"key":"237-23-7743","value":{"name":"Rug","height":77,"weight":120},"primaryKey":"237-23-7743"}'is '{"key":"237-23-7743","value":{"name":"Rug","height":77,"weight":120},"primaryKey":"237-23-7743"}'126 PASS expected is '{"key":"237-23-7743","value":{"name":"Rug","height":77,"weight":120},"primaryKey":"237-23-7743"}' 127 127 cursor.continue() 128 PASS '{"key":"237-23-7744","value":{"name":"Pug","height":66,"weight":110},"primaryKey":"237-23-7744"}'is '{"key":"237-23-7744","value":{"name":"Pug","height":66,"weight":110},"primaryKey":"237-23-7744"}'128 PASS expected is '{"key":"237-23-7744","value":{"name":"Pug","height":66,"weight":110},"primaryKey":"237-23-7744"}' 129 129 cursor.continue() 130 130 testBadAdvance() 131 trans = db.transaction(objectStoreName, IDBTransaction.READ_WRITE)131 trans = db.transaction(objectStoreName, 'readwrite') 132 132 objectStore = trans.objectStore(objectStoreName) 133 133 request = objectStore.openCursor() … … 136 136 PASS code is DOMException.TYPE_MISMATCH_ERR 137 137 testDelete() 138 trans = db.transaction(objectStoreName, IDBTransaction.READ_WRITE)138 trans = db.transaction(objectStoreName, 'readwrite') 139 139 objectStore = trans.objectStore(objectStoreName) 140 140 request = objectStore.openCursor() 141 PASS '{"key":"237-23-7732","value":{"name":"Bob","height":60,"weight":120},"primaryKey":"237-23-7732"}'is '{"key":"237-23-7732","value":{"name":"Bob","height":60,"weight":120},"primaryKey":"237-23-7732"}'141 PASS expected is '{"key":"237-23-7732","value":{"name":"Bob","height":60,"weight":120},"primaryKey":"237-23-7732"}' 142 142 cursor.advance(1) 143 PASS '{"key":"237-23-7733","value":{"name":"Ann","height":52,"weight":110},"primaryKey":"237-23-7733"}'is '{"key":"237-23-7733","value":{"name":"Ann","height":52,"weight":110},"primaryKey":"237-23-7733"}'143 PASS expected is '{"key":"237-23-7733","value":{"name":"Ann","height":52,"weight":110},"primaryKey":"237-23-7733"}' 144 144 cursor.advance(1) 145 PASS '{"key":"237-23-7734","value":{"name":"Ron","height":73,"weight":180},"primaryKey":"237-23-7734"}'is '{"key":"237-23-7734","value":{"name":"Ron","height":73,"weight":180},"primaryKey":"237-23-7734"}'145 PASS expected is '{"key":"237-23-7734","value":{"name":"Ron","height":73,"weight":180},"primaryKey":"237-23-7734"}' 146 146 cursor.delete() 147 PASS '{"key":"237-23-7738","value":{"name":"Leo","height":65,"weight":180},"primaryKey":"237-23-7738"}'is '{"key":"237-23-7738","value":{"name":"Leo","height":65,"weight":180},"primaryKey":"237-23-7738"}'147 PASS expected is '{"key":"237-23-7738","value":{"name":"Leo","height":65,"weight":180},"primaryKey":"237-23-7738"}' 148 148 cursor.advance(1) 149 PASS '{"key":"237-23-7739","value":{"name":"Jef","height":65,"weight":120},"primaryKey":"237-23-7739"}'is '{"key":"237-23-7739","value":{"name":"Jef","height":65,"weight":120},"primaryKey":"237-23-7739"}'149 PASS expected is '{"key":"237-23-7739","value":{"name":"Jef","height":65,"weight":120},"primaryKey":"237-23-7739"}' 150 150 cursor.advance(1) 151 PASS '{"key":"237-23-7740","value":{"name":"Sam","height":71,"weight":110},"primaryKey":"237-23-7740"}'is '{"key":"237-23-7740","value":{"name":"Sam","height":71,"weight":110},"primaryKey":"237-23-7740"}'151 PASS expected is '{"key":"237-23-7740","value":{"name":"Sam","height":71,"weight":110},"primaryKey":"237-23-7740"}' 152 152 cursor.advance(1) 153 PASS '{"key":"237-23-7741","value":{"name":"Bug","height":63,"weight":100},"primaryKey":"237-23-7741"}'is '{"key":"237-23-7741","value":{"name":"Bug","height":63,"weight":100},"primaryKey":"237-23-7741"}'153 PASS expected is '{"key":"237-23-7741","value":{"name":"Bug","height":63,"weight":100},"primaryKey":"237-23-7741"}' 154 154 cursor.advance(1) 155 PASS '{"key":"237-23-7742","value":{"name":"Tub","height":69,"weight":180},"primaryKey":"237-23-7742"}'is '{"key":"237-23-7742","value":{"name":"Tub","height":69,"weight":180},"primaryKey":"237-23-7742"}'155 PASS expected is '{"key":"237-23-7742","value":{"name":"Tub","height":69,"weight":180},"primaryKey":"237-23-7742"}' 156 156 cursor.advance(1) 157 PASS '{"key":"237-23-7743","value":{"name":"Rug","height":77,"weight":120},"primaryKey":"237-23-7743"}'is '{"key":"237-23-7743","value":{"name":"Rug","height":77,"weight":120},"primaryKey":"237-23-7743"}'157 PASS expected is '{"key":"237-23-7743","value":{"name":"Rug","height":77,"weight":120},"primaryKey":"237-23-7743"}' 158 158 cursor.advance(1) 159 PASS '{"key":"237-23-7744","value":{"name":"Pug","height":66,"weight":110},"primaryKey":"237-23-7744"}'is '{"key":"237-23-7744","value":{"name":"Pug","height":66,"weight":110},"primaryKey":"237-23-7744"}'159 PASS expected is '{"key":"237-23-7744","value":{"name":"Pug","height":66,"weight":110},"primaryKey":"237-23-7744"}' 160 160 cursor.advance(1) 161 161 PASS successfullyParsed is true -
trunk/LayoutTests/storage/indexeddb/cursor-continue-expected.txt
r116051 r116337 33 33 objectStore.add({'x': testData[nextToAdd]}, nextToAdd) 34 34 35 indexObject.openKeyCursor(null, IDBCursor.NEXT)35 indexObject.openKeyCursor(null, 'next') 36 36 PASS event.target.result.primaryKey is 0 37 37 event.target.result.continue(3.14159) … … 58 58 PASS event.target.result is null 59 59 60 indexObject.openKeyCursor(null, IDBCursor.PREV)60 indexObject.openKeyCursor(null, 'prev') 61 61 PASS event.target.result.primaryKey is 17 62 62 event.target.result.continue('A bit2') … … 77 77 PASS event.target.result is null 78 78 79 indexObject.openKeyCursor(null, IDBCursor.NEXT)79 indexObject.openKeyCursor(null, 'next') 80 80 PASS event.target.result.primaryKey is 0 81 81 event.target.result.continue(3.14159) … … 85 85 PASS code is IDBDatabaseException.DATA_ERR 86 86 87 indexObject.openKeyCursor(null, IDBCursor.NEXT)87 indexObject.openKeyCursor(null, 'next') 88 88 PASS event.target.result.primaryKey is 0 89 89 event.target.result.continue(3.14159) … … 93 93 PASS code is IDBDatabaseException.DATA_ERR 94 94 95 indexObject.openKeyCursor(null, IDBCursor.PREV)95 indexObject.openKeyCursor(null, 'prev') 96 96 PASS event.target.result.primaryKey is 17 97 97 event.target.result.continue('A bit2') … … 101 101 PASS code is IDBDatabaseException.DATA_ERR 102 102 103 indexObject.openKeyCursor(null, IDBCursor.PREV)103 indexObject.openKeyCursor(null, 'prev') 104 104 PASS event.target.result.primaryKey is 17 105 105 event.target.result.continue('A bit2') -
trunk/LayoutTests/storage/indexeddb/cursor-continue-validity-expected.txt
r116051 r116337 43 43 Checking objectStore 44 44 ==================== 45 indexObject.openCursor(null, IDBCursor.NEXT)45 indexObject.openCursor(null, 'next') 46 46 self.continueValue = 0 47 47 doubleContinueCallback() … … 401 401 Checking index 402 402 ============== 403 indexObject.openCursor(null, IDBCursor.NEXT)403 indexObject.openCursor(null, 'next') 404 404 self.continueValue = 0 405 405 cursor = event.target.result … … 733 733 Checking modification 734 734 ===================== 735 indexObject.openCursor(null, IDBCursor.NEXT)735 indexObject.openCursor(null, 'next') 736 736 self.continueValue = 0 737 737 cursor = event.target.result -
trunk/LayoutTests/storage/indexeddb/cursor-delete-expected.txt
r116051 r116337 19 19 objectStore.add('myValue4', 'myKey4') 20 20 openCursor1 21 trans = db.transaction(['test'], IDBTransaction.READ_WRITE)21 trans = db.transaction(['test'], 'readwrite') 22 22 trans.objectStore('test').openCursor(keyRange) 23 23 event.target.result.delete() … … 36 36 trans.objectStore('test').openCursor(keyRange) 37 37 PASS event.target.result is null 38 trans = db.transaction(['test'], IDBTransaction.READ_WRITE)38 trans = db.transaction(['test'], 'readwrite') 39 39 objectStore = trans.objectStore('test') 40 40 objectStore.add('myValue1', 'myKey1') -
trunk/LayoutTests/storage/indexeddb/cursor-inconsistency-expected.txt
r116051 r116337 19 19 objectStore.add('someValue4', 'someKey4').onerror = unexpectedErrorCallback 20 20 openBasicCursor() 21 trans = db.transaction(['basicStore'], IDBTransaction.READ_WRITE)21 trans = db.transaction(['basicStore'], 'readwrite') 22 22 trans.objectStore('basicStore') 23 23 objectStore.openCursor(keyRange) -
trunk/LayoutTests/storage/indexeddb/cursor-index-delete-expected.txt
r116051 r116337 20 20 objectStore.add({x: 4}, 'myKey4') 21 21 openCursor1 22 trans = db.transaction(['test'], IDBTransaction.READ_WRITE)22 trans = db.transaction(['test'], 'readwrite') 23 23 trans.objectStore('test').index('testIndex').openCursor(keyRange) 24 24 event.target.result.delete() … … 37 37 trans.objectStore('test').index('testIndex').openCursor(keyRange) 38 38 PASS event.target.result is null 39 trans = db.transaction(['test'], IDBTransaction.READ_WRITE)39 trans = db.transaction(['test'], 'readwrite') 40 40 objectStore = trans.objectStore('test') 41 41 objectStore.add({x: 1}, 'myKey1') -
trunk/LayoutTests/storage/indexeddb/cursor-key-order-expected.txt
r116051 r116337 13 13 14 14 populating store... 15 trans = db.transaction('store', IDBTransaction.READ_WRITE)15 trans = db.transaction('store', 'readwrite') 16 16 store = trans.objectStore('store'); 17 17 store.put(0, -Infinity) … … 67 67 68 68 iterating cursor... 69 trans = db.transaction('store', IDBTransaction.READ_ONLY)69 trans = db.transaction('store', 'readonly') 70 70 store = trans.objectStore('store'); 71 71 count = 0 -
trunk/LayoutTests/storage/indexeddb/cursor-prev-no-duplicate-expected.txt
r116051 r116337 15 15 16 16 populating store... 17 trans = db.transaction('store', IDBTransaction.READ_WRITE)17 trans = db.transaction('store', 'readwrite') 18 18 store = trans.objectStore('store'); 19 19 store.put({sorted: 3, value: 111}, 1) … … 24 24 store.put({sorted: 10, value: 666}, 15) 25 25 testFarRangeCursor: upper bound is well out of range, results always the same, whether open or closed 26 storeReq = store.openCursor(IDBKeyRange.upperBound(7, false), 2)26 storeReq = store.openCursor(IDBKeyRange.upperBound(7, false), 'prev') 27 27 28 Testing: store.openCursor(IDBKeyRange.upperBound(7, false), 2)28 Testing: store.openCursor(IDBKeyRange.upperBound(7, false), 'prev') 29 29 PASS cursor.key is 3 30 30 PASS cursor.value.value is 333 31 storeReq = store.openCursor(IDBKeyRange.upperBound(7, true), 2)31 storeReq = store.openCursor(IDBKeyRange.upperBound(7, true), 'prev') 32 32 DONE 33 33 34 Testing: store.openCursor(IDBKeyRange.upperBound(7, true), 2)34 Testing: store.openCursor(IDBKeyRange.upperBound(7, true), 'prev') 35 35 PASS cursor.key is 3 36 36 PASS cursor.value.value is 333 37 storeReq = index.openCursor(IDBKeyRange.upperBound(7, false), 2)37 storeReq = index.openCursor(IDBKeyRange.upperBound(7, false), 'prev') 38 38 DONE 39 39 40 Testing: index.openCursor(IDBKeyRange.upperBound(7, false), 2)40 Testing: index.openCursor(IDBKeyRange.upperBound(7, false), 'prev') 41 41 PASS cursor.key is 3 42 42 PASS cursor.value.value is 111 43 43 PASS cursor.primaryKey is 1 44 storeReq = index.openCursor(IDBKeyRange.upperBound(7, true), 2)44 storeReq = index.openCursor(IDBKeyRange.upperBound(7, true), 'prev') 45 45 DONE 46 46 47 Testing: index.openCursor(IDBKeyRange.upperBound(7, true), 2)47 Testing: index.openCursor(IDBKeyRange.upperBound(7, true), 'prev') 48 48 PASS cursor.key is 3 49 49 PASS cursor.value.value is 111 50 50 PASS cursor.primaryKey is 1 51 storeReq = index.openKeyCursor(IDBKeyRange.upperBound(7, false), 2)51 storeReq = index.openKeyCursor(IDBKeyRange.upperBound(7, false), 'prev') 52 52 DONE 53 53 54 Testing: index.openKeyCursor(IDBKeyRange.upperBound(7, false), 2)54 Testing: index.openKeyCursor(IDBKeyRange.upperBound(7, false), 'prev') 55 55 PASS cursor.key is 3 56 56 PASS cursor.primaryKey is 1 57 storeReq = index.openKeyCursor(IDBKeyRange.upperBound(7, true), 2)57 storeReq = index.openKeyCursor(IDBKeyRange.upperBound(7, true), 'prev') 58 58 DONE 59 59 60 Testing: index.openKeyCursor(IDBKeyRange.upperBound(7, true), 2)60 Testing: index.openKeyCursor(IDBKeyRange.upperBound(7, true), 'prev') 61 61 PASS cursor.key is 3 62 62 PASS cursor.primaryKey is 1 63 storeReq = store.openCursor(IDBKeyRange.upperBound(3, false), 2)63 storeReq = store.openCursor(IDBKeyRange.upperBound(3, false), 'prev') 64 64 DONE 65 65 66 Testing: store.openCursor(IDBKeyRange.upperBound(3, false), 2)66 Testing: store.openCursor(IDBKeyRange.upperBound(3, false), 'prev') 67 67 PASS cursor.key is 3 68 68 PASS cursor.value.value is 333 69 storeReq = store.openCursor(IDBKeyRange.upperBound(3, true), 2)69 storeReq = store.openCursor(IDBKeyRange.upperBound(3, true), 'prev') 70 70 DONE 71 71 72 Testing: store.openCursor(IDBKeyRange.upperBound(3, true), 2)72 Testing: store.openCursor(IDBKeyRange.upperBound(3, true), 'prev') 73 73 PASS cursor.key is 2 74 74 PASS cursor.value.value is 222 75 storeReq = index.openCursor(IDBKeyRange.upperBound(3, false), 2)75 storeReq = index.openCursor(IDBKeyRange.upperBound(3, false), 'prev') 76 76 DONE 77 77 78 Testing: index.openCursor(IDBKeyRange.upperBound(3, false), 2)78 Testing: index.openCursor(IDBKeyRange.upperBound(3, false), 'prev') 79 79 PASS cursor.key is 3 80 80 PASS cursor.value.value is 111 81 81 PASS cursor.primaryKey is 1 82 storeReq = index.openCursor(IDBKeyRange.upperBound(3, true), 2)82 storeReq = index.openCursor(IDBKeyRange.upperBound(3, true), 'prev') 83 83 DONE 84 84 85 Testing: index.openCursor(IDBKeyRange.upperBound(3, true), 2)85 Testing: index.openCursor(IDBKeyRange.upperBound(3, true), 'prev') 86 86 PASS cursor.key is 2 87 87 PASS cursor.value.value is 222 88 88 PASS cursor.primaryKey is 2 89 storeReq = index.openKeyCursor(IDBKeyRange.upperBound(3, false), 2)89 storeReq = index.openKeyCursor(IDBKeyRange.upperBound(3, false), 'prev') 90 90 DONE 91 91 92 Testing: index.openKeyCursor(IDBKeyRange.upperBound(3, false), 2)92 Testing: index.openKeyCursor(IDBKeyRange.upperBound(3, false), 'prev') 93 93 PASS cursor.key is 3 94 94 PASS cursor.primaryKey is 1 95 storeReq = index.openKeyCursor(IDBKeyRange.upperBound(3, true), 2)95 storeReq = index.openKeyCursor(IDBKeyRange.upperBound(3, true), 'prev') 96 96 DONE 97 97 98 Testing: index.openKeyCursor(IDBKeyRange.upperBound(3, true), 2)98 Testing: index.openKeyCursor(IDBKeyRange.upperBound(3, true), 'prev') 99 99 PASS cursor.key is 2 100 100 PASS cursor.primaryKey is 2 101 101 testNoDuplicate: there are 3 values, but we should return always the first one 102 storeReq = store.openCursor(IDBKeyRange.upperBound(15, false), 3)102 storeReq = store.openCursor(IDBKeyRange.upperBound(15, false), 'prevunique') 103 103 DONE 104 104 105 Testing: store.openCursor(IDBKeyRange.upperBound(15, false), 3)105 Testing: store.openCursor(IDBKeyRange.upperBound(15, false), 'prevunique') 106 106 PASS cursor.key is 15 107 107 PASS cursor.value.value is 666 108 108 PASS cursor.primaryKey is 15 109 storeReq = index.openCursor(IDBKeyRange.upperBound(15, false), 3)109 storeReq = index.openCursor(IDBKeyRange.upperBound(15, false), 'prevunique') 110 110 DONE 111 111 112 Testing: index.openCursor(IDBKeyRange.upperBound(15, false), 3)112 Testing: index.openCursor(IDBKeyRange.upperBound(15, false), 'prevunique') 113 113 PASS cursor.key is 10 114 114 PASS cursor.value.value is 666 115 115 PASS cursor.primaryKey is 15 116 storeReq = index.openKeyCursor(IDBKeyRange.upperBound(15, false), 3)116 storeReq = index.openKeyCursor(IDBKeyRange.upperBound(15, false), 'prevunique') 117 117 DONE 118 118 119 Testing: index.openKeyCursor(IDBKeyRange.upperBound(15, false), 3)119 Testing: index.openKeyCursor(IDBKeyRange.upperBound(15, false), 'prevunique') 120 120 PASS cursor.key is 10 121 121 PASS cursor.primaryKey is 15 -
trunk/LayoutTests/storage/indexeddb/cursor-primary-key-order-expected.txt
r116051 r116337 14 14 15 15 populating store... 16 trans = db.transaction('store', IDBTransaction.READ_WRITE)16 trans = db.transaction('store', 'readwrite') 17 17 store = trans.objectStore('store'); 18 18 store.put({"indexKey":0,"count":0}, 'c') … … 34 34 35 35 iterating cursor... 36 trans = db.transaction('store', IDBTransaction.READ_ONLY)36 trans = db.transaction('store', 'readonly') 37 37 store = trans.objectStore('store'); 38 38 index = store.index('index'); -
trunk/LayoutTests/storage/indexeddb/cursor-reverse-bug-expected.txt
r116051 r116337 15 15 16 16 populating store... 17 trans = db.transaction('store', IDBTransaction.READ_WRITE)17 trans = db.transaction('store', 'readwrite') 18 18 store = trans.objectStore('store'); 19 19 store.put(1, 1) … … 21 21 store.put(3, 3) 22 22 testCursor() 23 trans = db.transaction('store', IDBTransaction.READ_ONLY)23 trans = db.transaction('store', 'readonly') 24 24 store = trans.objectStore('store'); 25 25 index = store.index('index'); 26 26 upperBound: 7 open: false expected: 3 27 storeReq = store.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), IDBCursor.PREV)28 indexReq = index.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), IDBCursor.PREV)29 indexKeyReq = index.openKeyCursor(IDBKeyRange.upperBound(test.upperBound, test.open), IDBCursor.PREV)27 storeReq = store.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev') 28 indexReq = index.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev') 29 indexKeyReq = index.openKeyCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev') 30 30 cursor = event.target.result 31 31 PASS cursor.key is test.expected … … 40 40 PASS cursor.primaryKey is test.expected 41 41 testCursor() 42 trans = db.transaction('store', IDBTransaction.READ_ONLY)42 trans = db.transaction('store', 'readonly') 43 43 store = trans.objectStore('store'); 44 44 index = store.index('index'); 45 45 upperBound: 7 open: true expected: 3 46 storeReq = store.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), IDBCursor.PREV)47 indexReq = index.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), IDBCursor.PREV)48 indexKeyReq = index.openKeyCursor(IDBKeyRange.upperBound(test.upperBound, test.open), IDBCursor.PREV)46 storeReq = store.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev') 47 indexReq = index.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev') 48 indexKeyReq = index.openKeyCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev') 49 49 cursor = event.target.result 50 50 PASS cursor.key is test.expected … … 59 59 PASS cursor.primaryKey is test.expected 60 60 testCursor() 61 trans = db.transaction('store', IDBTransaction.READ_ONLY)61 trans = db.transaction('store', 'readonly') 62 62 store = trans.objectStore('store'); 63 63 index = store.index('index'); 64 64 upperBound: 3 open: false expected: 3 65 storeReq = store.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), IDBCursor.PREV)66 indexReq = index.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), IDBCursor.PREV)67 indexKeyReq = index.openKeyCursor(IDBKeyRange.upperBound(test.upperBound, test.open), IDBCursor.PREV)65 storeReq = store.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev') 66 indexReq = index.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev') 67 indexKeyReq = index.openKeyCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev') 68 68 cursor = event.target.result 69 69 PASS cursor.key is test.expected … … 78 78 PASS cursor.primaryKey is test.expected 79 79 testCursor() 80 trans = db.transaction('store', IDBTransaction.READ_ONLY)80 trans = db.transaction('store', 'readonly') 81 81 store = trans.objectStore('store'); 82 82 index = store.index('index'); 83 83 upperBound: 3 open: true expected: 2 84 storeReq = store.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), IDBCursor.PREV)85 indexReq = index.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), IDBCursor.PREV)86 indexKeyReq = index.openKeyCursor(IDBKeyRange.upperBound(test.upperBound, test.open), IDBCursor.PREV)84 storeReq = store.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev') 85 indexReq = index.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev') 86 indexKeyReq = index.openKeyCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev') 87 87 cursor = event.target.result 88 88 PASS cursor.key is test.expected -
trunk/LayoutTests/storage/indexeddb/cursor-skip-deleted-expected.txt
r116051 r116337 19 19 20 20 basicCursorTest() 21 trans = db.transaction(['store'], IDBTransaction.READ_WRITE)21 trans = db.transaction(['store'], 'readwrite') 22 22 23 23 testCursor(): … … 61 61 62 62 testCursor(): 63 trans.objectStore('store').openCursor(IDBKeyRange.lowerBound(0), IDBCursor.PREV)63 trans.objectStore('store').openCursor(IDBKeyRange.lowerBound(0), 'prev') 64 64 25: Zulu 65 65 24: Yankee -
trunk/LayoutTests/storage/indexeddb/cursor-update-expected.txt
r116051 r116337 30 30 objectStore.add({number: 4, id: 4}).onerror = unexpectedErrorCallback 31 31 openBasicCursor() 32 trans = db.transaction(['basicStore', 'autoIncrementStore', 'keyPathStore'], IDBTransaction.READ_WRITE)32 trans = db.transaction(['basicStore', 'autoIncrementStore', 'keyPathStore'], 'readwrite') 33 33 trans.objectStore('basicStore') 34 34 objectStore.openCursor(keyRange) -
trunk/LayoutTests/storage/indexeddb/data-corruption-expected.txt
r116051 r116337 16 16 db.createObjectStore('storeName') 17 17 addData(): 18 transaction = db.transaction(['storeName'], IDBTransaction.READ_WRITE)18 transaction = db.transaction(['storeName'], 'readwrite') 19 19 request = transaction.objectStore('storeName').add({x: testDate}, 'key') 20 20 addData(): 21 transaction = db.transaction(['storeName'], IDBTransaction.READ_ONLY)21 transaction = db.transaction(['storeName'], 'readonly') 22 22 request = transaction.objectStore('storeName').get('key') 23 23 PASS event.target.result.x.toString() == testDate.toString() is true -
trunk/LayoutTests/storage/indexeddb/database-quota-expected.txt
r116051 r116337 24 24 PASS db.objectStoreNames.contains('test456') is false 25 25 PASS db.objectStoreNames.contains('test123') is true 26 trans = db.transaction(['test123'], IDBTransaction.READ_WRITE)26 trans = db.transaction(['test123'], 'readwrite') 27 27 Creating 'data' which contains 64K of data 28 28 PASS data.length is 65536 -
trunk/LayoutTests/storage/indexeddb/delete-range-expected.txt
r116051 r116337 13 13 db.createObjectStore('store') 14 14 15 trans = db.transaction('store', IDBTransaction.READ_WRITE)15 trans = db.transaction('store', 'readwrite') 16 16 store = trans.objectStore('store') 17 17 store.put(1,1) … … 31 31 PASS Match! 32 32 33 trans = db.transaction('store', IDBTransaction.READ_WRITE)33 trans = db.transaction('store', 'readwrite') 34 34 store = trans.objectStore('store') 35 35 store.put(1,1) … … 49 49 PASS Match! 50 50 51 trans = db.transaction('store', IDBTransaction.READ_WRITE)51 trans = db.transaction('store', 'readwrite') 52 52 store = trans.objectStore('store') 53 53 store.put(1,1) … … 67 67 PASS Match! 68 68 69 trans = db.transaction('store', IDBTransaction.READ_WRITE)69 trans = db.transaction('store', 'readwrite') 70 70 store = trans.objectStore('store') 71 71 store.put(1,1) -
trunk/LayoutTests/storage/indexeddb/error-causes-abort-by-default-expected.txt
r116051 r116337 15 15 Deleted all object stores. 16 16 db.createObjectStore('storeName', null) 17 trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)17 trans = db.transaction(['storeName'], 'readwrite') 18 18 trans.onabort = unexpectedAbortCallback 19 19 trans.oncomplete = transactionCompleted … … 25 25 26 26 27 trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)27 trans = db.transaction(['storeName'], 'readwrite') 28 28 trans.onabort = transactionAborted1 29 29 trans.oncomplete = unexpectedCompleteCallback … … 34 34 35 35 36 trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)36 trans = db.transaction(['storeName'], 'readwrite') 37 37 trans.onabort = transactionAborted2 38 38 trans.oncomplete = unexpectedCompleteCallback -
trunk/LayoutTests/storage/indexeddb/exception-in-event-aborts-expected.txt
r116051 r116337 19 19 store.add({x: 'value', y: 'zzz'}, 'key') 20 20 21 trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)21 trans = db.transaction(['storeName'], 'readwrite') 22 22 trans.onabort = transactionAborted1 23 23 trans.oncomplete = unexpectedCompleteCallback … … 30 30 PASS Got expected error: 'this exception is expected' 31 31 PASS The transaction was aborted. 32 trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)32 trans = db.transaction(['storeName'], 'readwrite') 33 33 trans.onabort = transactionAborted2 34 34 trans.oncomplete = unexpectedCompleteCallback … … 41 41 PASS Got expected error: 'this exception is expected' 42 42 PASS The transaction was aborted. 43 trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)43 trans = db.transaction(['storeName'], 'readwrite') 44 44 trans.onabort = unexpectedAbortCallback 45 45 trans.oncomplete = transactionCompleted1 … … 51 51 52 52 PASS The transaction completed. 53 trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)53 trans = db.transaction(['storeName'], 'readwrite') 54 54 trans.onabort = unexpectedAbortCallback 55 55 trans.oncomplete = transactionCompleted2 -
trunk/LayoutTests/storage/indexeddb/factory-deletedatabase-expected.txt
r116051 r116337 15 15 PASS store.indexNames.contains('indexName') is true 16 16 store.add('value', 'key') 17 db.transaction('storeName', IDBTransaction.READ_WRITE)17 db.transaction('storeName', 'readwrite') 18 18 store = transaction.objectStore('storeName') 19 19 store.get('key') -
trunk/LayoutTests/storage/indexeddb/index-count-expected.txt
r116051 r116337 20 20 21 21 verifying count without range 22 trans = db.transaction('storeName', IDBTransaction.READ_ONLY)22 trans = db.transaction('storeName', 'readonly') 23 23 PASS trans != null is true 24 24 store = trans.objectStore('storeName') … … 31 31 32 32 verifying count with range 33 trans = db.transaction('storeName', IDBTransaction.READ_ONLY)33 trans = db.transaction('storeName', 'readonly') 34 34 PASS trans != null is true 35 35 store = trans.objectStore('storeName') … … 84 84 85 85 verifying count with key 86 trans = db.transaction('storeName', IDBTransaction.READ_ONLY)86 trans = db.transaction('storeName', 'readonly') 87 87 PASS trans != null is true 88 88 store = trans.objectStore('storeName') -
trunk/LayoutTests/storage/indexeddb/index-multientry-expected.txt
r116051 r116337 20 20 21 21 Populating stores (and indexes) 22 transaction = db.transaction(['store'], IDBTransaction.READ_WRITE)22 transaction = db.transaction(['store'], 'readwrite') 23 23 First try some keys that aren't what we're expecting 24 24 transaction.objectStore('store').put({x: [7, 8, 9], y: 'a'}, 'foo') … … 28 28 29 29 Verifying index: index 30 transaction = db.transaction(['store'], IDBTransaction.READ_ONLY)30 transaction = db.transaction(['store'], 'readonly') 31 31 transaction.objectStore('store').index('index').openCursor() 32 32 cursor = event.target.result … … 64 64 65 65 Verifying unique constraint on multiEntry index 66 transaction = db.transaction(['store-unique'], IDBTransaction.READ_WRITE)66 transaction = db.transaction(['store-unique'], 'readwrite') 67 67 transaction.objectStore('store-unique').put({x: [1, 2, 3], y: 'a'}, 'foo') 68 68 success! … … 83 83 84 84 Verifying index: index-new 85 transaction = db.transaction(['store'], IDBTransaction.READ_ONLY)85 transaction = db.transaction(['store'], 'readonly') 86 86 transaction.objectStore('store').index('index-new').openCursor() 87 87 cursor = event.target.result -
trunk/LayoutTests/storage/indexeddb/index-unique-expected.txt
r116051 r116337 16 16 store.createIndex('index', 'x', {unique: true}) 17 17 setVersionCompleted(): 18 transaction = db.transaction(['store'], IDBTransaction.READ_WRITE)18 transaction = db.transaction(['store'], 'readwrite') 19 19 transaction.objectStore('store').put({x: 1}, 'foo') 20 20 addMoreData(): -
trunk/LayoutTests/storage/indexeddb/key-generator-expected.txt
r116051 r116337 123 123 request = db.setVersion('1') 124 124 trans = request.result 125 trans1 = db.transaction(['store'], IDBTransaction.READ_WRITE)125 trans1 = db.transaction(['store'], 'readwrite') 126 126 store_t1 = trans1.objectStore('store') 127 127 store_t1.put('a') … … 134 134 trans1.abort() 135 135 aborted! 136 trans2 = db.transaction(['store'], IDBTransaction.READ_WRITE)136 trans2 = db.transaction(['store'], 'readwrite') 137 137 store_t2 = trans2.objectStore('store') 138 138 store_t2.put('c') … … 150 150 request = db.setVersion('1') 151 151 trans = request.result 152 trans1 = db.transaction(['store'], IDBTransaction.READ_WRITE)152 trans1 = db.transaction(['store'], 'readwrite') 153 153 store_t1 = trans1.objectStore('store') 154 154 store_t1.put('a') -
trunk/LayoutTests/storage/indexeddb/key-type-array-expected.txt
r116051 r116337 17 17 db.createObjectStore('store'); 18 18 19 trans = db.transaction('store', IDBTransaction.READ_WRITE)19 trans = db.transaction('store', 'readwrite') 20 20 store = trans.objectStore('store') 21 21 … … 160 160 PASS getreq.result is "value27" 161 161 162 trans = db.transaction('store', IDBTransaction.READ_WRITE)162 trans = db.transaction('store', 'readwrite') 163 163 store = trans.objectStore('store') 164 164 -
trunk/LayoutTests/storage/indexeddb/keypath-edges-expected.txt
r116051 r116337 16 16 17 17 testKeyPaths(): 18 transaction = db.transaction(['store-with-path'], IDBTransaction.READ_WRITE)18 transaction = db.transaction(['store-with-path'], 'readwrite') 19 19 store = transaction.objectStore('store-with-path') 20 20 … … 39 39 40 40 testKeyPathsAndGenerator(): 41 transaction = db.transaction(['store-with-path-and-generator'], IDBTransaction.READ_WRITE)41 transaction = db.transaction(['store-with-path-and-generator'], 'readwrite') 42 42 store = transaction.objectStore('store-with-path-and-generator') 43 43 -
trunk/LayoutTests/storage/indexeddb/keypath-intrinsic-properties-expected.txt
r116051 r116337 17 17 18 18 testKeyPaths(): 19 transaction = db.transaction('store', IDBTransaction.READ_WRITE)19 transaction = db.transaction('store', 'readwrite') 20 20 store = transaction.objectStore('store') 21 21 store.put({"id":"id#0","string":"","array":[]}) -
trunk/LayoutTests/storage/indexeddb/mozilla/clear-expected.txt
r116051 r116337 15 15 PASS Exception was thrown. 16 16 PASS code is IDBDatabaseException.READ_ONLY_ERR 17 db.transaction('foo', IDBTransaction.READ_WRITE).objectStore('foo').clear();17 db.transaction('foo', 'readwrite').objectStore('foo').clear(); 18 18 request = db.transaction('foo').objectStore('foo').openCursor(); 19 19 cursor = request.result; -
trunk/LayoutTests/storage/indexeddb/mozilla/create-index-unique-expected.txt
r116051 r116337 19 19 PASS event.target.transaction.db is db 20 20 PASS event.target.transaction.readyState is IDBTransaction.LOADING 21 PASS event.target.transaction.mode is IDBTransaction.VERSION_CHANGE21 PASS event.target.transaction.mode is 'versionchange' 22 22 PASS successfullyParsed is true 23 23 -
trunk/LayoutTests/storage/indexeddb/mozilla/create-objectstore-basics-expected.txt
r116051 r116337 15 15 PASS event.target.transaction.db is db 16 16 PASS event.target.transaction.readyState is IDBTransaction.LOADING 17 PASS event.target.transaction.mode is IDBTransaction.VERSION_CHANGE17 PASS event.target.transaction.mode is 'versionchange' 18 18 objectStore = db.createObjectStore(info.name, info.options); 19 19 PASS objectStore.name is info.name … … 21 21 PASS event.target.transaction.db is db 22 22 PASS event.target.transaction.readyState is IDBTransaction.LOADING 23 PASS event.target.transaction.mode is IDBTransaction.VERSION_CHANGE23 PASS event.target.transaction.mode is 'versionchange' 24 24 objectStore = db.createObjectStore(info.name, info.options); 25 25 PASS objectStore.name is info.name … … 27 27 PASS event.target.transaction.db is db 28 28 PASS event.target.transaction.readyState is IDBTransaction.LOADING 29 PASS event.target.transaction.mode is IDBTransaction.VERSION_CHANGE29 PASS event.target.transaction.mode is 'versionchange' 30 30 objectStore = db.createObjectStore(info.name, info.options); 31 31 PASS objectStore.name is info.name … … 33 33 PASS event.target.transaction.db is db 34 34 PASS event.target.transaction.readyState is IDBTransaction.LOADING 35 PASS event.target.transaction.mode is IDBTransaction.VERSION_CHANGE35 PASS event.target.transaction.mode is 'versionchange' 36 36 objectStore = db.createObjectStore(info.name, info.options); 37 37 PASS objectStore.name is info.name … … 39 39 PASS event.target.transaction.db is db 40 40 PASS event.target.transaction.readyState is IDBTransaction.LOADING 41 PASS event.target.transaction.mode is IDBTransaction.VERSION_CHANGE41 PASS event.target.transaction.mode is 'versionchange' 42 42 objectStore = db.createObjectStore(info.name, info.options); 43 43 PASS objectStore.name is info.name … … 46 46 PASS event.target.transaction.db is db 47 47 PASS event.target.transaction.readyState is IDBTransaction.LOADING 48 PASS event.target.transaction.mode is IDBTransaction.VERSION_CHANGE48 PASS event.target.transaction.mode is 'versionchange' 49 49 objectStore = db.createObjectStore(info.name, info.options); 50 50 PASS objectStore.name is info.name … … 53 53 PASS event.target.transaction.db is db 54 54 PASS event.target.transaction.readyState is IDBTransaction.LOADING 55 PASS event.target.transaction.mode is IDBTransaction.VERSION_CHANGE55 PASS event.target.transaction.mode is 'versionchange' 56 56 objectStore = db.createObjectStore(info.name, info.options); 57 57 PASS objectStore.name is info.name … … 60 60 PASS event.target.transaction.db is db 61 61 PASS event.target.transaction.readyState is IDBTransaction.LOADING 62 PASS event.target.transaction.mode is IDBTransaction.VERSION_CHANGE62 PASS event.target.transaction.mode is 'versionchange' 63 63 PASS successfullyParsed is true 64 64 -
trunk/LayoutTests/storage/indexeddb/mozilla/cursor-mutation-expected.txt
r116051 r116337 83 83 objectStoreDataNameSort = [ 1, 4, 5, 2, 3 ] 84 84 85 trans = db.transaction('foo', IDBTransaction.READ_WRITE)85 trans = db.transaction('foo', 'readwrite') 86 86 objectStore = trans.objectStore('foo') 87 87 request = objectStore.index('name').openCursor() -
trunk/LayoutTests/storage/indexeddb/mozilla/cursor-mutation-objectstore-only-expected.txt
r116051 r116337 66 66 sawAdded = false; 67 67 sawRemoved = false; 68 request = db.transaction('foo', IDBTransaction.READ_WRITE).objectStore('foo').openCursor();68 request = db.transaction('foo', 'readwrite').objectStore('foo').openCursor(); 69 69 iterateMutatingCursor(): 70 70 event.target.transaction.oncomplete = checkMutatingCursorResults; -
trunk/LayoutTests/storage/indexeddb/mozilla/cursors-expected.txt
r116051 r116337 432 432 request = objectStore.put('foo', sortedKeys[4]); 433 433 keyIndex = 0; 434 request = objectStore.openCursor(null, IDBCursor.NEXT);434 request = objectStore.openCursor(null, 'next'); 435 435 cursor = event.target.result; 436 436 PASS cursor.key is sortedKeys[keyIndex] … … 502 502 PASS event.target.result is undefined 503 503 request = objectStore.add('foo', sortedKeys[4]); 504 request = objectStore.openCursor(null, IDBCursor.PREV);504 request = objectStore.openCursor(null, 'prev'); 505 505 cursor = event.target.result; 506 506 PASS cursor.key is sortedKeys[keyIndex] -
trunk/LayoutTests/storage/indexeddb/mozilla/index-prev-no-duplicate-expected.txt
r116051 r116337 38 38 objectStore = trans.objectStore(objectStoreName); 39 39 keyIndex = 8; 40 request = objectStore.index('height').openCursor(null, IDBCursor.PREV);40 request = objectStore.index('height').openCursor(null, 'prev'); 41 41 cursor = event.target.result; 42 42 PASS cursor.key is 73 … … 126 126 objectStore = db.transaction(objectStoreName).objectStore(objectStoreName); 127 127 keyIndex = 8; 128 request = objectStore.index('height').openCursor(null, IDBCursor.PREV_NO_DUPLICATE);128 request = objectStore.index('height').openCursor(null, 'prevunique'); 129 129 cursor = event.target.result; 130 130 keyIndex -= 1 -
trunk/LayoutTests/storage/indexeddb/mozilla/index-prev-no-duplicate.html
r116051 r116337 121 121 keyIndex = evalAndLog("keyIndex = 8;"); 122 122 // first try with just PREV 123 request = evalAndLog("request = objectStore.index('height').openCursor(null, IDBCursor.PREV);");123 request = evalAndLog("request = objectStore.index('height').openCursor(null, 'prev');"); 124 124 request.onerror = unexpectedErrorCallback; 125 125 request.onsuccess = function(event) … … 152 152 objectStore = evalAndLog("objectStore = db.transaction(objectStoreName).objectStore(objectStoreName);"); 153 153 keyIndex = evalAndLog("keyIndex = 8;"); 154 request = evalAndLog("request = objectStore.index('height').openCursor(null, IDBCursor.PREV_NO_DUPLICATE);");154 request = evalAndLog("request = objectStore.index('height').openCursor(null, 'prevunique');"); 155 155 request.onerror = unexpectedErrorCallback; 156 156 request.onsuccess = function (event) -
trunk/LayoutTests/storage/indexeddb/mozilla/indexes-expected.txt
r116051 r116337 104 104 cursor = event.target.result; 105 105 PASS keyIndex is objectStoreData.length 106 request = objectStore.index('weight').openKeyCursor(null, IDBCursor.NEXT);106 request = objectStore.index('weight').openKeyCursor(null, 'next'); 107 107 cursor = event.target.result; 108 108 PASS cursor.key is objectStoreDataWeightSort[keyIndex].value.weight … … 151 151 objectStore = db.transaction(objectStoreName).objectStore(objectStoreName); 152 152 keyIndex = objectStoreDataNameSort.length - 1; 153 request = objectStore.index('name').openKeyCursor(null, IDBCursor.PREV);153 request = objectStore.index('name').openKeyCursor(null, 'prev'); 154 154 cursor = event.target.result; 155 155 PASS cursor.key is objectStoreDataNameSort[keyIndex].value.name … … 458 458 PASS keyIndex is objectStoreDataNameSort.length 459 459 keyIndex = objectStoreDataNameSort.length - 1; 460 request = objectStore.index('name').openCursor(null, IDBCursor.PREV);460 request = objectStore.index('name').openCursor(null, 'prev'); 461 461 cursor = event.target.result; 462 462 PASS cursor.key is objectStoreDataNameSort[keyIndex].value.name … … 711 711 keyIndex = 4; 712 712 keyRange = IDBKeyRange.bound('Bob', 'Ron'); 713 request = objectStore.index('name').openCursor(keyRange, IDBCursor.PREV);713 request = objectStore.index('name').openCursor(keyRange, 'prev'); 714 714 cursor = event.target.result; 715 715 PASS cursor.key is objectStoreDataNameSort[keyIndex].value.name … … 768 768 keyIndex = 3; 769 769 keyRange = IDBKeyRange.only(65); 770 request = objectStore.index('height').openKeyCursor(keyRange, IDBCursor.NEXT);770 request = objectStore.index('height').openKeyCursor(keyRange, 'next'); 771 771 cursor = event.target.result; 772 772 PASS cursor.key is objectStoreDataHeightSort[keyIndex].value.height … … 783 783 keyIndex = 3; 784 784 keyRange = IDBKeyRange.only(65); 785 request = objectStore.index('height').openKeyCursor(keyRange, IDBCursor.NEXT_NO_DUPLICATE);785 request = objectStore.index('height').openKeyCursor(keyRange, 'nextunique'); 786 786 cursor = event.target.result; 787 787 PASS cursor.key is objectStoreDataHeightSort[keyIndex].value.height … … 793 793 keyIndex = 3; 794 794 keyRange = IDBKeyRange.only(65); 795 request = objectStore.index('height').openCursor(keyRange, IDBCursor.NEXT);795 request = objectStore.index('height').openCursor(keyRange, 'next'); 796 796 cursor = event.target.result; 797 797 PASS cursor.key is objectStoreDataHeightSort[keyIndex].value.height … … 814 814 keyIndex = 3; 815 815 keyRange = IDBKeyRange.only(65); 816 request = objectStore.index('height').openCursor(keyRange, IDBCursor.NEXT_NO_DUPLICATE);816 request = objectStore.index('height').openCursor(keyRange, 'nextunique'); 817 817 cursor = event.target.result; 818 818 PASS cursor.key is objectStoreDataHeightSort[keyIndex].value.height -
trunk/LayoutTests/storage/indexeddb/mozilla/odd-result-order-expected.txt
r116051 r116337 19 19 event.target.transaction.oncomplete = addRecord; 20 20 addRecord(): 21 objectStore = db.transaction('foo', IDBTransaction.READ_WRITE).objectStore('foo');21 objectStore = db.transaction('foo', 'readwrite').objectStore('foo'); 22 22 data = { key: 5, index: 10 }; 23 23 request = objectStore.add(data); … … 36 36 PASS record.index is data.index 37 37 deleteRecord(): 38 objectStore = db.transaction('foo', IDBTransaction.READ_WRITE).objectStore('foo');38 objectStore = db.transaction('foo', 'readwrite').objectStore('foo'); 39 39 request = objectStore.delete(data.key); 40 40 deleteSuccess(): -
trunk/LayoutTests/storage/indexeddb/mozilla/readwrite-transactions-expected.txt
r116051 r116337 11 11 Deleted all object stores. 12 12 objectStore = db.createObjectStore(osName, { autoIncrement: true }); 13 request = db.transaction([osName], IDBTransaction.READ_WRITE).objectStore(osName).add({});14 PASS event.target.transaction.mode is IDBTransaction.READ_WRITE13 request = db.transaction([osName], 'readwrite').objectStore(osName).add({}); 14 PASS event.target.transaction.mode is 'readwrite' 15 15 key1 = event.target.result; 16 request = db.transaction(osName, IDBTransaction.READ_WRITE).objectStore(osName).add({});17 PASS event.target.transaction.mode is IDBTransaction.READ_WRITE16 request = db.transaction(osName, 'readwrite').objectStore(osName).add({}); 17 PASS event.target.transaction.mode is 'readwrite' 18 18 key2 = event.target.result; 19 request = db.transaction([osName], IDBTransaction.READ_WRITE).objectStore(osName).put({}, key1);20 PASS event.target.transaction.mode is IDBTransaction.READ_WRITE21 request = db.transaction(osName, IDBTransaction.READ_WRITE).objectStore(osName).put({}, key2);22 PASS event.target.transaction.mode is IDBTransaction.READ_WRITE23 request = db.transaction([osName], IDBTransaction.READ_WRITE).objectStore(osName).put({}, key1);24 PASS event.target.transaction.mode is IDBTransaction.READ_WRITE25 request = db.transaction(osName, IDBTransaction.READ_WRITE).objectStore(osName).put({}, key1);26 PASS event.target.transaction.mode is IDBTransaction.READ_WRITE27 request = db.transaction([osName], IDBTransaction.READ_WRITE).objectStore(osName).delete(key1);28 PASS event.target.transaction.mode is IDBTransaction.READ_WRITE29 request = db.transaction(osName, IDBTransaction.READ_WRITE).objectStore(osName).delete(key2);30 PASS event.target.transaction.mode is IDBTransaction.READ_WRITE19 request = db.transaction([osName], 'readwrite').objectStore(osName).put({}, key1); 20 PASS event.target.transaction.mode is 'readwrite' 21 request = db.transaction(osName, 'readwrite').objectStore(osName).put({}, key2); 22 PASS event.target.transaction.mode is 'readwrite' 23 request = db.transaction([osName], 'readwrite').objectStore(osName).put({}, key1); 24 PASS event.target.transaction.mode is 'readwrite' 25 request = db.transaction(osName, 'readwrite').objectStore(osName).put({}, key1); 26 PASS event.target.transaction.mode is 'readwrite' 27 request = db.transaction([osName], 'readwrite').objectStore(osName).delete(key1); 28 PASS event.target.transaction.mode is 'readwrite' 29 request = db.transaction(osName, 'readwrite').objectStore(osName).delete(key2); 30 PASS event.target.transaction.mode is 'readwrite' 31 31 PASS successfullyParsed is true 32 32 -
trunk/LayoutTests/storage/indexeddb/mozilla/readyState-expected.txt
r116051 r116337 7 7 8 8 indexedDB.open(name, description) 9 PASS request.readyState is IDBRequest.LOADING9 PASS request.readyState is 'pending' 10 10 openSuccess(): 11 PASS request.readyState is IDBRequest.DONE11 PASS request.readyState is 'done' 12 12 db = event.target.result 13 13 request = db.setVersion('1') 14 PASS request.readyState is IDBRequest.LOADING14 PASS request.readyState is 'pending' 15 15 setupObjectStore(): 16 PASS request.readyState is IDBRequest.DONE16 PASS request.readyState is 'done' 17 17 Deleted all object stores. 18 18 objectStore = db.createObjectStore('foo'); 19 19 key = 10; 20 20 request = objectStore.add({}, key); 21 PASS request.readyState is IDBRequest.LOADING21 PASS request.readyState is 'pending' 22 22 getRecord(): 23 PASS request.readyState is IDBRequest.DONE23 PASS request.readyState is 'done' 24 24 PASS event.target.result is key 25 25 request = objectStore.get(key); 26 PASS request.readyState is IDBRequest.LOADING26 PASS request.readyState is 'pending' 27 27 finalCheck(): 28 PASS request.readyState is IDBRequest.DONE28 PASS request.readyState is 'done' 29 29 PASS event.target.result == null is false 30 30 PASS successfullyParsed is true -
trunk/LayoutTests/storage/indexeddb/mozilla/resources/clear.js
r116051 r116337 45 45 { 46 46 evalAndExpectException("db.transaction('foo').objectStore('foo').clear();", "IDBDatabaseException.READ_ONLY_ERR"); 47 evalAndLog("db.transaction('foo', IDBTransaction.READ_WRITE).objectStore('foo').clear();");47 evalAndLog("db.transaction('foo', 'readwrite').objectStore('foo').clear();"); 48 48 request = evalAndLog("request = db.transaction('foo').objectStore('foo').openCursor();"); 49 49 request.onsuccess = areWeClearYet; -
trunk/LayoutTests/storage/indexeddb/mozilla/resources/create-index-unique.js
r116051 r116337 55 55 shouldBe("event.target.transaction.db", "db"); 56 56 shouldBe("event.target.transaction.readyState", "IDBTransaction.LOADING"); 57 shouldBe("event.target.transaction.mode", " IDBTransaction.VERSION_CHANGE");57 shouldBe("event.target.transaction.mode", "'versionchange'"); 58 58 finishJSTest(); 59 59 } -
trunk/LayoutTests/storage/indexeddb/mozilla/resources/create-objectstore-basics.js
r116051 r116337 58 58 shouldBe("event.target.transaction.db", "db"); 59 59 shouldBe("event.target.transaction.readyState", "IDBTransaction.LOADING"); 60 shouldBe("event.target.transaction.mode", " IDBTransaction.VERSION_CHANGE");60 shouldBe("event.target.transaction.mode", "'versionchange'"); 61 61 } 62 62 -
trunk/LayoutTests/storage/indexeddb/mozilla/resources/cursor-mutation-objectstore-only.js
r116051 r116337 91 91 sawRemoved = evalAndLog("sawRemoved = false;"); 92 92 93 request = evalAndLog("request = db.transaction('foo', IDBTransaction.READ_WRITE).objectStore('foo').openCursor();");93 request = evalAndLog("request = db.transaction('foo', 'readwrite').objectStore('foo').openCursor();"); 94 94 request.onsuccess = iterateMutatingCursor; 95 95 request.onerror = unexpectedErrorCallback; -
trunk/LayoutTests/storage/indexeddb/mozilla/resources/cursor-mutation.js
r116051 r116337 119 119 debug(""); 120 120 121 trans = evalAndLog("trans = db.transaction('foo', IDBTransaction.READ_WRITE)");121 trans = evalAndLog("trans = db.transaction('foo', 'readwrite')"); 122 122 objectStore = evalAndLog("objectStore = trans.objectStore('foo')"); 123 123 request = evalAndLog("request = objectStore.index('name').openCursor()"); -
trunk/LayoutTests/storage/indexeddb/mozilla/resources/cursors.js
r116051 r116337 313 313 retval = false; 314 314 315 request = evalAndLog("request = objectStore.openCursor(null, IDBCursor.NEXT);");315 request = evalAndLog("request = objectStore.openCursor(null, 'next');"); 316 316 request.onerror = unexpectedErrorCallback; 317 317 request.onsuccess = function (event) { … … 362 362 keyIndex = sortedKeys.length - 1; 363 363 364 request = evalAndLog("request = objectStore.openCursor(null, IDBCursor.PREV);");364 request = evalAndLog("request = objectStore.openCursor(null, 'prev');"); 365 365 request.onerror = unexpectedErrorCallback; 366 366 request.onsuccess = function (event) { -
trunk/LayoutTests/storage/indexeddb/mozilla/resources/indexes.js
r116051 r116337 178 178 keyIndex = 0; 179 179 180 request = evalAndLog("request = objectStore.index('weight').openKeyCursor(null, IDBCursor.NEXT);");180 request = evalAndLog("request = objectStore.index('weight').openKeyCursor(null, 'next');"); 181 181 request.onerror = unexpectedErrorCallback; 182 182 request.onsuccess = function (event) { … … 204 204 /* this was split out into a separate test 205 205 debug("Check that the name index enforces its unique constraint."); 206 objectStore = evalAndLog("objectStore = db.transaction(objectStoreName, IDBTransaction.READ_WRITE).objectStore(objectStoreName);");206 objectStore = evalAndLog("objectStore = db.transaction(objectStoreName, 'readwrite').objectStore(objectStoreName);"); 207 207 evalAndExpectException("objectStore.add({ name: 'Bob', height: 62, weight: 170 }, '237-23-7738');", "IDBDatabaseException.CONSTRAINT_ERR"); 208 208 */ … … 210 210 objectStore = evalAndLog("objectStore = db.transaction(objectStoreName).objectStore(objectStoreName);"); 211 211 keyIndex = evalAndLog("keyIndex = objectStoreDataNameSort.length - 1;"); 212 request = evalAndLog("request = objectStore.index('name').openKeyCursor(null, IDBCursor.PREV);");212 request = evalAndLog("request = objectStore.index('name').openKeyCursor(null, 'prev');"); 213 213 request.onerror = unexpectedErrorCallback; 214 214 request.onsuccess = function (event) { … … 477 477 keyIndex = evalAndLog("keyIndex = objectStoreDataNameSort.length - 1;"); 478 478 479 request = evalAndLog("request = objectStore.index('name').openCursor(null, IDBCursor.PREV);");479 request = evalAndLog("request = objectStore.index('name').openCursor(null, 'prev');"); 480 480 request.onerror = unexpectedErrorCallback; 481 481 request.onsuccess = function (event) { … … 662 662 keyRange = evalAndLog("keyRange = IDBKeyRange.bound('Bob', 'Ron');"); 663 663 664 request = evalAndLog("request = objectStore.index('name').openCursor(keyRange, IDBCursor.PREV);");664 request = evalAndLog("request = objectStore.index('name').openCursor(keyRange, 'prev');"); 665 665 request.onerror = unexpectedErrorCallback; 666 666 request.onsuccess = function (event) { … … 699 699 keyRange = evalAndLog("keyRange = IDBKeyRange.only(65);"); 700 700 701 request = evalAndLog("request = objectStore.index('height').openKeyCursor(keyRange, IDBCursor.NEXT);");701 request = evalAndLog("request = objectStore.index('height').openKeyCursor(keyRange, 'next');"); 702 702 request.onerror = unexpectedErrorCallback; 703 703 request.onsuccess = function (event) { … … 722 722 keyRange = evalAndLog("keyRange = IDBKeyRange.only(65);"); 723 723 724 request = evalAndLog("request = objectStore.index('height').openKeyCursor(keyRange, IDBCursor.NEXT_NO_DUPLICATE);");724 request = evalAndLog("request = objectStore.index('height').openKeyCursor(keyRange, 'nextunique');"); 725 725 request.onerror = unexpectedErrorCallback; 726 726 request.onsuccess = function (event) { … … 745 745 keyIndex = evalAndLog("keyIndex = 5;"); 746 746 747 request = evalAndLog("request = objectStore.index('height').openKeyCursor(null, IDBCursor.PREV_NO_DUPLICATE);");747 request = evalAndLog("request = objectStore.index('height').openKeyCursor(null, 'prevunique');"); 748 748 request.onerror = unexpectedErrorCallback; 749 749 request.onsuccess = function (event) { … … 772 772 keyRange = evalAndLog("keyRange = IDBKeyRange.only(65);"); 773 773 774 request = evalAndLog("request = objectStore.index('height').openCursor(keyRange, IDBCursor.NEXT);");774 request = evalAndLog("request = objectStore.index('height').openCursor(keyRange, 'next');"); 775 775 request.onerror = unexpectedErrorCallback; 776 776 request.onsuccess = function (event) { … … 800 800 keyRange = evalAndLog("keyRange = IDBKeyRange.only(65);"); 801 801 802 request = evalAndLog("request = objectStore.index('height').openCursor(keyRange, IDBCursor.NEXT_NO_DUPLICATE);");802 request = evalAndLog("request = objectStore.index('height').openCursor(keyRange, 'nextunique');"); 803 803 request.onerror = unexpectedErrorCallback; 804 804 request.onsuccess = function (event) { … … 828 828 keyIndex = evalAndLog("keyIndex = 5;"); 829 829 830 request = evalAndLog("request = objectStore.index('height').openCursor(null, IDBCursor.PREV_NO_DUPLICATE);");830 request = evalAndLog("request = objectStore.index('height').openCursor(null, 'prevunique');"); 831 831 request.onerror = unexpectedErrorCallback; 832 832 request.onsuccess = function (event) { -
trunk/LayoutTests/storage/indexeddb/mozilla/resources/odd-result-order.js
r116051 r116337 55 55 { 56 56 debug("addRecord():"); 57 objectStore = evalAndLog("objectStore = db.transaction('foo', IDBTransaction.READ_WRITE).objectStore('foo');");57 objectStore = evalAndLog("objectStore = db.transaction('foo', 'readwrite').objectStore('foo');"); 58 58 data = evalAndLog("data = { key: 5, index: 10 };"); 59 59 request = evalAndLog("request = objectStore.add(data);"); … … 103 103 { 104 104 debug("deleteRecord():"); 105 objectStore = evalAndLog("objectStore = db.transaction('foo', IDBTransaction.READ_WRITE).objectStore('foo');");105 objectStore = evalAndLog("objectStore = db.transaction('foo', 'readwrite').objectStore('foo');"); 106 106 request = evalAndLog("request = objectStore.delete(data.key);"); 107 107 request.onsuccess = deleteSuccess; -
trunk/LayoutTests/storage/indexeddb/mozilla/resources/readwrite-transactions.js
r116051 r116337 43 43 function setVersionComplete() 44 44 { 45 request = evalAndLog("request = db.transaction([osName], IDBTransaction.READ_WRITE).objectStore(osName).add({});");45 request = evalAndLog("request = db.transaction([osName], 'readwrite').objectStore(osName).add({});"); 46 46 request.onsuccess = postAdd; 47 47 request.onerror = unexpectedErrorCallback; … … 50 50 function postAdd() 51 51 { 52 shouldBe("event.target.transaction.mode", " IDBTransaction.READ_WRITE");52 shouldBe("event.target.transaction.mode", "'readwrite'"); 53 53 key1 = evalAndLog("key1 = event.target.result;"); 54 request = evalAndLog("request = db.transaction(osName, IDBTransaction.READ_WRITE).objectStore(osName).add({});");54 request = evalAndLog("request = db.transaction(osName, 'readwrite').objectStore(osName).add({});"); 55 55 request.onsuccess = postAdd2; 56 56 request.onerror = unexpectedErrorCallback; … … 59 59 function postAdd2() 60 60 { 61 shouldBe("event.target.transaction.mode", " IDBTransaction.READ_WRITE");61 shouldBe("event.target.transaction.mode", "'readwrite'"); 62 62 key2 = evalAndLog("key2 = event.target.result;"); 63 request = evalAndLog("request = db.transaction([osName], IDBTransaction.READ_WRITE).objectStore(osName).put({}, key1);");63 request = evalAndLog("request = db.transaction([osName], 'readwrite').objectStore(osName).put({}, key1);"); 64 64 request.onsuccess = postPut; 65 65 request.onerror = unexpectedErrorCallback; … … 68 68 function postPut() 69 69 { 70 shouldBe("event.target.transaction.mode", " IDBTransaction.READ_WRITE");71 request = evalAndLog("request = db.transaction(osName, IDBTransaction.READ_WRITE).objectStore(osName).put({}, key2);");70 shouldBe("event.target.transaction.mode", "'readwrite'"); 71 request = evalAndLog("request = db.transaction(osName, 'readwrite').objectStore(osName).put({}, key2);"); 72 72 request.onsuccess = postPut2; 73 73 request.onerror = unexpectedErrorCallback; … … 76 76 function postPut2() 77 77 { 78 shouldBe("event.target.transaction.mode", " IDBTransaction.READ_WRITE");79 request = evalAndLog("request = db.transaction([osName], IDBTransaction.READ_WRITE).objectStore(osName).put({}, key1);");78 shouldBe("event.target.transaction.mode", "'readwrite'"); 79 request = evalAndLog("request = db.transaction([osName], 'readwrite').objectStore(osName).put({}, key1);"); 80 80 request.onsuccess = postPut3; 81 81 request.onerror = unexpectedErrorCallback; … … 84 84 function postPut3() 85 85 { 86 shouldBe("event.target.transaction.mode", " IDBTransaction.READ_WRITE");87 request = evalAndLog("request = db.transaction(osName, IDBTransaction.READ_WRITE).objectStore(osName).put({}, key1);");86 shouldBe("event.target.transaction.mode", "'readwrite'"); 87 request = evalAndLog("request = db.transaction(osName, 'readwrite').objectStore(osName).put({}, key1);"); 88 88 request.onsuccess = postPut4; 89 89 request.onerror = unexpectedErrorCallback; … … 92 92 function postPut4() 93 93 { 94 shouldBe("event.target.transaction.mode", " IDBTransaction.READ_WRITE");95 request = evalAndLog("request = db.transaction([osName], IDBTransaction.READ_WRITE).objectStore(osName).delete(key1);");94 shouldBe("event.target.transaction.mode", "'readwrite'"); 95 request = evalAndLog("request = db.transaction([osName], 'readwrite').objectStore(osName).delete(key1);"); 96 96 request.onsuccess = postDelete; 97 97 request.onerror = unexpectedErrorCallback; … … 100 100 function postDelete() 101 101 { 102 shouldBe("event.target.transaction.mode", " IDBTransaction.READ_WRITE");103 request = evalAndLog("request = db.transaction(osName, IDBTransaction.READ_WRITE).objectStore(osName).delete(key2);");102 shouldBe("event.target.transaction.mode", "'readwrite'"); 103 request = evalAndLog("request = db.transaction(osName, 'readwrite').objectStore(osName).delete(key2);"); 104 104 request.onsuccess = postDelete2; 105 105 request.onerror = unexpectedErrorCallback; … … 108 108 function postDelete2() 109 109 { 110 shouldBe("event.target.transaction.mode", " IDBTransaction.READ_WRITE");110 shouldBe("event.target.transaction.mode", "'readwrite'"); 111 111 finishJSTest(); 112 112 } -
trunk/LayoutTests/storage/indexeddb/mozilla/resources/readyState.js
r116051 r116337 19 19 description = "My Test Database"; 20 20 request = evalAndLog("indexedDB.open(name, description)"); 21 shouldBe("request.readyState", " IDBRequest.LOADING");21 shouldBe("request.readyState", "'pending'"); 22 22 request.onsuccess = openSuccess; 23 23 request.onerror = unexpectedErrorCallback; … … 27 27 { 28 28 debug("openSuccess():"); 29 shouldBe("request.readyState", " IDBRequest.DONE");29 shouldBe("request.readyState", "'done'"); 30 30 db = evalAndLog("db = event.target.result"); 31 31 request = evalAndLog("request = db.setVersion('1')"); 32 shouldBe("request.readyState", " IDBRequest.LOADING");32 shouldBe("request.readyState", "'pending'"); 33 33 request.onsuccess = setupObjectStore; 34 34 request.onerror = unexpectedErrorCallback; … … 38 38 { 39 39 debug("setupObjectStore():"); 40 shouldBe("request.readyState", " IDBRequest.DONE");40 shouldBe("request.readyState", "'done'"); 41 41 deleteAllObjectStores(db); 42 42 … … 44 44 key = evalAndLog("key = 10;"); 45 45 request = evalAndLog("request = objectStore.add({}, key);"); 46 shouldBe("request.readyState", " IDBRequest.LOADING");46 shouldBe("request.readyState", "'pending'"); 47 47 request.onsuccess = getRecord; 48 48 request.onerror = unexpectedErrorCallback; … … 52 52 { 53 53 debug("getRecord():"); 54 shouldBe("request.readyState", " IDBRequest.DONE");54 shouldBe("request.readyState", "'done'"); 55 55 shouldBe("event.target.result", "key"); 56 56 request = evalAndLog("request = objectStore.get(key);"); 57 shouldBe("request.readyState", " IDBRequest.LOADING");57 shouldBe("request.readyState", "'pending'"); 58 58 request.onsuccess = finalCheck; 59 59 request.onerror = unexpectedErrorCallback; … … 63 63 { 64 64 debug("finalCheck():"); 65 shouldBe("request.readyState", " IDBRequest.DONE");65 shouldBe("request.readyState", "'done'"); 66 66 shouldBeFalse("event.target.result == null"); 67 67 finishJSTest(); -
trunk/LayoutTests/storage/indexeddb/mozilla/resources/versionchange.js
r116051 r116337 65 65 { 66 66 shouldBe("event.target.result", "event.target.transaction"); 67 shouldBe("event.target.transaction.mode", " IDBTransaction.VERSION_CHANGE");67 shouldBe("event.target.transaction.mode", "'versionchange'"); 68 68 shouldBe("db2.version", "'1'"); 69 69 … … 93 93 { 94 94 shouldBe("event.target.result", "event.target.transaction"); 95 shouldBe("event.target.transaction.mode", " IDBTransaction.VERSION_CHANGE");95 shouldBe("event.target.transaction.mode", "'versionchange'"); 96 96 shouldBe("db3.version", "'2'"); 97 97 shouldBe("versionChangeEventCount", "3"); -
trunk/LayoutTests/storage/indexeddb/mozilla/versionchange-expected.txt
r116051 r116337 21 21 PASS db2 received blocked event 22 22 PASS event.target.result is event.target.transaction 23 PASS event.target.transaction.mode is IDBTransaction.VERSION_CHANGE23 PASS event.target.transaction.mode is 'versionchange' 24 24 PASS db2.version is '1' 25 25 request = indexedDB.open(name, description); … … 38 38 db2.close(); 39 39 PASS event.target.result is event.target.transaction 40 PASS event.target.transaction.mode is IDBTransaction.VERSION_CHANGE40 PASS event.target.transaction.mode is 'versionchange' 41 41 PASS db3.version is '2' 42 42 PASS versionChangeEventCount is 3 -
trunk/LayoutTests/storage/indexeddb/mutating-cursor-expected.txt
r116051 r116337 19 19 objectStore.add(4, 4).onerror = unexpectedErrorCallback 20 20 openForwardCursor() 21 trans = db.transaction(['store'], IDBTransaction.READ_WRITE)21 trans = db.transaction(['store'], 'readwrite') 22 22 trans.objectStore('store') 23 23 objectStore.openCursor() … … 52 52 forwardCursorComplete() 53 53 openReverseCursor() 54 trans = db.transaction(['store'], IDBTransaction.READ_WRITE)54 trans = db.transaction(['store'], 'readwrite') 55 55 trans.objectStore('store') 56 objectStore.openCursor(null, IDBCursor.PREV)56 objectStore.openCursor(null, 'prev') 57 57 reverseCursor() 58 58 5 -
trunk/LayoutTests/storage/indexeddb/noblobs-expected.txt
r116051 r116337 17 17 18 18 testBlob(): 19 BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder20 PASS BlobBuilder != null is true21 19 PASS FileReader != null is true 22 builder = new BlobBuilder()23 20 test_content = 'This is a test. This is only a test.' 24 builder.append(test_content) 25 blob = builder.getBlob() 21 blob = new Blob([test_content]) 26 22 27 23 validateExceptions(blob): 28 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)24 transaction = db.transaction('storeName', 'readwrite') 29 25 store = transaction.objectStore('storeName') 30 26 Expecting exception from store.put(blob, 'key') … … 44 40 45 41 validateExceptions(file): 46 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)42 transaction = db.transaction('storeName', 'readwrite') 47 43 store = transaction.objectStore('storeName') 48 44 Expecting exception from store.put(file, 'key') … … 62 58 63 59 validateExceptions(filelist): 64 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)60 transaction = db.transaction('storeName', 'readwrite') 65 61 store = transaction.objectStore('storeName') 66 62 Expecting exception from store.put(filelist, 'key') -
trunk/LayoutTests/storage/indexeddb/noblobs.html
r116051 r116337 85 85 debug(""); 86 86 debug("validateExceptions(" + variable + "):"); 87 evalAndLog("transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)");87 evalAndLog("transaction = db.transaction('storeName', 'readwrite')"); 88 88 evalAndLog("store = transaction.objectStore('storeName')"); 89 89 evalAndExpectException("store.put(" + variable + ", 'key')", "DOMException.DATA_CLONE_ERR"); -
trunk/LayoutTests/storage/indexeddb/objectstore-autoincrement-expected.txt
r116051 r116337 27 27 PASS storeNames.length is 4 28 28 setVersionCompleted(): 29 trans = db.transaction(['StoreWithKeyPath', 'StoreWithAutoIncrement', 'PlainOldStore'], IDBTransaction.READ_WRITE)29 trans = db.transaction(['StoreWithKeyPath', 'StoreWithAutoIncrement', 'PlainOldStore'], 'readwrite') 30 30 store = trans.objectStore('StoreWithKeyPath') 31 31 Insert into object store with auto increment and key path, with key in the object. … … 67 67 PASS event.target.result is 1 68 68 testLongKeyPath(): 69 trans = db.transaction('StoreWithLongKeyPath', IDBTransaction.READ_WRITE)69 trans = db.transaction('StoreWithLongKeyPath', 'readwrite') 70 70 store = trans.objectStore('StoreWithLongKeyPath') 71 71 store.add({foo: 'bar'}) -
trunk/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt
r116051 r116337 77 77 PASS store.indexNames.item(1) is null 78 78 PASS store.indexNames.item(100) is null 79 transaction = db.transaction(['storeName'], IDBTransaction.READ_WRITE)79 transaction = db.transaction(['storeName'], 'readwrite') 80 80 store = transaction.objectStore('storeName') 81 81 Try to insert data with a Date key: … … 93 93 PASS event.target.errorCode is IDBDatabaseException.CONSTRAINT_ERR 94 94 event.preventDefault() 95 db.transaction(['storeName'], IDBTransaction.READ_WRITE)95 db.transaction(['storeName'], 'readwrite') 96 96 store = transaction.objectStore('storeName') 97 97 store.add({x: 'somevalue'}, 'somekey') … … 99 99 PASS Exception was thrown. 100 100 PASS code is IDBDatabaseException.DATA_ERR 101 db.transaction(['storeName'], IDBTransaction.READ_WRITE)101 db.transaction(['storeName'], 'readwrite') 102 102 store = transaction.objectStore('storeName') 103 103 Expecting exception from store.add({x: null}, 'validkey') 104 104 PASS Exception was thrown. 105 105 PASS code is IDBDatabaseException.DATA_ERR 106 db.transaction(['storeName'], IDBTransaction.READ_WRITE)106 db.transaction(['storeName'], 'readwrite') 107 107 store = transaction.objectStore('storeName') 108 108 store.get('key') -
trunk/LayoutTests/storage/indexeddb/objectstore-basics-workers-expected.txt
r116051 r116337 78 78 PASS [Worker] store.indexNames.item(1) is null 79 79 PASS [Worker] store.indexNames.item(100) is null 80 [Worker] transaction = db.transaction(['storeName'], IDBTransaction.READ_WRITE)80 [Worker] transaction = db.transaction(['storeName'], 'readwrite') 81 81 [Worker] store = transaction.objectStore('storeName') 82 82 [Worker] Try to insert data with a Date key: … … 94 94 PASS [Worker] event.target.errorCode is IDBDatabaseException.CONSTRAINT_ERR 95 95 [Worker] event.preventDefault() 96 [Worker] db.transaction(['storeName'], IDBTransaction.READ_WRITE)96 [Worker] db.transaction(['storeName'], 'readwrite') 97 97 [Worker] store = transaction.objectStore('storeName') 98 98 [Worker] store.add({x: 'somevalue'}, 'somekey') … … 100 100 PASS [Worker] Exception was thrown. 101 101 PASS [Worker] code is IDBDatabaseException.DATA_ERR 102 [Worker] db.transaction(['storeName'], IDBTransaction.READ_WRITE)102 [Worker] db.transaction(['storeName'], 'readwrite') 103 103 [Worker] store = transaction.objectStore('storeName') 104 104 [Worker] Expecting exception from store.add({x: null}, 'validkey') 105 105 PASS [Worker] Exception was thrown. 106 106 PASS [Worker] code is IDBDatabaseException.DATA_ERR 107 [Worker] db.transaction(['storeName'], IDBTransaction.READ_WRITE)107 [Worker] db.transaction(['storeName'], 'readwrite') 108 108 [Worker] store = transaction.objectStore('storeName') 109 109 [Worker] store.get('key') -
trunk/LayoutTests/storage/indexeddb/objectstore-count-expected.txt
r116051 r116337 18 18 19 19 verifying count without range 20 trans = db.transaction('storeName', IDBTransaction.READ_ONLY)20 trans = db.transaction('storeName', 'readonly') 21 21 PASS trans != null is true 22 22 store = trans.objectStore('storeName') … … 27 27 28 28 verifying count with range 29 trans = db.transaction('storeName', IDBTransaction.READ_ONLY)29 trans = db.transaction('storeName', 'readonly') 30 30 PASS trans != null is true 31 31 store = trans.objectStore('storeName') … … 78 78 79 79 verifying count with key 80 trans = db.transaction('storeName', IDBTransaction.READ_ONLY)80 trans = db.transaction('storeName', 'readonly') 81 81 PASS trans != null is true 82 82 store = trans.objectStore('storeName') -
trunk/LayoutTests/storage/indexeddb/open-cursor-expected.txt
r116051 r116337 18 18 event.target.source.openCursor(keyRange) 19 19 Cursor opened successfully. 20 PASS cursor.direction is 020 PASS cursor.direction is 'next' 21 21 PASS cursor.key is 'myKey' 22 22 PASS cursor.value is 'myValue' … … 34 34 event.target.source.openCursor("myKey") 35 35 Cursor opened successfully. 36 PASS cursor.direction is 036 PASS cursor.direction is 'next' 37 37 PASS cursor.key is 'myKey' 38 38 PASS cursor.value is 'myValue' -
trunk/LayoutTests/storage/indexeddb/open-during-transaction-expected.txt
r116051 r116337 15 15 starting transaction 16 16 state = 'starting' 17 trans = dbc1.transaction('storeName', IDBTransaction.READ_WRITE)17 trans = dbc1.transaction('storeName', 'readwrite') 18 18 trans.objectStore('storeName').put('value', 'key') 19 19 -
trunk/LayoutTests/storage/indexeddb/opencursor-key-expected.txt
r116051 r116337 31 31 objectStore.createIndex(indexData[i].name, indexData[i].keyPath, indexData[i].options); 32 32 testObjectStore() 33 trans = db.transaction(objectStoreName, IDBTransaction.READ_WRITE)33 trans = db.transaction(objectStoreName, 'readwrite') 34 34 objectStore = trans.objectStore(objectStoreName) 35 35 request = objectStore.openCursor('237-23-7739') … … 39 39 cursor.continue() 40 40 PASS cursor is null 41 trans = db.transaction(objectStoreName, IDBTransaction.READ_WRITE)41 trans = db.transaction(objectStoreName, 'readwrite') 42 42 objectStore = trans.objectStore(objectStoreName) 43 43 index = objectStore.index('weight') … … 56 56 cursor.continue() 57 57 PASS cursor is null 58 trans = db.transaction(objectStoreName, IDBTransaction.READ_WRITE)58 trans = db.transaction(objectStoreName, 'readwrite') 59 59 objectStore = trans.objectStore(objectStoreName) 60 60 index = objectStore.index('weight') -
trunk/LayoutTests/storage/indexeddb/prefetch-bugfix-108071-expected.txt
r116051 r116337 24 24 25 25 iterateAndDeleteFirstElement(): 26 trans = db.transaction(['store'], IDBTransaction.READ_WRITE)26 trans = db.transaction(['store'], 'readwrite') 27 27 trans.objectStore('store').openCursor() 28 28 0: Alpha -
trunk/LayoutTests/storage/indexeddb/readonly-expected.txt
r116051 r116337 21 21 trying to set readonly property request.readyState 22 22 request.readyState = 666 23 PASS request.readyState is still 223 PASS request.readyState is still done 24 24 db = event.target.result 25 25 trying to set readonly property db.name … … 30 30 trying to set readonly property transaction.mode 31 31 transaction.mode = 666 32 PASS transaction.mode is still 232 PASS transaction.mode is still versionchange 33 33 trying to set readonly property transaction.db 34 34 transaction.db = this … … 50 50 trying to set readonly property cursor.direction 51 51 cursor.direction = 666 52 PASS cursor.direction is still 052 PASS cursor.direction is still next 53 53 trying to set readonly property cursor.key 54 54 cursor.key = Infinity -
trunk/LayoutTests/storage/indexeddb/request-event-propagation-expected.txt
r116051 r116337 17 17 store.add({x: 'value', y: 'zzz'}, 'key') 18 18 Verify that handler fires and that not preventing default will result in an abort 19 trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)19 trans = db.transaction(['storeName'], 'readwrite') 20 20 trans.onabort = transactionAborted 21 21 trans.oncomplete = unexpectedCompleteCallback … … 28 28 29 29 Verifing error 30 trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)30 trans = db.transaction(['storeName'], 'readwrite') 31 31 trans.onabort = transactionAborted2 32 32 trans.oncomplete = unexpectedAbortCallback … … 95 95 96 96 Verifing success. 97 trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)97 trans = db.transaction(['storeName'], 'readwrite') 98 98 trans.oncomplete = transactionComplete 99 99 trans.onabort = unexpectedAbortCallback -
trunk/LayoutTests/storage/indexeddb/resources/basics.js
r116051 r116337 21 21 shouldBeNull("request.transaction"); 22 22 shouldBeTrue("'readyState' in request"); 23 shouldBe("request.readyState", " IDBRequest.LOADING");23 shouldBe("request.readyState", "'pending'"); 24 24 shouldBeTrue("'onsuccess' in request"); 25 25 shouldBeNull("request.onsuccess"); 26 26 shouldBeTrue("'onerror' in request"); 27 27 shouldBeNull("request.onerror"); 28 shouldBe("request.LOADING", "1");29 shouldBe("request.DONE", "2");30 28 request.onsuccess = openCallback; 31 29 request.onerror = unexpectedErrorCallback; … … 46 44 shouldBeNull("event.target.transaction"); 47 45 shouldBeTrue("'readyState' in request"); 48 shouldBe("event.target.readyState", " IDBRequest.DONE");46 shouldBe("event.target.readyState", "'done'"); 49 47 shouldBeTrue("'onsuccess' in event.target"); 50 48 shouldBeTrue("'onerror' in event.target"); 51 shouldBe("event.target.LOADING", "1");52 shouldBe("event.target.DONE", "2");53 49 54 50 finishJSTest(); -
trunk/LayoutTests/storage/indexeddb/resources/constants.js
r116051 r116337 22 22 shouldBe("IDBDatabaseException.VER_ERR", "12"); 23 23 24 shouldBe("IDBRequest.LOADING", "1");25 shouldBe("IDBRequest.DONE", "2");26 27 24 shouldBe("IDBCursor.NEXT", "0"); 28 25 shouldBe("IDBCursor.NEXT_NO_DUPLICATE", "1"); -
trunk/LayoutTests/storage/indexeddb/resources/create-object-store-options.js
r116051 r116337 38 38 function setVersionComplete() 39 39 { 40 trans = evalAndLog("trans = db.transaction(['a', 'b'], IDBTransaction.READ_WRITE)");41 shouldBe("trans.mode", " IDBTransaction.READ_WRITE");40 trans = evalAndLog("trans = db.transaction(['a', 'b'], 'readwrite')"); 41 shouldBe("trans.mode", "'readwrite'"); 42 42 43 43 req = evalAndLog("trans.objectStore('a').put({'a': 0})"); -
trunk/LayoutTests/storage/indexeddb/resources/cursor-added-bug.js
r116051 r116337 42 42 function openCursor() 43 43 { 44 evalAndLog("trans = db.transaction(['test'], IDBTransaction.READ_WRITE)");44 evalAndLog("trans = db.transaction(['test'], 'readwrite')"); 45 45 trans.onabort = finishJSTest; 46 46 trans.oncomplete = finishJSTest; -
trunk/LayoutTests/storage/indexeddb/resources/cursor-advance.js
r116051 r116337 83 83 store = store.index(indexName); 84 84 85 evalAndLog("request = store.openCursor(null, " + direction + ")"); 85 if (direction) 86 evalAndLog("request = store.openCursor(null, " + direction + ")"); 87 else 88 evalAndLog("request = store.openCursor()"); 86 89 var currentPos = 0; 87 90 function continueToTest(event) … … 134 137 function runTest(cursor, expectedValue) 135 138 { 136 shouldBe("'" + JSON.stringify(simplifyCursor(cursor)) + "'",137 "'" + JSON.stringify(expectedValue) + "'");139 expected = JSON.stringify(expectedValue); 140 shouldBe("expected", "'" + JSON.stringify(simplifyCursor(cursor)) + "'"); 138 141 } 139 142 … … 189 192 { 190 193 debug("testAdvanceIndexNoDupe()"); 191 makeAdvanceTest(0, IDBCursor.NEXT_NO_DUPLICATE, 3,194 makeAdvanceTest(0, "'nextunique'", 3, 192 195 // Sue (weight 130 - skipping weight 100, 110, 120) 193 196 {key: objectStoreData[3].value.weight, … … 200 203 { 201 204 debug("testAdvanceIndexPrev()"); 202 makeAdvanceTest(0, IDBCursor.PREV, 3,203 // Bob (weight 120 - skipping weights 180, 150, 130)205 makeAdvanceTest(0, "'prev'", 3, 206 // Joe (weight 150 - skipping 180, 180, 180) 204 207 {key: objectStoreData[4].value.weight, 205 208 value: objectStoreData[4].value, … … 211 214 { 212 215 debug("testAdvanceIndexPrevNoDupe()"); 213 makeAdvanceTest(0, IDBCursor.PREV_NO_DUPLICATE, 3,216 makeAdvanceTest(0, "'prevunique'", 3, 214 217 // Bob (weight 120 - skipping weights 180, 150, 130) 215 218 {key: objectStoreData[0].value.weight, … … 315 318 { 316 319 debug("testBadAdvance()"); 317 evalAndLog("trans = db.transaction(objectStoreName, IDBTransaction.READ_WRITE)");320 evalAndLog("trans = db.transaction(objectStoreName, 'readwrite')"); 318 321 objectStore = evalAndLog("objectStore = trans.objectStore(objectStoreName)"); 319 322 … … 336 339 { 337 340 debug("testDelete()"); 338 evalAndLog("trans = db.transaction(objectStoreName, IDBTransaction.READ_WRITE)");341 evalAndLog("trans = db.transaction(objectStoreName, 'readwrite')"); 339 342 objectStore = evalAndLog("objectStore = trans.objectStore(objectStoreName)"); 340 343 -
trunk/LayoutTests/storage/indexeddb/resources/cursor-continue-validity.js
r116051 r116337 61 61 debug("Checking objectStore"); 62 62 debug("===================="); 63 var request = evalAndLog("indexObject.openCursor(null, IDBCursor.NEXT)");63 var request = evalAndLog("indexObject.openCursor(null, 'next')"); 64 64 evalAndLog("self.continueValue = 0"); 65 65 request.onsuccess = evalAndLogCallback("doubleContinueCallback()"); … … 97 97 debug("Checking index"); 98 98 debug("=============="); 99 var request = evalAndLog("indexObject.openCursor(null, IDBCursor.NEXT)");99 var request = evalAndLog("indexObject.openCursor(null, 'next')"); 100 100 evalAndLog("self.continueValue = 0"); 101 101 request.onsuccess = doubleContinueIndexCallback; … … 135 135 debug("Checking modification"); 136 136 debug("====================="); 137 var request = evalAndLog("indexObject.openCursor(null, IDBCursor.NEXT)");137 var request = evalAndLog("indexObject.openCursor(null, 'next')"); 138 138 evalAndLog("self.continueValue = 0"); 139 139 request.onsuccess = modifyContinueOrderCallback; -
trunk/LayoutTests/storage/indexeddb/resources/cursor-continue.js
r116051 r116337 76 76 { 77 77 debug(""); 78 var request = evalAndLog("indexObject.openKeyCursor(null, IDBCursor.NEXT)");78 var request = evalAndLog("indexObject.openKeyCursor(null, 'next')"); 79 79 request.onsuccess = ascendingCallback; 80 80 request.onerror = unexpectedErrorCallback; … … 131 131 { 132 132 debug(""); 133 var request = evalAndLog("indexObject.openKeyCursor(null, IDBCursor.PREV)");133 var request = evalAndLog("indexObject.openKeyCursor(null, 'prev')"); 134 134 request.onsuccess = descendingCallback; 135 135 request.onerror = unexpectedErrorCallback; … … 176 176 { 177 177 debug(""); 178 var request = evalAndLog("indexObject.openKeyCursor(null, IDBCursor.NEXT)");178 var request = evalAndLog("indexObject.openKeyCursor(null, 'next')"); 179 179 self.stage = 0; 180 180 request.onerror = unexpectedErrorCallback; … … 198 198 { 199 199 debug(""); 200 var request = evalAndLog("indexObject.openKeyCursor(null, IDBCursor.NEXT)");200 var request = evalAndLog("indexObject.openKeyCursor(null, 'next')"); 201 201 self.stage = 0; 202 202 request.onerror = unexpectedErrorCallback; … … 220 220 { 221 221 debug(""); 222 var request = evalAndLog("indexObject.openKeyCursor(null, IDBCursor.PREV)");222 var request = evalAndLog("indexObject.openKeyCursor(null, 'prev')"); 223 223 self.stage = 0; 224 224 request.onerror = unexpectedErrorCallback; … … 242 242 { 243 243 debug(""); 244 var request = evalAndLog("indexObject.openKeyCursor(null, IDBCursor.PREV)");244 var request = evalAndLog("indexObject.openKeyCursor(null, 'prev')"); 245 245 self.stage = 0; 246 246 request.onerror = unexpectedErrorCallback; -
trunk/LayoutTests/storage/indexeddb/resources/cursor-delete.js
r116051 r116337 45 45 { 46 46 debug("openCursor1"); 47 evalAndLog("trans = db.transaction(['test'], IDBTransaction.READ_WRITE)");47 evalAndLog("trans = db.transaction(['test'], 'readwrite')"); 48 48 keyRange = IDBKeyRange.lowerBound("myKey1"); 49 49 request = evalAndLog("trans.objectStore('test').openCursor(keyRange)"); … … 75 75 function addObject() 76 76 { 77 evalAndLog("trans = db.transaction(['test'], IDBTransaction.READ_WRITE)");77 evalAndLog("trans = db.transaction(['test'], 'readwrite')"); 78 78 objectStore = evalAndLog("objectStore = trans.objectStore('test')"); 79 79 request = evalAndLog("objectStore.add('myValue1', 'myKey1')"); -
trunk/LayoutTests/storage/indexeddb/resources/cursor-inconsistency.js
r116051 r116337 46 46 { 47 47 debug("openBasicCursor()"); 48 evalAndLog("trans = db.transaction(['basicStore'], IDBTransaction.READ_WRITE)");48 evalAndLog("trans = db.transaction(['basicStore'], 'readwrite')"); 49 49 trans.onabort = unexpectedAbortCallback; 50 50 trans.oncomplete = transactionComplete; -
trunk/LayoutTests/storage/indexeddb/resources/cursor-index-delete.js
r116051 r116337 47 47 { 48 48 debug("openCursor1"); 49 evalAndLog("trans = db.transaction(['test'], IDBTransaction.READ_WRITE)");49 evalAndLog("trans = db.transaction(['test'], 'readwrite')"); 50 50 keyRange = IDBKeyRange.lowerBound(1); 51 51 request = evalAndLog("trans.objectStore('test').index('testIndex').openCursor(keyRange)"); … … 78 78 function addObject() 79 79 { 80 evalAndLog("trans = db.transaction(['test'], IDBTransaction.READ_WRITE)");80 evalAndLog("trans = db.transaction(['test'], 'readwrite')"); 81 81 objectStore = evalAndLog("objectStore = trans.objectStore('test')"); 82 82 request = evalAndLog("objectStore.add({x: 1}, 'myKey1')"); -
trunk/LayoutTests/storage/indexeddb/resources/cursor-key-order.js
r116051 r116337 135 135 debug(""); 136 136 debug("populating store..."); 137 evalAndLog("trans = db.transaction('store', IDBTransaction.READ_WRITE)");137 evalAndLog("trans = db.transaction('store', 'readwrite')"); 138 138 evalAndLog("store = trans.objectStore('store');"); 139 139 trans.onerror = unexpectedErrorCallback; … … 150 150 debug(""); 151 151 debug("iterating cursor..."); 152 evalAndLog("trans = db.transaction('store', IDBTransaction.READ_ONLY)");152 evalAndLog("trans = db.transaction('store', 'readonly')"); 153 153 evalAndLog("store = trans.objectStore('store');"); 154 154 trans.onerror = unexpectedErrorCallback; -
trunk/LayoutTests/storage/indexeddb/resources/cursor-prev-no-duplicate.js
r116051 r116337 37 37 debug(""); 38 38 debug("populating store..."); 39 evalAndLog("trans = db.transaction('store', IDBTransaction.READ_WRITE)");39 evalAndLog("trans = db.transaction('store', 'readwrite')"); 40 40 evalAndLog("store = trans.objectStore('store');"); 41 41 trans.onerror = unexpectedErrorCallback; … … 56 56 debug("testFarRangeCursor: upper bound is well out of range, results always the same, whether open or closed"); 57 57 58 runTest(makeOpenCursor("store", 7, false, IDBCursor.PREV),58 runTest(makeOpenCursor("store", 7, false, "'prev'"), 59 59 { expectedValue: 333, expectedKey: 3}).onsuccess = 60 60 testFarRangeCursor_open; … … 63 63 function testFarRangeCursor_open() 64 64 { 65 runTest(makeOpenCursor("store", 7, true, IDBCursor.PREV),65 runTest(makeOpenCursor("store", 7, true, "'prev'"), 66 66 { expectedValue: 333, expectedKey: 3}).onsuccess = 67 67 testFarRangeCursor_indexClosed; … … 71 71 { 72 72 // here '7' refers to the 'sorted' value 73 runTest(makeOpenCursor("index", 7, false, IDBCursor.PREV),73 runTest(makeOpenCursor("index", 7, false, "'prev'"), 74 74 { expectedValue: 111, expectedKey: 3, expectedPrimaryKey: 1}).onsuccess = 75 75 testFarRangeCursor_indexOpen; … … 77 77 function testFarRangeCursor_indexOpen() 78 78 { 79 runTest(makeOpenCursor("index", 7, true, IDBCursor.PREV),79 runTest(makeOpenCursor("index", 7, true, "'prev'"), 80 80 { expectedValue: 111, expectedKey: 3, expectedPrimaryKey: 1}).onsuccess = 81 81 testFarRangeCursor_indexKeyOpen; … … 85 85 { 86 86 // here '7' refers to the sorted value 87 runTest(makeOpenKeyCursor("index", 7, false, IDBCursor.PREV),87 runTest(makeOpenKeyCursor("index", 7, false, "'prev'"), 88 88 { expectedKey: 3, expectedPrimaryKey: 1}).onsuccess = 89 89 testFarRangeCursor_indexKeyClosed; … … 92 92 function testFarRangeCursor_indexKeyClosed() 93 93 { 94 runTest(makeOpenKeyCursor("index", 7, true, IDBCursor.PREV),94 runTest(makeOpenKeyCursor("index", 7, true, "'prev'"), 95 95 { expectedKey: 3, expectedPrimaryKey: 1}).onsuccess = 96 96 testBoundaryCursor_closed; … … 99 99 function testBoundaryCursor_closed() 100 100 { 101 runTest(makeOpenCursor("store", 3, false, IDBCursor.PREV),101 runTest(makeOpenCursor("store", 3, false, "'prev'"), 102 102 { expectedValue: 333, expectedKey: 3}).onsuccess = 103 103 testBoundaryCursor_open; … … 106 106 function testBoundaryCursor_open() 107 107 { 108 runTest(makeOpenCursor("store", 3, true, IDBCursor.PREV),108 runTest(makeOpenCursor("store", 3, true, "'prev'"), 109 109 { expectedValue: 222, expectedKey: 2}).onsuccess = 110 110 testBoundaryCursor_indexClosed; … … 114 114 { 115 115 // by index sort order, we should return them in a different order 116 runTest(makeOpenCursor("index", 3, false, IDBCursor.PREV),116 runTest(makeOpenCursor("index", 3, false, "'prev'"), 117 117 { expectedValue: 111, expectedKey: 3, expectedPrimaryKey: 1}).onsuccess = 118 118 testBoundaryCursor_indexOpen; … … 121 121 function testBoundaryCursor_indexOpen() 122 122 { 123 runTest(makeOpenCursor("index", 3, true, IDBCursor.PREV),123 runTest(makeOpenCursor("index", 3, true, "'prev'"), 124 124 { expectedValue: 222, expectedKey: 2, expectedPrimaryKey: 2}).onsuccess = 125 125 testBoundaryCursor_indexKeyClosed; … … 130 130 131 131 // now the value doesn't matter, just the primary key 132 runTest(makeOpenKeyCursor("index", 3, false, IDBCursor.PREV),132 runTest(makeOpenKeyCursor("index", 3, false, "'prev'"), 133 133 { expectedKey: 3, expectedPrimaryKey: 1}).onsuccess = 134 134 testBoundaryCursor_indexKeyOpen; … … 137 137 function testBoundaryCursor_indexKeyOpen() 138 138 { 139 runTest(makeOpenKeyCursor("index", 3, true, IDBCursor.PREV),139 runTest(makeOpenKeyCursor("index", 3, true, "'prev'"), 140 140 { expectedKey: 2, expectedPrimaryKey: 2}).onsuccess = 141 141 testNoDuplicate_closed; … … 149 149 // cursors, but we should make sure we get the right one 150 150 // anyway 151 runTest(makeOpenCursor("store", 15, false, IDBCursor.PREV_NO_DUPLICATE),151 runTest(makeOpenCursor("store", 15, false, "'prevunique'"), 152 152 { expectedValue: 666, expectedKey: 15, expectedPrimaryKey: 15 }) 153 153 .onsuccess = testNoDuplicate_open; … … 158 158 // still three values, but now the index says we should return the 159 159 // second one 160 runTest(makeOpenCursor("index", 15, false, IDBCursor.PREV_NO_DUPLICATE),160 runTest(makeOpenCursor("index", 15, false, "'prevunique'"), 161 161 { expectedValue: 666, expectedKey: 10, expectedPrimaryKey: 15}).onsuccess = testNoDuplicate_indexKeyClosed; 162 162 } … … 166 166 { 167 167 // same behavior as above, without a value 168 runTest(makeOpenKeyCursor("index", 15, false, IDBCursor.PREV_NO_DUPLICATE),168 runTest(makeOpenKeyCursor("index", 15, false, "'prevunique'"), 169 169 { expectedKey: 10, expectedPrimaryKey: 15}).onsuccess = 170 170 finishJSTest; … … 188 188 function runTest(openCursor, exp) 189 189 { 190 trans = db.transaction('store', IDBTransaction.READ_ONLY);190 trans = db.transaction('store', 'readonly'); 191 191 192 192 // expose these for code in openCursor -
trunk/LayoutTests/storage/indexeddb/resources/cursor-primary-key-order.js
r116051 r116337 55 55 debug(""); 56 56 debug("populating store..."); 57 evalAndLog("trans = db.transaction('store', IDBTransaction.READ_WRITE)");57 evalAndLog("trans = db.transaction('store', 'readwrite')"); 58 58 evalAndLog("store = trans.objectStore('store');"); 59 59 trans.onerror = unexpectedErrorCallback; … … 74 74 debug(""); 75 75 debug("iterating cursor..."); 76 evalAndLog("trans = db.transaction('store', IDBTransaction.READ_ONLY)");76 evalAndLog("trans = db.transaction('store', 'readonly')"); 77 77 evalAndLog("store = trans.objectStore('store');"); 78 78 evalAndLog("index = store.index('index');"); -
trunk/LayoutTests/storage/indexeddb/resources/cursor-reverse-bug.js
r116051 r116337 35 35 debug(""); 36 36 debug("populating store..."); 37 evalAndLog("trans = db.transaction('store', IDBTransaction.READ_WRITE)");37 evalAndLog("trans = db.transaction('store', 'readwrite')"); 38 38 evalAndLog("store = trans.objectStore('store');"); 39 39 trans.onerror = unexpectedErrorCallback; … … 65 65 test = tests.shift(); 66 66 67 evalAndLog("trans = db.transaction('store', IDBTransaction.READ_ONLY)");67 evalAndLog("trans = db.transaction('store', 'readonly')"); 68 68 trans.onerror = unexpectedErrorCallback; 69 69 trans.onabort = unexpectedAbortCallback; … … 89 89 90 90 debug("upperBound: " + test.upperBound + " open: " + test.open + " expected: " + test.expected); 91 storeReq = evalAndLog("storeReq = store.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), IDBCursor.PREV)");91 storeReq = evalAndLog("storeReq = store.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev')"); 92 92 storeReq.onsuccess = testFunction; 93 93 94 indexReq = evalAndLog("indexReq = index.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), IDBCursor.PREV)");94 indexReq = evalAndLog("indexReq = index.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev')"); 95 95 indexReq.onsuccess = testFunction; 96 96 97 indexKeyReq = evalAndLog("indexKeyReq = index.openKeyCursor(IDBKeyRange.upperBound(test.upperBound, test.open), IDBCursor.PREV)");97 indexKeyReq = evalAndLog("indexKeyReq = index.openKeyCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev')"); 98 98 indexKeyReq.onsuccess = testFunction; 99 99 } -
trunk/LayoutTests/storage/indexeddb/resources/cursor-skip-deleted.js
r116051 r116337 139 139 debug("basicCursorTest()"); 140 140 141 evalAndLog("trans = db.transaction(['store'], IDBTransaction.READ_WRITE)");141 evalAndLog("trans = db.transaction(['store'], 'readwrite')"); 142 142 trans.onabort = unexpectedAbortCallback; 143 143 trans.oncomplete = transactionComplete; … … 168 168 ]; 169 169 170 testCursor(deletes, "trans.objectStore('store').openCursor(IDBKeyRange.lowerBound(0), IDBCursor.PREV)", function() { resetObjectStore(indexCursorTest); });170 testCursor(deletes, "trans.objectStore('store').openCursor(IDBKeyRange.lowerBound(0), 'prev')", function() { resetObjectStore(indexCursorTest); }); 171 171 } 172 172 -
trunk/LayoutTests/storage/indexeddb/resources/cursor-update.js
r116051 r116337 58 58 { 59 59 debug("openBasicCursor()"); 60 evalAndLog("trans = db.transaction(['basicStore', 'autoIncrementStore', 'keyPathStore'], IDBTransaction.READ_WRITE)");60 evalAndLog("trans = db.transaction(['basicStore', 'autoIncrementStore', 'keyPathStore'], 'readwrite')"); 61 61 trans.onabort = unexpectedAbortCallback; 62 62 trans.oncomplete = transactionComplete; -
trunk/LayoutTests/storage/indexeddb/resources/data-corruption.js
r116051 r116337 42 42 { 43 43 debug("addData():"); 44 var transaction = evalAndLog("transaction = db.transaction(['storeName'], IDBTransaction.READ_WRITE)");44 var transaction = evalAndLog("transaction = db.transaction(['storeName'], 'readwrite')"); 45 45 var request = evalAndLog("request = transaction.objectStore('storeName').add({x: testDate}, 'key')"); 46 46 request.onerror = unexpectedErrorCallback; … … 51 51 { 52 52 debug("addData():"); 53 var transaction = evalAndLog("transaction = db.transaction(['storeName'], IDBTransaction.READ_ONLY)");53 var transaction = evalAndLog("transaction = db.transaction(['storeName'], 'readonly')"); 54 54 var request = evalAndLog("request = transaction.objectStore('storeName').get('key')"); 55 55 request.onerror = unexpectedErrorCallback; -
trunk/LayoutTests/storage/indexeddb/resources/database-quota.js
r116051 r116337 54 54 function checkQuotaEnforcing() 55 55 { 56 var trans = evalAndLog("trans = db.transaction(['test123'], IDBTransaction.READ_WRITE)");56 var trans = evalAndLog("trans = db.transaction(['test123'], 'readwrite')"); 57 57 trans.onabort = testComplete; 58 58 trans.oncomplete = unexpectedCompleteCallback; -
trunk/LayoutTests/storage/indexeddb/resources/delete-range.js
r116051 r116337 67 67 if (test) { 68 68 debug(""); 69 evalAndLog("trans = db.transaction('store', IDBTransaction.READ_WRITE)");69 evalAndLog("trans = db.transaction('store', 'readwrite')"); 70 70 evalAndLog("store = trans.objectStore('store')"); 71 71 for (i = 1; i <= 10; ++i) { -
trunk/LayoutTests/storage/indexeddb/resources/error-causes-abort-by-default.js
r116051 r116337 38 38 function addData() 39 39 { 40 trans = evalAndLog("trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)");40 trans = evalAndLog("trans = db.transaction(['storeName'], 'readwrite')"); 41 41 evalAndLog("trans.onabort = unexpectedAbortCallback"); 42 42 evalAndLog("trans.oncomplete = transactionCompleted"); … … 65 65 debug(""); 66 66 debug(""); 67 trans = evalAndLog("trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)");67 trans = evalAndLog("trans = db.transaction(['storeName'], 'readwrite')"); 68 68 evalAndLog("trans.onabort = transactionAborted1"); 69 69 evalAndLog("trans.oncomplete = unexpectedCompleteCallback"); … … 84 84 debug(""); 85 85 debug(""); 86 trans = evalAndLog("trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)");86 trans = evalAndLog("trans = db.transaction(['storeName'], 'readwrite')"); 87 87 evalAndLog("trans.onabort = transactionAborted2"); 88 88 evalAndLog("trans.oncomplete = unexpectedCompleteCallback"); -
trunk/LayoutTests/storage/indexeddb/resources/exception-in-event-aborts.js
r116051 r116337 41 41 { 42 42 debug(""); 43 trans = evalAndLog("trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)");43 trans = evalAndLog("trans = db.transaction(['storeName'], 'readwrite')"); 44 44 evalAndLog("trans.onabort = transactionAborted1"); 45 45 evalAndLog("trans.oncomplete = unexpectedCompleteCallback"); … … 63 63 shouldHaveHadError("this exception is expected"); 64 64 testPassed("The transaction was aborted."); 65 trans = evalAndLog("trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)");65 trans = evalAndLog("trans = db.transaction(['storeName'], 'readwrite')"); 66 66 evalAndLog("trans.onabort = transactionAborted2"); 67 67 evalAndLog("trans.oncomplete = unexpectedCompleteCallback"); … … 77 77 shouldHaveHadError("this exception is expected"); 78 78 testPassed("The transaction was aborted."); 79 trans = evalAndLog("trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)");79 trans = evalAndLog("trans = db.transaction(['storeName'], 'readwrite')"); 80 80 evalAndLog("trans.onabort = unexpectedAbortCallback"); 81 81 evalAndLog("trans.oncomplete = transactionCompleted1"); … … 102 102 debug(""); 103 103 testPassed("The transaction completed."); 104 trans = evalAndLog("trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)");104 trans = evalAndLog("trans = db.transaction(['storeName'], 'readwrite')"); 105 105 evalAndLog("trans.onabort = unexpectedAbortCallback"); 106 106 evalAndLog("trans.oncomplete = transactionCompleted2"); -
trunk/LayoutTests/storage/indexeddb/resources/factory-deletedatabase.js
r116051 r116337 40 40 function getValue() 41 41 { 42 transaction = evalAndLog("db.transaction('storeName', IDBTransaction.READ_WRITE)");42 transaction = evalAndLog("db.transaction('storeName', 'readwrite')"); 43 43 transaction.onabort = unexpectedErrorCallback; 44 44 var store = evalAndLog("store = transaction.objectStore('storeName')"); -
trunk/LayoutTests/storage/indexeddb/resources/index-count.js
r116051 r116337 45 45 debug(""); 46 46 debug("verifying count without range"); 47 trans = evalAndLog("trans = db.transaction('storeName', IDBTransaction.READ_ONLY)");47 trans = evalAndLog("trans = db.transaction('storeName', 'readonly')"); 48 48 shouldBeTrue("trans != null"); 49 49 trans.onabort = unexpectedAbortCallback; … … 68 68 debug(""); 69 69 debug("verifying count with range"); 70 trans = evalAndLog("trans = db.transaction('storeName', IDBTransaction.READ_ONLY)");70 trans = evalAndLog("trans = db.transaction('storeName', 'readonly')"); 71 71 shouldBeTrue("trans != null"); 72 72 trans.onabort = unexpectedAbortCallback; … … 113 113 debug(""); 114 114 debug("verifying count with key"); 115 trans = evalAndLog("trans = db.transaction('storeName', IDBTransaction.READ_ONLY)");115 trans = evalAndLog("trans = db.transaction('storeName', 'readonly')"); 116 116 shouldBeTrue("trans != null"); 117 117 trans.onabort = unexpectedAbortCallback; -
trunk/LayoutTests/storage/indexeddb/resources/index-cursor.js
r116051 r116337 174 174 keyRange = IDBKeyRange.upperBound(testData[upper], upperIsOpen); 175 175 176 var request = indexObject.openKeyCursor(keyRange, ascending ? IDBCursor.NEXT : IDBCursor.PREV);176 var request = indexObject.openKeyCursor(keyRange, ascending ? 'next' : 'prev'); 177 177 request.onsuccess = cursorIteration; 178 178 request.onerror = unexpectedErrorCallback; … … 241 241 debug(str); 242 242 243 var request = indexObject.openKeyCursor(null, ascending ? IDBCursor.NEXT : IDBCursor.PREV);243 var request = indexObject.openKeyCursor(null, ascending ? 'next' : 'prev'); 244 244 request.onsuccess = cursorIteration; 245 245 request.onerror = unexpectedErrorCallback; -
trunk/LayoutTests/storage/indexeddb/resources/index-multientry.js
r116051 r116337 43 43 debug(""); 44 44 debug("Populating stores (and indexes)"); 45 transaction = evalAndLog("transaction = db.transaction(['store'], IDBTransaction.READ_WRITE)");45 transaction = evalAndLog("transaction = db.transaction(['store'], 'readwrite')"); 46 46 transaction.onabort = unexpectedAbortCallback; 47 47 transaction.oncomplete = function() { verifyIndexes('index', verifyUniqueConstraint); }; … … 61 61 debug(""); 62 62 debug("Verifying index: " + indexName); 63 transaction = evalAndLog("transaction = db.transaction(['store'], IDBTransaction.READ_ONLY)");63 transaction = evalAndLog("transaction = db.transaction(['store'], 'readonly')"); 64 64 transaction.onabort = unexpectedAbortCallback; 65 65 transaction.oncomplete = callback; … … 95 95 debug(""); 96 96 debug("Verifying unique constraint on multiEntry index"); 97 transaction = evalAndLog("transaction = db.transaction(['store-unique'], IDBTransaction.READ_WRITE)");97 transaction = evalAndLog("transaction = db.transaction(['store-unique'], 'readwrite')"); 98 98 transaction.onabort = function () { 99 99 debug("Transaction aborted as expected"); -
trunk/LayoutTests/storage/indexeddb/resources/index-unique.js
r116051 r116337 42 42 { 43 43 debug("setVersionCompleted():"); 44 self.transaction = evalAndLog("transaction = db.transaction(['store'], IDBTransaction.READ_WRITE)");44 self.transaction = evalAndLog("transaction = db.transaction(['store'], 'readwrite')"); 45 45 46 46 request = evalAndLog("transaction.objectStore('store').put({x: 1}, 'foo')"); -
trunk/LayoutTests/storage/indexeddb/resources/key-generator.js
r116051 r116337 177 177 178 178 function (db, callback) { 179 evalAndLog("trans1 = db.transaction(['store'], IDBTransaction.READ_WRITE)");179 evalAndLog("trans1 = db.transaction(['store'], 'readwrite')"); 180 180 evalAndLog("store_t1 = trans1.objectStore('store')"); 181 181 evalAndLog("store_t1.put('a')"); … … 191 191 debug('aborted!'); 192 192 193 evalAndLog("trans2 = db.transaction(['store'], IDBTransaction.READ_WRITE)");193 evalAndLog("trans2 = db.transaction(['store'], 'readwrite')"); 194 194 evalAndLog("store_t2 = trans2.objectStore('store')"); 195 195 evalAndLog("store_t2.put('c')"); … … 211 211 212 212 function (db, callback) { 213 evalAndLog("trans1 = db.transaction(['store'], IDBTransaction.READ_WRITE)");213 evalAndLog("trans1 = db.transaction(['store'], 'readwrite')"); 214 214 evalAndLog("store_t1 = trans1.objectStore('store')"); 215 215 evalAndLog("store_t1.put('a')"); -
trunk/LayoutTests/storage/indexeddb/resources/key-type-array.js
r116051 r116337 42 42 function testValidArrayKeys() 43 43 { 44 evalAndLog("trans = db.transaction('store', IDBTransaction.READ_WRITE)");44 evalAndLog("trans = db.transaction('store', 'readwrite')"); 45 45 evalAndLog("store = trans.objectStore('store')"); 46 46 debug(""); … … 125 125 function testInvalidArrayKeys() 126 126 { 127 evalAndLog("trans = db.transaction('store', IDBTransaction.READ_WRITE)");127 evalAndLog("trans = db.transaction('store', 'readwrite')"); 128 128 evalAndLog("store = trans.objectStore('store')"); 129 129 debug(""); -
trunk/LayoutTests/storage/indexeddb/resources/keypath-edges.js
r116051 r116337 40 40 debug("testKeyPaths():"); 41 41 42 transaction = evalAndLog("transaction = db.transaction(['store-with-path'], IDBTransaction.READ_WRITE)");42 transaction = evalAndLog("transaction = db.transaction(['store-with-path'], 'readwrite')"); 43 43 store = evalAndLog("store = transaction.objectStore('store-with-path')"); 44 44 … … 72 72 debug("testKeyPathsAndGenerator():"); 73 73 74 transaction = evalAndLog("transaction = db.transaction(['store-with-path-and-generator'], IDBTransaction.READ_WRITE)");74 transaction = evalAndLog("transaction = db.transaction(['store-with-path-and-generator'], 'readwrite')"); 75 75 store = evalAndLog("store = transaction.objectStore('store-with-path-and-generator')"); 76 76 -
trunk/LayoutTests/storage/indexeddb/resources/keypath-intrinsic-properties.js
r116051 r116337 42 42 debug("testKeyPaths():"); 43 43 44 transaction = evalAndLog("transaction = db.transaction('store', IDBTransaction.READ_WRITE)");44 transaction = evalAndLog("transaction = db.transaction('store', 'readwrite')"); 45 45 transaction.onabort = unexpectedAbortCallback; 46 46 store = evalAndLog("store = transaction.objectStore('store')"); -
trunk/LayoutTests/storage/indexeddb/resources/mutating-cursor.js
r116051 r116337 45 45 { 46 46 debug("openForwardCursor()"); 47 evalAndLog("trans = db.transaction(['store'], IDBTransaction.READ_WRITE)");47 evalAndLog("trans = db.transaction(['store'], 'readwrite')"); 48 48 trans.onabort = unexpectedAbortCallback; 49 49 trans.oncomplete = forwardCursorComplete; … … 90 90 { 91 91 debug("openReverseCursor()"); 92 evalAndLog("trans = db.transaction(['store'], IDBTransaction.READ_WRITE)");92 evalAndLog("trans = db.transaction(['store'], 'readwrite')"); 93 93 trans.onabort = unexpectedAbortCallback; 94 94 trans.oncomplete = reverseCursorComplete; 95 95 96 96 self.objectStore = evalAndLog("trans.objectStore('store')"); 97 request = evalAndLog("objectStore.openCursor(null, IDBCursor.PREV)");97 request = evalAndLog("objectStore.openCursor(null, 'prev')"); 98 98 request.onsuccess = reverseCursor; 99 99 request.onerror = unexpectedErrorCallback; -
trunk/LayoutTests/storage/indexeddb/resources/objectstore-autoincrement.js
r116051 r116337 55 55 debug("setVersionCompleted():"); 56 56 57 self.trans = evalAndLog("trans = db.transaction(['StoreWithKeyPath', 'StoreWithAutoIncrement', 'PlainOldStore'], IDBTransaction.READ_WRITE)");57 self.trans = evalAndLog("trans = db.transaction(['StoreWithKeyPath', 'StoreWithAutoIncrement', 'PlainOldStore'], 'readwrite')"); 58 58 trans.onabort = unexpectedAbortCallback; 59 59 trans.oncomplete = testLongKeyPath; … … 156 156 { 157 157 debug("testLongKeyPath():"); 158 trans = evalAndLog("trans = db.transaction('StoreWithLongKeyPath', IDBTransaction.READ_WRITE)");158 trans = evalAndLog("trans = db.transaction('StoreWithLongKeyPath', 'readwrite')"); 159 159 trans.onabort = unexpectedAbortCallback; 160 160 trans.oncomplete = finishJSTest; -
trunk/LayoutTests/storage/indexeddb/resources/objectstore-basics.js
r116051 r116337 150 150 function addData() 151 151 { 152 var transaction = evalAndLog("transaction = db.transaction(['storeName'], IDBTransaction.READ_WRITE)");152 var transaction = evalAndLog("transaction = db.transaction(['storeName'], 'readwrite')"); 153 153 transaction.onabort = unexpectedAbortCallback; 154 154 self.store = evalAndLog("store = transaction.objectStore('storeName')"); … … 201 201 evalAndLog("event.preventDefault()"); 202 202 203 transaction = evalAndLog("db.transaction(['storeName'], IDBTransaction.READ_WRITE)");203 transaction = evalAndLog("db.transaction(['storeName'], 'readwrite')"); 204 204 transaction.onabort = unexpectedErrorCallback; 205 205 var store = evalAndLog("store = transaction.objectStore('storeName')"); … … 208 208 evalAndExpectException("store.add({x: 'othervalue'}, null)", "IDBDatabaseException.DATA_ERR"); 209 209 210 transaction = evalAndLog("db.transaction(['storeName'], IDBTransaction.READ_WRITE)");210 transaction = evalAndLog("db.transaction(['storeName'], 'readwrite')"); 211 211 transaction.onabort = unexpectedErrorCallback; 212 212 var store = evalAndLog("store = transaction.objectStore('storeName')"); … … 214 214 evalAndExpectException("store.add({x: null}, 'validkey')", "IDBDatabaseException.DATA_ERR"); 215 215 216 transaction = evalAndLog("db.transaction(['storeName'], IDBTransaction.READ_WRITE)");216 transaction = evalAndLog("db.transaction(['storeName'], 'readwrite')"); 217 217 transaction.onabort = unexpectedErrorCallback; 218 218 var store = evalAndLog("store = transaction.objectStore('storeName')"); -
trunk/LayoutTests/storage/indexeddb/resources/objectstore-count.js
r116051 r116337 42 42 debug(""); 43 43 debug("verifying count without range"); 44 trans = evalAndLog("trans = db.transaction('storeName', IDBTransaction.READ_ONLY)");44 trans = evalAndLog("trans = db.transaction('storeName', 'readonly')"); 45 45 shouldBeTrue("trans != null"); 46 46 trans.onabort = unexpectedAbortCallback; … … 63 63 debug(""); 64 64 debug("verifying count with range"); 65 trans = evalAndLog("trans = db.transaction('storeName', IDBTransaction.READ_ONLY)");65 trans = evalAndLog("trans = db.transaction('storeName', 'readonly')"); 66 66 shouldBeTrue("trans != null"); 67 67 trans.onabort = unexpectedAbortCallback; … … 106 106 debug(""); 107 107 debug("verifying count with key"); 108 trans = evalAndLog("trans = db.transaction('storeName', IDBTransaction.READ_ONLY)");108 trans = evalAndLog("trans = db.transaction('storeName', 'readonly')"); 109 109 shouldBeTrue("trans != null"); 110 110 trans.onabort = unexpectedAbortCallback; -
trunk/LayoutTests/storage/indexeddb/resources/objectstore-cursor.js
r116051 r116337 152 152 keyRange = IDBKeyRange.upperBound(testData[upper], upperIsOpen); 153 153 154 var request = objectStore.openCursor(keyRange, ascending ? IDBCursor.NEXT : IDBCursor.PREV);154 var request = objectStore.openCursor(keyRange, ascending ? 'next' : 'prev'); 155 155 request.onsuccess = cursorIteration; 156 156 request.onerror = unexpectedErrorCallback; … … 218 218 debug(str); 219 219 220 var request = objectStore.openCursor(null, ascending ? IDBCursor.NEXT : IDBCursor.PREV);220 var request = objectStore.openCursor(null, ascending ? 'next' : 'prev'); 221 221 request.onsuccess = cursorIteration; 222 222 request.onerror = unexpectedErrorCallback; -
trunk/LayoutTests/storage/indexeddb/resources/open-cursor.js
r116051 r116337 28 28 // FIXME: check that we can iterate the cursor. 29 29 cursor = event.target.result; 30 shouldBe("cursor.direction", " 0");30 shouldBe("cursor.direction", "'next'"); 31 31 shouldBe("cursor.key", "'myKey'"); 32 32 shouldBe("cursor.value", "'myValue'"); … … 68 68 // FIXME: check that we can iterate the cursor. 69 69 cursor = event.target.result; 70 shouldBe("cursor.direction", " 0");70 shouldBe("cursor.direction", "'next'"); 71 71 shouldBe("cursor.key", "'myKey'"); 72 72 shouldBe("cursor.value", "'myValue'"); -
trunk/LayoutTests/storage/indexeddb/resources/open-during-transaction.js
r116051 r116337 36 36 debug("starting transaction"); 37 37 evalAndLog("state = 'starting'"); 38 evalAndLog("trans = dbc1.transaction('storeName', IDBTransaction.READ_WRITE)");38 evalAndLog("trans = dbc1.transaction('storeName', 'readwrite')"); 39 39 evalAndLog("trans.objectStore('storeName').put('value', 'key')"); 40 40 trans.onabort = unexpectedAbortCallback; -
trunk/LayoutTests/storage/indexeddb/resources/opencursor-key.js
r116051 r116337 83 83 { 84 84 debug("testObjectStore()"); 85 evalAndLog("trans = db.transaction(objectStoreName, IDBTransaction.READ_WRITE)");85 evalAndLog("trans = db.transaction(objectStoreName, 'readwrite')"); 86 86 trans.onabort = unexpectedAbortCallback; 87 87 objectStore = evalAndLog("objectStore = trans.objectStore(objectStoreName)"); … … 110 110 function testIndex() 111 111 { 112 evalAndLog("trans = db.transaction(objectStoreName, IDBTransaction.READ_WRITE)");112 evalAndLog("trans = db.transaction(objectStoreName, 'readwrite')"); 113 113 objectStore = evalAndLog("objectStore = trans.objectStore(objectStoreName)"); 114 114 index = evalAndLog("index = objectStore.index('weight')"); … … 150 150 function testIndexWithKey() 151 151 { 152 evalAndLog("trans = db.transaction(objectStoreName, IDBTransaction.READ_WRITE)");152 evalAndLog("trans = db.transaction(objectStoreName, 'readwrite')"); 153 153 objectStore = evalAndLog("objectStore = trans.objectStore(objectStoreName)"); 154 154 index = evalAndLog("index = objectStore.index('weight')"); -
trunk/LayoutTests/storage/indexeddb/resources/prefetch-bugfix-108071.js
r116051 r116337 63 63 debug("iterateAndDeleteFirstElement():"); 64 64 65 evalAndLog("trans = db.transaction(['store'], IDBTransaction.READ_WRITE)");65 evalAndLog("trans = db.transaction(['store'], 'readwrite')"); 66 66 trans.onabort = transactionAborted; 67 67 trans.oncomplete = unexpectedCompleteCallback; -
trunk/LayoutTests/storage/indexeddb/resources/request-event-propagation.js
r116051 r116337 41 41 { 42 42 debug("Verify that handler fires and that not preventing default will result in an abort"); 43 trans = evalAndLog("trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)");43 trans = evalAndLog("trans = db.transaction(['storeName'], 'readwrite')"); 44 44 evalAndLog("trans.onabort = transactionAborted"); 45 45 evalAndLog("trans.oncomplete = unexpectedCompleteCallback"); … … 63 63 debug(""); 64 64 debug("Verifing error"); 65 trans = evalAndLog("trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)");65 trans = evalAndLog("trans = db.transaction(['storeName'], 'readwrite')"); 66 66 evalAndLog("trans.onabort = transactionAborted2"); 67 67 evalAndLog("trans.oncomplete = unexpectedAbortCallback"); … … 166 166 debug(""); 167 167 debug("Verifing success."); 168 trans = evalAndLog("trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)");168 trans = evalAndLog("trans = db.transaction(['storeName'], 'readwrite')"); 169 169 evalAndLog("trans.oncomplete = transactionComplete"); 170 170 evalAndLog("trans.onabort = unexpectedAbortCallback"); -
trunk/LayoutTests/storage/indexeddb/resources/set_version_blocked.js
r116051 r116337 41 41 blocked_event = event; 42 42 shouldBeEqualToString("blocked_event.version", "version 1"); 43 shouldEvaluateTo("blocked_event.target.readyState", 1);43 shouldEvaluateTo("blocked_event.target.readyState", "'pending'"); 44 44 evalAndLog("connections[1].close()"); 45 45 } -
trunk/LayoutTests/storage/indexeddb/resources/transaction-abort.js
r116051 r116337 41 41 function startTest() 42 42 { 43 trans = evalAndLog("trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)");43 trans = evalAndLog("trans = db.transaction(['storeName'], 'readwrite')"); 44 44 evalAndLog("trans.onabort = transactionAborted"); 45 45 evalAndLog("trans.oncomplete = unexpectedCompleteCallback"); -
trunk/LayoutTests/storage/indexeddb/resources/transaction-after-close.js
r116051 r116337 44 44 { 45 45 debug("running first transaction") 46 currentTransaction = evalAndLog("currentTransaction = db.transaction(['store'], IDBTransaction.READ_WRITE)");46 currentTransaction = evalAndLog("currentTransaction = db.transaction(['store'], 'readwrite')"); 47 47 currentTransaction.onabort = unexpectedAbortCallback; 48 48 currentTransaction.oncomplete = firstTransactionComplete; … … 55 55 { 56 56 evalAndLog("db.close()"); 57 evalAndExpectException("db.transaction(['store'], IDBTransaction.READ_WRITE)", "IDBDatabaseException.NOT_ALLOWED_ERR");57 evalAndExpectException("db.transaction(['store'], 'readwrite')", "IDBDatabaseException.NOT_ALLOWED_ERR"); 58 58 59 59 debug("") … … 66 66 function onSecondOpen() { 67 67 second_db = evalAndLog("second_db = event.target.result"); 68 currentTransaction = evalAndLog("currentTransaction = second_db.transaction(['store'], IDBTransaction.READ_WRITE)");68 currentTransaction = evalAndLog("currentTransaction = second_db.transaction(['store'], 'readwrite')"); 69 69 store = currentTransaction.objectStore('store'); 70 70 request = evalAndLog("request = store.put('1', '2')"); -
trunk/LayoutTests/storage/indexeddb/resources/transaction-basics.js
r116051 r116337 280 280 debug(""); 281 281 debug("Verify that specifying an invalid mode raises an exception"); 282 evalAndExpectException("db.transaction(['storeName'], 3)", "IDBDatabaseException.NON_TRANSIENT_ERR");282 evalAndExpectException("db.transaction(['storeName'], 'lsakjdf')", "IDBDatabaseException.NOT_ALLOWED_ERR"); 283 283 finishJSTest(); 284 284 } -
trunk/LayoutTests/storage/indexeddb/resources/transaction-event-propagation.js
r116051 r116337 40 40 { 41 41 debug("Verifing abort"); 42 trans = evalAndLog("trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)");42 trans = evalAndLog("trans = db.transaction(['storeName'], 'readwrite')"); 43 43 evalAndLog("trans.onabort = abortFiredCallback"); 44 44 evalAndLog("trans.oncomplete = unexpectedAbortCallback"); … … 90 90 debug(""); 91 91 debug("Verifing success."); 92 trans = evalAndLog("trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)");92 trans = evalAndLog("trans = db.transaction(['storeName'], 'readwrite')"); 93 93 evalAndLog("trans.oncomplete = completeFiredCallback"); 94 94 evalAndLog("trans.onabort = unexpectedAbortCallback"); -
trunk/LayoutTests/storage/indexeddb/resources/transaction-rollback.js
r116051 r116337 40 40 debug("setVersionComplete():"); 41 41 42 self.transaction = evalAndLog("transaction = db.transaction(['myObjectStore'], IDBTransaction.READ_WRITE)");42 self.transaction = evalAndLog("transaction = db.transaction(['myObjectStore'], 'readwrite')"); 43 43 transaction.onabort = abortCallback; 44 44 transaction.oncomplete = unexpectedCompleteCallback; … … 73 73 debug('Transaction was aborted.'); 74 74 75 self.transaction = evalAndLog("transaction = db.transaction(['myObjectStore'], IDBTransaction.READ)");75 self.transaction = evalAndLog("transaction = db.transaction(['myObjectStore'], 'readonly')"); 76 76 self.store = evalAndLog("store = transaction.objectStore('myObjectStore')"); 77 77 request = evalAndLog("store.get('rollbackKey123')"); -
trunk/LayoutTests/storage/indexeddb/set_version_blocked-expected.txt
r116051 r116337 11 11 seen_blocked_event = true 12 12 PASS blocked_event.version is "version 1" 13 PASS blocked_event.target.readyState is 113 PASS blocked_event.target.readyState is 'pending' 14 14 connections[1].close() 15 15 in setVersion.onsuccess -
trunk/LayoutTests/storage/indexeddb/structured-clone-expected.txt
r116051 r116337 18 18 19 19 Testing: undefined 20 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)20 transaction = db.transaction('storeName', 'readwrite') 21 21 store = transaction.objectStore('storeName') 22 22 store.put(value, 'key') … … 26 26 27 27 Testing: null 28 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)28 transaction = db.transaction('storeName', 'readwrite') 29 29 store = transaction.objectStore('storeName') 30 30 store.put(value, 'key') … … 36 36 37 37 Testing: true 38 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)38 transaction = db.transaction('storeName', 'readwrite') 39 39 store = transaction.objectStore('storeName') 40 40 store.put(value, 'key') … … 43 43 44 44 Testing: false 45 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)45 transaction = db.transaction('storeName', 'readwrite') 46 46 store = transaction.objectStore('storeName') 47 47 store.put(value, 'key') … … 53 53 54 54 Testing: NaN 55 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)55 transaction = db.transaction('storeName', 'readwrite') 56 56 store = transaction.objectStore('storeName') 57 57 store.put(value, 'key') … … 60 60 61 61 Testing: -Infinity 62 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)62 transaction = db.transaction('storeName', 'readwrite') 63 63 store = transaction.objectStore('storeName') 64 64 store.put(value, 'key') … … 67 67 68 68 Testing: -Number.MAX_VALUE 69 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)69 transaction = db.transaction('storeName', 'readwrite') 70 70 store = transaction.objectStore('storeName') 71 71 store.put(value, 'key') … … 74 74 75 75 Testing: -Number.MIN_VALUE 76 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)76 transaction = db.transaction('storeName', 'readwrite') 77 77 store = transaction.objectStore('storeName') 78 78 store.put(value, 'key') … … 81 81 82 82 Testing: -0 83 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)83 transaction = db.transaction('storeName', 'readwrite') 84 84 store = transaction.objectStore('storeName') 85 85 store.put(value, 'key') … … 88 88 89 89 Testing: 0 90 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)90 transaction = db.transaction('storeName', 'readwrite') 91 91 store = transaction.objectStore('storeName') 92 92 store.put(value, 'key') … … 95 95 96 96 Testing: Number.MIN_VALUE 97 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)97 transaction = db.transaction('storeName', 'readwrite') 98 98 store = transaction.objectStore('storeName') 99 99 store.put(value, 'key') … … 102 102 103 103 Testing: Number.MAX_VALUE 104 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)104 transaction = db.transaction('storeName', 'readwrite') 105 105 store = transaction.objectStore('storeName') 106 106 store.put(value, 'key') … … 109 109 110 110 Testing: Infinity 111 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)111 transaction = db.transaction('storeName', 'readwrite') 112 112 store = transaction.objectStore('storeName') 113 113 store.put(value, 'key') … … 119 119 120 120 Testing: '' 121 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)121 transaction = db.transaction('storeName', 'readwrite') 122 122 store = transaction.objectStore('storeName') 123 123 store.put(value, 'key') … … 126 126 127 127 Testing: 'this is a sample string' 128 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)128 transaction = db.transaction('storeName', 'readwrite') 129 129 store = transaction.objectStore('storeName') 130 130 store.put(value, 'key') … … 133 133 134 134 Testing: 'null(\0)' 135 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)135 transaction = db.transaction('storeName', 'readwrite') 136 136 store = transaction.objectStore('storeName') 137 137 store.put(value, 'key') … … 143 143 144 144 Testing: new Boolean(true) 145 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)145 transaction = db.transaction('storeName', 'readwrite') 146 146 store = transaction.objectStore('storeName') 147 147 store.put(value, 'key') … … 154 154 155 155 Testing: new Boolean(false) 156 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)156 transaction = db.transaction('storeName', 'readwrite') 157 157 store = transaction.objectStore('storeName') 158 158 store.put(value, 'key') … … 168 168 169 169 Testing: new Number(NaN) 170 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)170 transaction = db.transaction('storeName', 'readwrite') 171 171 store = transaction.objectStore('storeName') 172 172 store.put(value, 'key') … … 179 179 180 180 Testing: new Number(-Infinity) 181 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)181 transaction = db.transaction('storeName', 'readwrite') 182 182 store = transaction.objectStore('storeName') 183 183 store.put(value, 'key') … … 190 190 191 191 Testing: new Number(-Number.MAX_VALUE) 192 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)192 transaction = db.transaction('storeName', 'readwrite') 193 193 store = transaction.objectStore('storeName') 194 194 store.put(value, 'key') … … 201 201 202 202 Testing: new Number(-Number.MIN_VALUE) 203 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)203 transaction = db.transaction('storeName', 'readwrite') 204 204 store = transaction.objectStore('storeName') 205 205 store.put(value, 'key') … … 212 212 213 213 Testing: new Number(-0) 214 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)214 transaction = db.transaction('storeName', 'readwrite') 215 215 store = transaction.objectStore('storeName') 216 216 store.put(value, 'key') … … 223 223 224 224 Testing: new Number(0) 225 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)225 transaction = db.transaction('storeName', 'readwrite') 226 226 store = transaction.objectStore('storeName') 227 227 store.put(value, 'key') … … 234 234 235 235 Testing: new Number(Number.MIN_VALUE) 236 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)236 transaction = db.transaction('storeName', 'readwrite') 237 237 store = transaction.objectStore('storeName') 238 238 store.put(value, 'key') … … 245 245 246 246 Testing: new Number(Number.MAX_VALUE) 247 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)247 transaction = db.transaction('storeName', 'readwrite') 248 248 store = transaction.objectStore('storeName') 249 249 store.put(value, 'key') … … 256 256 257 257 Testing: new Number(Infinity) 258 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)258 transaction = db.transaction('storeName', 'readwrite') 259 259 store = transaction.objectStore('storeName') 260 260 store.put(value, 'key') … … 270 270 271 271 Testing: new String() 272 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)272 transaction = db.transaction('storeName', 'readwrite') 273 273 store = transaction.objectStore('storeName') 274 274 store.put(value, 'key') … … 281 281 282 282 Testing: new String('this is a sample string') 283 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)283 transaction = db.transaction('storeName', 'readwrite') 284 284 store = transaction.objectStore('storeName') 285 285 store.put(value, 'key') … … 292 292 293 293 Testing: new String('null(\0)') 294 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)294 transaction = db.transaction('storeName', 'readwrite') 295 295 store = transaction.objectStore('storeName') 296 296 store.put(value, 'key') … … 306 306 307 307 Testing: new Date(-1e13) 308 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)308 transaction = db.transaction('storeName', 'readwrite') 309 309 store = transaction.objectStore('storeName') 310 310 store.put(value, 'key') … … 317 317 318 318 Testing: new Date(-1e12) 319 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)319 transaction = db.transaction('storeName', 'readwrite') 320 320 store = transaction.objectStore('storeName') 321 321 store.put(value, 'key') … … 328 328 329 329 Testing: new Date(-1e9) 330 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)330 transaction = db.transaction('storeName', 'readwrite') 331 331 store = transaction.objectStore('storeName') 332 332 store.put(value, 'key') … … 339 339 340 340 Testing: new Date(-1e6) 341 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)341 transaction = db.transaction('storeName', 'readwrite') 342 342 store = transaction.objectStore('storeName') 343 343 store.put(value, 'key') … … 350 350 351 351 Testing: new Date(-1e3) 352 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)352 transaction = db.transaction('storeName', 'readwrite') 353 353 store = transaction.objectStore('storeName') 354 354 store.put(value, 'key') … … 361 361 362 362 Testing: new Date(0) 363 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)363 transaction = db.transaction('storeName', 'readwrite') 364 364 store = transaction.objectStore('storeName') 365 365 store.put(value, 'key') … … 372 372 373 373 Testing: new Date(1e3) 374 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)374 transaction = db.transaction('storeName', 'readwrite') 375 375 store = transaction.objectStore('storeName') 376 376 store.put(value, 'key') … … 383 383 384 384 Testing: new Date(1e6) 385 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)385 transaction = db.transaction('storeName', 'readwrite') 386 386 store = transaction.objectStore('storeName') 387 387 store.put(value, 'key') … … 394 394 395 395 Testing: new Date(1e9) 396 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)396 transaction = db.transaction('storeName', 'readwrite') 397 397 store = transaction.objectStore('storeName') 398 398 store.put(value, 'key') … … 405 405 406 406 Testing: new Date(1e12) 407 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)407 transaction = db.transaction('storeName', 'readwrite') 408 408 store = transaction.objectStore('storeName') 409 409 store.put(value, 'key') … … 416 416 417 417 Testing: new Date(1e13) 418 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)418 transaction = db.transaction('storeName', 'readwrite') 419 419 store = transaction.objectStore('storeName') 420 420 store.put(value, 'key') … … 430 430 431 431 Testing RegExp: new RegExp() 432 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)432 transaction = db.transaction('storeName', 'readwrite') 433 433 store = transaction.objectStore('storeName') 434 434 store.put(value, 'key') … … 439 439 440 440 Testing RegExp: /abc/ 441 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)441 transaction = db.transaction('storeName', 'readwrite') 442 442 store = transaction.objectStore('storeName') 443 443 store.put(value, 'key') … … 448 448 449 449 Testing RegExp: /abc/g 450 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)450 transaction = db.transaction('storeName', 'readwrite') 451 451 store = transaction.objectStore('storeName') 452 452 store.put(value, 'key') … … 457 457 458 458 Testing RegExp: /abc/i 459 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)459 transaction = db.transaction('storeName', 'readwrite') 460 460 store = transaction.objectStore('storeName') 461 461 store.put(value, 'key') … … 466 466 467 467 Testing RegExp: /abc/gi 468 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)468 transaction = db.transaction('storeName', 'readwrite') 469 469 store = transaction.objectStore('storeName') 470 470 store.put(value, 'key') … … 475 475 476 476 Testing RegExp: /abc/m 477 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)477 transaction = db.transaction('storeName', 'readwrite') 478 478 store = transaction.objectStore('storeName') 479 479 store.put(value, 'key') … … 484 484 485 485 Testing RegExp: /abc/mg 486 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)486 transaction = db.transaction('storeName', 'readwrite') 487 487 store = transaction.objectStore('storeName') 488 488 store.put(value, 'key') … … 493 493 494 494 Testing RegExp: /abc/mi 495 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)495 transaction = db.transaction('storeName', 'readwrite') 496 496 store = transaction.objectStore('storeName') 497 497 store.put(value, 'key') … … 502 502 503 503 Testing RegExp: /abc/mgi 504 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)504 transaction = db.transaction('storeName', 'readwrite') 505 505 store = transaction.objectStore('storeName') 506 506 store.put(value, 'key') … … 516 516 canvas.height = 8 517 517 test_data = canvas.getContext('2d').getImageData(0, 0, 8, 8) 518 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)518 transaction = db.transaction('storeName', 'readwrite') 519 519 store = transaction.objectStore('storeName') 520 520 store.put(value, 'key') … … 545 545 test_data[21] = 456 546 546 test_data[30] = null 547 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)547 transaction = db.transaction('storeName', 'readwrite') 548 548 store = transaction.objectStore('storeName') 549 549 store.put(value, 'key') … … 568 568 test_data['bar'] = 456 569 569 test_data[''] = null 570 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)570 transaction = db.transaction('storeName', 'readwrite') 571 571 store = transaction.objectStore('storeName') 572 572 store.put(value, 'key') … … 585 585 Test types that can't be cloned: 586 586 587 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)587 transaction = db.transaction('storeName', 'readwrite') 588 588 store = transaction.objectStore('storeName') 589 589 -
trunk/LayoutTests/storage/indexeddb/structured-clone.html
r116051 r116337 103 103 // One transaction per test, since some tests require asynchronous 104 104 // operations to verify the result (e.g. via FileReader) 105 evalAndLog("transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)");105 evalAndLog("transaction = db.transaction('storeName', 'readwrite')"); 106 106 transaction.onerror = unexpectedErrorCallback; 107 107 transaction.onabort = unexpectedAbortCallback; … … 512 512 debug(""); 513 513 514 evalAndLog("transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)");514 evalAndLog("transaction = db.transaction('storeName', 'readwrite')"); 515 515 evalAndLog("store = transaction.objectStore('storeName')"); 516 516 transaction.onerror = unexpectedErrorCallback; -
trunk/LayoutTests/storage/indexeddb/transaction-abort-expected.txt
r116051 r116337 16 16 store = db.createObjectStore('storeName', null) 17 17 store.add({x: 'value', y: 'zzz'}, 'key') 18 trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)18 trans = db.transaction(['storeName'], 'readwrite') 19 19 trans.onabort = transactionAborted 20 20 trans.oncomplete = unexpectedCompleteCallback -
trunk/LayoutTests/storage/indexeddb/transaction-abort-with-js-recursion-cross-frame-expected.txt
r116051 r116337 9 9 db = event.target.result 10 10 db.setVersion('new version') 11 pendingTransaction = db.transaction(['objectStore'], IDBTransaction.READ_WRITE)11 pendingTransaction = db.transaction(['objectStore'], 'readwrite') 12 12 Start re-entrant JS 13 transaction = db.transaction(['objectStore'], IDBTransaction.READ_WRITE)13 transaction = db.transaction(['objectStore'], 'readwrite') 14 14 End re-entrant JS 15 15 store = pendingTransaction.objectStore('objectStore') -
trunk/LayoutTests/storage/indexeddb/transaction-abort-with-js-recursion-cross-frame.html
r116051 r116337 39 39 function click() { 40 40 body.onclick = test; 41 var pendingTransaction = evalAndLog("pendingTransaction = db.transaction(['objectStore'], IDBTransaction.READ_WRITE)");41 var pendingTransaction = evalAndLog("pendingTransaction = db.transaction(['objectStore'], 'readwrite')"); 42 42 pendingTransaction.onsuccess = unexpectedErrorCallback; 43 43 pendingTransaction.onerror = unexpectedErrorCallback; … … 54 54 { 55 55 debug("Start re-entrant JS"); 56 transaction = evalAndLog("transaction = db.transaction(['objectStore'], IDBTransaction.READ_WRITE)");56 transaction = evalAndLog("transaction = db.transaction(['objectStore'], 'readwrite')"); 57 57 debug("End re-entrant JS"); 58 58 } -
trunk/LayoutTests/storage/indexeddb/transaction-abort-with-js-recursion-expected.txt
r116051 r116337 9 9 db = event.target.result 10 10 db.setVersion('new version') 11 pendingTransaction = db.transaction(['objectStore'], IDBTransaction.READ_WRITE)11 pendingTransaction = db.transaction(['objectStore'], 'readwrite') 12 12 Start re-entrant JS 13 transaction = db.transaction(['objectStore'], IDBTransaction.READ_WRITE)13 transaction = db.transaction(['objectStore'], 'readwrite') 14 14 End re-entrant JS 15 15 store = pendingTransaction.objectStore('objectStore') -
trunk/LayoutTests/storage/indexeddb/transaction-abort-with-js-recursion.html
r116051 r116337 38 38 { 39 39 body.onclick = test; 40 var pendingTransaction = evalAndLog("pendingTransaction = db.transaction(['objectStore'], IDBTransaction.READ_WRITE)");40 var pendingTransaction = evalAndLog("pendingTransaction = db.transaction(['objectStore'], 'readwrite')"); 41 41 pendingTransaction.onsuccess = unexpectedErrorCallback; 42 42 pendingTransaction.onerror = unexpectedErrorCallback; … … 53 53 { 54 54 debug("Start re-entrant JS"); 55 transaction = evalAndLog("transaction = db.transaction(['objectStore'], IDBTransaction.READ_WRITE)");55 transaction = evalAndLog("transaction = db.transaction(['objectStore'], 'readwrite')"); 56 56 debug("End re-entrant JS"); 57 57 } -
trunk/LayoutTests/storage/indexeddb/transaction-after-close-expected.txt
r116051 r116337 15 15 PASS Put success 16 16 running first transaction 17 currentTransaction = db.transaction(['store'], IDBTransaction.READ_WRITE)17 currentTransaction = db.transaction(['store'], 'readwrite') 18 18 objectStore.put('a', 'b') 19 19 db.close() 20 Expecting exception from db.transaction(['store'], IDBTransaction.READ_WRITE)20 Expecting exception from db.transaction(['store'], 'readwrite') 21 21 PASS Exception was thrown. 22 22 PASS code is IDBDatabaseException.NOT_ALLOWED_ERR … … 25 25 indexedDB.open('transaction-after-close') 26 26 second_db = event.target.result 27 currentTransaction = second_db.transaction(['store'], IDBTransaction.READ_WRITE)27 currentTransaction = second_db.transaction(['store'], 'readwrite') 28 28 request = store.put('1', '2') 29 29 PASS final put success -
trunk/LayoutTests/storage/indexeddb/transaction-basics-expected.txt
r116051 r116337 171 171 172 172 Verify that specifying an invalid mode raises an exception 173 Expecting exception from db.transaction(['storeName'], 3)173 Expecting exception from db.transaction(['storeName'], 'lsakjdf') 174 174 PASS Exception was thrown. 175 PASS code is IDBDatabaseException.NO N_TRANSIENT_ERR175 PASS code is IDBDatabaseException.NOT_ALLOWED_ERR 176 176 PASS successfullyParsed is true 177 177 -
trunk/LayoutTests/storage/indexeddb/transaction-event-propagation-expected.txt
r116051 r116337 16 16 store.add({x: 'value', y: 'zzz'}, 'key') 17 17 Verifing abort 18 trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)18 trans = db.transaction(['storeName'], 'readwrite') 19 19 trans.onabort = abortFiredCallback 20 20 trans.oncomplete = unexpectedAbortCallback … … 48 48 49 49 Verifing success. 50 trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)50 trans = db.transaction(['storeName'], 'readwrite') 51 51 trans.oncomplete = completeFiredCallback 52 52 trans.onabort = unexpectedAbortCallback -
trunk/LayoutTests/storage/indexeddb/transaction-rollback-expected.txt
r116051 r116337 16 16 PASS db.objectStoreNames.length is 1 17 17 setVersionComplete(): 18 transaction = db.transaction(['myObjectStore'], IDBTransaction.READ_WRITE)18 transaction = db.transaction(['myObjectStore'], 'readwrite') 19 19 store = transaction.objectStore('myObjectStore') 20 20 store.add('rollbackValue', 'rollbackKey123') … … 26 26 abortCallback(): 27 27 Transaction was aborted. 28 transaction = db.transaction(['myObjectStore'], IDBTransaction.READ)28 transaction = db.transaction(['myObjectStore'], 'readonly') 29 29 store = transaction.objectStore('myObjectStore') 30 30 store.get('rollbackKey123') -
trunk/LayoutTests/storage/indexeddb/tutorial.html
r116051 r116337 217 217 // 218 218 // Next is "mode" which specifies the locking mode. The default is READ_ONLY (i.e. a shared lock). 219 // That's fine for this case, but later we'll ask for IDBTransaction.READ_WRITE. At the moment,219 // That's fine for this case, but later we'll ask for 'readwrite'. At the moment, 220 220 // Chromium/WebKit pretends every transaction is READ_WRITE, which is kind of bad. 221 window.currentTransaction = db.transaction("people", IDBTransaction.READ_WRITE);221 window.currentTransaction = db.transaction("people", 'readwrite'); 222 222 currentTransaction.oncomplete = unexpectedComplete; 223 223 currentTransaction.onabort = onTransactionAborted; … … 267 267 { 268 268 // Now let's make a real transaction and a person to our objectStore. 269 window.currentTransaction = db.transaction("people", IDBTransaction.READ_WRITE);269 window.currentTransaction = db.transaction("people", 'readwrite'); 270 270 currentTransaction.onabort = unexpectedAbort; 271 271 … … 305 305 // It simply takes in a key and returns a request whose result will be the value. Note that here 306 306 // we're passing in an array for objectStoreNames rather than a simple string. 307 window.currentTransaction = db.transaction(["people"], IDBTransaction.READ_WRITE);307 window.currentTransaction = db.transaction(["people"], 'readwrite'); 308 308 currentTransaction.onabort = unexpectedAbort; 309 309 … … 332 332 // we'll get the objects for ids 2 and 3. You can also create cursors that are only right or only 333 333 // left bounded or ommit the bound in order to grab all objects. You can also specify a direction 334 // which can be IDBCursor.NEXT(default) for the cursor to move forward, NEXT_NO_DUPLICATE to only334 // which can be 'next' (default) for the cursor to move forward, NEXT_NO_DUPLICATE to only 335 335 // return unique entires (only applies to indexes with unique set to false), PREV to move backwards, 336 336 // and PREV_NO_DUPLICATE. 337 337 var keyRange = IDBKeyRange.bound(1, 3, true, false); 338 var request = people.openCursor(keyRange, IDBCursor.NEXT);338 var request = people.openCursor(keyRange, 'next'); 339 339 request.onsuccess = onObjectStoreCursor; 340 340 request.onerror = unexpectedError; … … 389 389 // the onsuccess conditions. 390 390 var lname = event.target.source; 391 lname.openCursor(IDBKeyRange.lowerBound("Doe", false), IDBCursor.NEXT_NO_DUPLICATE);392 lname.openCursor(null, IDBCursor.PREV_NO_DUPLICATE);391 lname.openCursor(IDBKeyRange.lowerBound("Doe", false), 'nextunique'); 392 lname.openCursor(null, 'prevunique'); 393 393 lname.openCursor(IDBKeyRange.upperBound("ZZZZ")); 394 lname.openCursor(IDBKeyRange.only("Doe"), IDBCursor.PREV);394 lname.openCursor(IDBKeyRange.only("Doe"), 'prev'); 395 395 lname.openCursor(); 396 396 lname.openKeyCursor(); -
trunk/Source/WebCore/ChangeLog
r116334 r116337 1 2012-05-07 Alec Flett <alecflett@chromium.org> 2 3 IndexedDB: Replace numeric constants with strings 4 https://bugs.webkit.org/show_bug.cgi?id=84894 5 6 Reviewed by Tony Chang. 7 8 Test: storage/indexeddb/legacy-constants.html 9 10 Update IDBObjectStore.openCursor, IDBIndex.openCursor, 11 IDBIndex.openKeyCursor, IDBDatabase.transaction, 12 IDBCursor.direction, IDBTransaction.mode, and 13 IDBRequest.readyState to meet the latest spec. All of these APIs 14 now support string-based values in addition to the 15 legacy/deprecated enum-based values. 16 17 * Modules/indexeddb/IDBCursor.cpp: 18 (WebCore): 19 (WebCore::IDBCursor::direction): 20 (WebCore::IDBCursor::stringToDirection): 21 (WebCore::IDBCursor::directionToString): 22 * Modules/indexeddb/IDBCursor.h: 23 (IDBCursor): 24 * Modules/indexeddb/IDBCursor.idl: 25 * Modules/indexeddb/IDBDatabase.cpp: 26 (WebCore::IDBDatabase::transaction): 27 (WebCore): 28 * Modules/indexeddb/IDBDatabase.h: 29 (IDBDatabase): 30 * Modules/indexeddb/IDBDatabase.idl: 31 * Modules/indexeddb/IDBIndex.cpp: 32 (WebCore::IDBIndex::openCursor): 33 (WebCore): 34 (WebCore::IDBIndex::openKeyCursor): 35 * Modules/indexeddb/IDBIndex.h: 36 (WebCore::IDBIndex::openCursor): 37 (IDBIndex): 38 (WebCore::IDBIndex::openKeyCursor): 39 * Modules/indexeddb/IDBIndex.idl: 40 * Modules/indexeddb/IDBObjectStore.cpp: 41 (WebCore::IDBObjectStore::openCursor): 42 (WebCore): 43 * Modules/indexeddb/IDBObjectStore.h: 44 (WebCore::IDBObjectStore::openCursor): 45 (IDBObjectStore): 46 * Modules/indexeddb/IDBObjectStore.idl: 47 * Modules/indexeddb/IDBRequest.cpp: 48 (WebCore::IDBRequest::IDBRequest): 49 (WebCore::IDBRequest::readyState): 50 (WebCore::IDBRequest::markEarlyDeath): 51 (WebCore::IDBRequest::resetReadyState): 52 (WebCore::IDBRequest::abort): 53 (WebCore::IDBRequest::finishCursor): 54 (WebCore::IDBRequest::onSuccess): 55 (WebCore::IDBRequest::stop): 56 * Modules/indexeddb/IDBRequest.h: 57 * Modules/indexeddb/IDBRequest.idl: 58 * Modules/indexeddb/IDBTransaction.cpp: 59 (WebCore): 60 (WebCore::IDBTransaction::mode): 61 (WebCore::IDBTransaction::stringToMode): 62 (WebCore::IDBTransaction::modeToString): 63 * Modules/indexeddb/IDBTransaction.h: 64 (IDBTransaction): 65 * Modules/indexeddb/IDBTransaction.idl: 66 1 67 2012-05-07 W. James MacLean <wjmaclean@chromium.org> 2 68 -
trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp
r116051 r116337 46 46 } 47 47 48 const AtomicString& IDBCursor::directionNext() 49 { 50 DEFINE_STATIC_LOCAL(AtomicString, next, ("next")); 51 return next; 52 } 53 54 const AtomicString& IDBCursor::directionNextUnique() 55 { 56 DEFINE_STATIC_LOCAL(AtomicString, nextunique, ("nextunique")); 57 return nextunique; 58 } 59 60 const AtomicString& IDBCursor::directionPrev() 61 { 62 DEFINE_STATIC_LOCAL(AtomicString, prev, ("prev")); 63 return prev; 64 } 65 66 const AtomicString& IDBCursor::directionPrevUnique() 67 { 68 DEFINE_STATIC_LOCAL(AtomicString, prevunique, ("prevunique")); 69 return prevunique; 70 } 71 72 48 73 IDBCursor::IDBCursor(PassRefPtr<IDBCursorBackendInterface> backend, IDBRequest* request, IDBAny* source, IDBTransaction* transaction) 49 74 : m_backend(backend) … … 64 89 } 65 90 66 unsigned shortIDBCursor::direction() const91 const String& IDBCursor::direction() const 67 92 { 68 93 IDB_TRACE("IDBCursor::direction"); 69 return m_backend->direction(); 94 ExceptionCode ec = 0; 95 const AtomicString& direction = directionToString(m_backend->direction(), ec); 96 ASSERT(!ec); 97 return direction; 70 98 } 71 99 … … 209 237 } 210 238 239 unsigned short IDBCursor::stringToDirection(const String& directionString, ExceptionCode& ec) 240 { 241 if (directionString == IDBCursor::directionNext()) 242 return IDBCursor::NEXT; 243 if (directionString == IDBCursor::directionNextUnique()) 244 return IDBCursor::NEXT_NO_DUPLICATE; 245 if (directionString == IDBCursor::directionPrev()) 246 return IDBCursor::PREV; 247 if (directionString == IDBCursor::directionPrevUnique()) 248 return IDBCursor::PREV_NO_DUPLICATE; 249 250 // FIXME: should be a JavaScript TypeError. See https://bugs.webkit.org/show_bug.cgi?id=85513 251 ec = IDBDatabaseException::NON_TRANSIENT_ERR; 252 return 0; 253 } 254 255 const AtomicString& IDBCursor::directionToString(unsigned short direction, ExceptionCode& ec) 256 { 257 switch (direction) { 258 case IDBCursor::NEXT: 259 return IDBCursor::directionNext(); 260 261 case IDBCursor::NEXT_NO_DUPLICATE: 262 return IDBCursor::directionNextUnique(); 263 264 case IDBCursor::PREV: 265 return IDBCursor::directionPrev(); 266 267 case IDBCursor::PREV_NO_DUPLICATE: 268 return IDBCursor::directionPrevUnique(); 269 270 default: 271 ec = IDBDatabaseException::NON_TRANSIENT_ERR; 272 return IDBCursor::directionNext(); 273 } 274 } 275 211 276 } // namespace WebCore 212 277 -
trunk/Source/WebCore/Modules/indexeddb/IDBCursor.h
r116051 r116337 54 54 PREV_NO_DUPLICATE = 3, 55 55 }; 56 57 static const AtomicString& directionNext(); 58 static const AtomicString& directionNextUnique(); 59 static const AtomicString& directionPrev(); 60 static const AtomicString& directionPrevUnique(); 61 62 static unsigned short stringToDirection(const String& modeString, ExceptionCode&); 63 static const AtomicString& directionToString(unsigned short mode, ExceptionCode&); 64 56 65 static PassRefPtr<IDBCursor> create(PassRefPtr<IDBCursorBackendInterface>, IDBRequest*, IDBAny* source, IDBTransaction*); 57 66 virtual ~IDBCursor(); … … 61 70 62 71 // Implement the IDL 63 unsigned shortdirection() const;72 const String& direction() const; 64 73 PassRefPtr<IDBKey> key() const; 65 74 PassRefPtr<IDBKey> primaryKey() const; -
trunk/Source/WebCore/Modules/indexeddb/IDBCursor.idl
r116051 r116337 29 29 Conditional=INDEXED_DATABASE, 30 30 ] IDBCursor { 31 // FIXME: Eventually remove legacy enum constants, see https://bugs.webkit.org/show_bug.cgi?id=85315 31 32 const unsigned short NEXT = 0; 32 33 const unsigned short NEXT_NO_DUPLICATE = 1; … … 34 35 const unsigned short PREV_NO_DUPLICATE = 3; 35 36 36 readonly attribute unsigned shortdirection;37 readonly attribute DOMString direction; 37 38 readonly attribute IDBKey key; 38 39 readonly attribute IDBKey primaryKey; -
trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
r116051 r116337 138 138 } 139 139 140 PassRefPtr<IDBTransaction> IDBDatabase::transaction(ScriptExecutionContext* context, const String& storeName, unsigned short mode, ExceptionCode& ec) 141 { 142 RefPtr<DOMStringList> storeNames = DOMStringList::create(); 143 storeNames->append(storeName); 144 return transaction(context, storeNames, mode, ec); 145 } 146 147 PassRefPtr<IDBTransaction> IDBDatabase::transaction(ScriptExecutionContext* context, PassRefPtr<DOMStringList> prpStoreNames, unsigned short mode, ExceptionCode& ec) 140 PassRefPtr<IDBTransaction> IDBDatabase::transaction(ScriptExecutionContext* context, PassRefPtr<DOMStringList> prpStoreNames, const String& modeString, ExceptionCode& ec) 148 141 { 149 142 RefPtr<DOMStringList> storeNames = prpStoreNames; … … 153 146 } 154 147 155 if (mode != IDBTransaction::READ_WRITE && mode != IDBTransaction::READ_ONLY) {156 ec = IDBDatabaseException::NON_TRANSIENT_ERR;157 return 0; 158 } 148 unsigned short mode = IDBTransaction::stringToMode(modeString, ec); 149 if (ec) 150 return 0; 151 159 152 if (m_closePending) { 160 153 ec = IDBDatabaseException::NOT_ALLOWED_ERR; … … 175 168 return transaction.release(); 176 169 } 170 171 PassRefPtr<IDBTransaction> IDBDatabase::transaction(ScriptExecutionContext* context, const String& storeName, const String& mode, ExceptionCode& ec) 172 { 173 RefPtr<DOMStringList> storeNames = DOMStringList::create(); 174 storeNames->append(storeName); 175 return transaction(context, storeNames, mode, ec); 176 } 177 178 PassRefPtr<IDBTransaction> IDBDatabase::transaction(ScriptExecutionContext* context, const String& storeName, unsigned short mode, ExceptionCode& ec) 179 { 180 RefPtr<DOMStringList> storeNames = DOMStringList::create(); 181 storeNames->append(storeName); 182 return transaction(context, storeNames, mode, ec); 183 } 184 185 PassRefPtr<IDBTransaction> IDBDatabase::transaction(ScriptExecutionContext* context, PassRefPtr<DOMStringList> prpStoreNames, unsigned short mode, ExceptionCode& ec) 186 { 187 DEFINE_STATIC_LOCAL(String, consoleMessage, ("Numeric transaction modes are deprecated in IDBDatabase.transaction. Use \"readonly\" or \"readwrite\".")); 188 context->addConsoleMessage(JSMessageSource, LogMessageType, WarningMessageLevel, consoleMessage); 189 AtomicString modeString = IDBTransaction::modeToString(mode, ec); 190 if (ec) 191 return 0; 192 193 return transaction(context, prpStoreNames, modeString, ec); 194 } 195 177 196 178 197 void IDBDatabase::close() -
trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h
r116051 r116337 65 65 PassRefPtr<IDBObjectStore> createObjectStore(const String& name, ExceptionCode& ec) { return createObjectStore(name, Dictionary(), ec); } 66 66 PassRefPtr<IDBObjectStore> createObjectStore(const String& name, const Dictionary&, ExceptionCode&); 67 PassRefPtr<IDBTransaction> transaction(ScriptExecutionContext*, PassRefPtr<DOMStringList>, const String& mode, ExceptionCode&); 68 PassRefPtr<IDBTransaction> transaction(ScriptExecutionContext*, const String&, const String& mode, ExceptionCode&); 67 69 PassRefPtr<IDBTransaction> transaction(ScriptExecutionContext*, PassRefPtr<DOMStringList>, unsigned short mode, ExceptionCode&); 68 70 PassRefPtr<IDBTransaction> transaction(ScriptExecutionContext*, const String&, unsigned short mode, ExceptionCode&); -
trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.idl
r116051 r116337 46 46 [CallWith=ScriptExecutionContext] IDBVersionChangeRequest setVersion(in DOMString version) 47 47 raises (IDBDatabaseException); 48 [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMStringList storeNames, in [Optional=DefaultIs Undefined] unsigned shortmode)48 [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMStringList storeNames, in [Optional=DefaultIsNullString] DOMString mode) 49 49 raises (IDBDatabaseException); 50 [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString[] storeNames, in [Optional=DefaultIs Undefined] unsigned shortmode)50 [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString[] storeNames, in [Optional=DefaultIsNullString] DOMString mode) 51 51 raises (IDBDatabaseException); 52 [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString storeName, in [Optional=DefaultIs Undefined] unsigned shortmode)52 [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString storeName, in [Optional=DefaultIsNullString] DOMString mode) 53 53 raises (IDBDatabaseException); 54 55 // FIXME: remove these when https://bugs.webkit.org/show_bug.cgi?id=85326 is fixed. 56 [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMStringList storeNames, in unsigned short mode) 57 raises (IDBDatabaseException); 58 [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString[] storeNames, in unsigned short mode) 59 raises (IDBDatabaseException); 60 [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString storeName, in unsigned short mode) 61 raises (IDBDatabaseException); 62 54 63 void close(); 55 64 -
trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp
r116051 r116337 57 57 } 58 58 59 PassRefPtr<IDBRequest> IDBIndex::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, unsigned short direction, ExceptionCode& ec) 60 { 61 IDB_TRACE("IDBIndex::openCursor"); 62 if (direction != IDBCursor::NEXT && direction != IDBCursor::NEXT_NO_DUPLICATE && direction != IDBCursor::PREV && direction != IDBCursor::PREV_NO_DUPLICATE) { 63 // FIXME: May need to change when specced: http://www.w3.org/Bugs/Public/show_bug.cgi?id=11406 64 ec = IDBDatabaseException::CONSTRAINT_ERR; 65 return 0; 66 } 59 PassRefPtr<IDBRequest> IDBIndex::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, const String& directionString, ExceptionCode& ec) 60 { 61 IDB_TRACE("IDBIndex::openCursor"); 62 unsigned short direction = IDBCursor::stringToDirection(directionString, ec); 63 if (ec) 64 return 0; 67 65 68 66 RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get()); … … 76 74 } 77 75 76 PassRefPtr<IDBRequest> IDBIndex::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, unsigned short direction, ExceptionCode& ec) 77 { 78 IDB_TRACE("IDBIndex::openCursor"); 79 DEFINE_STATIC_LOCAL(String, consoleMessage, ("Numeric direction values are deprecated in IDBIndex.openCursor. Use \"next\", \"nextunique\", \"prev\", or \"prevunique\".")); 80 context->addConsoleMessage(JSMessageSource, LogMessageType, WarningMessageLevel, consoleMessage); 81 const String& directionString = IDBCursor::directionToString(direction, ec); 82 if (ec) 83 return 0; 84 return openCursor(context, keyRange, directionString, ec); 85 } 86 87 PassRefPtr<IDBRequest> IDBIndex::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKey> key, const String& direction, ExceptionCode& ec) 88 { 89 IDB_TRACE("IDBIndex::openCursor"); 90 RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(key, ec); 91 if (ec) 92 return 0; 93 return openCursor(context, keyRange.release(), ec); 94 } 95 78 96 PassRefPtr<IDBRequest> IDBIndex::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKey> key, unsigned short direction, ExceptionCode& ec) 79 97 { 80 IDB_TRACE("IDB ObjectStore::openCursor");98 IDB_TRACE("IDBIndex::openCursor"); 81 99 RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(key, ec); 82 100 if (ec) … … 106 124 } 107 125 108 PassRefPtr<IDBRequest> IDBIndex::openKeyCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, unsigned short direction, ExceptionCode& ec) 109 { 110 IDB_TRACE("IDBIndex::openKeyCursor"); 111 if (direction != IDBCursor::NEXT && direction != IDBCursor::NEXT_NO_DUPLICATE && direction != IDBCursor::PREV && direction != IDBCursor::PREV_NO_DUPLICATE) { 112 // FIXME: May need to change when specced: http://www.w3.org/Bugs/Public/show_bug.cgi?id=11406 113 ec = IDBDatabaseException::CONSTRAINT_ERR; 114 return 0; 115 } 126 PassRefPtr<IDBRequest> IDBIndex::openKeyCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, const String& directionString, ExceptionCode& ec) 127 { 128 IDB_TRACE("IDBIndex::openKeyCursor"); 129 130 unsigned short direction = IDBCursor::stringToDirection(directionString, ec); 131 if (ec) 132 return 0; 116 133 117 134 RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get()); … … 125 142 } 126 143 144 PassRefPtr<IDBRequest> IDBIndex::openKeyCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, unsigned short direction, ExceptionCode& ec) 145 { 146 IDB_TRACE("IDBIndex::openKeyCursor"); 147 DEFINE_STATIC_LOCAL(String, consoleMessage, ("Numeric direction values are deprecated in IDBIndex.openKeyCursor. Use \"next\", \"nextunique\", \"prev\", or \"prevunique\".")); 148 context->addConsoleMessage(JSMessageSource, LogMessageType, WarningMessageLevel, consoleMessage); 149 const String& directionString = IDBCursor::directionToString(direction, ec); 150 if (ec) 151 return 0; 152 return openKeyCursor(context, keyRange, directionString, ec); 153 } 154 155 PassRefPtr<IDBRequest> IDBIndex::openKeyCursor(ScriptExecutionContext* context, PassRefPtr<IDBKey> key, const String& direction, ExceptionCode& ec) 156 { 157 IDB_TRACE("IDBIndex::openKeyCursor"); 158 RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(key, ec); 159 if (ec) 160 return 0; 161 return openKeyCursor(context, keyRange.release(), ec); 162 } 163 127 164 PassRefPtr<IDBRequest> IDBIndex::openKeyCursor(ScriptExecutionContext* context, PassRefPtr<IDBKey> key, unsigned short direction, ExceptionCode& ec) 128 165 { 129 IDB_TRACE("IDB ObjectStore::openKeyCursor");166 IDB_TRACE("IDBIndex::openKeyCursor"); 130 167 RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(key, ec); 131 168 if (ec) -
trunk/Source/WebCore/Modules/indexeddb/IDBIndex.h
r116051 r116337 57 57 // FIXME: Try to modify the code generator so this is unneeded. 58 58 PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext* context, ExceptionCode& ec) { return openCursor(context, static_cast<IDBKeyRange*>(0), ec); } 59 PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionCode& ec) { return openCursor(context, keyRange, IDBCursor::NEXT, ec); } 60 PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKey> key, ExceptionCode& ec) { return openCursor(context, key, IDBCursor::NEXT, ec); } 59 PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionCode& ec) { return openCursor(context, keyRange, IDBCursor::directionNext(), ec); } 60 PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKey> key, ExceptionCode& ec) { return openCursor(context, key, IDBCursor::directionNext(), ec); } 61 PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, const String& direction, ExceptionCode&); 62 PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKey>, const String& direction, ExceptionCode&); 61 63 PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, unsigned short direction, ExceptionCode&); 62 64 PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKey>, unsigned short direction, ExceptionCode&); … … 66 68 67 69 PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext* context, ExceptionCode& ec) { return openKeyCursor(context, static_cast<IDBKeyRange*>(0), ec); } 68 PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionCode& ec) { return openKeyCursor(context, keyRange, IDBCursor::NEXT, ec); } 69 PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext* context, PassRefPtr<IDBKey> key, ExceptionCode& ec) { return openKeyCursor(context, key, IDBCursor::NEXT, ec); } 70 PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionCode& ec) { return openKeyCursor(context, keyRange, IDBCursor::directionNext(), ec); } 71 PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext* context, PassRefPtr<IDBKey> key, ExceptionCode& ec) { return openKeyCursor(context, key, IDBCursor::directionNext(), ec); } 72 PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, const String& direction, ExceptionCode&); 73 PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext*, PassRefPtr<IDBKey>, const String& direction, ExceptionCode&); 70 74 PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, unsigned short direction, ExceptionCode&); 71 75 PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext*, PassRefPtr<IDBKey>, unsigned short direction, ExceptionCode&); -
trunk/Source/WebCore/Modules/indexeddb/IDBIndex.idl
r116051 r116337 35 35 readonly attribute boolean multiEntry; 36 36 37 [CallWith=ScriptExecutionContext] IDBRequest openCursor(in [Optional] IDBKeyRange range, in [Optional] DOMString direction) 38 raises (IDBDatabaseException); 39 [CallWith=ScriptExecutionContext] IDBRequest openCursor(in IDBKey key, in [Optional] DOMString direction) 40 raises (IDBDatabaseException); 41 42 [CallWith=ScriptExecutionContext] IDBRequest openKeyCursor(in [Optional] IDBKeyRange range, in [Optional] DOMString direction) 43 raises (IDBDatabaseException); 44 [CallWith=ScriptExecutionContext] IDBRequest openKeyCursor(in IDBKey key, in [Optional] DOMString direction) 45 raises (IDBDatabaseException); 46 47 // FIXME: remove these when 48 // https://bugs.webkit.org/show_bug.cgi?id=85326 is fixed. 37 49 [CallWith=ScriptExecutionContext] IDBRequest openCursor(in [Optional] IDBKeyRange range, in [Optional] unsigned short direction) 38 50 raises (IDBDatabaseException); … … 43 55 [CallWith=ScriptExecutionContext] IDBRequest openKeyCursor(in IDBKey key, in [Optional] unsigned short direction) 44 56 raises (IDBDatabaseException); 57 45 58 [CallWith=ScriptExecutionContext] IDBRequest get(in IDBKeyRange key) 46 59 raises (IDBDatabaseException); -
trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
r116051 r116337 256 256 } 257 257 258 PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> range, unsigned short direction, ExceptionCode& ec)258 PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> range, const String& directionString, ExceptionCode& ec) 259 259 { 260 260 IDB_TRACE("IDBObjectStore::openCursor"); 261 if (direction != IDBCursor::NEXT && direction != IDBCursor::NEXT_NO_DUPLICATE && direction != IDBCursor::PREV && direction != IDBCursor::PREV_NO_DUPLICATE) { 262 // FIXME: May need to change when specced: http://www.w3.org/Bugs/Public/show_bug.cgi?id=11406 263 ec = IDBDatabaseException::CONSTRAINT_ERR; 264 return 0; 265 } 261 unsigned short direction = IDBCursor::stringToDirection(directionString, ec); 262 if (ec) 263 return 0; 266 264 267 265 RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get()); … … 275 273 } 276 274 277 PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKey> key, unsigned short direction, ExceptionCode& ec) 275 PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> range, unsigned short direction, ExceptionCode& ec) 276 { 277 IDB_TRACE("IDBObjectStore::openCursor"); 278 DEFINE_STATIC_LOCAL(String, consoleMessage, ("Numeric direction values are deprecated in IDBObjectStore.openCursor. Use\"next\", \"nextunique\", \"prev\", or \"prevunique\".")); 279 context->addConsoleMessage(JSMessageSource, LogMessageType, WarningMessageLevel, consoleMessage); 280 const String& directionString = IDBCursor::directionToString(direction, ec); 281 if (ec) 282 return 0; 283 return openCursor(context, range, directionString, ec); 284 } 285 286 PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKey> key, const String& direction, ExceptionCode& ec) 278 287 { 279 288 IDB_TRACE("IDBObjectStore::openCursor"); … … 284 293 } 285 294 295 PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKey> key, unsigned short direction, ExceptionCode& ec) 296 { 297 IDB_TRACE("IDBObjectStore::openCursor"); 298 RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(key, ec); 299 if (ec) 300 return 0; 301 return openCursor(context, key, direction, ec); 302 } 303 286 304 PassRefPtr<IDBRequest> IDBObjectStore::count(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> range, ExceptionCode& ec) 287 305 { -
trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h
r116051 r116337 66 66 PassRefPtr<IDBIndex> createIndex(const String& name, const String& keyPath, ExceptionCode& ec) { return createIndex(name, keyPath, Dictionary(), ec); } 67 67 PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext* context, ExceptionCode& ec) { return openCursor(context, static_cast<IDBKeyRange*>(0), ec); } 68 PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionCode& ec) { return openCursor(context, keyRange, IDBCursor:: NEXT, ec); }69 PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKey> key, ExceptionCode& ec) { return openCursor(context, key, IDBCursor:: NEXT, ec); }68 PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, ExceptionCode& ec) { return openCursor(context, keyRange, IDBCursor::directionNext(), ec); } 69 PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKey> key, ExceptionCode& ec) { return openCursor(context, key, IDBCursor::directionNext(), ec); } 70 70 71 71 PassRefPtr<IDBRequest> get(ScriptExecutionContext*, PassRefPtr<IDBKey>, ExceptionCode&); … … 81 81 void deleteIndex(const String& name, ExceptionCode&); 82 82 83 PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, const String& direction, ExceptionCode&); 84 PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKey>, const String& direction, ExceptionCode&); 83 85 PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, unsigned short direction, ExceptionCode&); 84 86 PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKey>, unsigned short direction, ExceptionCode&); -
trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl
r116051 r116337 48 48 [CallWith=ScriptExecutionContext] IDBRequest get(in IDBKey key) 49 49 raises (IDBDatabaseException); 50 [CallWith=ScriptExecutionContext] IDBRequest openCursor(in [Optional] IDBKeyRange range, in [Optional] DOMString direction) 51 raises (IDBDatabaseException); 52 [CallWith=ScriptExecutionContext] IDBRequest openCursor(in IDBKey key, in [Optional] DOMString direction) 53 raises (IDBDatabaseException); 54 55 // FIXME: remove these when https://bugs.webkit.org/show_bug.cgi?id=85326 is fixed. 50 56 [CallWith=ScriptExecutionContext] IDBRequest openCursor(in [Optional] IDBKeyRange range, in [Optional] unsigned short direction) 51 57 raises (IDBDatabaseException); 52 58 [CallWith=ScriptExecutionContext] IDBRequest openCursor(in IDBKey key, in [Optional] unsigned short direction) 53 59 raises (IDBDatabaseException); 60 54 61 IDBIndex createIndex(in DOMString name, in DOMString keyPath, in [Optional] Dictionary options) 55 62 raises (IDBDatabaseException); -
trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp
r116051 r116337 57 57 , m_source(source) 58 58 , m_transaction(transaction) 59 , m_readyState( LOADING)59 , m_readyState(PENDING) 60 60 , m_requestFinished(false) 61 61 , m_cursorFinished(false) … … 114 114 } 115 115 116 unsigned short IDBRequest::readyState() const 117 { 118 ASSERT(m_readyState == LOADING || m_readyState == DONE); 119 return m_readyState; 116 const String& IDBRequest::readyState() const 117 { 118 ASSERT(m_readyState == PENDING || m_readyState == DONE); 119 DEFINE_STATIC_LOCAL(AtomicString, pending, ("pending")); 120 DEFINE_STATIC_LOCAL(AtomicString, done, ("done")); 121 122 if (m_readyState == PENDING) 123 return pending; 124 125 return done; 120 126 } 121 127 122 128 void IDBRequest::markEarlyDeath() 123 129 { 124 ASSERT(m_readyState == LOADING);130 ASSERT(m_readyState == PENDING); 125 131 m_readyState = EarlyDeath; 126 132 } … … 134 140 return false; 135 141 136 m_readyState = LOADING;142 m_readyState = PENDING; 137 143 m_result.clear(); 138 144 m_errorCode = 0; … … 154 160 return; 155 161 156 if (m_readyState != LOADING) {162 if (m_readyState != PENDING) { 157 163 ASSERT(m_readyState == DONE); 158 164 return; … … 187 193 { 188 194 m_cursorFinished = true; 189 if (m_readyState != LOADING)195 if (m_readyState != PENDING) 190 196 m_requestFinished = true; 191 197 } … … 269 275 270 276 ASSERT(m_source->type() == IDBAny::IDBDatabaseType); 271 ASSERT(m_transaction->mode() == IDBTransaction:: VERSION_CHANGE);277 ASSERT(m_transaction->mode() == IDBTransaction::modeVersionChange()); 272 278 m_source->idbDatabase()->setVersionChangeTransaction(frontend.get()); 273 279 … … 312 318 313 319 m_contextStopped = true; 314 if (m_readyState == LOADING)320 if (m_readyState == PENDING) 315 321 markEarlyDeath(); 316 322 } -
trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h
r116051 r116337 60 60 // Defined in the IDL 61 61 enum ReadyState { 62 LOADING = 1,62 PENDING = 1, 63 63 DONE = 2, 64 64 EarlyDeath = 3 65 65 }; 66 unsigned short readyState() const; 66 67 const String& readyState() const; 67 68 68 69 DEFINE_ATTRIBUTE_EVENT_LISTENER(success); -
trunk/Source/WebCore/Modules/indexeddb/IDBRequest.idl
r116051 r116337 45 45 46 46 // States 47 const unsigned short LOADING = 1; 48 const unsigned short DONE = 2; 49 readonly attribute unsigned short readyState; 47 readonly attribute DOMString readyState; 50 48 51 49 // Events -
trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
r116051 r116337 49 49 } 50 50 51 const AtomicString& IDBTransaction::modeReadOnly() 52 { 53 DEFINE_STATIC_LOCAL(AtomicString, readonly, ("readonly")); 54 return readonly; 55 } 56 57 const AtomicString& IDBTransaction::modeReadWrite() 58 { 59 DEFINE_STATIC_LOCAL(AtomicString, readwrite, ("readwrite")); 60 return readwrite; 61 } 62 63 const AtomicString& IDBTransaction::modeVersionChange() 64 { 65 DEFINE_STATIC_LOCAL(AtomicString, versionchange, ("versionchange")); 66 return versionchange; 67 } 68 69 const AtomicString& IDBTransaction::modeReadOnlyLegacy() 70 { 71 DEFINE_STATIC_LOCAL(AtomicString, readonly, ("0")); 72 return readonly; 73 } 74 75 const AtomicString& IDBTransaction::modeReadWriteLegacy() 76 { 77 DEFINE_STATIC_LOCAL(AtomicString, readwrite, ("1")); 78 return readwrite; 79 } 80 81 51 82 IDBTransaction::IDBTransaction(ScriptExecutionContext* context, PassRefPtr<IDBTransactionBackendInterface> backend, IDBDatabase* db) 52 83 : ActiveDOMObject(context, this) … … 75 106 } 76 107 77 unsigned short IDBTransaction::mode() const 78 { 79 return m_mode; 108 const String& IDBTransaction::mode() const 109 { 110 ExceptionCode ec = 0; 111 const AtomicString& mode = modeToString(m_mode, ec); 112 ASSERT(!ec); 113 return mode; 80 114 } 81 115 … … 208 242 } 209 243 244 unsigned short IDBTransaction::stringToMode(const String& modeString, ExceptionCode& ec) 245 { 246 if (modeString.isNull() 247 || modeString == IDBTransaction::modeReadOnly()) 248 return IDBTransaction::READ_ONLY; 249 if (modeString == IDBTransaction::modeReadWrite()) 250 return IDBTransaction::READ_WRITE; 251 ec = IDBDatabaseException::NOT_ALLOWED_ERR; 252 return 0; 253 } 254 255 const AtomicString& IDBTransaction::modeToString(unsigned short mode, ExceptionCode& ec) 256 { 257 switch (mode) { 258 case IDBTransaction::READ_ONLY: 259 return IDBTransaction::modeReadOnly(); 260 break; 261 262 case IDBTransaction::READ_WRITE: 263 return IDBTransaction::modeReadWrite(); 264 break; 265 266 case IDBTransaction::VERSION_CHANGE: 267 return IDBTransaction::modeVersionChange(); 268 break; 269 270 default: 271 ec = IDBDatabaseException::NON_TRANSIENT_ERR; 272 return IDBTransaction::modeReadOnly(); 273 } 274 } 275 210 276 const AtomicString& IDBTransaction::interfaceName() const 211 277 { -
trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h
r116051 r116337 57 57 }; 58 58 59 static const AtomicString& modeReadOnly(); 60 static const AtomicString& modeReadWrite(); 61 static const AtomicString& modeVersionChange(); 62 static const AtomicString& modeReadOnlyLegacy(); 63 static const AtomicString& modeReadWriteLegacy(); 64 65 static unsigned short stringToMode(const String&, ExceptionCode&); 66 static const AtomicString& modeToString(unsigned short, ExceptionCode&); 67 59 68 IDBTransactionBackendInterface* backend() const; 60 69 bool finished() const; 61 70 62 unsigned shortmode() const;71 const String& mode() const; 63 72 IDBDatabase* db() const; 64 73 PassRefPtr<IDBObjectStore> objectStore(const String& name, ExceptionCode&); … … 118 127 RefPtr<IDBTransactionBackendInterface> m_backend; 119 128 RefPtr<IDBDatabase> m_database; 120 unsigned short m_mode;129 const unsigned short m_mode; 121 130 bool m_transactionFinished; // Is it possible that we'll fire any more events or allow any new requests? If not, we're finished. 122 131 bool m_contextStopped; -
trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.idl
r116051 r116337 32 32 EventTarget 33 33 ] IDBTransaction { 34 // Modes34 // FIXME: Eventually remove legacy enum constants, see https://bugs.webkit.org/show_bug.cgi?id=85315 35 35 const unsigned short READ_ONLY = 0; 36 36 const unsigned short READ_WRITE = 1; … … 38 38 39 39 // Properties 40 readonly attribute unsigned shortmode;40 readonly attribute DOMString mode; 41 41 readonly attribute IDBDatabase db; 42 42 // Methods
Note: See TracChangeset
for help on using the changeset viewer.