Changeset 116337 in webkit


Ignore:
Timestamp:
May 7, 2012 12:12:00 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

IndexedDB: Replace numeric constants with strings
https://bugs.webkit.org/show_bug.cgi?id=84894

Patch by Alec Flett <alecflett@chromium.org> on 2012-05-07
Reviewed by Tony Chang.

Source/WebCore:

Test: storage/indexeddb/legacy-constants.html

Update IDBObjectStore.openCursor, IDBIndex.openCursor,
IDBIndex.openKeyCursor, IDBDatabase.transaction,
IDBCursor.direction, IDBTransaction.mode, and
IDBRequest.readyState to meet the latest spec. All of these APIs
now support string-based values in addition to the
legacy/deprecated enum-based values.

  • Modules/indexeddb/IDBCursor.cpp:

(WebCore):
(WebCore::IDBCursor::direction):
(WebCore::IDBCursor::stringToDirection):
(WebCore::IDBCursor::directionToString):

  • Modules/indexeddb/IDBCursor.h:

(IDBCursor):

  • Modules/indexeddb/IDBCursor.idl:
  • Modules/indexeddb/IDBDatabase.cpp:

(WebCore::IDBDatabase::transaction):
(WebCore):

  • Modules/indexeddb/IDBDatabase.h:

(IDBDatabase):

  • Modules/indexeddb/IDBDatabase.idl:
  • Modules/indexeddb/IDBIndex.cpp:

(WebCore::IDBIndex::openCursor):
(WebCore):
(WebCore::IDBIndex::openKeyCursor):

  • Modules/indexeddb/IDBIndex.h:

(WebCore::IDBIndex::openCursor):
(IDBIndex):
(WebCore::IDBIndex::openKeyCursor):

  • Modules/indexeddb/IDBIndex.idl:
  • Modules/indexeddb/IDBObjectStore.cpp:

(WebCore::IDBObjectStore::openCursor):
(WebCore):

  • Modules/indexeddb/IDBObjectStore.h:

(WebCore::IDBObjectStore::openCursor):
(IDBObjectStore):

  • Modules/indexeddb/IDBObjectStore.idl:
  • Modules/indexeddb/IDBRequest.cpp:

(WebCore::IDBRequest::IDBRequest):
(WebCore::IDBRequest::readyState):
(WebCore::IDBRequest::markEarlyDeath):
(WebCore::IDBRequest::resetReadyState):
(WebCore::IDBRequest::abort):
(WebCore::IDBRequest::finishCursor):
(WebCore::IDBRequest::onSuccess):
(WebCore::IDBRequest::stop):

  • Modules/indexeddb/IDBRequest.h:
  • Modules/indexeddb/IDBRequest.idl:
  • Modules/indexeddb/IDBTransaction.cpp:

(WebCore):
(WebCore::IDBTransaction::mode):
(WebCore::IDBTransaction::stringToMode):
(WebCore::IDBTransaction::modeToString):

  • Modules/indexeddb/IDBTransaction.h:

(IDBTransaction):

  • Modules/indexeddb/IDBTransaction.idl:

LayoutTests:

New test for legacy constants (legacy-constants) and update all
other tests to use the new string-based constants.

  • storage/indexeddb/basics-expected.txt:
  • storage/indexeddb/basics-workers-expected.txt:
  • storage/indexeddb/constants-expected.txt:
  • storage/indexeddb/create-object-store-options-expected.txt:
  • storage/indexeddb/cursor-added-bug-expected.txt:
  • storage/indexeddb/cursor-advance-expected.txt:
  • storage/indexeddb/cursor-continue-expected.txt:
  • storage/indexeddb/cursor-continue-validity-expected.txt:
  • storage/indexeddb/cursor-delete-expected.txt:
  • storage/indexeddb/cursor-inconsistency-expected.txt:
  • storage/indexeddb/cursor-index-delete-expected.txt:
  • storage/indexeddb/cursor-key-order-expected.txt:
  • storage/indexeddb/cursor-prev-no-duplicate-expected.txt:
  • storage/indexeddb/cursor-primary-key-order-expected.txt:
  • storage/indexeddb/cursor-reverse-bug-expected.txt:
  • storage/indexeddb/cursor-skip-deleted-expected.txt:
  • storage/indexeddb/cursor-update-expected.txt:
  • storage/indexeddb/data-corruption-expected.txt:
  • storage/indexeddb/database-quota-expected.txt:
  • storage/indexeddb/delete-range-expected.txt:
  • storage/indexeddb/error-causes-abort-by-default-expected.txt:
  • storage/indexeddb/exception-in-event-aborts-expected.txt:
  • storage/indexeddb/factory-deletedatabase-expected.txt:
  • storage/indexeddb/index-count-expected.txt:
  • storage/indexeddb/index-multientry-expected.txt:
  • storage/indexeddb/index-unique-expected.txt:
  • storage/indexeddb/key-generator-expected.txt:
  • storage/indexeddb/key-type-array-expected.txt:
  • storage/indexeddb/keypath-edges-expected.txt:
  • storage/indexeddb/keypath-intrinsic-properties-expected.txt:
  • storage/indexeddb/legacy-constants-expected.txt: Added.
  • storage/indexeddb/legacy-constants.html: Added.
  • storage/indexeddb/mozilla/clear-expected.txt:
  • storage/indexeddb/mozilla/create-index-unique-expected.txt:
  • storage/indexeddb/mozilla/create-objectstore-basics-expected.txt:
  • storage/indexeddb/mozilla/cursor-mutation-expected.txt:
  • storage/indexeddb/mozilla/cursor-mutation-objectstore-only-expected.txt:
  • storage/indexeddb/mozilla/cursors-expected.txt:
  • storage/indexeddb/mozilla/index-prev-no-duplicate-expected.txt:
  • storage/indexeddb/mozilla/index-prev-no-duplicate.html:
  • storage/indexeddb/mozilla/indexes-expected.txt:
  • storage/indexeddb/mozilla/odd-result-order-expected.txt:
  • storage/indexeddb/mozilla/readwrite-transactions-expected.txt:
  • storage/indexeddb/mozilla/readyState-expected.txt:
  • storage/indexeddb/mozilla/resources/clear.js:

(clear):

  • storage/indexeddb/mozilla/resources/create-index-unique.js:

(createAndVerifyIndex):

  • storage/indexeddb/mozilla/resources/create-objectstore-basics.js:

(cleanDatabase):

  • storage/indexeddb/mozilla/resources/cursor-mutation-objectstore-only.js:

(checkCursorResultsAndSetupMutatingCursor):

  • storage/indexeddb/mozilla/resources/cursor-mutation.js:

(setupMutatingCursor):

  • storage/indexeddb/mozilla/resources/cursors.js:
  • storage/indexeddb/mozilla/resources/indexes.js:
  • storage/indexeddb/mozilla/resources/odd-result-order.js:

(addRecord):
(deleteRecord):

  • storage/indexeddb/mozilla/resources/readwrite-transactions.js:

(setVersionComplete):
(postAdd):
(postAdd2):
(postPut):
(postPut2):
(postPut3):
(postPut4):
(postDelete):
(postDelete2):

  • storage/indexeddb/mozilla/resources/readyState.js:

(test):
(openSuccess):
(setupObjectStore):
(getRecord):
(finalCheck):

  • storage/indexeddb/mozilla/resources/versionchange.js:

(postSetVersion):
(postSetVersion2):

  • storage/indexeddb/mozilla/versionchange-expected.txt:
  • storage/indexeddb/mutating-cursor-expected.txt:
  • storage/indexeddb/noblobs-expected.txt:
  • storage/indexeddb/noblobs.html:
  • storage/indexeddb/objectstore-autoincrement-expected.txt:
  • storage/indexeddb/objectstore-basics-expected.txt:
  • storage/indexeddb/objectstore-basics-workers-expected.txt:
  • storage/indexeddb/objectstore-count-expected.txt:
  • storage/indexeddb/open-cursor-expected.txt:
  • storage/indexeddb/open-during-transaction-expected.txt:
  • storage/indexeddb/opencursor-key-expected.txt:
  • storage/indexeddb/prefetch-bugfix-108071-expected.txt:
  • storage/indexeddb/readonly-expected.txt:
  • storage/indexeddb/request-event-propagation-expected.txt:
  • storage/indexeddb/resources/basics.js:

(test):
(openCallback):

  • storage/indexeddb/resources/constants.js:

(test):

  • storage/indexeddb/resources/create-object-store-options.js:

(setVersionComplete):

  • storage/indexeddb/resources/cursor-added-bug.js:

(openCursor):

  • storage/indexeddb/resources/cursor-advance.js:

(runTest):
(testAdvanceIndexNoDupe):
(testAdvanceIndexPrev):
(testAdvanceIndexPrevNoDupe):

  • storage/indexeddb/resources/cursor-continue-validity.js:

(continueTest):
(continueIndexTest):
(testModifyContinueOrder):

  • storage/indexeddb/resources/cursor-continue.js:

(ascendingTest):
(descendingTest):

  • storage/indexeddb/resources/cursor-delete.js:

(openCursor):
(addObject):

  • storage/indexeddb/resources/cursor-inconsistency.js:

(openBasicCursor):

  • storage/indexeddb/resources/cursor-index-delete.js:

(openCursor):
(addObject):

  • storage/indexeddb/resources/cursor-key-order.js:
  • storage/indexeddb/resources/cursor-prev-no-duplicate.js:

(populateStore):
(testFarRangeCursor_closed):
(testFarRangeCursor_open):
(testFarRangeCursor_indexClosed):
(testFarRangeCursor_indexOpen):
(testFarRangeCursor_indexKeyOpen):
(testFarRangeCursor_indexKeyClosed):
(testBoundaryCursor_closed):
(testBoundaryCursor_open):
(testBoundaryCursor_indexClosed):
(testBoundaryCursor_indexOpen):
(testBoundaryCursor_indexKeyClosed):
(testBoundaryCursor_indexKeyOpen):
(testNoDuplicate_closed):
(testNoDuplicate_open):
(testNoDuplicate_indexKeyClosed):

  • storage/indexeddb/resources/cursor-primary-key-order.js:

(populateStore):

  • storage/indexeddb/resources/cursor-reverse-bug.js:

(populateStore):
(testCursor):

  • storage/indexeddb/resources/cursor-skip-deleted.js:

(basicCursorTest):
(reverseCursorTest):

  • storage/indexeddb/resources/cursor-update.js:

(openBasicCursor):

  • storage/indexeddb/resources/data-corruption.js:

(addData):
(getData):

  • storage/indexeddb/resources/database-quota.js:

(checkQuotaEnforcing):

  • storage/indexeddb/resources/delete-range.js:

(runTests.nextTest):
(runTests):

  • storage/indexeddb/resources/error-causes-abort-by-default.js:

(addData):
(transactionCompleted):
(transactionAborted1):

  • storage/indexeddb/resources/exception-in-event-aborts.js:

(startTest):
(transactionAborted1):
(transactionAborted2):

  • storage/indexeddb/resources/factory-deletedatabase.js:

(getValue):

  • storage/indexeddb/resources/index-count.js:
  • storage/indexeddb/resources/index-cursor.js:

(runNextTest):
(testNullKeyRange):

  • storage/indexeddb/resources/index-multientry.js:
  • storage/indexeddb/resources/index-unique.js:

(setVersionCompleted):

  • storage/indexeddb/resources/key-generator.js:

(.):

  • storage/indexeddb/resources/key-type-array.js:
  • storage/indexeddb/resources/keypath-edges.js:
  • storage/indexeddb/resources/keypath-intrinsic-properties.js:
  • storage/indexeddb/resources/legacy-constants.js: Added.

(test):
(prepareDatabase.openreq.onsuccess.verreq.onsuccess):
(prepareDatabase.openreq.onsuccess):
(prepareDatabase):
(populateStore):
(checkNext.request.onsuccess):
(checkNext):
(checkNextNoDuplicate.request.onsuccess):
(checkNextNoDuplicate):
(checkPrev.request.onsuccess):
(checkPrev):
(checkPrevNoDuplicate.request.onsuccess):
(checkPrevNoDuplicate):

  • storage/indexeddb/resources/mutating-cursor.js:

(openForwardCursor):
(openReverseCursor):

  • storage/indexeddb/resources/objectstore-autoincrement.js:

(setVersionCompleted):

  • storage/indexeddb/resources/objectstore-basics.js:

(addData):
(addAgainFailure):

  • storage/indexeddb/resources/objectstore-count.js:
  • storage/indexeddb/resources/objectstore-cursor.js:

(runNextTest):
(testNullKeyRange):

  • storage/indexeddb/resources/open-cursor.js:

(cursorWithKeySuccess):
(cursorSuccess):

  • storage/indexeddb/resources/open-during-transaction.js:
  • storage/indexeddb/resources/opencursor-key.js:
  • storage/indexeddb/resources/prefetch-bugfix-108071.js:
  • storage/indexeddb/resources/request-event-propagation.js:

(startTest):
(transactionAborted):
(transactionAborted2):

  • storage/indexeddb/resources/set_version_blocked.js:

(blocked):

  • storage/indexeddb/resources/transaction-abort.js:

(startTest):

  • storage/indexeddb/resources/transaction-after-close.js:

(runFirstRegularTransaction):
(firstTransactionComplete):
(onSecondOpen):

  • storage/indexeddb/resources/transaction-basics.js:

(testInvalidMode):

  • storage/indexeddb/resources/transaction-event-propagation.js:

(startTest):
(dbAbortBubbleCallback):

  • storage/indexeddb/resources/transaction-rollback.js:

(setVersionComplete):
(abortCallback):

  • storage/indexeddb/set_version_blocked-expected.txt:
  • storage/indexeddb/structured-clone-expected.txt:
  • storage/indexeddb/structured-clone.html:
  • storage/indexeddb/transaction-abort-expected.txt:
  • storage/indexeddb/transaction-abort-with-js-recursion-cross-frame-expected.txt:
  • storage/indexeddb/transaction-abort-with-js-recursion-cross-frame.html:
  • storage/indexeddb/transaction-abort-with-js-recursion-expected.txt:
  • storage/indexeddb/transaction-abort-with-js-recursion.html:
  • storage/indexeddb/transaction-after-close-expected.txt:
  • storage/indexeddb/transaction-basics-expected.txt:
  • storage/indexeddb/transaction-event-propagation-expected.txt:
  • storage/indexeddb/transaction-rollback-expected.txt:
  • storage/indexeddb/tutorial.html:
Location:
trunk
Files:
3 added
148 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r116335 r116337  
     12012-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
    12562012-05-07  Adam Barth  <abarth@webkit.org>
    2257
  • trunk/LayoutTests/http/tests/inspector/indexeddb/indexeddb-test.js

    r116051 r116337  
    154154    function step2(db)
    155155    {
    156         var transaction = db.transaction([objectStoreName], IDBTransaction.READ_WRITE);
     156        var transaction = db.transaction([objectStoreName], 'readwrite');
    157157        var objectStore = transaction.objectStore(objectStoreName);
    158158        callback(objectStore, innerCommitCallback);
  • trunk/LayoutTests/storage/indexeddb/basics-expected.txt

    r116051 r116337  
    2424PASS request.transaction is null
    2525PASS 'readyState' in request is true
    26 PASS request.readyState is IDBRequest.LOADING
     26PASS request.readyState is 'pending'
    2727PASS 'onsuccess' in request is true
    2828PASS request.onsuccess is null
    2929PASS 'onerror' in request is true
    3030PASS request.onerror is null
    31 PASS request.LOADING is 1
    32 PASS request.DONE is 2
    3331PASS 'result' in event.target is true
    3432PASS !!event.target.result is true
     
    4240PASS event.target.transaction is null
    4341PASS 'readyState' in request is true
    44 PASS event.target.readyState is IDBRequest.DONE
     42PASS event.target.readyState is 'done'
    4543PASS 'onsuccess' in event.target is true
    4644PASS 'onerror' in event.target is true
    47 PASS event.target.LOADING is 1
    48 PASS event.target.DONE is 2
    4945PASS successfullyParsed is true
    5046
  • trunk/LayoutTests/storage/indexeddb/basics-shared-workers-expected.txt

    r112490 r116337  
    2525PASS [Worker] request.transaction is null
    2626PASS [Worker] 'readyState' in request is true
    27 PASS [Worker] request.readyState is IDBRequest.LOADING
     27PASS [Worker] request.readyState is 'pending'
    2828PASS [Worker] 'onsuccess' in request is true
    2929PASS [Worker] request.onsuccess is null
    3030PASS [Worker] 'onerror' in request is true
    3131PASS [Worker] request.onerror is null
    32 PASS [Worker] request.LOADING is 1
    33 PASS [Worker] request.DONE is 2
    3432PASS [Worker] 'result' in event.target is true
    3533PASS [Worker] !!event.target.result is true
     
    4341PASS [Worker] event.target.transaction is null
    4442PASS [Worker] 'readyState' in request is true
    45 PASS [Worker] event.target.readyState is IDBRequest.DONE
     43PASS [Worker] event.target.readyState is 'done'
    4644PASS [Worker] 'onsuccess' in event.target is true
    4745PASS [Worker] 'onerror' in event.target is true
    48 PASS [Worker] event.target.LOADING is 1
    49 PASS [Worker] event.target.DONE is 2
    5046PASS successfullyParsed is true
    5147
  • trunk/LayoutTests/storage/indexeddb/basics-workers-expected.txt

    r116051 r116337  
    2525PASS [Worker] request.transaction is null
    2626PASS [Worker] 'readyState' in request is true
    27 PASS [Worker] request.readyState is IDBRequest.LOADING
     27PASS [Worker] request.readyState is 'pending'
    2828PASS [Worker] 'onsuccess' in request is true
    2929PASS [Worker] request.onsuccess is null
    3030PASS [Worker] 'onerror' in request is true
    3131PASS [Worker] request.onerror is null
    32 PASS [Worker] request.LOADING is 1
    33 PASS [Worker] request.DONE is 2
    3432PASS [Worker] 'result' in event.target is true
    3533PASS [Worker] !!event.target.result is true
     
    4341PASS [Worker] event.target.transaction is null
    4442PASS [Worker] 'readyState' in request is true
    45 PASS [Worker] event.target.readyState is IDBRequest.DONE
     43PASS [Worker] event.target.readyState is 'done'
    4644PASS [Worker] 'onsuccess' in event.target is true
    4745PASS [Worker] 'onerror' in event.target is true
    48 PASS [Worker] event.target.LOADING is 1
    49 PASS [Worker] event.target.DONE is 2
    5046PASS successfullyParsed is true
    5147
  • trunk/LayoutTests/storage/indexeddb/constants-expected.txt

    r116051 r116337  
    1818PASS IDBDatabaseException.QUOTA_ERR is 11
    1919PASS IDBDatabaseException.VER_ERR is 12
    20 PASS IDBRequest.LOADING is 1
    21 PASS IDBRequest.DONE is 2
    2220PASS IDBCursor.NEXT is 0
    2321PASS IDBCursor.NEXT_NO_DUPLICATE is 1
  • trunk/LayoutTests/storage/indexeddb/create-object-store-options-expected.txt

    r116051 r116337  
    1313db.createObjectStore('b')
    1414db.createObjectStore('c', {autoIncrement: true});
    15 trans = db.transaction(['a', 'b'], IDBTransaction.READ_WRITE)
    16 PASS trans.mode is IDBTransaction.READ_WRITE
     15trans = db.transaction(['a', 'b'], 'readwrite')
     16PASS trans.mode is 'readwrite'
    1717trans.objectStore('a').put({'a': 0})
    1818Expecting TypeError exception from db.createObjectStore('d', 'bar');
  • trunk/LayoutTests/storage/indexeddb/cursor-added-bug-expected.txt

    r116051 r116337  
    1616objectStore.add(2, 2)
    1717objectStore.add(3, 3)
    18 trans = db.transaction(['test'], IDBTransaction.READ_WRITE)
     18trans = db.transaction(['test'], 'readwrite')
    1919trans.objectStore('test').openCursor()
    2020PASS event.target.result.key is 1
  • trunk/LayoutTests/storage/indexeddb/cursor-advance-expected.txt

    r116051 r116337  
    3434trans = db.transaction(objectStoreName)
    3535store = trans.objectStore(objectStoreName)
    36 request = store.openCursor(null, null)
     36request = store.openCursor()
    3737cursor.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"}'
     38PASS expected is '{"key":"237-23-7733","value":{"name":"Ann","height":52,"weight":110},"primaryKey":"237-23-7733"}'
    3939testContinueThenAdvance()
    4040trans = db.transaction(objectStoreName)
    4141store = trans.objectStore(objectStoreName)
    42 request = store.openCursor(null, null)
     42request = store.openCursor()
    4343cursor.continue();
    4444cursor.continue();
    4545cursor.continue();
    4646cursor.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"}'
     47PASS expected is '{"key":"237-23-7736","value":{"name":"Joe","height":65,"weight":150},"primaryKey":"237-23-7736"}'
    4848testAdvanceMultiple()
    4949trans = db.transaction(objectStoreName)
    5050store = trans.objectStore(objectStoreName)
    51 request = store.openCursor(null, null)
     51request = store.openCursor()
    5252cursor.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"}'
     53PASS expected is '{"key":"237-23-7735","value":{"name":"Sue","height":58,"weight":130},"primaryKey":"237-23-7735"}'
    5454testAdvanceIndex()
    5555trans = db.transaction(objectStoreName)
    5656store = trans.objectStore(objectStoreName)
    57 request = store.openCursor(null, null)
     57request = store.openCursor()
    5858cursor.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"}'
     59PASS expected is '{"key":"Jef","value":{"name":"Jef","height":65,"weight":120},"primaryKey":"237-23-7739"}'
    6060testAdvanceIndexNoDupe()
    6161trans = db.transaction(objectStoreName)
    6262store = trans.objectStore(objectStoreName)
    63 request = store.openCursor(null, 1)
     63request = store.openCursor(null, 'nextunique')
    6464cursor.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"}'
     65PASS expected is '{"key":130,"value":{"name":"Sue","height":58,"weight":130},"primaryKey":"237-23-7735"}'
    6666testAdvanceIndexPrev()
    6767trans = db.transaction(objectStoreName)
    6868store = trans.objectStore(objectStoreName)
    69 request = store.openCursor(null, 2)
     69request = store.openCursor(null, 'prev')
    7070cursor.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"}'
     71PASS expected is '{"key":150,"value":{"name":"Joe","height":65,"weight":150},"primaryKey":"237-23-7736"}'
    7272testAdvanceIndexPrevNoDupe()
    7373trans = db.transaction(objectStoreName)
    7474store = trans.objectStore(objectStoreName)
    75 request = store.openCursor(null, 3)
     75request = store.openCursor(null, 'prevunique')
    7676cursor.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"}'
     77PASS expected is '{"key":120,"value":{"name":"Bob","height":60,"weight":120},"primaryKey":"237-23-7732"}'
    7878testAdvanceToEnd()
    7979trans = db.transaction(objectStoreName)
    8080store = trans.objectStore(objectStoreName)
    81 request = store.openCursor(null, null)
     81request = store.openCursor()
    8282cursor.advance(100)
    83 PASS 'null' is 'null'
     83PASS expected is 'null'
    8484testPrefetchInRange()
    8585trans = db.transaction(objectStoreName)
    8686objectStore = trans.objectStore(objectStoreName)
    8787request = 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"}'
     88PASS expected is '{"key":"237-23-7732","value":{"name":"Bob","height":60,"weight":120},"primaryKey":"237-23-7732"}'
    8989cursor.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"}'
     90PASS expected is '{"key":"237-23-7733","value":{"name":"Ann","height":52,"weight":110},"primaryKey":"237-23-7733"}'
    9191cursor.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"}'
     92PASS expected is '{"key":"237-23-7734","value":{"name":"Ron","height":73,"weight":180},"primaryKey":"237-23-7734"}'
    9393cursor.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"}'
     94PASS expected is '{"key":"237-23-7735","value":{"name":"Sue","height":58,"weight":130},"primaryKey":"237-23-7735"}'
    9595cursor.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"}'
     96PASS expected is '{"key":"237-23-7737","value":{"name":"Pat","height":65,"weight":100},"primaryKey":"237-23-7737"}'
    9797cursor.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"}'
     98PASS expected is '{"key":"237-23-7738","value":{"name":"Leo","height":65,"weight":180},"primaryKey":"237-23-7738"}'
    9999cursor.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"}'
     100PASS expected is '{"key":"237-23-7739","value":{"name":"Jef","height":65,"weight":120},"primaryKey":"237-23-7739"}'
    101101cursor.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"}'
     102PASS expected is '{"key":"237-23-7740","value":{"name":"Sam","height":71,"weight":110},"primaryKey":"237-23-7740"}'
    103103cursor.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"}'
     104PASS expected is '{"key":"237-23-7741","value":{"name":"Bug","height":63,"weight":100},"primaryKey":"237-23-7741"}'
    105105cursor.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"}'
     106PASS expected is '{"key":"237-23-7742","value":{"name":"Tub","height":69,"weight":180},"primaryKey":"237-23-7742"}'
    107107cursor.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"}'
     108PASS expected is '{"key":"237-23-7743","value":{"name":"Rug","height":77,"weight":120},"primaryKey":"237-23-7743"}'
    109109cursor.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"}'
     110PASS expected is '{"key":"237-23-7744","value":{"name":"Pug","height":66,"weight":110},"primaryKey":"237-23-7744"}'
    111111cursor.continue()
    112112testPrefetchOutOfRange()
     
    114114objectStore = trans.objectStore(objectStoreName)
    115115request = 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"}'
     116PASS expected is '{"key":"237-23-7732","value":{"name":"Bob","height":60,"weight":120},"primaryKey":"237-23-7732"}'
    117117cursor.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"}'
     118PASS expected is '{"key":"237-23-7733","value":{"name":"Ann","height":52,"weight":110},"primaryKey":"237-23-7733"}'
    119119cursor.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"}'
     120PASS expected is '{"key":"237-23-7734","value":{"name":"Ron","height":73,"weight":180},"primaryKey":"237-23-7734"}'
    121121cursor.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"}'
     122PASS expected is '{"key":"237-23-7735","value":{"name":"Sue","height":58,"weight":130},"primaryKey":"237-23-7735"}'
    123123cursor.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"}'
     124PASS expected is '{"key":"237-23-7742","value":{"name":"Tub","height":69,"weight":180},"primaryKey":"237-23-7742"}'
    125125cursor.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"}'
     126PASS expected is '{"key":"237-23-7743","value":{"name":"Rug","height":77,"weight":120},"primaryKey":"237-23-7743"}'
    127127cursor.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"}'
     128PASS expected is '{"key":"237-23-7744","value":{"name":"Pug","height":66,"weight":110},"primaryKey":"237-23-7744"}'
    129129cursor.continue()
    130130testBadAdvance()
    131 trans = db.transaction(objectStoreName, IDBTransaction.READ_WRITE)
     131trans = db.transaction(objectStoreName, 'readwrite')
    132132objectStore = trans.objectStore(objectStoreName)
    133133request = objectStore.openCursor()
     
    136136PASS code is DOMException.TYPE_MISMATCH_ERR
    137137testDelete()
    138 trans = db.transaction(objectStoreName, IDBTransaction.READ_WRITE)
     138trans = db.transaction(objectStoreName, 'readwrite')
    139139objectStore = trans.objectStore(objectStoreName)
    140140request = 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"}'
     141PASS expected is '{"key":"237-23-7732","value":{"name":"Bob","height":60,"weight":120},"primaryKey":"237-23-7732"}'
    142142cursor.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"}'
     143PASS expected is '{"key":"237-23-7733","value":{"name":"Ann","height":52,"weight":110},"primaryKey":"237-23-7733"}'
    144144cursor.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"}'
     145PASS expected is '{"key":"237-23-7734","value":{"name":"Ron","height":73,"weight":180},"primaryKey":"237-23-7734"}'
    146146cursor.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"}'
     147PASS expected is '{"key":"237-23-7738","value":{"name":"Leo","height":65,"weight":180},"primaryKey":"237-23-7738"}'
    148148cursor.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"}'
     149PASS expected is '{"key":"237-23-7739","value":{"name":"Jef","height":65,"weight":120},"primaryKey":"237-23-7739"}'
    150150cursor.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"}'
     151PASS expected is '{"key":"237-23-7740","value":{"name":"Sam","height":71,"weight":110},"primaryKey":"237-23-7740"}'
    152152cursor.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"}'
     153PASS expected is '{"key":"237-23-7741","value":{"name":"Bug","height":63,"weight":100},"primaryKey":"237-23-7741"}'
    154154cursor.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"}'
     155PASS expected is '{"key":"237-23-7742","value":{"name":"Tub","height":69,"weight":180},"primaryKey":"237-23-7742"}'
    156156cursor.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"}'
     157PASS expected is '{"key":"237-23-7743","value":{"name":"Rug","height":77,"weight":120},"primaryKey":"237-23-7743"}'
    158158cursor.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"}'
     159PASS expected is '{"key":"237-23-7744","value":{"name":"Pug","height":66,"weight":110},"primaryKey":"237-23-7744"}'
    160160cursor.advance(1)
    161161PASS successfullyParsed is true
  • trunk/LayoutTests/storage/indexeddb/cursor-continue-expected.txt

    r116051 r116337  
    3333objectStore.add({'x': testData[nextToAdd]}, nextToAdd)
    3434
    35 indexObject.openKeyCursor(null, IDBCursor.NEXT)
     35indexObject.openKeyCursor(null, 'next')
    3636PASS event.target.result.primaryKey is 0
    3737event.target.result.continue(3.14159)
     
    5858PASS event.target.result is null
    5959
    60 indexObject.openKeyCursor(null, IDBCursor.PREV)
     60indexObject.openKeyCursor(null, 'prev')
    6161PASS event.target.result.primaryKey is 17
    6262event.target.result.continue('A bit2')
     
    7777PASS event.target.result is null
    7878
    79 indexObject.openKeyCursor(null, IDBCursor.NEXT)
     79indexObject.openKeyCursor(null, 'next')
    8080PASS event.target.result.primaryKey is 0
    8181event.target.result.continue(3.14159)
     
    8585PASS code is IDBDatabaseException.DATA_ERR
    8686
    87 indexObject.openKeyCursor(null, IDBCursor.NEXT)
     87indexObject.openKeyCursor(null, 'next')
    8888PASS event.target.result.primaryKey is 0
    8989event.target.result.continue(3.14159)
     
    9393PASS code is IDBDatabaseException.DATA_ERR
    9494
    95 indexObject.openKeyCursor(null, IDBCursor.PREV)
     95indexObject.openKeyCursor(null, 'prev')
    9696PASS event.target.result.primaryKey is 17
    9797event.target.result.continue('A bit2')
     
    101101PASS code is IDBDatabaseException.DATA_ERR
    102102
    103 indexObject.openKeyCursor(null, IDBCursor.PREV)
     103indexObject.openKeyCursor(null, 'prev')
    104104PASS event.target.result.primaryKey is 17
    105105event.target.result.continue('A bit2')
  • trunk/LayoutTests/storage/indexeddb/cursor-continue-validity-expected.txt

    r116051 r116337  
    4343Checking objectStore
    4444====================
    45 indexObject.openCursor(null, IDBCursor.NEXT)
     45indexObject.openCursor(null, 'next')
    4646self.continueValue = 0
    4747doubleContinueCallback()
     
    401401Checking index
    402402==============
    403 indexObject.openCursor(null, IDBCursor.NEXT)
     403indexObject.openCursor(null, 'next')
    404404self.continueValue = 0
    405405cursor = event.target.result
     
    733733Checking modification
    734734=====================
    735 indexObject.openCursor(null, IDBCursor.NEXT)
     735indexObject.openCursor(null, 'next')
    736736self.continueValue = 0
    737737cursor = event.target.result
  • trunk/LayoutTests/storage/indexeddb/cursor-delete-expected.txt

    r116051 r116337  
    1919objectStore.add('myValue4', 'myKey4')
    2020openCursor1
    21 trans = db.transaction(['test'], IDBTransaction.READ_WRITE)
     21trans = db.transaction(['test'], 'readwrite')
    2222trans.objectStore('test').openCursor(keyRange)
    2323event.target.result.delete()
     
    3636trans.objectStore('test').openCursor(keyRange)
    3737PASS event.target.result is null
    38 trans = db.transaction(['test'], IDBTransaction.READ_WRITE)
     38trans = db.transaction(['test'], 'readwrite')
    3939objectStore = trans.objectStore('test')
    4040objectStore.add('myValue1', 'myKey1')
  • trunk/LayoutTests/storage/indexeddb/cursor-inconsistency-expected.txt

    r116051 r116337  
    1919objectStore.add('someValue4', 'someKey4').onerror = unexpectedErrorCallback
    2020openBasicCursor()
    21 trans = db.transaction(['basicStore'], IDBTransaction.READ_WRITE)
     21trans = db.transaction(['basicStore'], 'readwrite')
    2222trans.objectStore('basicStore')
    2323objectStore.openCursor(keyRange)
  • trunk/LayoutTests/storage/indexeddb/cursor-index-delete-expected.txt

    r116051 r116337  
    2020objectStore.add({x: 4}, 'myKey4')
    2121openCursor1
    22 trans = db.transaction(['test'], IDBTransaction.READ_WRITE)
     22trans = db.transaction(['test'], 'readwrite')
    2323trans.objectStore('test').index('testIndex').openCursor(keyRange)
    2424event.target.result.delete()
     
    3737trans.objectStore('test').index('testIndex').openCursor(keyRange)
    3838PASS event.target.result is null
    39 trans = db.transaction(['test'], IDBTransaction.READ_WRITE)
     39trans = db.transaction(['test'], 'readwrite')
    4040objectStore = trans.objectStore('test')
    4141objectStore.add({x: 1}, 'myKey1')
  • trunk/LayoutTests/storage/indexeddb/cursor-key-order-expected.txt

    r116051 r116337  
    1313
    1414populating store...
    15 trans = db.transaction('store', IDBTransaction.READ_WRITE)
     15trans = db.transaction('store', 'readwrite')
    1616store = trans.objectStore('store');
    1717store.put(0, -Infinity)
     
    6767
    6868iterating cursor...
    69 trans = db.transaction('store', IDBTransaction.READ_ONLY)
     69trans = db.transaction('store', 'readonly')
    7070store = trans.objectStore('store');
    7171count = 0
  • trunk/LayoutTests/storage/indexeddb/cursor-prev-no-duplicate-expected.txt

    r116051 r116337  
    1515
    1616populating store...
    17 trans = db.transaction('store', IDBTransaction.READ_WRITE)
     17trans = db.transaction('store', 'readwrite')
    1818store = trans.objectStore('store');
    1919store.put({sorted: 3, value: 111}, 1)
     
    2424store.put({sorted: 10, value: 666}, 15)
    2525testFarRangeCursor: upper bound is well out of range, results always the same, whether open or closed
    26 storeReq = store.openCursor(IDBKeyRange.upperBound(7, false), 2)
     26storeReq = store.openCursor(IDBKeyRange.upperBound(7, false), 'prev')
    2727
    28 Testing: store.openCursor(IDBKeyRange.upperBound(7, false), 2)
     28Testing: store.openCursor(IDBKeyRange.upperBound(7, false), 'prev')
    2929PASS cursor.key is 3
    3030PASS cursor.value.value is 333
    31 storeReq = store.openCursor(IDBKeyRange.upperBound(7, true), 2)
     31storeReq = store.openCursor(IDBKeyRange.upperBound(7, true), 'prev')
    3232DONE
    3333
    34 Testing: store.openCursor(IDBKeyRange.upperBound(7, true), 2)
     34Testing: store.openCursor(IDBKeyRange.upperBound(7, true), 'prev')
    3535PASS cursor.key is 3
    3636PASS cursor.value.value is 333
    37 storeReq = index.openCursor(IDBKeyRange.upperBound(7, false), 2)
     37storeReq = index.openCursor(IDBKeyRange.upperBound(7, false), 'prev')
    3838DONE
    3939
    40 Testing: index.openCursor(IDBKeyRange.upperBound(7, false), 2)
     40Testing: index.openCursor(IDBKeyRange.upperBound(7, false), 'prev')
    4141PASS cursor.key is 3
    4242PASS cursor.value.value is 111
    4343PASS cursor.primaryKey is 1
    44 storeReq = index.openCursor(IDBKeyRange.upperBound(7, true), 2)
     44storeReq = index.openCursor(IDBKeyRange.upperBound(7, true), 'prev')
    4545DONE
    4646
    47 Testing: index.openCursor(IDBKeyRange.upperBound(7, true), 2)
     47Testing: index.openCursor(IDBKeyRange.upperBound(7, true), 'prev')
    4848PASS cursor.key is 3
    4949PASS cursor.value.value is 111
    5050PASS cursor.primaryKey is 1
    51 storeReq = index.openKeyCursor(IDBKeyRange.upperBound(7, false), 2)
     51storeReq = index.openKeyCursor(IDBKeyRange.upperBound(7, false), 'prev')
    5252DONE
    5353
    54 Testing: index.openKeyCursor(IDBKeyRange.upperBound(7, false), 2)
     54Testing: index.openKeyCursor(IDBKeyRange.upperBound(7, false), 'prev')
    5555PASS cursor.key is 3
    5656PASS cursor.primaryKey is 1
    57 storeReq = index.openKeyCursor(IDBKeyRange.upperBound(7, true), 2)
     57storeReq = index.openKeyCursor(IDBKeyRange.upperBound(7, true), 'prev')
    5858DONE
    5959
    60 Testing: index.openKeyCursor(IDBKeyRange.upperBound(7, true), 2)
     60Testing: index.openKeyCursor(IDBKeyRange.upperBound(7, true), 'prev')
    6161PASS cursor.key is 3
    6262PASS cursor.primaryKey is 1
    63 storeReq = store.openCursor(IDBKeyRange.upperBound(3, false), 2)
     63storeReq = store.openCursor(IDBKeyRange.upperBound(3, false), 'prev')
    6464DONE
    6565
    66 Testing: store.openCursor(IDBKeyRange.upperBound(3, false), 2)
     66Testing: store.openCursor(IDBKeyRange.upperBound(3, false), 'prev')
    6767PASS cursor.key is 3
    6868PASS cursor.value.value is 333
    69 storeReq = store.openCursor(IDBKeyRange.upperBound(3, true), 2)
     69storeReq = store.openCursor(IDBKeyRange.upperBound(3, true), 'prev')
    7070DONE
    7171
    72 Testing: store.openCursor(IDBKeyRange.upperBound(3, true), 2)
     72Testing: store.openCursor(IDBKeyRange.upperBound(3, true), 'prev')
    7373PASS cursor.key is 2
    7474PASS cursor.value.value is 222
    75 storeReq = index.openCursor(IDBKeyRange.upperBound(3, false), 2)
     75storeReq = index.openCursor(IDBKeyRange.upperBound(3, false), 'prev')
    7676DONE
    7777
    78 Testing: index.openCursor(IDBKeyRange.upperBound(3, false), 2)
     78Testing: index.openCursor(IDBKeyRange.upperBound(3, false), 'prev')
    7979PASS cursor.key is 3
    8080PASS cursor.value.value is 111
    8181PASS cursor.primaryKey is 1
    82 storeReq = index.openCursor(IDBKeyRange.upperBound(3, true), 2)
     82storeReq = index.openCursor(IDBKeyRange.upperBound(3, true), 'prev')
    8383DONE
    8484
    85 Testing: index.openCursor(IDBKeyRange.upperBound(3, true), 2)
     85Testing: index.openCursor(IDBKeyRange.upperBound(3, true), 'prev')
    8686PASS cursor.key is 2
    8787PASS cursor.value.value is 222
    8888PASS cursor.primaryKey is 2
    89 storeReq = index.openKeyCursor(IDBKeyRange.upperBound(3, false), 2)
     89storeReq = index.openKeyCursor(IDBKeyRange.upperBound(3, false), 'prev')
    9090DONE
    9191
    92 Testing: index.openKeyCursor(IDBKeyRange.upperBound(3, false), 2)
     92Testing: index.openKeyCursor(IDBKeyRange.upperBound(3, false), 'prev')
    9393PASS cursor.key is 3
    9494PASS cursor.primaryKey is 1
    95 storeReq = index.openKeyCursor(IDBKeyRange.upperBound(3, true), 2)
     95storeReq = index.openKeyCursor(IDBKeyRange.upperBound(3, true), 'prev')
    9696DONE
    9797
    98 Testing: index.openKeyCursor(IDBKeyRange.upperBound(3, true), 2)
     98Testing: index.openKeyCursor(IDBKeyRange.upperBound(3, true), 'prev')
    9999PASS cursor.key is 2
    100100PASS cursor.primaryKey is 2
    101101testNoDuplicate: there are 3 values, but we should return always the first one
    102 storeReq = store.openCursor(IDBKeyRange.upperBound(15, false), 3)
     102storeReq = store.openCursor(IDBKeyRange.upperBound(15, false), 'prevunique')
    103103DONE
    104104
    105 Testing: store.openCursor(IDBKeyRange.upperBound(15, false), 3)
     105Testing: store.openCursor(IDBKeyRange.upperBound(15, false), 'prevunique')
    106106PASS cursor.key is 15
    107107PASS cursor.value.value is 666
    108108PASS cursor.primaryKey is 15
    109 storeReq = index.openCursor(IDBKeyRange.upperBound(15, false), 3)
     109storeReq = index.openCursor(IDBKeyRange.upperBound(15, false), 'prevunique')
    110110DONE
    111111
    112 Testing: index.openCursor(IDBKeyRange.upperBound(15, false), 3)
     112Testing: index.openCursor(IDBKeyRange.upperBound(15, false), 'prevunique')
    113113PASS cursor.key is 10
    114114PASS cursor.value.value is 666
    115115PASS cursor.primaryKey is 15
    116 storeReq = index.openKeyCursor(IDBKeyRange.upperBound(15, false), 3)
     116storeReq = index.openKeyCursor(IDBKeyRange.upperBound(15, false), 'prevunique')
    117117DONE
    118118
    119 Testing: index.openKeyCursor(IDBKeyRange.upperBound(15, false), 3)
     119Testing: index.openKeyCursor(IDBKeyRange.upperBound(15, false), 'prevunique')
    120120PASS cursor.key is 10
    121121PASS cursor.primaryKey is 15
  • trunk/LayoutTests/storage/indexeddb/cursor-primary-key-order-expected.txt

    r116051 r116337  
    1414
    1515populating store...
    16 trans = db.transaction('store', IDBTransaction.READ_WRITE)
     16trans = db.transaction('store', 'readwrite')
    1717store = trans.objectStore('store');
    1818store.put({"indexKey":0,"count":0}, 'c')
     
    3434
    3535iterating cursor...
    36 trans = db.transaction('store', IDBTransaction.READ_ONLY)
     36trans = db.transaction('store', 'readonly')
    3737store = trans.objectStore('store');
    3838index = store.index('index');
  • trunk/LayoutTests/storage/indexeddb/cursor-reverse-bug-expected.txt

    r116051 r116337  
    1515
    1616populating store...
    17 trans = db.transaction('store', IDBTransaction.READ_WRITE)
     17trans = db.transaction('store', 'readwrite')
    1818store = trans.objectStore('store');
    1919store.put(1, 1)
     
    2121store.put(3, 3)
    2222testCursor()
    23 trans = db.transaction('store', IDBTransaction.READ_ONLY)
     23trans = db.transaction('store', 'readonly')
    2424store = trans.objectStore('store');
    2525index = store.index('index');
    2626upperBound: 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)
     27storeReq = store.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev')
     28indexReq = index.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev')
     29indexKeyReq = index.openKeyCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev')
    3030cursor = event.target.result
    3131PASS cursor.key is test.expected
     
    4040PASS cursor.primaryKey is test.expected
    4141testCursor()
    42 trans = db.transaction('store', IDBTransaction.READ_ONLY)
     42trans = db.transaction('store', 'readonly')
    4343store = trans.objectStore('store');
    4444index = store.index('index');
    4545upperBound: 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)
     46storeReq = store.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev')
     47indexReq = index.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev')
     48indexKeyReq = index.openKeyCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev')
    4949cursor = event.target.result
    5050PASS cursor.key is test.expected
     
    5959PASS cursor.primaryKey is test.expected
    6060testCursor()
    61 trans = db.transaction('store', IDBTransaction.READ_ONLY)
     61trans = db.transaction('store', 'readonly')
    6262store = trans.objectStore('store');
    6363index = store.index('index');
    6464upperBound: 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)
     65storeReq = store.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev')
     66indexReq = index.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev')
     67indexKeyReq = index.openKeyCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev')
    6868cursor = event.target.result
    6969PASS cursor.key is test.expected
     
    7878PASS cursor.primaryKey is test.expected
    7979testCursor()
    80 trans = db.transaction('store', IDBTransaction.READ_ONLY)
     80trans = db.transaction('store', 'readonly')
    8181store = trans.objectStore('store');
    8282index = store.index('index');
    8383upperBound: 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)
     84storeReq = store.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev')
     85indexReq = index.openCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev')
     86indexKeyReq = index.openKeyCursor(IDBKeyRange.upperBound(test.upperBound, test.open), 'prev')
    8787cursor = event.target.result
    8888PASS cursor.key is test.expected
  • trunk/LayoutTests/storage/indexeddb/cursor-skip-deleted-expected.txt

    r116051 r116337  
    1919
    2020basicCursorTest()
    21 trans = db.transaction(['store'], IDBTransaction.READ_WRITE)
     21trans = db.transaction(['store'], 'readwrite')
    2222
    2323testCursor():
     
    6161
    6262testCursor():
    63 trans.objectStore('store').openCursor(IDBKeyRange.lowerBound(0), IDBCursor.PREV)
     63trans.objectStore('store').openCursor(IDBKeyRange.lowerBound(0), 'prev')
    646425: Zulu
    656524: Yankee
  • trunk/LayoutTests/storage/indexeddb/cursor-update-expected.txt

    r116051 r116337  
    3030objectStore.add({number: 4, id: 4}).onerror = unexpectedErrorCallback
    3131openBasicCursor()
    32 trans = db.transaction(['basicStore', 'autoIncrementStore', 'keyPathStore'], IDBTransaction.READ_WRITE)
     32trans = db.transaction(['basicStore', 'autoIncrementStore', 'keyPathStore'], 'readwrite')
    3333trans.objectStore('basicStore')
    3434objectStore.openCursor(keyRange)
  • trunk/LayoutTests/storage/indexeddb/data-corruption-expected.txt

    r116051 r116337  
    1616db.createObjectStore('storeName')
    1717addData():
    18 transaction = db.transaction(['storeName'], IDBTransaction.READ_WRITE)
     18transaction = db.transaction(['storeName'], 'readwrite')
    1919request = transaction.objectStore('storeName').add({x: testDate}, 'key')
    2020addData():
    21 transaction = db.transaction(['storeName'], IDBTransaction.READ_ONLY)
     21transaction = db.transaction(['storeName'], 'readonly')
    2222request = transaction.objectStore('storeName').get('key')
    2323PASS event.target.result.x.toString() == testDate.toString() is true
  • trunk/LayoutTests/storage/indexeddb/database-quota-expected.txt

    r116051 r116337  
    2424PASS db.objectStoreNames.contains('test456') is false
    2525PASS db.objectStoreNames.contains('test123') is true
    26 trans = db.transaction(['test123'], IDBTransaction.READ_WRITE)
     26trans = db.transaction(['test123'], 'readwrite')
    2727Creating 'data' which contains 64K of data
    2828PASS data.length is 65536
  • trunk/LayoutTests/storage/indexeddb/delete-range-expected.txt

    r116051 r116337  
    1313db.createObjectStore('store')
    1414
    15 trans = db.transaction('store', IDBTransaction.READ_WRITE)
     15trans = db.transaction('store', 'readwrite')
    1616store = trans.objectStore('store')
    1717store.put(1,1)
     
    3131PASS Match!
    3232
    33 trans = db.transaction('store', IDBTransaction.READ_WRITE)
     33trans = db.transaction('store', 'readwrite')
    3434store = trans.objectStore('store')
    3535store.put(1,1)
     
    4949PASS Match!
    5050
    51 trans = db.transaction('store', IDBTransaction.READ_WRITE)
     51trans = db.transaction('store', 'readwrite')
    5252store = trans.objectStore('store')
    5353store.put(1,1)
     
    6767PASS Match!
    6868
    69 trans = db.transaction('store', IDBTransaction.READ_WRITE)
     69trans = db.transaction('store', 'readwrite')
    7070store = trans.objectStore('store')
    7171store.put(1,1)
  • trunk/LayoutTests/storage/indexeddb/error-causes-abort-by-default-expected.txt

    r116051 r116337  
    1515Deleted all object stores.
    1616db.createObjectStore('storeName', null)
    17 trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)
     17trans = db.transaction(['storeName'], 'readwrite')
    1818trans.onabort = unexpectedAbortCallback
    1919trans.oncomplete = transactionCompleted
     
    2525
    2626
    27 trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)
     27trans = db.transaction(['storeName'], 'readwrite')
    2828trans.onabort = transactionAborted1
    2929trans.oncomplete = unexpectedCompleteCallback
     
    3434
    3535
    36 trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)
     36trans = db.transaction(['storeName'], 'readwrite')
    3737trans.onabort = transactionAborted2
    3838trans.oncomplete = unexpectedCompleteCallback
  • trunk/LayoutTests/storage/indexeddb/exception-in-event-aborts-expected.txt

    r116051 r116337  
    1919store.add({x: 'value', y: 'zzz'}, 'key')
    2020
    21 trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)
     21trans = db.transaction(['storeName'], 'readwrite')
    2222trans.onabort = transactionAborted1
    2323trans.oncomplete = unexpectedCompleteCallback
     
    3030PASS Got expected error: 'this exception is expected'
    3131PASS The transaction was aborted.
    32 trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)
     32trans = db.transaction(['storeName'], 'readwrite')
    3333trans.onabort = transactionAborted2
    3434trans.oncomplete = unexpectedCompleteCallback
     
    4141PASS Got expected error: 'this exception is expected'
    4242PASS The transaction was aborted.
    43 trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)
     43trans = db.transaction(['storeName'], 'readwrite')
    4444trans.onabort = unexpectedAbortCallback
    4545trans.oncomplete = transactionCompleted1
     
    5151
    5252PASS The transaction completed.
    53 trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)
     53trans = db.transaction(['storeName'], 'readwrite')
    5454trans.onabort = unexpectedAbortCallback
    5555trans.oncomplete = transactionCompleted2
  • trunk/LayoutTests/storage/indexeddb/factory-deletedatabase-expected.txt

    r116051 r116337  
    1515PASS store.indexNames.contains('indexName') is true
    1616store.add('value', 'key')
    17 db.transaction('storeName', IDBTransaction.READ_WRITE)
     17db.transaction('storeName', 'readwrite')
    1818store = transaction.objectStore('storeName')
    1919store.get('key')
  • trunk/LayoutTests/storage/indexeddb/index-count-expected.txt

    r116051 r116337  
    2020
    2121verifying count without range
    22 trans = db.transaction('storeName', IDBTransaction.READ_ONLY)
     22trans = db.transaction('storeName', 'readonly')
    2323PASS trans != null is true
    2424store = trans.objectStore('storeName')
     
    3131
    3232verifying count with range
    33 trans = db.transaction('storeName', IDBTransaction.READ_ONLY)
     33trans = db.transaction('storeName', 'readonly')
    3434PASS trans != null is true
    3535store = trans.objectStore('storeName')
     
    8484
    8585verifying count with key
    86 trans = db.transaction('storeName', IDBTransaction.READ_ONLY)
     86trans = db.transaction('storeName', 'readonly')
    8787PASS trans != null is true
    8888store = trans.objectStore('storeName')
  • trunk/LayoutTests/storage/indexeddb/index-multientry-expected.txt

    r116051 r116337  
    2020
    2121Populating stores (and indexes)
    22 transaction = db.transaction(['store'], IDBTransaction.READ_WRITE)
     22transaction = db.transaction(['store'], 'readwrite')
    2323First try some keys that aren't what we're expecting
    2424transaction.objectStore('store').put({x: [7, 8, 9], y: 'a'}, 'foo')
     
    2828
    2929Verifying index: index
    30 transaction = db.transaction(['store'], IDBTransaction.READ_ONLY)
     30transaction = db.transaction(['store'], 'readonly')
    3131transaction.objectStore('store').index('index').openCursor()
    3232cursor = event.target.result
     
    6464
    6565Verifying unique constraint on multiEntry index
    66 transaction = db.transaction(['store-unique'], IDBTransaction.READ_WRITE)
     66transaction = db.transaction(['store-unique'], 'readwrite')
    6767transaction.objectStore('store-unique').put({x: [1, 2, 3], y: 'a'}, 'foo')
    6868success!
     
    8383
    8484Verifying index: index-new
    85 transaction = db.transaction(['store'], IDBTransaction.READ_ONLY)
     85transaction = db.transaction(['store'], 'readonly')
    8686transaction.objectStore('store').index('index-new').openCursor()
    8787cursor = event.target.result
  • trunk/LayoutTests/storage/indexeddb/index-unique-expected.txt

    r116051 r116337  
    1616store.createIndex('index', 'x', {unique: true})
    1717setVersionCompleted():
    18 transaction = db.transaction(['store'], IDBTransaction.READ_WRITE)
     18transaction = db.transaction(['store'], 'readwrite')
    1919transaction.objectStore('store').put({x: 1}, 'foo')
    2020addMoreData():
  • trunk/LayoutTests/storage/indexeddb/key-generator-expected.txt

    r116051 r116337  
    123123request = db.setVersion('1')
    124124trans = request.result
    125 trans1 = db.transaction(['store'], IDBTransaction.READ_WRITE)
     125trans1 = db.transaction(['store'], 'readwrite')
    126126store_t1 = trans1.objectStore('store')
    127127store_t1.put('a')
     
    134134trans1.abort()
    135135aborted!
    136 trans2 = db.transaction(['store'], IDBTransaction.READ_WRITE)
     136trans2 = db.transaction(['store'], 'readwrite')
    137137store_t2 = trans2.objectStore('store')
    138138store_t2.put('c')
     
    150150request = db.setVersion('1')
    151151trans = request.result
    152 trans1 = db.transaction(['store'], IDBTransaction.READ_WRITE)
     152trans1 = db.transaction(['store'], 'readwrite')
    153153store_t1 = trans1.objectStore('store')
    154154store_t1.put('a')
  • trunk/LayoutTests/storage/indexeddb/key-type-array-expected.txt

    r116051 r116337  
    1717db.createObjectStore('store');
    1818
    19 trans = db.transaction('store', IDBTransaction.READ_WRITE)
     19trans = db.transaction('store', 'readwrite')
    2020store = trans.objectStore('store')
    2121
     
    160160PASS getreq.result is "value27"
    161161
    162 trans = db.transaction('store', IDBTransaction.READ_WRITE)
     162trans = db.transaction('store', 'readwrite')
    163163store = trans.objectStore('store')
    164164
  • trunk/LayoutTests/storage/indexeddb/keypath-edges-expected.txt

    r116051 r116337  
    1616
    1717testKeyPaths():
    18 transaction = db.transaction(['store-with-path'], IDBTransaction.READ_WRITE)
     18transaction = db.transaction(['store-with-path'], 'readwrite')
    1919store = transaction.objectStore('store-with-path')
    2020
     
    3939
    4040testKeyPathsAndGenerator():
    41 transaction = db.transaction(['store-with-path-and-generator'], IDBTransaction.READ_WRITE)
     41transaction = db.transaction(['store-with-path-and-generator'], 'readwrite')
    4242store = transaction.objectStore('store-with-path-and-generator')
    4343
  • trunk/LayoutTests/storage/indexeddb/keypath-intrinsic-properties-expected.txt

    r116051 r116337  
    1717
    1818testKeyPaths():
    19 transaction = db.transaction('store', IDBTransaction.READ_WRITE)
     19transaction = db.transaction('store', 'readwrite')
    2020store = transaction.objectStore('store')
    2121store.put({"id":"id#0","string":"","array":[]})
  • trunk/LayoutTests/storage/indexeddb/mozilla/clear-expected.txt

    r116051 r116337  
    1515PASS Exception was thrown.
    1616PASS code is IDBDatabaseException.READ_ONLY_ERR
    17 db.transaction('foo', IDBTransaction.READ_WRITE).objectStore('foo').clear();
     17db.transaction('foo', 'readwrite').objectStore('foo').clear();
    1818request = db.transaction('foo').objectStore('foo').openCursor();
    1919cursor = request.result;
  • trunk/LayoutTests/storage/indexeddb/mozilla/create-index-unique-expected.txt

    r116051 r116337  
    1919PASS event.target.transaction.db is db
    2020PASS event.target.transaction.readyState is IDBTransaction.LOADING
    21 PASS event.target.transaction.mode is IDBTransaction.VERSION_CHANGE
     21PASS event.target.transaction.mode is 'versionchange'
    2222PASS successfullyParsed is true
    2323
  • trunk/LayoutTests/storage/indexeddb/mozilla/create-objectstore-basics-expected.txt

    r116051 r116337  
    1515PASS event.target.transaction.db is db
    1616PASS event.target.transaction.readyState is IDBTransaction.LOADING
    17 PASS event.target.transaction.mode is IDBTransaction.VERSION_CHANGE
     17PASS event.target.transaction.mode is 'versionchange'
    1818objectStore = db.createObjectStore(info.name, info.options);
    1919PASS objectStore.name is info.name
     
    2121PASS event.target.transaction.db is db
    2222PASS event.target.transaction.readyState is IDBTransaction.LOADING
    23 PASS event.target.transaction.mode is IDBTransaction.VERSION_CHANGE
     23PASS event.target.transaction.mode is 'versionchange'
    2424objectStore = db.createObjectStore(info.name, info.options);
    2525PASS objectStore.name is info.name
     
    2727PASS event.target.transaction.db is db
    2828PASS event.target.transaction.readyState is IDBTransaction.LOADING
    29 PASS event.target.transaction.mode is IDBTransaction.VERSION_CHANGE
     29PASS event.target.transaction.mode is 'versionchange'
    3030objectStore = db.createObjectStore(info.name, info.options);
    3131PASS objectStore.name is info.name
     
    3333PASS event.target.transaction.db is db
    3434PASS event.target.transaction.readyState is IDBTransaction.LOADING
    35 PASS event.target.transaction.mode is IDBTransaction.VERSION_CHANGE
     35PASS event.target.transaction.mode is 'versionchange'
    3636objectStore = db.createObjectStore(info.name, info.options);
    3737PASS objectStore.name is info.name
     
    3939PASS event.target.transaction.db is db
    4040PASS event.target.transaction.readyState is IDBTransaction.LOADING
    41 PASS event.target.transaction.mode is IDBTransaction.VERSION_CHANGE
     41PASS event.target.transaction.mode is 'versionchange'
    4242objectStore = db.createObjectStore(info.name, info.options);
    4343PASS objectStore.name is info.name
     
    4646PASS event.target.transaction.db is db
    4747PASS event.target.transaction.readyState is IDBTransaction.LOADING
    48 PASS event.target.transaction.mode is IDBTransaction.VERSION_CHANGE
     48PASS event.target.transaction.mode is 'versionchange'
    4949objectStore = db.createObjectStore(info.name, info.options);
    5050PASS objectStore.name is info.name
     
    5353PASS event.target.transaction.db is db
    5454PASS event.target.transaction.readyState is IDBTransaction.LOADING
    55 PASS event.target.transaction.mode is IDBTransaction.VERSION_CHANGE
     55PASS event.target.transaction.mode is 'versionchange'
    5656objectStore = db.createObjectStore(info.name, info.options);
    5757PASS objectStore.name is info.name
     
    6060PASS event.target.transaction.db is db
    6161PASS event.target.transaction.readyState is IDBTransaction.LOADING
    62 PASS event.target.transaction.mode is IDBTransaction.VERSION_CHANGE
     62PASS event.target.transaction.mode is 'versionchange'
    6363PASS successfullyParsed is true
    6464
  • trunk/LayoutTests/storage/indexeddb/mozilla/cursor-mutation-expected.txt

    r116051 r116337  
    8383objectStoreDataNameSort = [ 1, 4, 5, 2, 3 ]
    8484
    85 trans = db.transaction('foo', IDBTransaction.READ_WRITE)
     85trans = db.transaction('foo', 'readwrite')
    8686objectStore = trans.objectStore('foo')
    8787request = objectStore.index('name').openCursor()
  • trunk/LayoutTests/storage/indexeddb/mozilla/cursor-mutation-objectstore-only-expected.txt

    r116051 r116337  
    6666sawAdded = false;
    6767sawRemoved = false;
    68 request = db.transaction('foo', IDBTransaction.READ_WRITE).objectStore('foo').openCursor();
     68request = db.transaction('foo', 'readwrite').objectStore('foo').openCursor();
    6969iterateMutatingCursor():
    7070event.target.transaction.oncomplete = checkMutatingCursorResults;
  • trunk/LayoutTests/storage/indexeddb/mozilla/cursors-expected.txt

    r116051 r116337  
    432432request = objectStore.put('foo', sortedKeys[4]);
    433433keyIndex = 0;
    434 request = objectStore.openCursor(null, IDBCursor.NEXT);
     434request = objectStore.openCursor(null, 'next');
    435435cursor = event.target.result;
    436436PASS cursor.key is sortedKeys[keyIndex]
     
    502502PASS event.target.result is undefined
    503503request = objectStore.add('foo', sortedKeys[4]);
    504 request = objectStore.openCursor(null, IDBCursor.PREV);
     504request = objectStore.openCursor(null, 'prev');
    505505cursor = event.target.result;
    506506PASS cursor.key is sortedKeys[keyIndex]
  • trunk/LayoutTests/storage/indexeddb/mozilla/index-prev-no-duplicate-expected.txt

    r116051 r116337  
    3838objectStore = trans.objectStore(objectStoreName);
    3939keyIndex = 8;
    40 request = objectStore.index('height').openCursor(null, IDBCursor.PREV);
     40request = objectStore.index('height').openCursor(null, 'prev');
    4141cursor = event.target.result;
    4242PASS cursor.key is 73
     
    126126objectStore = db.transaction(objectStoreName).objectStore(objectStoreName);
    127127keyIndex = 8;
    128 request = objectStore.index('height').openCursor(null, IDBCursor.PREV_NO_DUPLICATE);
     128request = objectStore.index('height').openCursor(null, 'prevunique');
    129129cursor = event.target.result;
    130130keyIndex -= 1
  • trunk/LayoutTests/storage/indexeddb/mozilla/index-prev-no-duplicate.html

    r116051 r116337  
    121121    keyIndex = evalAndLog("keyIndex = 8;");
    122122    // 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');");
    124124    request.onerror = unexpectedErrorCallback;
    125125    request.onsuccess = function(event)
     
    152152    objectStore = evalAndLog("objectStore = db.transaction(objectStoreName).objectStore(objectStoreName);");
    153153    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');");
    155155    request.onerror = unexpectedErrorCallback;
    156156    request.onsuccess = function (event)
  • trunk/LayoutTests/storage/indexeddb/mozilla/indexes-expected.txt

    r116051 r116337  
    104104cursor = event.target.result;
    105105PASS keyIndex is objectStoreData.length
    106 request = objectStore.index('weight').openKeyCursor(null, IDBCursor.NEXT);
     106request = objectStore.index('weight').openKeyCursor(null, 'next');
    107107cursor = event.target.result;
    108108PASS cursor.key is objectStoreDataWeightSort[keyIndex].value.weight
     
    151151objectStore = db.transaction(objectStoreName).objectStore(objectStoreName);
    152152keyIndex = objectStoreDataNameSort.length - 1;
    153 request = objectStore.index('name').openKeyCursor(null, IDBCursor.PREV);
     153request = objectStore.index('name').openKeyCursor(null, 'prev');
    154154cursor = event.target.result;
    155155PASS cursor.key is objectStoreDataNameSort[keyIndex].value.name
     
    458458PASS keyIndex is objectStoreDataNameSort.length
    459459keyIndex = objectStoreDataNameSort.length - 1;
    460 request = objectStore.index('name').openCursor(null, IDBCursor.PREV);
     460request = objectStore.index('name').openCursor(null, 'prev');
    461461cursor = event.target.result;
    462462PASS cursor.key is objectStoreDataNameSort[keyIndex].value.name
     
    711711keyIndex = 4;
    712712keyRange = IDBKeyRange.bound('Bob', 'Ron');
    713 request = objectStore.index('name').openCursor(keyRange, IDBCursor.PREV);
     713request = objectStore.index('name').openCursor(keyRange, 'prev');
    714714cursor = event.target.result;
    715715PASS cursor.key is objectStoreDataNameSort[keyIndex].value.name
     
    768768keyIndex = 3;
    769769keyRange = IDBKeyRange.only(65);
    770 request = objectStore.index('height').openKeyCursor(keyRange, IDBCursor.NEXT);
     770request = objectStore.index('height').openKeyCursor(keyRange, 'next');
    771771cursor = event.target.result;
    772772PASS cursor.key is objectStoreDataHeightSort[keyIndex].value.height
     
    783783keyIndex = 3;
    784784keyRange = IDBKeyRange.only(65);
    785 request = objectStore.index('height').openKeyCursor(keyRange, IDBCursor.NEXT_NO_DUPLICATE);
     785request = objectStore.index('height').openKeyCursor(keyRange, 'nextunique');
    786786cursor = event.target.result;
    787787PASS cursor.key is objectStoreDataHeightSort[keyIndex].value.height
     
    793793keyIndex = 3;
    794794keyRange = IDBKeyRange.only(65);
    795 request = objectStore.index('height').openCursor(keyRange, IDBCursor.NEXT);
     795request = objectStore.index('height').openCursor(keyRange, 'next');
    796796cursor = event.target.result;
    797797PASS cursor.key is objectStoreDataHeightSort[keyIndex].value.height
     
    814814keyIndex = 3;
    815815keyRange = IDBKeyRange.only(65);
    816 request = objectStore.index('height').openCursor(keyRange, IDBCursor.NEXT_NO_DUPLICATE);
     816request = objectStore.index('height').openCursor(keyRange, 'nextunique');
    817817cursor = event.target.result;
    818818PASS cursor.key is objectStoreDataHeightSort[keyIndex].value.height
  • trunk/LayoutTests/storage/indexeddb/mozilla/odd-result-order-expected.txt

    r116051 r116337  
    1919event.target.transaction.oncomplete = addRecord;
    2020addRecord():
    21 objectStore = db.transaction('foo', IDBTransaction.READ_WRITE).objectStore('foo');
     21objectStore = db.transaction('foo', 'readwrite').objectStore('foo');
    2222data = { key: 5, index: 10 };
    2323request = objectStore.add(data);
     
    3636PASS record.index is data.index
    3737deleteRecord():
    38 objectStore = db.transaction('foo', IDBTransaction.READ_WRITE).objectStore('foo');
     38objectStore = db.transaction('foo', 'readwrite').objectStore('foo');
    3939request = objectStore.delete(data.key);
    4040deleteSuccess():
  • trunk/LayoutTests/storage/indexeddb/mozilla/readwrite-transactions-expected.txt

    r116051 r116337  
    1111Deleted all object stores.
    1212objectStore = 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_WRITE
     13request = db.transaction([osName], 'readwrite').objectStore(osName).add({});
     14PASS event.target.transaction.mode is 'readwrite'
    1515key1 = event.target.result;
    16 request = db.transaction(osName, IDBTransaction.READ_WRITE).objectStore(osName).add({});
    17 PASS event.target.transaction.mode is IDBTransaction.READ_WRITE
     16request = db.transaction(osName, 'readwrite').objectStore(osName).add({});
     17PASS event.target.transaction.mode is 'readwrite'
    1818key2 = event.target.result;
    19 request = db.transaction([osName], IDBTransaction.READ_WRITE).objectStore(osName).put({}, key1);
    20 PASS event.target.transaction.mode is IDBTransaction.READ_WRITE
    21 request = db.transaction(osName, IDBTransaction.READ_WRITE).objectStore(osName).put({}, key2);
    22 PASS event.target.transaction.mode is IDBTransaction.READ_WRITE
    23 request = db.transaction([osName], IDBTransaction.READ_WRITE).objectStore(osName).put({}, key1);
    24 PASS event.target.transaction.mode is IDBTransaction.READ_WRITE
    25 request = db.transaction(osName, IDBTransaction.READ_WRITE).objectStore(osName).put({}, key1);
    26 PASS event.target.transaction.mode is IDBTransaction.READ_WRITE
    27 request = db.transaction([osName], IDBTransaction.READ_WRITE).objectStore(osName).delete(key1);
    28 PASS event.target.transaction.mode is IDBTransaction.READ_WRITE
    29 request = db.transaction(osName, IDBTransaction.READ_WRITE).objectStore(osName).delete(key2);
    30 PASS event.target.transaction.mode is IDBTransaction.READ_WRITE
     19request = db.transaction([osName], 'readwrite').objectStore(osName).put({}, key1);
     20PASS event.target.transaction.mode is 'readwrite'
     21request = db.transaction(osName, 'readwrite').objectStore(osName).put({}, key2);
     22PASS event.target.transaction.mode is 'readwrite'
     23request = db.transaction([osName], 'readwrite').objectStore(osName).put({}, key1);
     24PASS event.target.transaction.mode is 'readwrite'
     25request = db.transaction(osName, 'readwrite').objectStore(osName).put({}, key1);
     26PASS event.target.transaction.mode is 'readwrite'
     27request = db.transaction([osName], 'readwrite').objectStore(osName).delete(key1);
     28PASS event.target.transaction.mode is 'readwrite'
     29request = db.transaction(osName, 'readwrite').objectStore(osName).delete(key2);
     30PASS event.target.transaction.mode is 'readwrite'
    3131PASS successfullyParsed is true
    3232
  • trunk/LayoutTests/storage/indexeddb/mozilla/readyState-expected.txt

    r116051 r116337  
    77
    88indexedDB.open(name, description)
    9 PASS request.readyState is IDBRequest.LOADING
     9PASS request.readyState is 'pending'
    1010openSuccess():
    11 PASS request.readyState is IDBRequest.DONE
     11PASS request.readyState is 'done'
    1212db = event.target.result
    1313request = db.setVersion('1')
    14 PASS request.readyState is IDBRequest.LOADING
     14PASS request.readyState is 'pending'
    1515setupObjectStore():
    16 PASS request.readyState is IDBRequest.DONE
     16PASS request.readyState is 'done'
    1717Deleted all object stores.
    1818objectStore = db.createObjectStore('foo');
    1919key = 10;
    2020request = objectStore.add({}, key);
    21 PASS request.readyState is IDBRequest.LOADING
     21PASS request.readyState is 'pending'
    2222getRecord():
    23 PASS request.readyState is IDBRequest.DONE
     23PASS request.readyState is 'done'
    2424PASS event.target.result is key
    2525request = objectStore.get(key);
    26 PASS request.readyState is IDBRequest.LOADING
     26PASS request.readyState is 'pending'
    2727finalCheck():
    28 PASS request.readyState is IDBRequest.DONE
     28PASS request.readyState is 'done'
    2929PASS event.target.result == null is false
    3030PASS successfullyParsed is true
  • trunk/LayoutTests/storage/indexeddb/mozilla/resources/clear.js

    r116051 r116337  
    4545{
    4646    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();");
    4848    request = evalAndLog("request = db.transaction('foo').objectStore('foo').openCursor();");
    4949    request.onsuccess = areWeClearYet;
  • trunk/LayoutTests/storage/indexeddb/mozilla/resources/create-index-unique.js

    r116051 r116337  
    5555    shouldBe("event.target.transaction.db", "db");
    5656    shouldBe("event.target.transaction.readyState", "IDBTransaction.LOADING");
    57     shouldBe("event.target.transaction.mode", "IDBTransaction.VERSION_CHANGE");
     57    shouldBe("event.target.transaction.mode", "'versionchange'");
    5858    finishJSTest();
    5959}
  • trunk/LayoutTests/storage/indexeddb/mozilla/resources/create-objectstore-basics.js

    r116051 r116337  
    5858        shouldBe("event.target.transaction.db", "db");
    5959        shouldBe("event.target.transaction.readyState", "IDBTransaction.LOADING");
    60         shouldBe("event.target.transaction.mode", "IDBTransaction.VERSION_CHANGE");
     60        shouldBe("event.target.transaction.mode", "'versionchange'");
    6161    }
    6262
  • trunk/LayoutTests/storage/indexeddb/mozilla/resources/cursor-mutation-objectstore-only.js

    r116051 r116337  
    9191    sawRemoved = evalAndLog("sawRemoved = false;");
    9292
    93     request = evalAndLog("request = db.transaction('foo', IDBTransaction.READ_WRITE).objectStore('foo').openCursor();");
     93    request = evalAndLog("request = db.transaction('foo', 'readwrite').objectStore('foo').openCursor();");
    9494    request.onsuccess = iterateMutatingCursor;
    9595    request.onerror = unexpectedErrorCallback;
  • trunk/LayoutTests/storage/indexeddb/mozilla/resources/cursor-mutation.js

    r116051 r116337  
    119119    debug("");
    120120
    121     trans = evalAndLog("trans = db.transaction('foo', IDBTransaction.READ_WRITE)");
     121    trans = evalAndLog("trans = db.transaction('foo', 'readwrite')");
    122122    objectStore = evalAndLog("objectStore = trans.objectStore('foo')");
    123123    request = evalAndLog("request = objectStore.index('name').openCursor()");
  • trunk/LayoutTests/storage/indexeddb/mozilla/resources/cursors.js

    r116051 r116337  
    313313    retval = false;
    314314
    315     request = evalAndLog("request = objectStore.openCursor(null, IDBCursor.NEXT);");
     315    request = evalAndLog("request = objectStore.openCursor(null, 'next');");
    316316    request.onerror = unexpectedErrorCallback;
    317317    request.onsuccess = function (event) {
     
    362362    keyIndex = sortedKeys.length - 1;
    363363
    364     request = evalAndLog("request = objectStore.openCursor(null, IDBCursor.PREV);");
     364    request = evalAndLog("request = objectStore.openCursor(null, 'prev');");
    365365    request.onerror = unexpectedErrorCallback;
    366366    request.onsuccess = function (event) {
  • trunk/LayoutTests/storage/indexeddb/mozilla/resources/indexes.js

    r116051 r116337  
    178178    keyIndex = 0;
    179179
    180     request = evalAndLog("request = objectStore.index('weight').openKeyCursor(null, IDBCursor.NEXT);");
     180    request = evalAndLog("request = objectStore.index('weight').openKeyCursor(null, 'next');");
    181181    request.onerror = unexpectedErrorCallback;
    182182    request.onsuccess = function (event) {
     
    204204/* this was split out into a separate test
    205205    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);");
    207207    evalAndExpectException("objectStore.add({ name: 'Bob', height: 62, weight: 170 }, '237-23-7738');", "IDBDatabaseException.CONSTRAINT_ERR");
    208208*/
     
    210210    objectStore = evalAndLog("objectStore = db.transaction(objectStoreName).objectStore(objectStoreName);");
    211211    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');");
    213213    request.onerror = unexpectedErrorCallback;
    214214    request.onsuccess = function (event) {
     
    477477    keyIndex = evalAndLog("keyIndex = objectStoreDataNameSort.length - 1;");
    478478
    479     request = evalAndLog("request = objectStore.index('name').openCursor(null, IDBCursor.PREV);");
     479    request = evalAndLog("request = objectStore.index('name').openCursor(null, 'prev');");
    480480    request.onerror = unexpectedErrorCallback;
    481481    request.onsuccess = function (event) {
     
    662662    keyRange = evalAndLog("keyRange = IDBKeyRange.bound('Bob', 'Ron');");
    663663
    664     request = evalAndLog("request = objectStore.index('name').openCursor(keyRange, IDBCursor.PREV);");
     664    request = evalAndLog("request = objectStore.index('name').openCursor(keyRange, 'prev');");
    665665    request.onerror = unexpectedErrorCallback;
    666666    request.onsuccess = function (event) {
     
    699699    keyRange = evalAndLog("keyRange = IDBKeyRange.only(65);");
    700700
    701     request = evalAndLog("request = objectStore.index('height').openKeyCursor(keyRange, IDBCursor.NEXT);");
     701    request = evalAndLog("request = objectStore.index('height').openKeyCursor(keyRange, 'next');");
    702702    request.onerror = unexpectedErrorCallback;
    703703    request.onsuccess = function (event) {
     
    722722    keyRange = evalAndLog("keyRange = IDBKeyRange.only(65);");
    723723
    724     request = evalAndLog("request = objectStore.index('height').openKeyCursor(keyRange, IDBCursor.NEXT_NO_DUPLICATE);");
     724    request = evalAndLog("request = objectStore.index('height').openKeyCursor(keyRange, 'nextunique');");
    725725    request.onerror = unexpectedErrorCallback;
    726726    request.onsuccess = function (event) {
     
    745745    keyIndex = evalAndLog("keyIndex = 5;");
    746746
    747     request = evalAndLog("request = objectStore.index('height').openKeyCursor(null, IDBCursor.PREV_NO_DUPLICATE);");
     747    request = evalAndLog("request = objectStore.index('height').openKeyCursor(null, 'prevunique');");
    748748    request.onerror = unexpectedErrorCallback;
    749749    request.onsuccess = function (event) {
     
    772772    keyRange = evalAndLog("keyRange = IDBKeyRange.only(65);");
    773773
    774     request = evalAndLog("request = objectStore.index('height').openCursor(keyRange, IDBCursor.NEXT);");
     774    request = evalAndLog("request = objectStore.index('height').openCursor(keyRange, 'next');");
    775775    request.onerror = unexpectedErrorCallback;
    776776    request.onsuccess = function (event) {
     
    800800    keyRange = evalAndLog("keyRange = IDBKeyRange.only(65);");
    801801
    802     request = evalAndLog("request = objectStore.index('height').openCursor(keyRange, IDBCursor.NEXT_NO_DUPLICATE);");
     802    request = evalAndLog("request = objectStore.index('height').openCursor(keyRange, 'nextunique');");
    803803    request.onerror = unexpectedErrorCallback;
    804804    request.onsuccess = function (event) {
     
    828828    keyIndex = evalAndLog("keyIndex = 5;");
    829829
    830     request = evalAndLog("request = objectStore.index('height').openCursor(null, IDBCursor.PREV_NO_DUPLICATE);");
     830    request = evalAndLog("request = objectStore.index('height').openCursor(null, 'prevunique');");
    831831    request.onerror = unexpectedErrorCallback;
    832832    request.onsuccess = function (event) {
  • trunk/LayoutTests/storage/indexeddb/mozilla/resources/odd-result-order.js

    r116051 r116337  
    5555{
    5656    debug("addRecord():");
    57     objectStore = evalAndLog("objectStore = db.transaction('foo', IDBTransaction.READ_WRITE).objectStore('foo');");
     57    objectStore = evalAndLog("objectStore = db.transaction('foo', 'readwrite').objectStore('foo');");
    5858    data = evalAndLog("data = { key: 5, index: 10 };");
    5959    request = evalAndLog("request = objectStore.add(data);");
     
    103103{
    104104    debug("deleteRecord():");
    105     objectStore = evalAndLog("objectStore = db.transaction('foo', IDBTransaction.READ_WRITE).objectStore('foo');");
     105    objectStore = evalAndLog("objectStore = db.transaction('foo', 'readwrite').objectStore('foo');");
    106106    request = evalAndLog("request = objectStore.delete(data.key);");
    107107    request.onsuccess = deleteSuccess;
  • trunk/LayoutTests/storage/indexeddb/mozilla/resources/readwrite-transactions.js

    r116051 r116337  
    4343function setVersionComplete()
    4444{
    45     request = evalAndLog("request = db.transaction([osName], IDBTransaction.READ_WRITE).objectStore(osName).add({});");
     45    request = evalAndLog("request = db.transaction([osName], 'readwrite').objectStore(osName).add({});");
    4646    request.onsuccess = postAdd;
    4747    request.onerror = unexpectedErrorCallback;
     
    5050function postAdd()
    5151{
    52     shouldBe("event.target.transaction.mode", "IDBTransaction.READ_WRITE");
     52    shouldBe("event.target.transaction.mode", "'readwrite'");
    5353    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({});");
    5555    request.onsuccess = postAdd2;
    5656    request.onerror = unexpectedErrorCallback;
     
    5959function postAdd2()
    6060{
    61     shouldBe("event.target.transaction.mode", "IDBTransaction.READ_WRITE");
     61    shouldBe("event.target.transaction.mode", "'readwrite'");
    6262    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);");
    6464    request.onsuccess = postPut;
    6565    request.onerror = unexpectedErrorCallback;
     
    6868function postPut()
    6969{
    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);");
    7272    request.onsuccess = postPut2;
    7373    request.onerror = unexpectedErrorCallback;
     
    7676function postPut2()
    7777{
    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);");
    8080    request.onsuccess = postPut3;
    8181    request.onerror = unexpectedErrorCallback;
     
    8484function postPut3()
    8585{
    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);");
    8888    request.onsuccess = postPut4;
    8989    request.onerror = unexpectedErrorCallback;
     
    9292function postPut4()
    9393{
    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);");
    9696    request.onsuccess = postDelete;
    9797    request.onerror = unexpectedErrorCallback;
     
    100100function postDelete()
    101101{
    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);");
    104104    request.onsuccess = postDelete2;
    105105    request.onerror = unexpectedErrorCallback;
     
    108108function postDelete2()
    109109{
    110     shouldBe("event.target.transaction.mode", "IDBTransaction.READ_WRITE");
     110    shouldBe("event.target.transaction.mode", "'readwrite'");
    111111    finishJSTest();
    112112}
  • trunk/LayoutTests/storage/indexeddb/mozilla/resources/readyState.js

    r116051 r116337  
    1919    description = "My Test Database";
    2020    request = evalAndLog("indexedDB.open(name, description)");
    21     shouldBe("request.readyState", "IDBRequest.LOADING");
     21    shouldBe("request.readyState", "'pending'");
    2222    request.onsuccess = openSuccess;
    2323    request.onerror = unexpectedErrorCallback;
     
    2727{
    2828    debug("openSuccess():");
    29     shouldBe("request.readyState", "IDBRequest.DONE");
     29    shouldBe("request.readyState", "'done'");
    3030    db = evalAndLog("db = event.target.result");
    3131    request = evalAndLog("request = db.setVersion('1')");
    32     shouldBe("request.readyState", "IDBRequest.LOADING");
     32    shouldBe("request.readyState", "'pending'");
    3333    request.onsuccess = setupObjectStore;
    3434    request.onerror = unexpectedErrorCallback;
     
    3838{
    3939    debug("setupObjectStore():");
    40     shouldBe("request.readyState", "IDBRequest.DONE");
     40    shouldBe("request.readyState", "'done'");
    4141    deleteAllObjectStores(db);
    4242
     
    4444    key = evalAndLog("key = 10;");
    4545    request = evalAndLog("request = objectStore.add({}, key);");
    46     shouldBe("request.readyState", "IDBRequest.LOADING");
     46    shouldBe("request.readyState", "'pending'");
    4747    request.onsuccess = getRecord;
    4848    request.onerror = unexpectedErrorCallback;
     
    5252{
    5353    debug("getRecord():");
    54     shouldBe("request.readyState", "IDBRequest.DONE");
     54    shouldBe("request.readyState", "'done'");
    5555    shouldBe("event.target.result", "key");
    5656    request = evalAndLog("request = objectStore.get(key);");
    57     shouldBe("request.readyState", "IDBRequest.LOADING");
     57    shouldBe("request.readyState", "'pending'");
    5858    request.onsuccess = finalCheck;
    5959    request.onerror = unexpectedErrorCallback;
     
    6363{
    6464    debug("finalCheck():");
    65     shouldBe("request.readyState", "IDBRequest.DONE");
     65    shouldBe("request.readyState", "'done'");
    6666    shouldBeFalse("event.target.result == null");
    6767    finishJSTest();
  • trunk/LayoutTests/storage/indexeddb/mozilla/resources/versionchange.js

    r116051 r116337  
    6565{
    6666    shouldBe("event.target.result", "event.target.transaction");
    67     shouldBe("event.target.transaction.mode", "IDBTransaction.VERSION_CHANGE");
     67    shouldBe("event.target.transaction.mode", "'versionchange'");
    6868    shouldBe("db2.version", "'1'");
    6969
     
    9393{
    9494    shouldBe("event.target.result", "event.target.transaction");
    95     shouldBe("event.target.transaction.mode", "IDBTransaction.VERSION_CHANGE");
     95    shouldBe("event.target.transaction.mode", "'versionchange'");
    9696    shouldBe("db3.version", "'2'");
    9797    shouldBe("versionChangeEventCount", "3");
  • trunk/LayoutTests/storage/indexeddb/mozilla/versionchange-expected.txt

    r116051 r116337  
    2121PASS db2 received blocked event
    2222PASS event.target.result is event.target.transaction
    23 PASS event.target.transaction.mode is IDBTransaction.VERSION_CHANGE
     23PASS event.target.transaction.mode is 'versionchange'
    2424PASS db2.version is '1'
    2525request = indexedDB.open(name, description);
     
    3838db2.close();
    3939PASS event.target.result is event.target.transaction
    40 PASS event.target.transaction.mode is IDBTransaction.VERSION_CHANGE
     40PASS event.target.transaction.mode is 'versionchange'
    4141PASS db3.version is '2'
    4242PASS versionChangeEventCount is 3
  • trunk/LayoutTests/storage/indexeddb/mutating-cursor-expected.txt

    r116051 r116337  
    1919objectStore.add(4, 4).onerror = unexpectedErrorCallback
    2020openForwardCursor()
    21 trans = db.transaction(['store'], IDBTransaction.READ_WRITE)
     21trans = db.transaction(['store'], 'readwrite')
    2222trans.objectStore('store')
    2323objectStore.openCursor()
     
    5252forwardCursorComplete()
    5353openReverseCursor()
    54 trans = db.transaction(['store'], IDBTransaction.READ_WRITE)
     54trans = db.transaction(['store'], 'readwrite')
    5555trans.objectStore('store')
    56 objectStore.openCursor(null, IDBCursor.PREV)
     56objectStore.openCursor(null, 'prev')
    5757reverseCursor()
    58585
  • trunk/LayoutTests/storage/indexeddb/noblobs-expected.txt

    r116051 r116337  
    1717
    1818testBlob():
    19 BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder
    20 PASS BlobBuilder != null is true
    2119PASS FileReader != null is true
    22 builder = new BlobBuilder()
    2320test_content = 'This is a test. This is only a test.'
    24 builder.append(test_content)
    25 blob = builder.getBlob()
     21blob = new Blob([test_content])
    2622
    2723validateExceptions(blob):
    28 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     24transaction = db.transaction('storeName', 'readwrite')
    2925store = transaction.objectStore('storeName')
    3026Expecting exception from store.put(blob, 'key')
     
    4440
    4541validateExceptions(file):
    46 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     42transaction = db.transaction('storeName', 'readwrite')
    4743store = transaction.objectStore('storeName')
    4844Expecting exception from store.put(file, 'key')
     
    6258
    6359validateExceptions(filelist):
    64 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     60transaction = db.transaction('storeName', 'readwrite')
    6561store = transaction.objectStore('storeName')
    6662Expecting exception from store.put(filelist, 'key')
  • trunk/LayoutTests/storage/indexeddb/noblobs.html

    r116051 r116337  
    8585    debug("");
    8686    debug("validateExceptions(" + variable + "):");
    87     evalAndLog("transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)");
     87    evalAndLog("transaction = db.transaction('storeName', 'readwrite')");
    8888    evalAndLog("store = transaction.objectStore('storeName')");
    8989    evalAndExpectException("store.put(" + variable + ", 'key')", "DOMException.DATA_CLONE_ERR");
  • trunk/LayoutTests/storage/indexeddb/objectstore-autoincrement-expected.txt

    r116051 r116337  
    2727PASS storeNames.length is 4
    2828setVersionCompleted():
    29 trans = db.transaction(['StoreWithKeyPath', 'StoreWithAutoIncrement', 'PlainOldStore'], IDBTransaction.READ_WRITE)
     29trans = db.transaction(['StoreWithKeyPath', 'StoreWithAutoIncrement', 'PlainOldStore'], 'readwrite')
    3030store = trans.objectStore('StoreWithKeyPath')
    3131Insert into object store with auto increment and key path, with key in the object.
     
    6767PASS event.target.result is 1
    6868testLongKeyPath():
    69 trans = db.transaction('StoreWithLongKeyPath', IDBTransaction.READ_WRITE)
     69trans = db.transaction('StoreWithLongKeyPath', 'readwrite')
    7070store = trans.objectStore('StoreWithLongKeyPath')
    7171store.add({foo: 'bar'})
  • trunk/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt

    r116051 r116337  
    7777PASS store.indexNames.item(1) is null
    7878PASS store.indexNames.item(100) is null
    79 transaction = db.transaction(['storeName'], IDBTransaction.READ_WRITE)
     79transaction = db.transaction(['storeName'], 'readwrite')
    8080store = transaction.objectStore('storeName')
    8181Try to insert data with a Date key:
     
    9393PASS event.target.errorCode is IDBDatabaseException.CONSTRAINT_ERR
    9494event.preventDefault()
    95 db.transaction(['storeName'], IDBTransaction.READ_WRITE)
     95db.transaction(['storeName'], 'readwrite')
    9696store = transaction.objectStore('storeName')
    9797store.add({x: 'somevalue'}, 'somekey')
     
    9999PASS Exception was thrown.
    100100PASS code is IDBDatabaseException.DATA_ERR
    101 db.transaction(['storeName'], IDBTransaction.READ_WRITE)
     101db.transaction(['storeName'], 'readwrite')
    102102store = transaction.objectStore('storeName')
    103103Expecting exception from store.add({x: null}, 'validkey')
    104104PASS Exception was thrown.
    105105PASS code is IDBDatabaseException.DATA_ERR
    106 db.transaction(['storeName'], IDBTransaction.READ_WRITE)
     106db.transaction(['storeName'], 'readwrite')
    107107store = transaction.objectStore('storeName')
    108108store.get('key')
  • trunk/LayoutTests/storage/indexeddb/objectstore-basics-workers-expected.txt

    r116051 r116337  
    7878PASS [Worker] store.indexNames.item(1) is null
    7979PASS [Worker] store.indexNames.item(100) is null
    80 [Worker] transaction = db.transaction(['storeName'], IDBTransaction.READ_WRITE)
     80[Worker] transaction = db.transaction(['storeName'], 'readwrite')
    8181[Worker] store = transaction.objectStore('storeName')
    8282[Worker] Try to insert data with a Date key:
     
    9494PASS [Worker] event.target.errorCode is IDBDatabaseException.CONSTRAINT_ERR
    9595[Worker] event.preventDefault()
    96 [Worker] db.transaction(['storeName'], IDBTransaction.READ_WRITE)
     96[Worker] db.transaction(['storeName'], 'readwrite')
    9797[Worker] store = transaction.objectStore('storeName')
    9898[Worker] store.add({x: 'somevalue'}, 'somekey')
     
    100100PASS [Worker] Exception was thrown.
    101101PASS [Worker] code is IDBDatabaseException.DATA_ERR
    102 [Worker] db.transaction(['storeName'], IDBTransaction.READ_WRITE)
     102[Worker] db.transaction(['storeName'], 'readwrite')
    103103[Worker] store = transaction.objectStore('storeName')
    104104[Worker] Expecting exception from store.add({x: null}, 'validkey')
    105105PASS [Worker] Exception was thrown.
    106106PASS [Worker] code is IDBDatabaseException.DATA_ERR
    107 [Worker] db.transaction(['storeName'], IDBTransaction.READ_WRITE)
     107[Worker] db.transaction(['storeName'], 'readwrite')
    108108[Worker] store = transaction.objectStore('storeName')
    109109[Worker] store.get('key')
  • trunk/LayoutTests/storage/indexeddb/objectstore-count-expected.txt

    r116051 r116337  
    1818
    1919verifying count without range
    20 trans = db.transaction('storeName', IDBTransaction.READ_ONLY)
     20trans = db.transaction('storeName', 'readonly')
    2121PASS trans != null is true
    2222store = trans.objectStore('storeName')
     
    2727
    2828verifying count with range
    29 trans = db.transaction('storeName', IDBTransaction.READ_ONLY)
     29trans = db.transaction('storeName', 'readonly')
    3030PASS trans != null is true
    3131store = trans.objectStore('storeName')
     
    7878
    7979verifying count with key
    80 trans = db.transaction('storeName', IDBTransaction.READ_ONLY)
     80trans = db.transaction('storeName', 'readonly')
    8181PASS trans != null is true
    8282store = trans.objectStore('storeName')
  • trunk/LayoutTests/storage/indexeddb/open-cursor-expected.txt

    r116051 r116337  
    1818event.target.source.openCursor(keyRange)
    1919Cursor opened successfully.
    20 PASS cursor.direction is 0
     20PASS cursor.direction is 'next'
    2121PASS cursor.key is 'myKey'
    2222PASS cursor.value is 'myValue'
     
    3434event.target.source.openCursor("myKey")
    3535Cursor opened successfully.
    36 PASS cursor.direction is 0
     36PASS cursor.direction is 'next'
    3737PASS cursor.key is 'myKey'
    3838PASS cursor.value is 'myValue'
  • trunk/LayoutTests/storage/indexeddb/open-during-transaction-expected.txt

    r116051 r116337  
    1515starting transaction
    1616state = 'starting'
    17 trans = dbc1.transaction('storeName', IDBTransaction.READ_WRITE)
     17trans = dbc1.transaction('storeName', 'readwrite')
    1818trans.objectStore('storeName').put('value', 'key')
    1919
  • trunk/LayoutTests/storage/indexeddb/opencursor-key-expected.txt

    r116051 r116337  
    3131objectStore.createIndex(indexData[i].name, indexData[i].keyPath, indexData[i].options);
    3232testObjectStore()
    33 trans = db.transaction(objectStoreName, IDBTransaction.READ_WRITE)
     33trans = db.transaction(objectStoreName, 'readwrite')
    3434objectStore = trans.objectStore(objectStoreName)
    3535request = objectStore.openCursor('237-23-7739')
     
    3939cursor.continue()
    4040PASS cursor is null
    41 trans = db.transaction(objectStoreName, IDBTransaction.READ_WRITE)
     41trans = db.transaction(objectStoreName, 'readwrite')
    4242objectStore = trans.objectStore(objectStoreName)
    4343index = objectStore.index('weight')
     
    5656cursor.continue()
    5757PASS cursor is null
    58 trans = db.transaction(objectStoreName, IDBTransaction.READ_WRITE)
     58trans = db.transaction(objectStoreName, 'readwrite')
    5959objectStore = trans.objectStore(objectStoreName)
    6060index = objectStore.index('weight')
  • trunk/LayoutTests/storage/indexeddb/prefetch-bugfix-108071-expected.txt

    r116051 r116337  
    2424
    2525iterateAndDeleteFirstElement():
    26 trans = db.transaction(['store'], IDBTransaction.READ_WRITE)
     26trans = db.transaction(['store'], 'readwrite')
    2727trans.objectStore('store').openCursor()
    28280: Alpha
  • trunk/LayoutTests/storage/indexeddb/readonly-expected.txt

    r116051 r116337  
    2121trying to set readonly property request.readyState
    2222request.readyState = 666
    23 PASS request.readyState is still 2
     23PASS request.readyState is still done
    2424db = event.target.result
    2525trying to set readonly property db.name
     
    3030trying to set readonly property transaction.mode
    3131transaction.mode = 666
    32 PASS transaction.mode is still 2
     32PASS transaction.mode is still versionchange
    3333trying to set readonly property transaction.db
    3434transaction.db = this
     
    5050trying to set readonly property cursor.direction
    5151cursor.direction = 666
    52 PASS cursor.direction is still 0
     52PASS cursor.direction is still next
    5353trying to set readonly property cursor.key
    5454cursor.key = Infinity
  • trunk/LayoutTests/storage/indexeddb/request-event-propagation-expected.txt

    r116051 r116337  
    1717store.add({x: 'value', y: 'zzz'}, 'key')
    1818Verify that handler fires and that not preventing default will result in an abort
    19 trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)
     19trans = db.transaction(['storeName'], 'readwrite')
    2020trans.onabort = transactionAborted
    2121trans.oncomplete = unexpectedCompleteCallback
     
    2828
    2929Verifing error
    30 trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)
     30trans = db.transaction(['storeName'], 'readwrite')
    3131trans.onabort = transactionAborted2
    3232trans.oncomplete = unexpectedAbortCallback
     
    9595
    9696Verifing success.
    97 trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)
     97trans = db.transaction(['storeName'], 'readwrite')
    9898trans.oncomplete = transactionComplete
    9999trans.onabort = unexpectedAbortCallback
  • trunk/LayoutTests/storage/indexeddb/resources/basics.js

    r116051 r116337  
    2121    shouldBeNull("request.transaction");
    2222    shouldBeTrue("'readyState' in request");
    23     shouldBe("request.readyState", "IDBRequest.LOADING");
     23    shouldBe("request.readyState", "'pending'");
    2424    shouldBeTrue("'onsuccess' in request");
    2525    shouldBeNull("request.onsuccess");
    2626    shouldBeTrue("'onerror' in request");
    2727    shouldBeNull("request.onerror");
    28     shouldBe("request.LOADING", "1");
    29     shouldBe("request.DONE", "2");
    3028    request.onsuccess = openCallback;
    3129    request.onerror = unexpectedErrorCallback;
     
    4644    shouldBeNull("event.target.transaction");
    4745    shouldBeTrue("'readyState' in request");
    48     shouldBe("event.target.readyState", "IDBRequest.DONE");
     46    shouldBe("event.target.readyState", "'done'");
    4947    shouldBeTrue("'onsuccess' in event.target");
    5048    shouldBeTrue("'onerror' in event.target");
    51     shouldBe("event.target.LOADING", "1");
    52     shouldBe("event.target.DONE", "2");
    5349
    5450    finishJSTest();
  • trunk/LayoutTests/storage/indexeddb/resources/constants.js

    r116051 r116337  
    2222    shouldBe("IDBDatabaseException.VER_ERR", "12");
    2323
    24     shouldBe("IDBRequest.LOADING", "1");
    25     shouldBe("IDBRequest.DONE", "2");
    26 
    2724    shouldBe("IDBCursor.NEXT", "0");
    2825    shouldBe("IDBCursor.NEXT_NO_DUPLICATE", "1");
  • trunk/LayoutTests/storage/indexeddb/resources/create-object-store-options.js

    r116051 r116337  
    3838function setVersionComplete()
    3939{
    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'");
    4242
    4343    req = evalAndLog("trans.objectStore('a').put({'a': 0})");
  • trunk/LayoutTests/storage/indexeddb/resources/cursor-added-bug.js

    r116051 r116337  
    4242function openCursor()
    4343{
    44     evalAndLog("trans = db.transaction(['test'], IDBTransaction.READ_WRITE)");
     44    evalAndLog("trans = db.transaction(['test'], 'readwrite')");
    4545    trans.onabort = finishJSTest;
    4646    trans.oncomplete = finishJSTest;
  • trunk/LayoutTests/storage/indexeddb/resources/cursor-advance.js

    r116051 r116337  
    8383        store = store.index(indexName);
    8484
    85     evalAndLog("request = store.openCursor(null, " + direction + ")");
     85    if (direction)
     86        evalAndLog("request = store.openCursor(null, " + direction + ")");
     87    else
     88        evalAndLog("request = store.openCursor()");
    8689    var currentPos = 0;
    8790    function continueToTest(event)
     
    134137function runTest(cursor, expectedValue)
    135138{
    136     shouldBe("'" + JSON.stringify(simplifyCursor(cursor)) + "'",
    137              "'" + JSON.stringify(expectedValue) + "'");
     139    expected = JSON.stringify(expectedValue);
     140    shouldBe("expected", "'" + JSON.stringify(simplifyCursor(cursor)) + "'");
    138141}
    139142
     
    189192{
    190193    debug("testAdvanceIndexNoDupe()");
    191     makeAdvanceTest(0, IDBCursor.NEXT_NO_DUPLICATE, 3,
     194    makeAdvanceTest(0, "'nextunique'", 3,
    192195                    // Sue (weight 130 - skipping weight 100, 110, 120)
    193196                    {key: objectStoreData[3].value.weight,
     
    200203{
    201204    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)
    204207                    {key: objectStoreData[4].value.weight,
    205208                     value: objectStoreData[4].value,
     
    211214{
    212215    debug("testAdvanceIndexPrevNoDupe()");
    213     makeAdvanceTest(0, IDBCursor.PREV_NO_DUPLICATE, 3,
     216    makeAdvanceTest(0, "'prevunique'", 3,
    214217                    // Bob (weight 120 - skipping weights 180, 150, 130)
    215218                    {key: objectStoreData[0].value.weight,
     
    315318{
    316319    debug("testBadAdvance()");
    317     evalAndLog("trans = db.transaction(objectStoreName, IDBTransaction.READ_WRITE)");
     320    evalAndLog("trans = db.transaction(objectStoreName, 'readwrite')");
    318321    objectStore = evalAndLog("objectStore = trans.objectStore(objectStoreName)");
    319322
     
    336339{
    337340    debug("testDelete()");
    338     evalAndLog("trans = db.transaction(objectStoreName, IDBTransaction.READ_WRITE)");
     341    evalAndLog("trans = db.transaction(objectStoreName, 'readwrite')");
    339342    objectStore = evalAndLog("objectStore = trans.objectStore(objectStoreName)");
    340343
  • trunk/LayoutTests/storage/indexeddb/resources/cursor-continue-validity.js

    r116051 r116337  
    6161    debug("Checking objectStore");
    6262    debug("====================");
    63     var request = evalAndLog("indexObject.openCursor(null, IDBCursor.NEXT)");
     63    var request = evalAndLog("indexObject.openCursor(null, 'next')");
    6464    evalAndLog("self.continueValue = 0");
    6565    request.onsuccess = evalAndLogCallback("doubleContinueCallback()");
     
    9797    debug("Checking index");
    9898    debug("==============");
    99     var request = evalAndLog("indexObject.openCursor(null, IDBCursor.NEXT)");
     99    var request = evalAndLog("indexObject.openCursor(null, 'next')");
    100100    evalAndLog("self.continueValue = 0");
    101101    request.onsuccess = doubleContinueIndexCallback;
     
    135135    debug("Checking modification");
    136136    debug("=====================");
    137     var request = evalAndLog("indexObject.openCursor(null, IDBCursor.NEXT)");
     137    var request = evalAndLog("indexObject.openCursor(null, 'next')");
    138138    evalAndLog("self.continueValue = 0");
    139139    request.onsuccess = modifyContinueOrderCallback;
  • trunk/LayoutTests/storage/indexeddb/resources/cursor-continue.js

    r116051 r116337  
    7676{
    7777    debug("");
    78     var request = evalAndLog("indexObject.openKeyCursor(null, IDBCursor.NEXT)");
     78    var request = evalAndLog("indexObject.openKeyCursor(null, 'next')");
    7979    request.onsuccess = ascendingCallback;
    8080    request.onerror = unexpectedErrorCallback;
     
    131131{
    132132    debug("");
    133     var request = evalAndLog("indexObject.openKeyCursor(null, IDBCursor.PREV)");
     133    var request = evalAndLog("indexObject.openKeyCursor(null, 'prev')");
    134134    request.onsuccess = descendingCallback;
    135135    request.onerror = unexpectedErrorCallback;
     
    176176{
    177177    debug("");
    178     var request = evalAndLog("indexObject.openKeyCursor(null, IDBCursor.NEXT)");
     178    var request = evalAndLog("indexObject.openKeyCursor(null, 'next')");
    179179    self.stage = 0;
    180180    request.onerror = unexpectedErrorCallback;
     
    198198{
    199199    debug("");
    200     var request = evalAndLog("indexObject.openKeyCursor(null, IDBCursor.NEXT)");
     200    var request = evalAndLog("indexObject.openKeyCursor(null, 'next')");
    201201    self.stage = 0;
    202202    request.onerror = unexpectedErrorCallback;
     
    220220{
    221221    debug("");
    222     var request = evalAndLog("indexObject.openKeyCursor(null, IDBCursor.PREV)");
     222    var request = evalAndLog("indexObject.openKeyCursor(null, 'prev')");
    223223    self.stage = 0;
    224224    request.onerror = unexpectedErrorCallback;
     
    242242{
    243243    debug("");
    244     var request = evalAndLog("indexObject.openKeyCursor(null, IDBCursor.PREV)");
     244    var request = evalAndLog("indexObject.openKeyCursor(null, 'prev')");
    245245    self.stage = 0;
    246246    request.onerror = unexpectedErrorCallback;
  • trunk/LayoutTests/storage/indexeddb/resources/cursor-delete.js

    r116051 r116337  
    4545{
    4646    debug("openCursor1");
    47     evalAndLog("trans = db.transaction(['test'], IDBTransaction.READ_WRITE)");
     47    evalAndLog("trans = db.transaction(['test'], 'readwrite')");
    4848    keyRange = IDBKeyRange.lowerBound("myKey1");
    4949    request = evalAndLog("trans.objectStore('test').openCursor(keyRange)");
     
    7575function addObject()
    7676{
    77     evalAndLog("trans = db.transaction(['test'], IDBTransaction.READ_WRITE)");
     77    evalAndLog("trans = db.transaction(['test'], 'readwrite')");
    7878    objectStore = evalAndLog("objectStore = trans.objectStore('test')");
    7979    request = evalAndLog("objectStore.add('myValue1', 'myKey1')");
  • trunk/LayoutTests/storage/indexeddb/resources/cursor-inconsistency.js

    r116051 r116337  
    4646{
    4747    debug("openBasicCursor()");
    48     evalAndLog("trans = db.transaction(['basicStore'], IDBTransaction.READ_WRITE)");
     48    evalAndLog("trans = db.transaction(['basicStore'], 'readwrite')");
    4949    trans.onabort = unexpectedAbortCallback;
    5050    trans.oncomplete = transactionComplete;
  • trunk/LayoutTests/storage/indexeddb/resources/cursor-index-delete.js

    r116051 r116337  
    4747{
    4848    debug("openCursor1");
    49     evalAndLog("trans = db.transaction(['test'], IDBTransaction.READ_WRITE)");
     49    evalAndLog("trans = db.transaction(['test'], 'readwrite')");
    5050    keyRange = IDBKeyRange.lowerBound(1);
    5151    request = evalAndLog("trans.objectStore('test').index('testIndex').openCursor(keyRange)");
     
    7878function addObject()
    7979{
    80     evalAndLog("trans = db.transaction(['test'], IDBTransaction.READ_WRITE)");
     80    evalAndLog("trans = db.transaction(['test'], 'readwrite')");
    8181    objectStore = evalAndLog("objectStore = trans.objectStore('test')");
    8282    request = evalAndLog("objectStore.add({x: 1}, 'myKey1')");
  • trunk/LayoutTests/storage/indexeddb/resources/cursor-key-order.js

    r116051 r116337  
    135135    debug("");
    136136    debug("populating store...");
    137     evalAndLog("trans = db.transaction('store', IDBTransaction.READ_WRITE)");
     137    evalAndLog("trans = db.transaction('store', 'readwrite')");
    138138    evalAndLog("store = trans.objectStore('store');");
    139139    trans.onerror = unexpectedErrorCallback;
     
    150150    debug("");
    151151    debug("iterating cursor...");
    152     evalAndLog("trans = db.transaction('store', IDBTransaction.READ_ONLY)");
     152    evalAndLog("trans = db.transaction('store', 'readonly')");
    153153    evalAndLog("store = trans.objectStore('store');");
    154154    trans.onerror = unexpectedErrorCallback;
  • trunk/LayoutTests/storage/indexeddb/resources/cursor-prev-no-duplicate.js

    r116051 r116337  
    3737    debug("");
    3838    debug("populating store...");
    39     evalAndLog("trans = db.transaction('store', IDBTransaction.READ_WRITE)");
     39    evalAndLog("trans = db.transaction('store', 'readwrite')");
    4040    evalAndLog("store = trans.objectStore('store');");
    4141    trans.onerror = unexpectedErrorCallback;
     
    5656    debug("testFarRangeCursor: upper bound is well out of range, results always the same, whether open or closed");
    5757
    58     runTest(makeOpenCursor("store", 7, false, IDBCursor.PREV),
     58    runTest(makeOpenCursor("store", 7, false, "'prev'"),
    5959            { expectedValue: 333, expectedKey: 3}).onsuccess =
    6060                testFarRangeCursor_open;
     
    6363function testFarRangeCursor_open()
    6464{
    65     runTest(makeOpenCursor("store", 7, true, IDBCursor.PREV),
     65    runTest(makeOpenCursor("store", 7, true, "'prev'"),
    6666            { expectedValue: 333, expectedKey: 3}).onsuccess =
    6767                testFarRangeCursor_indexClosed;
     
    7171{
    7272        // here '7' refers to the 'sorted' value
    73         runTest(makeOpenCursor("index", 7, false, IDBCursor.PREV),
     73        runTest(makeOpenCursor("index", 7, false, "'prev'"),
    7474                { expectedValue: 111, expectedKey: 3, expectedPrimaryKey: 1}).onsuccess =
    7575                    testFarRangeCursor_indexOpen;
     
    7777function testFarRangeCursor_indexOpen()
    7878{
    79     runTest(makeOpenCursor("index", 7, true, IDBCursor.PREV),
     79    runTest(makeOpenCursor("index", 7, true, "'prev'"),
    8080            { expectedValue: 111, expectedKey: 3, expectedPrimaryKey: 1}).onsuccess =
    8181                testFarRangeCursor_indexKeyOpen;
     
    8585{
    8686    // here '7' refers to the sorted value
    87     runTest(makeOpenKeyCursor("index", 7, false, IDBCursor.PREV),
     87    runTest(makeOpenKeyCursor("index", 7, false, "'prev'"),
    8888            { expectedKey: 3, expectedPrimaryKey: 1}).onsuccess =
    8989                testFarRangeCursor_indexKeyClosed;
     
    9292function testFarRangeCursor_indexKeyClosed()
    9393{
    94     runTest(makeOpenKeyCursor("index", 7, true, IDBCursor.PREV),
     94    runTest(makeOpenKeyCursor("index", 7, true, "'prev'"),
    9595            { expectedKey: 3, expectedPrimaryKey: 1}).onsuccess =
    9696                testBoundaryCursor_closed;
     
    9999function testBoundaryCursor_closed()
    100100{
    101     runTest(makeOpenCursor("store", 3, false, IDBCursor.PREV),
     101    runTest(makeOpenCursor("store", 3, false, "'prev'"),
    102102            { expectedValue: 333, expectedKey: 3}).onsuccess =
    103103                testBoundaryCursor_open;
     
    106106function testBoundaryCursor_open()
    107107{
    108     runTest(makeOpenCursor("store", 3, true, IDBCursor.PREV),
     108    runTest(makeOpenCursor("store", 3, true, "'prev'"),
    109109            { expectedValue: 222, expectedKey: 2}).onsuccess =
    110110                testBoundaryCursor_indexClosed;
     
    114114{
    115115    // 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'"),
    117117            { expectedValue: 111, expectedKey: 3, expectedPrimaryKey: 1}).onsuccess =
    118118                testBoundaryCursor_indexOpen;
     
    121121function testBoundaryCursor_indexOpen()
    122122{
    123     runTest(makeOpenCursor("index", 3, true, IDBCursor.PREV),
     123    runTest(makeOpenCursor("index", 3, true, "'prev'"),
    124124            { expectedValue: 222, expectedKey: 2, expectedPrimaryKey: 2}).onsuccess =
    125125                testBoundaryCursor_indexKeyClosed;
     
    130130
    131131    // 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'"),
    133133            { expectedKey: 3, expectedPrimaryKey: 1}).onsuccess =
    134134                testBoundaryCursor_indexKeyOpen;
     
    137137function testBoundaryCursor_indexKeyOpen()
    138138{
    139     runTest(makeOpenKeyCursor("index", 3, true, IDBCursor.PREV),
     139    runTest(makeOpenKeyCursor("index", 3, true, "'prev'"),
    140140            { expectedKey: 2, expectedPrimaryKey: 2}).onsuccess =
    141141                testNoDuplicate_closed;
     
    149149    // cursors, but we should make sure we get the right one
    150150    // anyway
    151     runTest(makeOpenCursor("store", 15, false, IDBCursor.PREV_NO_DUPLICATE),
     151    runTest(makeOpenCursor("store", 15, false, "'prevunique'"),
    152152            { expectedValue: 666, expectedKey: 15, expectedPrimaryKey: 15 })
    153153                .onsuccess = testNoDuplicate_open;
     
    158158    // still three values, but now the index says we should return the
    159159    // second one
    160     runTest(makeOpenCursor("index", 15, false, IDBCursor.PREV_NO_DUPLICATE),
     160    runTest(makeOpenCursor("index", 15, false, "'prevunique'"),
    161161            { expectedValue: 666, expectedKey: 10, expectedPrimaryKey: 15}).onsuccess = testNoDuplicate_indexKeyClosed;
    162162}
     
    166166{
    167167    // same behavior as above, without a value
    168     runTest(makeOpenKeyCursor("index", 15, false, IDBCursor.PREV_NO_DUPLICATE),
     168    runTest(makeOpenKeyCursor("index", 15, false, "'prevunique'"),
    169169            { expectedKey: 10, expectedPrimaryKey: 15}).onsuccess =
    170170                finishJSTest;
     
    188188function runTest(openCursor, exp)
    189189{
    190     trans = db.transaction('store', IDBTransaction.READ_ONLY);
     190    trans = db.transaction('store', 'readonly');
    191191
    192192    // expose these for code in openCursor
  • trunk/LayoutTests/storage/indexeddb/resources/cursor-primary-key-order.js

    r116051 r116337  
    5555    debug("");
    5656    debug("populating store...");
    57     evalAndLog("trans = db.transaction('store', IDBTransaction.READ_WRITE)");
     57    evalAndLog("trans = db.transaction('store', 'readwrite')");
    5858    evalAndLog("store = trans.objectStore('store');");
    5959    trans.onerror = unexpectedErrorCallback;
     
    7474    debug("");
    7575    debug("iterating cursor...");
    76     evalAndLog("trans = db.transaction('store', IDBTransaction.READ_ONLY)");
     76    evalAndLog("trans = db.transaction('store', 'readonly')");
    7777    evalAndLog("store = trans.objectStore('store');");
    7878    evalAndLog("index = store.index('index');");
  • trunk/LayoutTests/storage/indexeddb/resources/cursor-reverse-bug.js

    r116051 r116337  
    3535    debug("");
    3636    debug("populating store...");
    37     evalAndLog("trans = db.transaction('store', IDBTransaction.READ_WRITE)");
     37    evalAndLog("trans = db.transaction('store', 'readwrite')");
    3838    evalAndLog("store = trans.objectStore('store');");
    3939    trans.onerror = unexpectedErrorCallback;
     
    6565    test = tests.shift();
    6666
    67     evalAndLog("trans = db.transaction('store', IDBTransaction.READ_ONLY)");
     67    evalAndLog("trans = db.transaction('store', 'readonly')");
    6868    trans.onerror = unexpectedErrorCallback;
    6969    trans.onabort = unexpectedAbortCallback;
     
    8989
    9090    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')");
    9292    storeReq.onsuccess = testFunction;
    9393
    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')");
    9595    indexReq.onsuccess = testFunction;
    9696
    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')");
    9898    indexKeyReq.onsuccess = testFunction;
    9999}
  • trunk/LayoutTests/storage/indexeddb/resources/cursor-skip-deleted.js

    r116051 r116337  
    139139    debug("basicCursorTest()");
    140140
    141     evalAndLog("trans = db.transaction(['store'], IDBTransaction.READ_WRITE)");
     141    evalAndLog("trans = db.transaction(['store'], 'readwrite')");
    142142    trans.onabort = unexpectedAbortCallback;
    143143    trans.oncomplete = transactionComplete;
     
    168168                   ];
    169169
    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); });
    171171}
    172172
  • trunk/LayoutTests/storage/indexeddb/resources/cursor-update.js

    r116051 r116337  
    5858{
    5959    debug("openBasicCursor()");
    60     evalAndLog("trans = db.transaction(['basicStore', 'autoIncrementStore', 'keyPathStore'], IDBTransaction.READ_WRITE)");
     60    evalAndLog("trans = db.transaction(['basicStore', 'autoIncrementStore', 'keyPathStore'], 'readwrite')");
    6161    trans.onabort = unexpectedAbortCallback;
    6262    trans.oncomplete = transactionComplete;
  • trunk/LayoutTests/storage/indexeddb/resources/data-corruption.js

    r116051 r116337  
    4242{
    4343    debug("addData():");
    44     var transaction = evalAndLog("transaction = db.transaction(['storeName'], IDBTransaction.READ_WRITE)");
     44    var transaction = evalAndLog("transaction = db.transaction(['storeName'], 'readwrite')");
    4545    var request = evalAndLog("request = transaction.objectStore('storeName').add({x: testDate}, 'key')");
    4646    request.onerror = unexpectedErrorCallback;
     
    5151{
    5252    debug("addData():");
    53     var transaction = evalAndLog("transaction = db.transaction(['storeName'], IDBTransaction.READ_ONLY)");
     53    var transaction = evalAndLog("transaction = db.transaction(['storeName'], 'readonly')");
    5454    var request = evalAndLog("request = transaction.objectStore('storeName').get('key')");
    5555    request.onerror = unexpectedErrorCallback;
  • trunk/LayoutTests/storage/indexeddb/resources/database-quota.js

    r116051 r116337  
    5454function checkQuotaEnforcing()
    5555{
    56     var trans = evalAndLog("trans = db.transaction(['test123'], IDBTransaction.READ_WRITE)");
     56    var trans = evalAndLog("trans = db.transaction(['test123'], 'readwrite')");
    5757    trans.onabort = testComplete;
    5858    trans.oncomplete = unexpectedCompleteCallback;
  • trunk/LayoutTests/storage/indexeddb/resources/delete-range.js

    r116051 r116337  
    6767        if (test) {
    6868            debug("");
    69             evalAndLog("trans = db.transaction('store', IDBTransaction.READ_WRITE)");
     69            evalAndLog("trans = db.transaction('store', 'readwrite')");
    7070            evalAndLog("store = trans.objectStore('store')");
    7171            for (i = 1; i <= 10; ++i) {
  • trunk/LayoutTests/storage/indexeddb/resources/error-causes-abort-by-default.js

    r116051 r116337  
    3838function addData()
    3939{
    40     trans = evalAndLog("trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)");
     40    trans = evalAndLog("trans = db.transaction(['storeName'], 'readwrite')");
    4141    evalAndLog("trans.onabort = unexpectedAbortCallback");
    4242    evalAndLog("trans.oncomplete = transactionCompleted");
     
    6565    debug("");
    6666    debug("");
    67     trans = evalAndLog("trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)");
     67    trans = evalAndLog("trans = db.transaction(['storeName'], 'readwrite')");
    6868    evalAndLog("trans.onabort = transactionAborted1");
    6969    evalAndLog("trans.oncomplete = unexpectedCompleteCallback");
     
    8484    debug("");
    8585    debug("");
    86     trans = evalAndLog("trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)");
     86    trans = evalAndLog("trans = db.transaction(['storeName'], 'readwrite')");
    8787    evalAndLog("trans.onabort = transactionAborted2");
    8888    evalAndLog("trans.oncomplete = unexpectedCompleteCallback");
  • trunk/LayoutTests/storage/indexeddb/resources/exception-in-event-aborts.js

    r116051 r116337  
    4141{
    4242    debug("");
    43     trans = evalAndLog("trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)");
     43    trans = evalAndLog("trans = db.transaction(['storeName'], 'readwrite')");
    4444    evalAndLog("trans.onabort = transactionAborted1");
    4545    evalAndLog("trans.oncomplete = unexpectedCompleteCallback");
     
    6363    shouldHaveHadError("this exception is expected");
    6464    testPassed("The transaction was aborted.");
    65     trans = evalAndLog("trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)");
     65    trans = evalAndLog("trans = db.transaction(['storeName'], 'readwrite')");
    6666    evalAndLog("trans.onabort = transactionAborted2");
    6767    evalAndLog("trans.oncomplete = unexpectedCompleteCallback");
     
    7777    shouldHaveHadError("this exception is expected");
    7878    testPassed("The transaction was aborted.");
    79     trans = evalAndLog("trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)");
     79    trans = evalAndLog("trans = db.transaction(['storeName'], 'readwrite')");
    8080    evalAndLog("trans.onabort = unexpectedAbortCallback");
    8181    evalAndLog("trans.oncomplete = transactionCompleted1");
     
    102102    debug("");
    103103    testPassed("The transaction completed.");
    104     trans = evalAndLog("trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)");
     104    trans = evalAndLog("trans = db.transaction(['storeName'], 'readwrite')");
    105105    evalAndLog("trans.onabort = unexpectedAbortCallback");
    106106    evalAndLog("trans.oncomplete = transactionCompleted2");
  • trunk/LayoutTests/storage/indexeddb/resources/factory-deletedatabase.js

    r116051 r116337  
    4040function getValue()
    4141{
    42     transaction = evalAndLog("db.transaction('storeName', IDBTransaction.READ_WRITE)");
     42    transaction = evalAndLog("db.transaction('storeName', 'readwrite')");
    4343    transaction.onabort = unexpectedErrorCallback;
    4444    var store = evalAndLog("store = transaction.objectStore('storeName')");
  • trunk/LayoutTests/storage/indexeddb/resources/index-count.js

    r116051 r116337  
    4545    debug("");
    4646    debug("verifying count without range");
    47     trans = evalAndLog("trans = db.transaction('storeName', IDBTransaction.READ_ONLY)");
     47    trans = evalAndLog("trans = db.transaction('storeName', 'readonly')");
    4848    shouldBeTrue("trans != null");
    4949    trans.onabort = unexpectedAbortCallback;
     
    6868    debug("");
    6969    debug("verifying count with range");
    70     trans = evalAndLog("trans = db.transaction('storeName', IDBTransaction.READ_ONLY)");
     70    trans = evalAndLog("trans = db.transaction('storeName', 'readonly')");
    7171    shouldBeTrue("trans != null");
    7272    trans.onabort = unexpectedAbortCallback;
     
    113113    debug("");
    114114    debug("verifying count with key");
    115     trans = evalAndLog("trans = db.transaction('storeName', IDBTransaction.READ_ONLY)");
     115    trans = evalAndLog("trans = db.transaction('storeName', 'readonly')");
    116116    shouldBeTrue("trans != null");
    117117    trans.onabort = unexpectedAbortCallback;
  • trunk/LayoutTests/storage/indexeddb/resources/index-cursor.js

    r116051 r116337  
    174174        keyRange = IDBKeyRange.upperBound(testData[upper], upperIsOpen);
    175175
    176     var request = indexObject.openKeyCursor(keyRange, ascending ? IDBCursor.NEXT : IDBCursor.PREV);
     176    var request = indexObject.openKeyCursor(keyRange, ascending ? 'next' : 'prev');
    177177    request.onsuccess = cursorIteration;
    178178    request.onerror = unexpectedErrorCallback;
     
    241241    debug(str);
    242242
    243     var request = indexObject.openKeyCursor(null, ascending ? IDBCursor.NEXT : IDBCursor.PREV);
     243    var request = indexObject.openKeyCursor(null, ascending ? 'next' : 'prev');
    244244    request.onsuccess = cursorIteration;
    245245    request.onerror = unexpectedErrorCallback;
  • trunk/LayoutTests/storage/indexeddb/resources/index-multientry.js

    r116051 r116337  
    4343    debug("");
    4444    debug("Populating stores (and indexes)");
    45     transaction = evalAndLog("transaction = db.transaction(['store'], IDBTransaction.READ_WRITE)");
     45    transaction = evalAndLog("transaction = db.transaction(['store'], 'readwrite')");
    4646    transaction.onabort = unexpectedAbortCallback;
    4747    transaction.oncomplete = function() { verifyIndexes('index', verifyUniqueConstraint); };
     
    6161    debug("");
    6262    debug("Verifying index: " + indexName);
    63     transaction = evalAndLog("transaction = db.transaction(['store'], IDBTransaction.READ_ONLY)");
     63    transaction = evalAndLog("transaction = db.transaction(['store'], 'readonly')");
    6464    transaction.onabort = unexpectedAbortCallback;
    6565    transaction.oncomplete = callback;
     
    9595    debug("");
    9696    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')");
    9898    transaction.onabort = function () {
    9999        debug("Transaction aborted as expected");
  • trunk/LayoutTests/storage/indexeddb/resources/index-unique.js

    r116051 r116337  
    4242{
    4343    debug("setVersionCompleted():");
    44     self.transaction = evalAndLog("transaction = db.transaction(['store'], IDBTransaction.READ_WRITE)");
     44    self.transaction = evalAndLog("transaction = db.transaction(['store'], 'readwrite')");
    4545
    4646    request = evalAndLog("transaction.objectStore('store').put({x: 1}, 'foo')");
  • trunk/LayoutTests/storage/indexeddb/resources/key-generator.js

    r116051 r116337  
    177177
    178178    function (db, callback) {
    179         evalAndLog("trans1 = db.transaction(['store'], IDBTransaction.READ_WRITE)");
     179        evalAndLog("trans1 = db.transaction(['store'], 'readwrite')");
    180180        evalAndLog("store_t1 = trans1.objectStore('store')");
    181181        evalAndLog("store_t1.put('a')");
     
    191191                debug('aborted!');
    192192
    193                 evalAndLog("trans2 = db.transaction(['store'], IDBTransaction.READ_WRITE)");
     193                evalAndLog("trans2 = db.transaction(['store'], 'readwrite')");
    194194                evalAndLog("store_t2 = trans2.objectStore('store')");
    195195                evalAndLog("store_t2.put('c')");
     
    211211
    212212    function (db, callback) {
    213         evalAndLog("trans1 = db.transaction(['store'], IDBTransaction.READ_WRITE)");
     213        evalAndLog("trans1 = db.transaction(['store'], 'readwrite')");
    214214        evalAndLog("store_t1 = trans1.objectStore('store')");
    215215        evalAndLog("store_t1.put('a')");
  • trunk/LayoutTests/storage/indexeddb/resources/key-type-array.js

    r116051 r116337  
    4242function testValidArrayKeys()
    4343{
    44     evalAndLog("trans = db.transaction('store', IDBTransaction.READ_WRITE)");
     44    evalAndLog("trans = db.transaction('store', 'readwrite')");
    4545    evalAndLog("store = trans.objectStore('store')");
    4646    debug("");
     
    125125function testInvalidArrayKeys()
    126126{
    127     evalAndLog("trans = db.transaction('store', IDBTransaction.READ_WRITE)");
     127    evalAndLog("trans = db.transaction('store', 'readwrite')");
    128128    evalAndLog("store = trans.objectStore('store')");
    129129    debug("");
  • trunk/LayoutTests/storage/indexeddb/resources/keypath-edges.js

    r116051 r116337  
    4040    debug("testKeyPaths():");
    4141
    42     transaction = evalAndLog("transaction = db.transaction(['store-with-path'], IDBTransaction.READ_WRITE)");
     42    transaction = evalAndLog("transaction = db.transaction(['store-with-path'], 'readwrite')");
    4343    store = evalAndLog("store = transaction.objectStore('store-with-path')");
    4444
     
    7272    debug("testKeyPathsAndGenerator():");
    7373
    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')");
    7575    store = evalAndLog("store = transaction.objectStore('store-with-path-and-generator')");
    7676
  • trunk/LayoutTests/storage/indexeddb/resources/keypath-intrinsic-properties.js

    r116051 r116337  
    4242    debug("testKeyPaths():");
    4343
    44     transaction = evalAndLog("transaction = db.transaction('store', IDBTransaction.READ_WRITE)");
     44    transaction = evalAndLog("transaction = db.transaction('store', 'readwrite')");
    4545    transaction.onabort = unexpectedAbortCallback;
    4646    store = evalAndLog("store = transaction.objectStore('store')");
  • trunk/LayoutTests/storage/indexeddb/resources/mutating-cursor.js

    r116051 r116337  
    4545{
    4646    debug("openForwardCursor()");
    47     evalAndLog("trans = db.transaction(['store'], IDBTransaction.READ_WRITE)");
     47    evalAndLog("trans = db.transaction(['store'], 'readwrite')");
    4848    trans.onabort = unexpectedAbortCallback;
    4949    trans.oncomplete = forwardCursorComplete;
     
    9090{
    9191    debug("openReverseCursor()");
    92     evalAndLog("trans = db.transaction(['store'], IDBTransaction.READ_WRITE)");
     92    evalAndLog("trans = db.transaction(['store'], 'readwrite')");
    9393    trans.onabort = unexpectedAbortCallback;
    9494    trans.oncomplete = reverseCursorComplete;
    9595
    9696    self.objectStore = evalAndLog("trans.objectStore('store')");
    97     request = evalAndLog("objectStore.openCursor(null, IDBCursor.PREV)");
     97    request = evalAndLog("objectStore.openCursor(null, 'prev')");
    9898    request.onsuccess = reverseCursor;
    9999    request.onerror = unexpectedErrorCallback;
  • trunk/LayoutTests/storage/indexeddb/resources/objectstore-autoincrement.js

    r116051 r116337  
    5555    debug("setVersionCompleted():");
    5656
    57     self.trans = evalAndLog("trans = db.transaction(['StoreWithKeyPath', 'StoreWithAutoIncrement', 'PlainOldStore'], IDBTransaction.READ_WRITE)");
     57    self.trans = evalAndLog("trans = db.transaction(['StoreWithKeyPath', 'StoreWithAutoIncrement', 'PlainOldStore'], 'readwrite')");
    5858    trans.onabort = unexpectedAbortCallback;
    5959    trans.oncomplete = testLongKeyPath;
     
    156156{
    157157    debug("testLongKeyPath():");
    158     trans = evalAndLog("trans = db.transaction('StoreWithLongKeyPath', IDBTransaction.READ_WRITE)");
     158    trans = evalAndLog("trans = db.transaction('StoreWithLongKeyPath', 'readwrite')");
    159159    trans.onabort = unexpectedAbortCallback;
    160160    trans.oncomplete = finishJSTest;
  • trunk/LayoutTests/storage/indexeddb/resources/objectstore-basics.js

    r116051 r116337  
    150150function addData()
    151151{
    152     var transaction = evalAndLog("transaction = db.transaction(['storeName'], IDBTransaction.READ_WRITE)");
     152    var transaction = evalAndLog("transaction = db.transaction(['storeName'], 'readwrite')");
    153153    transaction.onabort = unexpectedAbortCallback;
    154154    self.store = evalAndLog("store = transaction.objectStore('storeName')");
     
    201201    evalAndLog("event.preventDefault()");
    202202
    203     transaction = evalAndLog("db.transaction(['storeName'], IDBTransaction.READ_WRITE)");
     203    transaction = evalAndLog("db.transaction(['storeName'], 'readwrite')");
    204204    transaction.onabort = unexpectedErrorCallback;
    205205    var store = evalAndLog("store = transaction.objectStore('storeName')");
     
    208208    evalAndExpectException("store.add({x: 'othervalue'}, null)", "IDBDatabaseException.DATA_ERR");
    209209
    210     transaction = evalAndLog("db.transaction(['storeName'], IDBTransaction.READ_WRITE)");
     210    transaction = evalAndLog("db.transaction(['storeName'], 'readwrite')");
    211211    transaction.onabort = unexpectedErrorCallback;
    212212    var store = evalAndLog("store = transaction.objectStore('storeName')");
     
    214214    evalAndExpectException("store.add({x: null}, 'validkey')", "IDBDatabaseException.DATA_ERR");
    215215
    216     transaction = evalAndLog("db.transaction(['storeName'], IDBTransaction.READ_WRITE)");
     216    transaction = evalAndLog("db.transaction(['storeName'], 'readwrite')");
    217217    transaction.onabort = unexpectedErrorCallback;
    218218    var store = evalAndLog("store = transaction.objectStore('storeName')");
  • trunk/LayoutTests/storage/indexeddb/resources/objectstore-count.js

    r116051 r116337  
    4242    debug("");
    4343    debug("verifying count without range");
    44     trans = evalAndLog("trans = db.transaction('storeName', IDBTransaction.READ_ONLY)");
     44    trans = evalAndLog("trans = db.transaction('storeName', 'readonly')");
    4545    shouldBeTrue("trans != null");
    4646    trans.onabort = unexpectedAbortCallback;
     
    6363    debug("");
    6464    debug("verifying count with range");
    65     trans = evalAndLog("trans = db.transaction('storeName', IDBTransaction.READ_ONLY)");
     65    trans = evalAndLog("trans = db.transaction('storeName', 'readonly')");
    6666    shouldBeTrue("trans != null");
    6767    trans.onabort = unexpectedAbortCallback;
     
    106106    debug("");
    107107    debug("verifying count with key");
    108     trans = evalAndLog("trans = db.transaction('storeName', IDBTransaction.READ_ONLY)");
     108    trans = evalAndLog("trans = db.transaction('storeName', 'readonly')");
    109109    shouldBeTrue("trans != null");
    110110    trans.onabort = unexpectedAbortCallback;
  • trunk/LayoutTests/storage/indexeddb/resources/objectstore-cursor.js

    r116051 r116337  
    152152        keyRange = IDBKeyRange.upperBound(testData[upper], upperIsOpen);
    153153
    154     var request = objectStore.openCursor(keyRange, ascending ? IDBCursor.NEXT : IDBCursor.PREV);
     154    var request = objectStore.openCursor(keyRange, ascending ? 'next' : 'prev');
    155155    request.onsuccess = cursorIteration;
    156156    request.onerror = unexpectedErrorCallback;
     
    218218    debug(str);
    219219
    220     var request = objectStore.openCursor(null, ascending ? IDBCursor.NEXT : IDBCursor.PREV);
     220    var request = objectStore.openCursor(null, ascending ? 'next' : 'prev');
    221221    request.onsuccess = cursorIteration;
    222222    request.onerror = unexpectedErrorCallback;
  • trunk/LayoutTests/storage/indexeddb/resources/open-cursor.js

    r116051 r116337  
    2828    // FIXME: check that we can iterate the cursor.
    2929    cursor = event.target.result;
    30     shouldBe("cursor.direction", "0");
     30    shouldBe("cursor.direction", "'next'");
    3131    shouldBe("cursor.key", "'myKey'");
    3232    shouldBe("cursor.value", "'myValue'");
     
    6868    // FIXME: check that we can iterate the cursor.
    6969    cursor = event.target.result;
    70     shouldBe("cursor.direction", "0");
     70    shouldBe("cursor.direction", "'next'");
    7171    shouldBe("cursor.key", "'myKey'");
    7272    shouldBe("cursor.value", "'myValue'");
  • trunk/LayoutTests/storage/indexeddb/resources/open-during-transaction.js

    r116051 r116337  
    3636    debug("starting transaction");
    3737    evalAndLog("state = 'starting'");
    38     evalAndLog("trans = dbc1.transaction('storeName', IDBTransaction.READ_WRITE)");
     38    evalAndLog("trans = dbc1.transaction('storeName', 'readwrite')");
    3939    evalAndLog("trans.objectStore('storeName').put('value', 'key')");
    4040    trans.onabort = unexpectedAbortCallback;
  • trunk/LayoutTests/storage/indexeddb/resources/opencursor-key.js

    r116051 r116337  
    8383{
    8484    debug("testObjectStore()");
    85     evalAndLog("trans = db.transaction(objectStoreName, IDBTransaction.READ_WRITE)");
     85    evalAndLog("trans = db.transaction(objectStoreName, 'readwrite')");
    8686    trans.onabort = unexpectedAbortCallback;
    8787    objectStore = evalAndLog("objectStore = trans.objectStore(objectStoreName)");
     
    110110function testIndex()
    111111{
    112     evalAndLog("trans = db.transaction(objectStoreName, IDBTransaction.READ_WRITE)");
     112    evalAndLog("trans = db.transaction(objectStoreName, 'readwrite')");
    113113    objectStore = evalAndLog("objectStore = trans.objectStore(objectStoreName)");
    114114    index = evalAndLog("index = objectStore.index('weight')");
     
    150150function testIndexWithKey()
    151151{
    152     evalAndLog("trans = db.transaction(objectStoreName, IDBTransaction.READ_WRITE)");
     152    evalAndLog("trans = db.transaction(objectStoreName, 'readwrite')");
    153153    objectStore = evalAndLog("objectStore = trans.objectStore(objectStoreName)");
    154154    index = evalAndLog("index = objectStore.index('weight')");
  • trunk/LayoutTests/storage/indexeddb/resources/prefetch-bugfix-108071.js

    r116051 r116337  
    6363    debug("iterateAndDeleteFirstElement():");
    6464
    65     evalAndLog("trans = db.transaction(['store'], IDBTransaction.READ_WRITE)");
     65    evalAndLog("trans = db.transaction(['store'], 'readwrite')");
    6666    trans.onabort = transactionAborted;
    6767    trans.oncomplete = unexpectedCompleteCallback;
  • trunk/LayoutTests/storage/indexeddb/resources/request-event-propagation.js

    r116051 r116337  
    4141{
    4242    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')");
    4444    evalAndLog("trans.onabort = transactionAborted");
    4545    evalAndLog("trans.oncomplete = unexpectedCompleteCallback");
     
    6363    debug("");
    6464    debug("Verifing error");
    65     trans = evalAndLog("trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)");
     65    trans = evalAndLog("trans = db.transaction(['storeName'], 'readwrite')");
    6666    evalAndLog("trans.onabort = transactionAborted2");
    6767    evalAndLog("trans.oncomplete = unexpectedAbortCallback");
     
    166166    debug("");
    167167    debug("Verifing success.");
    168     trans = evalAndLog("trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)");
     168    trans = evalAndLog("trans = db.transaction(['storeName'], 'readwrite')");
    169169    evalAndLog("trans.oncomplete = transactionComplete");
    170170    evalAndLog("trans.onabort = unexpectedAbortCallback");
  • trunk/LayoutTests/storage/indexeddb/resources/set_version_blocked.js

    r116051 r116337  
    4141    blocked_event = event;
    4242    shouldBeEqualToString("blocked_event.version", "version 1");
    43     shouldEvaluateTo("blocked_event.target.readyState", 1);
     43    shouldEvaluateTo("blocked_event.target.readyState", "'pending'");
    4444    evalAndLog("connections[1].close()");
    4545}
  • trunk/LayoutTests/storage/indexeddb/resources/transaction-abort.js

    r116051 r116337  
    4141function startTest()
    4242{
    43     trans = evalAndLog("trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)");
     43    trans = evalAndLog("trans = db.transaction(['storeName'], 'readwrite')");
    4444    evalAndLog("trans.onabort = transactionAborted");
    4545    evalAndLog("trans.oncomplete = unexpectedCompleteCallback");
  • trunk/LayoutTests/storage/indexeddb/resources/transaction-after-close.js

    r116051 r116337  
    4444{
    4545    debug("running first transaction")
    46     currentTransaction = evalAndLog("currentTransaction = db.transaction(['store'], IDBTransaction.READ_WRITE)");
     46    currentTransaction = evalAndLog("currentTransaction = db.transaction(['store'], 'readwrite')");
    4747    currentTransaction.onabort = unexpectedAbortCallback;
    4848    currentTransaction.oncomplete = firstTransactionComplete;
     
    5555{
    5656    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");
    5858
    5959    debug("")
     
    6666function onSecondOpen() {
    6767    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')");
    6969    store = currentTransaction.objectStore('store');
    7070    request = evalAndLog("request = store.put('1', '2')");
  • trunk/LayoutTests/storage/indexeddb/resources/transaction-basics.js

    r116051 r116337  
    280280    debug("");
    281281    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");
    283283    finishJSTest();
    284284}
  • trunk/LayoutTests/storage/indexeddb/resources/transaction-event-propagation.js

    r116051 r116337  
    4040{
    4141    debug("Verifing abort");
    42     trans = evalAndLog("trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)");
     42    trans = evalAndLog("trans = db.transaction(['storeName'], 'readwrite')");
    4343    evalAndLog("trans.onabort = abortFiredCallback");
    4444    evalAndLog("trans.oncomplete = unexpectedAbortCallback");
     
    9090    debug("");
    9191    debug("Verifing success.");
    92     trans = evalAndLog("trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)");
     92    trans = evalAndLog("trans = db.transaction(['storeName'], 'readwrite')");
    9393    evalAndLog("trans.oncomplete = completeFiredCallback");
    9494    evalAndLog("trans.onabort = unexpectedAbortCallback");
  • trunk/LayoutTests/storage/indexeddb/resources/transaction-rollback.js

    r116051 r116337  
    4040    debug("setVersionComplete():");
    4141
    42     self.transaction = evalAndLog("transaction = db.transaction(['myObjectStore'], IDBTransaction.READ_WRITE)");
     42    self.transaction = evalAndLog("transaction = db.transaction(['myObjectStore'], 'readwrite')");
    4343    transaction.onabort = abortCallback;
    4444    transaction.oncomplete = unexpectedCompleteCallback;
     
    7373    debug('Transaction was aborted.');
    7474
    75     self.transaction = evalAndLog("transaction = db.transaction(['myObjectStore'], IDBTransaction.READ)");
     75    self.transaction = evalAndLog("transaction = db.transaction(['myObjectStore'], 'readonly')");
    7676    self.store = evalAndLog("store = transaction.objectStore('myObjectStore')");
    7777    request = evalAndLog("store.get('rollbackKey123')");
  • trunk/LayoutTests/storage/indexeddb/set_version_blocked-expected.txt

    r116051 r116337  
    1111seen_blocked_event = true
    1212PASS blocked_event.version is "version 1"
    13 PASS blocked_event.target.readyState is 1
     13PASS blocked_event.target.readyState is 'pending'
    1414connections[1].close()
    1515in setVersion.onsuccess
  • trunk/LayoutTests/storage/indexeddb/structured-clone-expected.txt

    r116051 r116337  
    1818
    1919Testing: undefined
    20 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     20transaction = db.transaction('storeName', 'readwrite')
    2121store = transaction.objectStore('storeName')
    2222store.put(value, 'key')
     
    2626
    2727Testing: null
    28 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     28transaction = db.transaction('storeName', 'readwrite')
    2929store = transaction.objectStore('storeName')
    3030store.put(value, 'key')
     
    3636
    3737Testing: true
    38 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     38transaction = db.transaction('storeName', 'readwrite')
    3939store = transaction.objectStore('storeName')
    4040store.put(value, 'key')
     
    4343
    4444Testing: false
    45 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     45transaction = db.transaction('storeName', 'readwrite')
    4646store = transaction.objectStore('storeName')
    4747store.put(value, 'key')
     
    5353
    5454Testing: NaN
    55 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     55transaction = db.transaction('storeName', 'readwrite')
    5656store = transaction.objectStore('storeName')
    5757store.put(value, 'key')
     
    6060
    6161Testing: -Infinity
    62 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     62transaction = db.transaction('storeName', 'readwrite')
    6363store = transaction.objectStore('storeName')
    6464store.put(value, 'key')
     
    6767
    6868Testing: -Number.MAX_VALUE
    69 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     69transaction = db.transaction('storeName', 'readwrite')
    7070store = transaction.objectStore('storeName')
    7171store.put(value, 'key')
     
    7474
    7575Testing: -Number.MIN_VALUE
    76 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     76transaction = db.transaction('storeName', 'readwrite')
    7777store = transaction.objectStore('storeName')
    7878store.put(value, 'key')
     
    8181
    8282Testing: -0
    83 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     83transaction = db.transaction('storeName', 'readwrite')
    8484store = transaction.objectStore('storeName')
    8585store.put(value, 'key')
     
    8888
    8989Testing: 0
    90 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     90transaction = db.transaction('storeName', 'readwrite')
    9191store = transaction.objectStore('storeName')
    9292store.put(value, 'key')
     
    9595
    9696Testing: Number.MIN_VALUE
    97 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     97transaction = db.transaction('storeName', 'readwrite')
    9898store = transaction.objectStore('storeName')
    9999store.put(value, 'key')
     
    102102
    103103Testing: Number.MAX_VALUE
    104 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     104transaction = db.transaction('storeName', 'readwrite')
    105105store = transaction.objectStore('storeName')
    106106store.put(value, 'key')
     
    109109
    110110Testing: Infinity
    111 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     111transaction = db.transaction('storeName', 'readwrite')
    112112store = transaction.objectStore('storeName')
    113113store.put(value, 'key')
     
    119119
    120120Testing: ''
    121 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     121transaction = db.transaction('storeName', 'readwrite')
    122122store = transaction.objectStore('storeName')
    123123store.put(value, 'key')
     
    126126
    127127Testing: 'this is a sample string'
    128 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     128transaction = db.transaction('storeName', 'readwrite')
    129129store = transaction.objectStore('storeName')
    130130store.put(value, 'key')
     
    133133
    134134Testing: 'null(\0)'
    135 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     135transaction = db.transaction('storeName', 'readwrite')
    136136store = transaction.objectStore('storeName')
    137137store.put(value, 'key')
     
    143143
    144144Testing: new Boolean(true)
    145 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     145transaction = db.transaction('storeName', 'readwrite')
    146146store = transaction.objectStore('storeName')
    147147store.put(value, 'key')
     
    154154
    155155Testing: new Boolean(false)
    156 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     156transaction = db.transaction('storeName', 'readwrite')
    157157store = transaction.objectStore('storeName')
    158158store.put(value, 'key')
     
    168168
    169169Testing: new Number(NaN)
    170 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     170transaction = db.transaction('storeName', 'readwrite')
    171171store = transaction.objectStore('storeName')
    172172store.put(value, 'key')
     
    179179
    180180Testing: new Number(-Infinity)
    181 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     181transaction = db.transaction('storeName', 'readwrite')
    182182store = transaction.objectStore('storeName')
    183183store.put(value, 'key')
     
    190190
    191191Testing: new Number(-Number.MAX_VALUE)
    192 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     192transaction = db.transaction('storeName', 'readwrite')
    193193store = transaction.objectStore('storeName')
    194194store.put(value, 'key')
     
    201201
    202202Testing: new Number(-Number.MIN_VALUE)
    203 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     203transaction = db.transaction('storeName', 'readwrite')
    204204store = transaction.objectStore('storeName')
    205205store.put(value, 'key')
     
    212212
    213213Testing: new Number(-0)
    214 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     214transaction = db.transaction('storeName', 'readwrite')
    215215store = transaction.objectStore('storeName')
    216216store.put(value, 'key')
     
    223223
    224224Testing: new Number(0)
    225 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     225transaction = db.transaction('storeName', 'readwrite')
    226226store = transaction.objectStore('storeName')
    227227store.put(value, 'key')
     
    234234
    235235Testing: new Number(Number.MIN_VALUE)
    236 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     236transaction = db.transaction('storeName', 'readwrite')
    237237store = transaction.objectStore('storeName')
    238238store.put(value, 'key')
     
    245245
    246246Testing: new Number(Number.MAX_VALUE)
    247 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     247transaction = db.transaction('storeName', 'readwrite')
    248248store = transaction.objectStore('storeName')
    249249store.put(value, 'key')
     
    256256
    257257Testing: new Number(Infinity)
    258 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     258transaction = db.transaction('storeName', 'readwrite')
    259259store = transaction.objectStore('storeName')
    260260store.put(value, 'key')
     
    270270
    271271Testing: new String()
    272 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     272transaction = db.transaction('storeName', 'readwrite')
    273273store = transaction.objectStore('storeName')
    274274store.put(value, 'key')
     
    281281
    282282Testing: new String('this is a sample string')
    283 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     283transaction = db.transaction('storeName', 'readwrite')
    284284store = transaction.objectStore('storeName')
    285285store.put(value, 'key')
     
    292292
    293293Testing: new String('null(\0)')
    294 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     294transaction = db.transaction('storeName', 'readwrite')
    295295store = transaction.objectStore('storeName')
    296296store.put(value, 'key')
     
    306306
    307307Testing: new Date(-1e13)
    308 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     308transaction = db.transaction('storeName', 'readwrite')
    309309store = transaction.objectStore('storeName')
    310310store.put(value, 'key')
     
    317317
    318318Testing: new Date(-1e12)
    319 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     319transaction = db.transaction('storeName', 'readwrite')
    320320store = transaction.objectStore('storeName')
    321321store.put(value, 'key')
     
    328328
    329329Testing: new Date(-1e9)
    330 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     330transaction = db.transaction('storeName', 'readwrite')
    331331store = transaction.objectStore('storeName')
    332332store.put(value, 'key')
     
    339339
    340340Testing: new Date(-1e6)
    341 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     341transaction = db.transaction('storeName', 'readwrite')
    342342store = transaction.objectStore('storeName')
    343343store.put(value, 'key')
     
    350350
    351351Testing: new Date(-1e3)
    352 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     352transaction = db.transaction('storeName', 'readwrite')
    353353store = transaction.objectStore('storeName')
    354354store.put(value, 'key')
     
    361361
    362362Testing: new Date(0)
    363 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     363transaction = db.transaction('storeName', 'readwrite')
    364364store = transaction.objectStore('storeName')
    365365store.put(value, 'key')
     
    372372
    373373Testing: new Date(1e3)
    374 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     374transaction = db.transaction('storeName', 'readwrite')
    375375store = transaction.objectStore('storeName')
    376376store.put(value, 'key')
     
    383383
    384384Testing: new Date(1e6)
    385 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     385transaction = db.transaction('storeName', 'readwrite')
    386386store = transaction.objectStore('storeName')
    387387store.put(value, 'key')
     
    394394
    395395Testing: new Date(1e9)
    396 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     396transaction = db.transaction('storeName', 'readwrite')
    397397store = transaction.objectStore('storeName')
    398398store.put(value, 'key')
     
    405405
    406406Testing: new Date(1e12)
    407 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     407transaction = db.transaction('storeName', 'readwrite')
    408408store = transaction.objectStore('storeName')
    409409store.put(value, 'key')
     
    416416
    417417Testing: new Date(1e13)
    418 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     418transaction = db.transaction('storeName', 'readwrite')
    419419store = transaction.objectStore('storeName')
    420420store.put(value, 'key')
     
    430430
    431431Testing RegExp: new RegExp()
    432 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     432transaction = db.transaction('storeName', 'readwrite')
    433433store = transaction.objectStore('storeName')
    434434store.put(value, 'key')
     
    439439
    440440Testing RegExp: /abc/
    441 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     441transaction = db.transaction('storeName', 'readwrite')
    442442store = transaction.objectStore('storeName')
    443443store.put(value, 'key')
     
    448448
    449449Testing RegExp: /abc/g
    450 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     450transaction = db.transaction('storeName', 'readwrite')
    451451store = transaction.objectStore('storeName')
    452452store.put(value, 'key')
     
    457457
    458458Testing RegExp: /abc/i
    459 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     459transaction = db.transaction('storeName', 'readwrite')
    460460store = transaction.objectStore('storeName')
    461461store.put(value, 'key')
     
    466466
    467467Testing RegExp: /abc/gi
    468 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     468transaction = db.transaction('storeName', 'readwrite')
    469469store = transaction.objectStore('storeName')
    470470store.put(value, 'key')
     
    475475
    476476Testing RegExp: /abc/m
    477 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     477transaction = db.transaction('storeName', 'readwrite')
    478478store = transaction.objectStore('storeName')
    479479store.put(value, 'key')
     
    484484
    485485Testing RegExp: /abc/mg
    486 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     486transaction = db.transaction('storeName', 'readwrite')
    487487store = transaction.objectStore('storeName')
    488488store.put(value, 'key')
     
    493493
    494494Testing RegExp: /abc/mi
    495 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     495transaction = db.transaction('storeName', 'readwrite')
    496496store = transaction.objectStore('storeName')
    497497store.put(value, 'key')
     
    502502
    503503Testing RegExp: /abc/mgi
    504 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     504transaction = db.transaction('storeName', 'readwrite')
    505505store = transaction.objectStore('storeName')
    506506store.put(value, 'key')
     
    516516canvas.height = 8
    517517test_data = canvas.getContext('2d').getImageData(0, 0, 8, 8)
    518 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     518transaction = db.transaction('storeName', 'readwrite')
    519519store = transaction.objectStore('storeName')
    520520store.put(value, 'key')
     
    545545test_data[21] = 456
    546546test_data[30] = null
    547 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     547transaction = db.transaction('storeName', 'readwrite')
    548548store = transaction.objectStore('storeName')
    549549store.put(value, 'key')
     
    568568test_data['bar'] = 456
    569569test_data[''] = null
    570 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     570transaction = db.transaction('storeName', 'readwrite')
    571571store = transaction.objectStore('storeName')
    572572store.put(value, 'key')
     
    585585Test types that can't be cloned:
    586586
    587 transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)
     587transaction = db.transaction('storeName', 'readwrite')
    588588store = transaction.objectStore('storeName')
    589589
  • trunk/LayoutTests/storage/indexeddb/structured-clone.html

    r116051 r116337  
    103103    // One transaction per test, since some tests require asynchronous
    104104    // 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')");
    106106    transaction.onerror = unexpectedErrorCallback;
    107107    transaction.onabort = unexpectedAbortCallback;
     
    512512    debug("");
    513513
    514     evalAndLog("transaction = db.transaction('storeName', IDBTransaction.READ_WRITE)");
     514    evalAndLog("transaction = db.transaction('storeName', 'readwrite')");
    515515    evalAndLog("store = transaction.objectStore('storeName')");
    516516    transaction.onerror = unexpectedErrorCallback;
  • trunk/LayoutTests/storage/indexeddb/transaction-abort-expected.txt

    r116051 r116337  
    1616store = db.createObjectStore('storeName', null)
    1717store.add({x: 'value', y: 'zzz'}, 'key')
    18 trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)
     18trans = db.transaction(['storeName'], 'readwrite')
    1919trans.onabort = transactionAborted
    2020trans.oncomplete = unexpectedCompleteCallback
  • trunk/LayoutTests/storage/indexeddb/transaction-abort-with-js-recursion-cross-frame-expected.txt

    r116051 r116337  
    99db = event.target.result
    1010db.setVersion('new version')
    11 pendingTransaction = db.transaction(['objectStore'], IDBTransaction.READ_WRITE)
     11pendingTransaction = db.transaction(['objectStore'], 'readwrite')
    1212Start re-entrant JS
    13 transaction = db.transaction(['objectStore'], IDBTransaction.READ_WRITE)
     13transaction = db.transaction(['objectStore'], 'readwrite')
    1414End re-entrant JS
    1515store = pendingTransaction.objectStore('objectStore')
  • trunk/LayoutTests/storage/indexeddb/transaction-abort-with-js-recursion-cross-frame.html

    r116051 r116337  
    3939function click() {
    4040    body.onclick = test;
    41     var pendingTransaction = evalAndLog("pendingTransaction = db.transaction(['objectStore'], IDBTransaction.READ_WRITE)");
     41    var pendingTransaction = evalAndLog("pendingTransaction = db.transaction(['objectStore'], 'readwrite')");
    4242    pendingTransaction.onsuccess = unexpectedErrorCallback;
    4343    pendingTransaction.onerror = unexpectedErrorCallback;
     
    5454{
    5555    debug("Start re-entrant JS");
    56     transaction = evalAndLog("transaction = db.transaction(['objectStore'], IDBTransaction.READ_WRITE)");
     56    transaction = evalAndLog("transaction = db.transaction(['objectStore'], 'readwrite')");
    5757    debug("End re-entrant JS");
    5858}
  • trunk/LayoutTests/storage/indexeddb/transaction-abort-with-js-recursion-expected.txt

    r116051 r116337  
    99db = event.target.result
    1010db.setVersion('new version')
    11 pendingTransaction = db.transaction(['objectStore'], IDBTransaction.READ_WRITE)
     11pendingTransaction = db.transaction(['objectStore'], 'readwrite')
    1212Start re-entrant JS
    13 transaction = db.transaction(['objectStore'], IDBTransaction.READ_WRITE)
     13transaction = db.transaction(['objectStore'], 'readwrite')
    1414End re-entrant JS
    1515store = pendingTransaction.objectStore('objectStore')
  • trunk/LayoutTests/storage/indexeddb/transaction-abort-with-js-recursion.html

    r116051 r116337  
    3838{
    3939    body.onclick = test;
    40     var pendingTransaction = evalAndLog("pendingTransaction = db.transaction(['objectStore'], IDBTransaction.READ_WRITE)");
     40    var pendingTransaction = evalAndLog("pendingTransaction = db.transaction(['objectStore'], 'readwrite')");
    4141    pendingTransaction.onsuccess = unexpectedErrorCallback;
    4242    pendingTransaction.onerror = unexpectedErrorCallback;
     
    5353{
    5454    debug("Start re-entrant JS");
    55     transaction = evalAndLog("transaction = db.transaction(['objectStore'], IDBTransaction.READ_WRITE)");
     55    transaction = evalAndLog("transaction = db.transaction(['objectStore'], 'readwrite')");
    5656    debug("End re-entrant JS");
    5757}
  • trunk/LayoutTests/storage/indexeddb/transaction-after-close-expected.txt

    r116051 r116337  
    1515PASS Put success
    1616running first transaction
    17 currentTransaction = db.transaction(['store'], IDBTransaction.READ_WRITE)
     17currentTransaction = db.transaction(['store'], 'readwrite')
    1818objectStore.put('a', 'b')
    1919db.close()
    20 Expecting exception from db.transaction(['store'], IDBTransaction.READ_WRITE)
     20Expecting exception from db.transaction(['store'], 'readwrite')
    2121PASS Exception was thrown.
    2222PASS code is IDBDatabaseException.NOT_ALLOWED_ERR
     
    2525indexedDB.open('transaction-after-close')
    2626second_db = event.target.result
    27 currentTransaction = second_db.transaction(['store'], IDBTransaction.READ_WRITE)
     27currentTransaction = second_db.transaction(['store'], 'readwrite')
    2828request = store.put('1', '2')
    2929PASS final put success
  • trunk/LayoutTests/storage/indexeddb/transaction-basics-expected.txt

    r116051 r116337  
    171171
    172172Verify that specifying an invalid mode raises an exception
    173 Expecting exception from db.transaction(['storeName'], 3)
     173Expecting exception from db.transaction(['storeName'], 'lsakjdf')
    174174PASS Exception was thrown.
    175 PASS code is IDBDatabaseException.NON_TRANSIENT_ERR
     175PASS code is IDBDatabaseException.NOT_ALLOWED_ERR
    176176PASS successfullyParsed is true
    177177
  • trunk/LayoutTests/storage/indexeddb/transaction-event-propagation-expected.txt

    r116051 r116337  
    1616store.add({x: 'value', y: 'zzz'}, 'key')
    1717Verifing abort
    18 trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)
     18trans = db.transaction(['storeName'], 'readwrite')
    1919trans.onabort = abortFiredCallback
    2020trans.oncomplete = unexpectedAbortCallback
     
    4848
    4949Verifing success.
    50 trans = db.transaction(['storeName'], IDBTransaction.READ_WRITE)
     50trans = db.transaction(['storeName'], 'readwrite')
    5151trans.oncomplete = completeFiredCallback
    5252trans.onabort = unexpectedAbortCallback
  • trunk/LayoutTests/storage/indexeddb/transaction-rollback-expected.txt

    r116051 r116337  
    1616PASS db.objectStoreNames.length is 1
    1717setVersionComplete():
    18 transaction = db.transaction(['myObjectStore'], IDBTransaction.READ_WRITE)
     18transaction = db.transaction(['myObjectStore'], 'readwrite')
    1919store = transaction.objectStore('myObjectStore')
    2020store.add('rollbackValue', 'rollbackKey123')
     
    2626abortCallback():
    2727Transaction was aborted.
    28 transaction = db.transaction(['myObjectStore'], IDBTransaction.READ)
     28transaction = db.transaction(['myObjectStore'], 'readonly')
    2929store = transaction.objectStore('myObjectStore')
    3030store.get('rollbackKey123')
  • trunk/LayoutTests/storage/indexeddb/tutorial.html

    r116051 r116337  
    217217    //
    218218    // 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,
    220220    // 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');
    222222    currentTransaction.oncomplete = unexpectedComplete;
    223223    currentTransaction.onabort = onTransactionAborted;
     
    267267{
    268268    // 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');
    270270    currentTransaction.onabort = unexpectedAbort;
    271271
     
    305305    // It simply takes in a key and returns a request whose result will be the value. Note that here
    306306    // 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');
    308308    currentTransaction.onabort = unexpectedAbort;
    309309
     
    332332    // we'll get the objects for ids 2 and 3. You can also create cursors that are only right or only
    333333    // 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 only
     334    // which can be 'next' (default) for the cursor to move forward, NEXT_NO_DUPLICATE to only
    335335    // return unique entires (only applies to indexes with unique set to false), PREV to move backwards,
    336336    // and PREV_NO_DUPLICATE.
    337337    var keyRange = IDBKeyRange.bound(1, 3, true, false);
    338     var request = people.openCursor(keyRange, IDBCursor.NEXT);
     338    var request = people.openCursor(keyRange, 'next');
    339339    request.onsuccess = onObjectStoreCursor;
    340340    request.onerror = unexpectedError;
     
    389389    // the onsuccess conditions.
    390390    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');
    393393    lname.openCursor(IDBKeyRange.upperBound("ZZZZ"));
    394     lname.openCursor(IDBKeyRange.only("Doe"), IDBCursor.PREV);
     394    lname.openCursor(IDBKeyRange.only("Doe"), 'prev');
    395395    lname.openCursor();
    396396    lname.openKeyCursor();
  • trunk/Source/WebCore/ChangeLog

    r116334 r116337  
     12012-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
    1672012-05-07  W. James MacLean  <wjmaclean@chromium.org>
    268
  • trunk/Source/WebCore/Modules/indexeddb/IDBCursor.cpp

    r116051 r116337  
    4646}
    4747
     48const AtomicString& IDBCursor::directionNext()
     49{
     50    DEFINE_STATIC_LOCAL(AtomicString, next, ("next"));
     51    return next;
     52}
     53
     54const AtomicString& IDBCursor::directionNextUnique()
     55{
     56    DEFINE_STATIC_LOCAL(AtomicString, nextunique, ("nextunique"));
     57    return nextunique;
     58}
     59
     60const AtomicString& IDBCursor::directionPrev()
     61{
     62    DEFINE_STATIC_LOCAL(AtomicString, prev, ("prev"));
     63    return prev;
     64}
     65
     66const AtomicString& IDBCursor::directionPrevUnique()
     67{
     68    DEFINE_STATIC_LOCAL(AtomicString, prevunique, ("prevunique"));
     69    return prevunique;
     70}
     71
     72
    4873IDBCursor::IDBCursor(PassRefPtr<IDBCursorBackendInterface> backend, IDBRequest* request, IDBAny* source, IDBTransaction* transaction)
    4974    : m_backend(backend)
     
    6489}
    6590
    66 unsigned short IDBCursor::direction() const
     91const String& IDBCursor::direction() const
    6792{
    6893    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;
    7098}
    7199
     
    209237}
    210238
     239unsigned 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
     255const 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
    211276} // namespace WebCore
    212277
  • trunk/Source/WebCore/Modules/indexeddb/IDBCursor.h

    r116051 r116337  
    5454        PREV_NO_DUPLICATE = 3,
    5555    };
     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
    5665    static PassRefPtr<IDBCursor> create(PassRefPtr<IDBCursorBackendInterface>, IDBRequest*, IDBAny* source, IDBTransaction*);
    5766    virtual ~IDBCursor();
     
    6170
    6271    // Implement the IDL
    63     unsigned short direction() const;
     72    const String& direction() const;
    6473    PassRefPtr<IDBKey> key() const;
    6574    PassRefPtr<IDBKey> primaryKey() const;
  • trunk/Source/WebCore/Modules/indexeddb/IDBCursor.idl

    r116051 r116337  
    2929        Conditional=INDEXED_DATABASE,
    3030    ] IDBCursor {
     31        // FIXME: Eventually remove legacy enum constants, see https://bugs.webkit.org/show_bug.cgi?id=85315
    3132        const unsigned short NEXT = 0;
    3233        const unsigned short NEXT_NO_DUPLICATE = 1;
     
    3435        const unsigned short PREV_NO_DUPLICATE = 3;
    3536
    36         readonly attribute unsigned short direction;
     37        readonly attribute DOMString direction;
    3738        readonly attribute IDBKey key;
    3839        readonly attribute IDBKey primaryKey;
  • trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp

    r116051 r116337  
    138138}
    139139
    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)
     140PassRefPtr<IDBTransaction> IDBDatabase::transaction(ScriptExecutionContext* context, PassRefPtr<DOMStringList> prpStoreNames, const String& modeString, ExceptionCode& ec)
    148141{
    149142    RefPtr<DOMStringList> storeNames = prpStoreNames;
     
    153146    }
    154147
    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
    159152    if (m_closePending) {
    160153        ec = IDBDatabaseException::NOT_ALLOWED_ERR;
     
    175168    return transaction.release();
    176169}
     170
     171PassRefPtr<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
     178PassRefPtr<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
     185PassRefPtr<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
    177196
    178197void IDBDatabase::close()
  • trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.h

    r116051 r116337  
    6565    PassRefPtr<IDBObjectStore> createObjectStore(const String& name, ExceptionCode& ec) { return createObjectStore(name, Dictionary(), ec); }
    6666    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&);
    6769    PassRefPtr<IDBTransaction> transaction(ScriptExecutionContext*, PassRefPtr<DOMStringList>, unsigned short mode, ExceptionCode&);
    6870    PassRefPtr<IDBTransaction> transaction(ScriptExecutionContext*, const String&, unsigned short mode, ExceptionCode&);
  • trunk/Source/WebCore/Modules/indexeddb/IDBDatabase.idl

    r116051 r116337  
    4646        [CallWith=ScriptExecutionContext] IDBVersionChangeRequest setVersion(in DOMString version)
    4747            raises (IDBDatabaseException);
    48         [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMStringList storeNames, in [Optional=DefaultIsUndefined] unsigned short mode)
     48        [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMStringList storeNames, in [Optional=DefaultIsNullString] DOMString mode)
    4949            raises (IDBDatabaseException);
    50         [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString[] storeNames, in [Optional=DefaultIsUndefined] unsigned short mode)
     50        [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString[] storeNames, in [Optional=DefaultIsNullString] DOMString mode)
    5151            raises (IDBDatabaseException);
    52         [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString storeName, in [Optional=DefaultIsUndefined] unsigned short mode)
     52        [CallWith=ScriptExecutionContext] IDBTransaction transaction(in DOMString storeName, in [Optional=DefaultIsNullString] DOMString mode)
    5353            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
    5463        void close();
    5564
  • trunk/Source/WebCore/Modules/indexeddb/IDBIndex.cpp

    r116051 r116337  
    5757}
    5858
    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     }
     59PassRefPtr<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;
    6765
    6866    RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
     
    7674}
    7775
     76PassRefPtr<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
     87PassRefPtr<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
    7896PassRefPtr<IDBRequest> IDBIndex::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKey> key, unsigned short direction, ExceptionCode& ec)
    7997{
    80     IDB_TRACE("IDBObjectStore::openCursor");
     98    IDB_TRACE("IDBIndex::openCursor");
    8199    RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(key, ec);
    82100    if (ec)
     
    106124}
    107125
    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     }
     126PassRefPtr<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;
    116133
    117134    RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
     
    125142}
    126143
     144PassRefPtr<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
     155PassRefPtr<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
    127164PassRefPtr<IDBRequest> IDBIndex::openKeyCursor(ScriptExecutionContext* context, PassRefPtr<IDBKey> key, unsigned short direction, ExceptionCode& ec)
    128165{
    129     IDB_TRACE("IDBObjectStore::openKeyCursor");
     166    IDB_TRACE("IDBIndex::openKeyCursor");
    130167    RefPtr<IDBKeyRange> keyRange = IDBKeyRange::only(key, ec);
    131168    if (ec)
  • trunk/Source/WebCore/Modules/indexeddb/IDBIndex.h

    r116051 r116337  
    5757    // FIXME: Try to modify the code generator so this is unneeded.
    5858    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&);
    6163    PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, unsigned short direction, ExceptionCode&);
    6264    PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKey>, unsigned short direction, ExceptionCode&);
     
    6668
    6769    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&);
    7074    PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, unsigned short direction, ExceptionCode&);
    7175    PassRefPtr<IDBRequest> openKeyCursor(ScriptExecutionContext*, PassRefPtr<IDBKey>, unsigned short direction, ExceptionCode&);
  • trunk/Source/WebCore/Modules/indexeddb/IDBIndex.idl

    r116051 r116337  
    3535        readonly attribute boolean multiEntry;
    3636
     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.
    3749        [CallWith=ScriptExecutionContext] IDBRequest openCursor(in [Optional] IDBKeyRange range, in [Optional] unsigned short direction)
    3850            raises (IDBDatabaseException);
     
    4355        [CallWith=ScriptExecutionContext] IDBRequest openKeyCursor(in IDBKey key, in [Optional] unsigned short direction)
    4456            raises (IDBDatabaseException);
     57       
    4558        [CallWith=ScriptExecutionContext] IDBRequest get(in IDBKeyRange key)
    4659            raises (IDBDatabaseException);
  • trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp

    r116051 r116337  
    256256}
    257257
    258 PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> range, unsigned short direction, ExceptionCode& ec)
     258PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> range, const String& directionString, ExceptionCode& ec)
    259259{
    260260    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;
    266264
    267265    RefPtr<IDBRequest> request = IDBRequest::create(context, IDBAny::create(this), m_transaction.get());
     
    275273}
    276274
    277 PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKey> key, unsigned short direction, ExceptionCode& ec)
     275PassRefPtr<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
     286PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKey> key, const String& direction, ExceptionCode& ec)
    278287{
    279288    IDB_TRACE("IDBObjectStore::openCursor");
     
    284293}
    285294
     295PassRefPtr<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
    286304PassRefPtr<IDBRequest> IDBObjectStore::count(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> range, ExceptionCode& ec)
    287305{
  • trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.h

    r116051 r116337  
    6666    PassRefPtr<IDBIndex> createIndex(const String& name, const String& keyPath, ExceptionCode& ec) { return createIndex(name, keyPath, Dictionary(), ec); }
    6767    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); }
    7070
    7171    PassRefPtr<IDBRequest> get(ScriptExecutionContext*, PassRefPtr<IDBKey>, ExceptionCode&);
     
    8181    void deleteIndex(const String& name, ExceptionCode&);
    8282
     83    PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, const String& direction, ExceptionCode&);
     84    PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKey>, const String& direction, ExceptionCode&);
    8385    PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKeyRange>, unsigned short direction, ExceptionCode&);
    8486    PassRefPtr<IDBRequest> openCursor(ScriptExecutionContext*, PassRefPtr<IDBKey>, unsigned short direction, ExceptionCode&);
  • trunk/Source/WebCore/Modules/indexeddb/IDBObjectStore.idl

    r116051 r116337  
    4848        [CallWith=ScriptExecutionContext] IDBRequest get(in IDBKey key)
    4949            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.
    5056        [CallWith=ScriptExecutionContext] IDBRequest openCursor(in [Optional] IDBKeyRange range, in [Optional] unsigned short direction)
    5157            raises (IDBDatabaseException);
    5258        [CallWith=ScriptExecutionContext] IDBRequest openCursor(in IDBKey key, in [Optional] unsigned short direction)
    5359            raises (IDBDatabaseException);
     60
    5461        IDBIndex createIndex(in DOMString name, in DOMString keyPath, in [Optional] Dictionary options)
    5562            raises (IDBDatabaseException);
  • trunk/Source/WebCore/Modules/indexeddb/IDBRequest.cpp

    r116051 r116337  
    5757    , m_source(source)
    5858    , m_transaction(transaction)
    59     , m_readyState(LOADING)
     59    , m_readyState(PENDING)
    6060    , m_requestFinished(false)
    6161    , m_cursorFinished(false)
     
    114114}
    115115
    116 unsigned short IDBRequest::readyState() const
    117 {
    118     ASSERT(m_readyState == LOADING || m_readyState == DONE);
    119     return m_readyState;
     116const 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;
    120126}
    121127
    122128void IDBRequest::markEarlyDeath()
    123129{
    124     ASSERT(m_readyState == LOADING);
     130    ASSERT(m_readyState == PENDING);
    125131    m_readyState = EarlyDeath;
    126132}
     
    134140        return false;
    135141
    136     m_readyState = LOADING;
     142    m_readyState = PENDING;
    137143    m_result.clear();
    138144    m_errorCode = 0;
     
    154160        return;
    155161
    156     if (m_readyState != LOADING) {
     162    if (m_readyState != PENDING) {
    157163        ASSERT(m_readyState == DONE);
    158164        return;
     
    187193{
    188194    m_cursorFinished = true;
    189     if (m_readyState != LOADING)
     195    if (m_readyState != PENDING)
    190196        m_requestFinished = true;
    191197}
     
    269275
    270276    ASSERT(m_source->type() == IDBAny::IDBDatabaseType);
    271     ASSERT(m_transaction->mode() == IDBTransaction::VERSION_CHANGE);
     277    ASSERT(m_transaction->mode() == IDBTransaction::modeVersionChange());
    272278    m_source->idbDatabase()->setVersionChangeTransaction(frontend.get());
    273279
     
    312318
    313319    m_contextStopped = true;
    314     if (m_readyState == LOADING)
     320    if (m_readyState == PENDING)
    315321        markEarlyDeath();
    316322}
  • trunk/Source/WebCore/Modules/indexeddb/IDBRequest.h

    r116051 r116337  
    6060    // Defined in the IDL
    6161    enum ReadyState {
    62         LOADING = 1,
     62        PENDING = 1,
    6363        DONE = 2,
    6464        EarlyDeath = 3
    6565    };
    66     unsigned short readyState() const;
     66
     67    const String& readyState() const;
    6768
    6869    DEFINE_ATTRIBUTE_EVENT_LISTENER(success);
  • trunk/Source/WebCore/Modules/indexeddb/IDBRequest.idl

    r116051 r116337  
    4545
    4646        // States
    47         const unsigned short LOADING = 1;
    48         const unsigned short DONE = 2;
    49         readonly attribute unsigned short readyState;
     47        readonly attribute DOMString readyState;
    5048
    5149        // Events
  • trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp

    r116051 r116337  
    4949}
    5050
     51const AtomicString& IDBTransaction::modeReadOnly()
     52{
     53    DEFINE_STATIC_LOCAL(AtomicString, readonly, ("readonly"));
     54    return readonly;
     55}
     56
     57const AtomicString& IDBTransaction::modeReadWrite()
     58{
     59    DEFINE_STATIC_LOCAL(AtomicString, readwrite, ("readwrite"));
     60    return readwrite;
     61}
     62
     63const AtomicString& IDBTransaction::modeVersionChange()
     64{
     65    DEFINE_STATIC_LOCAL(AtomicString, versionchange, ("versionchange"));
     66    return versionchange;
     67}
     68
     69const AtomicString& IDBTransaction::modeReadOnlyLegacy()
     70{
     71    DEFINE_STATIC_LOCAL(AtomicString, readonly, ("0"));
     72    return readonly;
     73}
     74
     75const AtomicString& IDBTransaction::modeReadWriteLegacy()
     76{
     77    DEFINE_STATIC_LOCAL(AtomicString, readwrite, ("1"));
     78    return readwrite;
     79}
     80
     81
    5182IDBTransaction::IDBTransaction(ScriptExecutionContext* context, PassRefPtr<IDBTransactionBackendInterface> backend, IDBDatabase* db)
    5283    : ActiveDOMObject(context, this)
     
    75106}
    76107
    77 unsigned short IDBTransaction::mode() const
    78 {
    79     return m_mode;
     108const String& IDBTransaction::mode() const
     109{
     110    ExceptionCode ec = 0;
     111    const AtomicString& mode = modeToString(m_mode, ec);
     112    ASSERT(!ec);
     113    return mode;
    80114}
    81115
     
    208242}
    209243
     244unsigned 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
     255const 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
    210276const AtomicString& IDBTransaction::interfaceName() const
    211277{
  • trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.h

    r116051 r116337  
    5757    };
    5858
     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
    5968    IDBTransactionBackendInterface* backend() const;
    6069    bool finished() const;
    6170
    62     unsigned short mode() const;
     71    const String& mode() const;
    6372    IDBDatabase* db() const;
    6473    PassRefPtr<IDBObjectStore> objectStore(const String& name, ExceptionCode&);
     
    118127    RefPtr<IDBTransactionBackendInterface> m_backend;
    119128    RefPtr<IDBDatabase> m_database;
    120     unsigned short m_mode;
     129    const unsigned short m_mode;
    121130    bool m_transactionFinished; // Is it possible that we'll fire any more events or allow any new requests? If not, we're finished.
    122131    bool m_contextStopped;
  • trunk/Source/WebCore/Modules/indexeddb/IDBTransaction.idl

    r116051 r116337  
    3232        EventTarget
    3333    ] IDBTransaction {
    34         // Modes
     34        // FIXME: Eventually remove legacy enum constants, see https://bugs.webkit.org/show_bug.cgi?id=85315
    3535        const unsigned short READ_ONLY = 0;
    3636        const unsigned short READ_WRITE = 1;
     
    3838
    3939        // Properties
    40         readonly attribute unsigned short mode;
     40        readonly attribute DOMString mode;
    4141        readonly attribute IDBDatabase db;
    4242        // Methods
Note: See TracChangeset for help on using the changeset viewer.