зеркало из https://github.com/mozilla/gecko-dev.git
Bug 618134 - 'IndexedDB: Rename cursor types to comply with spec changes'. r=sicking, a=blocking.
This commit is contained in:
Родитель
b17dc24412
Коммит
65d3922d64
|
@ -22,6 +22,7 @@
|
|||
*
|
||||
* Contributor(s):
|
||||
* Shawn Wilsher <me@shawnwilsher.com>
|
||||
* Ben Turner <bent.mozilla@gmail.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
|
@ -58,13 +59,13 @@ USING_INDEXEDDB_NAMESPACE
|
|||
|
||||
namespace {
|
||||
|
||||
class GetHelper : public AsyncConnectionHelper
|
||||
class GetKeyHelper : public AsyncConnectionHelper
|
||||
{
|
||||
public:
|
||||
GetHelper(IDBTransaction* aTransaction,
|
||||
IDBRequest* aRequest,
|
||||
IDBIndex* aIndex,
|
||||
const Key& aKey)
|
||||
GetKeyHelper(IDBTransaction* aTransaction,
|
||||
IDBRequest* aRequest,
|
||||
IDBIndex* aIndex,
|
||||
const Key& aKey)
|
||||
: AsyncConnectionHelper(aTransaction, aRequest), mIndex(aIndex), mKey(aKey)
|
||||
{ }
|
||||
|
||||
|
@ -83,14 +84,14 @@ protected:
|
|||
Key mKey;
|
||||
};
|
||||
|
||||
class GetObjectHelper : public GetHelper
|
||||
class GetHelper : public GetKeyHelper
|
||||
{
|
||||
public:
|
||||
GetObjectHelper(IDBTransaction* aTransaction,
|
||||
IDBRequest* aRequest,
|
||||
IDBIndex* aIndex,
|
||||
const Key& aKey)
|
||||
: GetHelper(aTransaction, aRequest, aIndex, aKey)
|
||||
GetHelper(IDBTransaction* aTransaction,
|
||||
IDBRequest* aRequest,
|
||||
IDBIndex* aIndex,
|
||||
const Key& aKey)
|
||||
: GetKeyHelper(aTransaction, aRequest, aIndex, aKey)
|
||||
{ }
|
||||
|
||||
nsresult DoDatabaseWork(mozIStorageConnection* aConnection);
|
||||
|
@ -100,15 +101,15 @@ protected:
|
|||
nsString mValue;
|
||||
};
|
||||
|
||||
class GetAllHelper : public GetHelper
|
||||
class GetAllKeysHelper : public GetKeyHelper
|
||||
{
|
||||
public:
|
||||
GetAllHelper(IDBTransaction* aTransaction,
|
||||
IDBRequest* aRequest,
|
||||
IDBIndex* aIndex,
|
||||
const Key& aKey,
|
||||
const PRUint32 aLimit)
|
||||
: GetHelper(aTransaction, aRequest, aIndex, aKey), mLimit(aLimit)
|
||||
GetAllKeysHelper(IDBTransaction* aTransaction,
|
||||
IDBRequest* aRequest,
|
||||
IDBIndex* aIndex,
|
||||
const Key& aKey,
|
||||
const PRUint32 aLimit)
|
||||
: GetKeyHelper(aTransaction, aRequest, aIndex, aKey), mLimit(aLimit)
|
||||
{ }
|
||||
|
||||
nsresult DoDatabaseWork(mozIStorageConnection* aConnection);
|
||||
|
@ -119,15 +120,15 @@ protected:
|
|||
nsTArray<Key> mKeys;
|
||||
};
|
||||
|
||||
class GetAllObjectsHelper : public GetHelper
|
||||
class GetAllHelper : public GetKeyHelper
|
||||
{
|
||||
public:
|
||||
GetAllObjectsHelper(IDBTransaction* aTransaction,
|
||||
IDBRequest* aRequest,
|
||||
IDBIndex* aIndex,
|
||||
const Key& aKey,
|
||||
const PRUint32 aLimit)
|
||||
: GetHelper(aTransaction, aRequest, aIndex, aKey), mLimit(aLimit)
|
||||
GetAllHelper(IDBTransaction* aTransaction,
|
||||
IDBRequest* aRequest,
|
||||
IDBIndex* aIndex,
|
||||
const Key& aKey,
|
||||
const PRUint32 aLimit)
|
||||
: GetKeyHelper(aTransaction, aRequest, aIndex, aKey), mLimit(aLimit)
|
||||
{ }
|
||||
|
||||
nsresult DoDatabaseWork(mozIStorageConnection* aConnection);
|
||||
|
@ -138,17 +139,17 @@ protected:
|
|||
nsTArray<nsString> mValues;
|
||||
};
|
||||
|
||||
class OpenCursorHelper : public AsyncConnectionHelper
|
||||
class OpenKeyCursorHelper : public AsyncConnectionHelper
|
||||
{
|
||||
public:
|
||||
OpenCursorHelper(IDBTransaction* aTransaction,
|
||||
IDBRequest* aRequest,
|
||||
IDBIndex* aIndex,
|
||||
const Key& aLowerKey,
|
||||
const Key& aUpperKey,
|
||||
PRBool aLowerOpen,
|
||||
PRBool aUpperOpen,
|
||||
PRUint16 aDirection)
|
||||
OpenKeyCursorHelper(IDBTransaction* aTransaction,
|
||||
IDBRequest* aRequest,
|
||||
IDBIndex* aIndex,
|
||||
const Key& aLowerKey,
|
||||
const Key& aUpperKey,
|
||||
PRBool aLowerOpen,
|
||||
PRBool aUpperOpen,
|
||||
PRUint16 aDirection)
|
||||
: AsyncConnectionHelper(aTransaction, aRequest), mIndex(aIndex),
|
||||
mLowerKey(aLowerKey), mUpperKey(aUpperKey), mLowerOpen(aLowerOpen),
|
||||
mUpperOpen(aUpperOpen), mDirection(aDirection)
|
||||
|
@ -180,17 +181,17 @@ private:
|
|||
Key mRangeKey;
|
||||
};
|
||||
|
||||
class OpenObjectCursorHelper : public AsyncConnectionHelper
|
||||
class OpenCursorHelper : public AsyncConnectionHelper
|
||||
{
|
||||
public:
|
||||
OpenObjectCursorHelper(IDBTransaction* aTransaction,
|
||||
IDBRequest* aRequest,
|
||||
IDBIndex* aIndex,
|
||||
const Key& aLowerKey,
|
||||
const Key& aUpperKey,
|
||||
PRBool aLowerOpen,
|
||||
PRBool aUpperOpen,
|
||||
PRUint16 aDirection)
|
||||
OpenCursorHelper(IDBTransaction* aTransaction,
|
||||
IDBRequest* aRequest,
|
||||
IDBIndex* aIndex,
|
||||
const Key& aLowerKey,
|
||||
const Key& aUpperKey,
|
||||
PRBool aLowerOpen,
|
||||
PRBool aUpperOpen,
|
||||
PRUint16 aDirection)
|
||||
: AsyncConnectionHelper(aTransaction, aRequest), mIndex(aIndex),
|
||||
mLowerKey(aLowerKey), mUpperKey(aUpperKey), mLowerOpen(aLowerOpen),
|
||||
mUpperOpen(aUpperOpen), mDirection(aDirection)
|
||||
|
@ -367,8 +368,7 @@ IDBIndex::Get(nsIVariant* aKey,
|
|||
nsRefPtr<IDBRequest> request = GenerateRequest(this);
|
||||
NS_ENSURE_TRUE(request, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
|
||||
|
||||
nsRefPtr<GetHelper> helper(new GetHelper(transaction, request, this, key));
|
||||
|
||||
nsRefPtr<GetHelper> helper = new GetHelper(transaction, request, this, key);
|
||||
rv = helper->DispatchToTransactionPool();
|
||||
NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
|
||||
|
||||
|
@ -377,8 +377,8 @@ IDBIndex::Get(nsIVariant* aKey,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
IDBIndex::GetObject(nsIVariant* aKey,
|
||||
nsIIDBRequest** _retval)
|
||||
IDBIndex::GetKey(nsIVariant* aKey,
|
||||
nsIIDBRequest** _retval)
|
||||
{
|
||||
NS_PRECONDITION(NS_IsMainThread(), "Wrong thread!");
|
||||
|
||||
|
@ -398,8 +398,8 @@ IDBIndex::GetObject(nsIVariant* aKey,
|
|||
nsRefPtr<IDBRequest> request = GenerateRequest(this);
|
||||
NS_ENSURE_TRUE(request, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
|
||||
|
||||
nsRefPtr<GetObjectHelper> helper =
|
||||
new GetObjectHelper(transaction, request, this, key);
|
||||
nsRefPtr<GetKeyHelper> helper =
|
||||
new GetKeyHelper(transaction, request, this, key);
|
||||
|
||||
rv = helper->DispatchToTransactionPool();
|
||||
NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
|
||||
|
@ -447,10 +447,10 @@ IDBIndex::GetAll(nsIVariant* aKey,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
IDBIndex::GetAllObjects(nsIVariant* aKey,
|
||||
PRUint32 aLimit,
|
||||
PRUint8 aOptionalArgCount,
|
||||
nsIIDBRequest** _retval)
|
||||
IDBIndex::GetAllKeys(nsIVariant* aKey,
|
||||
PRUint32 aLimit,
|
||||
PRUint8 aOptionalArgCount,
|
||||
nsIIDBRequest** _retval)
|
||||
{
|
||||
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
|
||||
|
||||
|
@ -474,8 +474,8 @@ IDBIndex::GetAllObjects(nsIVariant* aKey,
|
|||
nsRefPtr<IDBRequest> request = GenerateRequest(this);
|
||||
NS_ENSURE_TRUE(request, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
|
||||
|
||||
nsRefPtr<GetAllObjectsHelper> helper =
|
||||
new GetAllObjectsHelper(transaction, request, this, key, aLimit);
|
||||
nsRefPtr<GetAllKeysHelper> helper =
|
||||
new GetAllKeysHelper(transaction, request, this, key, aLimit);
|
||||
|
||||
rv = helper->DispatchToTransactionPool();
|
||||
NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
|
||||
|
@ -549,10 +549,10 @@ IDBIndex::OpenCursor(nsIIDBKeyRange* aKeyRange,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
IDBIndex::OpenObjectCursor(nsIIDBKeyRange* aKeyRange,
|
||||
PRUint16 aDirection,
|
||||
PRUint8 aOptionalArgCount,
|
||||
nsIIDBRequest** _retval)
|
||||
IDBIndex::OpenKeyCursor(nsIIDBKeyRange* aKeyRange,
|
||||
PRUint16 aDirection,
|
||||
PRUint8 aOptionalArgCount,
|
||||
nsIIDBRequest** _retval)
|
||||
{
|
||||
NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
|
||||
|
||||
|
@ -601,9 +601,9 @@ IDBIndex::OpenObjectCursor(nsIIDBKeyRange* aKeyRange,
|
|||
nsRefPtr<IDBRequest> request = GenerateRequest(this);
|
||||
NS_ENSURE_TRUE(request, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
|
||||
|
||||
nsRefPtr<OpenObjectCursorHelper> helper =
|
||||
new OpenObjectCursorHelper(transaction, request, this, lowerKey, upperKey,
|
||||
lowerOpen, upperOpen, aDirection);
|
||||
nsRefPtr<OpenKeyCursorHelper> helper =
|
||||
new OpenKeyCursorHelper(transaction, request, this, lowerKey, upperKey,
|
||||
lowerOpen, upperOpen, aDirection);
|
||||
|
||||
rv = helper->DispatchToTransactionPool();
|
||||
NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
|
||||
|
@ -613,7 +613,7 @@ IDBIndex::OpenObjectCursor(nsIIDBKeyRange* aKeyRange,
|
|||
}
|
||||
|
||||
nsresult
|
||||
GetHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
|
||||
GetKeyHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
|
||||
{
|
||||
NS_ASSERTION(aConnection, "Passed a null connection!");
|
||||
|
||||
|
@ -672,7 +672,7 @@ GetHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
|
|||
}
|
||||
|
||||
nsresult
|
||||
GetHelper::GetSuccessResult(nsIWritableVariant* aResult)
|
||||
GetKeyHelper::GetSuccessResult(nsIWritableVariant* aResult)
|
||||
{
|
||||
NS_ASSERTION(!mKey.IsNull(), "Badness!");
|
||||
|
||||
|
@ -692,7 +692,7 @@ GetHelper::GetSuccessResult(nsIWritableVariant* aResult)
|
|||
}
|
||||
|
||||
nsresult
|
||||
GetObjectHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
|
||||
GetHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
|
||||
{
|
||||
NS_ASSERTION(aConnection, "Passed a null connection!");
|
||||
|
||||
|
@ -738,7 +738,7 @@ GetObjectHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
|
|||
}
|
||||
|
||||
nsresult
|
||||
GetObjectHelper::OnSuccess(nsIDOMEventTarget* aTarget)
|
||||
GetHelper::OnSuccess(nsIDOMEventTarget* aTarget)
|
||||
{
|
||||
nsRefPtr<GetSuccessEvent> event(new GetSuccessEvent(mValue));
|
||||
nsresult rv = event->Init(mRequest, mTransaction);
|
||||
|
@ -750,7 +750,7 @@ GetObjectHelper::OnSuccess(nsIDOMEventTarget* aTarget)
|
|||
}
|
||||
|
||||
nsresult
|
||||
GetAllHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
|
||||
GetAllKeysHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
|
||||
{
|
||||
NS_ASSERTION(aConnection, "Passed a null connection!");
|
||||
|
||||
|
@ -860,7 +860,7 @@ GetAllHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
|
|||
}
|
||||
|
||||
nsresult
|
||||
GetAllHelper::OnSuccess(nsIDOMEventTarget* aTarget)
|
||||
GetAllKeysHelper::OnSuccess(nsIDOMEventTarget* aTarget)
|
||||
{
|
||||
nsRefPtr<GetAllKeySuccessEvent> event(new GetAllKeySuccessEvent(mKeys));
|
||||
|
||||
|
@ -875,7 +875,7 @@ GetAllHelper::OnSuccess(nsIDOMEventTarget* aTarget)
|
|||
}
|
||||
|
||||
nsresult
|
||||
GetAllObjectsHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
|
||||
GetAllHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
|
||||
{
|
||||
NS_ASSERTION(aConnection, "Passed a null connection!");
|
||||
|
||||
|
@ -984,7 +984,7 @@ GetAllObjectsHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
|
|||
}
|
||||
|
||||
nsresult
|
||||
GetAllObjectsHelper::OnSuccess(nsIDOMEventTarget* aTarget)
|
||||
GetAllHelper::OnSuccess(nsIDOMEventTarget* aTarget)
|
||||
{
|
||||
nsRefPtr<GetAllSuccessEvent> event(new GetAllSuccessEvent(mValues));
|
||||
|
||||
|
@ -999,7 +999,7 @@ GetAllObjectsHelper::OnSuccess(nsIDOMEventTarget* aTarget)
|
|||
}
|
||||
|
||||
nsresult
|
||||
OpenCursorHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
|
||||
OpenKeyCursorHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
|
||||
{
|
||||
NS_ASSERTION(aConnection, "Passed a null connection!");
|
||||
|
||||
|
@ -1220,7 +1220,7 @@ OpenCursorHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
|
|||
}
|
||||
|
||||
nsresult
|
||||
OpenCursorHelper::GetSuccessResult(nsIWritableVariant* aResult)
|
||||
OpenKeyCursorHelper::GetSuccessResult(nsIWritableVariant* aResult)
|
||||
{
|
||||
if (mKey.IsUnset()) {
|
||||
aResult->SetAsEmpty();
|
||||
|
@ -1237,7 +1237,7 @@ OpenCursorHelper::GetSuccessResult(nsIWritableVariant* aResult)
|
|||
}
|
||||
|
||||
nsresult
|
||||
OpenObjectCursorHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
|
||||
OpenCursorHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
|
||||
{
|
||||
NS_ASSERTION(aConnection, "Passed a null connection!");
|
||||
|
||||
|
@ -1509,7 +1509,7 @@ OpenObjectCursorHelper::DoDatabaseWork(mozIStorageConnection* aConnection)
|
|||
}
|
||||
|
||||
nsresult
|
||||
OpenObjectCursorHelper::GetSuccessResult(nsIWritableVariant* aResult)
|
||||
OpenCursorHelper::GetSuccessResult(nsIWritableVariant* aResult)
|
||||
{
|
||||
if (mKey.IsUnset()) {
|
||||
aResult->SetAsEmpty();
|
||||
|
|
|
@ -49,7 +49,7 @@ interface nsIVariant;
|
|||
* http://dev.w3.org/2006/webapi/WebSimpleDB/#idl-def-IDBIndex for more
|
||||
* information.
|
||||
*/
|
||||
[scriptable, uuid(b44450e2-4a44-41e8-b098-1a7b389634b5)]
|
||||
[scriptable, uuid(9df1ac24-06cf-47d1-9159-3b3d65975b80)]
|
||||
interface nsIIDBIndex : nsISupports
|
||||
{
|
||||
readonly attribute DOMString name;
|
||||
|
@ -66,7 +66,7 @@ interface nsIIDBIndex : nsISupports
|
|||
get(in nsIVariant key);
|
||||
|
||||
nsIIDBRequest
|
||||
getObject(in nsIVariant key);
|
||||
getKey(in nsIVariant key);
|
||||
|
||||
[optional_argc]
|
||||
nsIIDBRequest
|
||||
|
@ -75,8 +75,8 @@ interface nsIIDBIndex : nsISupports
|
|||
|
||||
[optional_argc]
|
||||
nsIIDBRequest
|
||||
getAllObjects([optional /* null */] in nsIVariant key,
|
||||
[optional /* unlimited */] in unsigned long limit);
|
||||
getAllKeys([optional /* null */] in nsIVariant key,
|
||||
[optional /* unlimited */] in unsigned long limit);
|
||||
|
||||
[optional_argc]
|
||||
nsIIDBRequest
|
||||
|
@ -85,7 +85,6 @@ interface nsIIDBIndex : nsISupports
|
|||
|
||||
[optional_argc]
|
||||
nsIIDBRequest
|
||||
openObjectCursor([optional /* null */] in nsIIDBKeyRange range,
|
||||
[optional /* nsIIDBCursor::NEXT */]
|
||||
in unsigned short direction);
|
||||
openKeyCursor([optional /* null */] in nsIIDBKeyRange range,
|
||||
[optional /* nsIIDBCursor::NEXT */] in unsigned short direction);
|
||||
};
|
||||
|
|
|
@ -82,7 +82,7 @@
|
|||
sawRemoved = false;
|
||||
|
||||
db.transaction("foo", IDBTransaction.READ_WRITE).objectStore("foo")
|
||||
.index("name").openObjectCursor().onsuccess = function(event) {
|
||||
.index("name").openCursor().onsuccess = function(event) {
|
||||
event.transaction.oncomplete = continueToNextStep;
|
||||
let cursor = event.result;
|
||||
if (cursor) {
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
ok(true, "5");
|
||||
|
||||
// Check both indexes to make sure that they were updated.
|
||||
request = index.getObject(END_DATA);
|
||||
request = index.get(END_DATA);
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = grabEventAndContinueHandler;
|
||||
event = yield;
|
||||
|
@ -92,7 +92,7 @@
|
|||
SimpleTest.ok(obj.data, event.result.data,
|
||||
"Non-unique index was properly updated.");
|
||||
|
||||
request = uniqueIndex.getObject(END_DATA);
|
||||
request = uniqueIndex.get(END_DATA);
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = grabEventAndContinueHandler;
|
||||
event = yield;
|
||||
|
|
|
@ -101,7 +101,7 @@
|
|||
objectStore = db.transaction(objectStoreName)
|
||||
.objectStore(objectStoreName);
|
||||
|
||||
request = objectStore.index("height").getAll(65);
|
||||
request = objectStore.index("height").getAllKeys(65);
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = grabEventAndContinueHandler;
|
||||
event = yield;
|
||||
|
@ -115,7 +115,7 @@
|
|||
"Correct key");
|
||||
}
|
||||
|
||||
request = objectStore.index("height").getAll();
|
||||
request = objectStore.index("height").getAllKeys();
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = grabEventAndContinueHandler;
|
||||
event = yield;
|
||||
|
@ -129,7 +129,7 @@
|
|||
is(event.result[i], objectStoreDataHeightSort[i].key, "Correct key");
|
||||
}
|
||||
|
||||
request = objectStore.index("height").getAll(null, 4);
|
||||
request = objectStore.index("height").getAllKeys(null, 4);
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = grabEventAndContinueHandler;
|
||||
event = yield;
|
||||
|
@ -142,7 +142,7 @@
|
|||
is(event.result[i], objectStoreDataHeightSort[i].key, "Correct key");
|
||||
}
|
||||
|
||||
request = objectStore.index("height").getAll(65, 1);
|
||||
request = objectStore.index("height").getAllKeys(65, 1);
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = grabEventAndContinueHandler;
|
||||
event = yield;
|
||||
|
|
|
@ -99,7 +99,7 @@
|
|||
objectStore = db.transaction(objectStoreName)
|
||||
.objectStore(objectStoreName);
|
||||
|
||||
request = objectStore.index("height").getAllObjects(65);
|
||||
request = objectStore.index("height").getAll(65);
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = grabEventAndContinueHandler;
|
||||
event = yield;
|
||||
|
@ -119,7 +119,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
request = objectStore.index("height").getAllObjects();
|
||||
request = objectStore.index("height").getAll();
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = grabEventAndContinueHandler;
|
||||
event = yield;
|
||||
|
@ -140,7 +140,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
request = objectStore.index("height").getAllObjects(null, 4);
|
||||
request = objectStore.index("height").getAll(null, 4);
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = grabEventAndContinueHandler;
|
||||
event = yield;
|
||||
|
@ -160,7 +160,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
request = objectStore.index("height").getAllObjects(65, 1);
|
||||
request = objectStore.index("height").getAll(65, 1);
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = grabEventAndContinueHandler;
|
||||
event = yield;
|
||||
|
|
|
@ -127,14 +127,14 @@
|
|||
is(index.unique, indexData[i].unique, "Correct keyPath");
|
||||
}
|
||||
|
||||
request = objectStore.index("name").get("Bob");
|
||||
request = objectStore.index("name").getKey("Bob");
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = grabEventAndContinueHandler;
|
||||
event = yield;
|
||||
|
||||
is(event.result, "237-23-7732", "Correct key returned!");
|
||||
|
||||
request = objectStore.index("name").getObject("Bob");
|
||||
request = objectStore.index("name").get("Bob");
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = grabEventAndContinueHandler;
|
||||
event = yield;
|
||||
|
@ -147,7 +147,7 @@
|
|||
|
||||
let keyIndex = 0;
|
||||
|
||||
request = objectStore.index("name").openCursor();
|
||||
request = objectStore.index("name").openKeyCursor();
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = function (event) {
|
||||
let cursor = event.result;
|
||||
|
@ -178,7 +178,7 @@
|
|||
|
||||
keyIndex = 0;
|
||||
|
||||
request = objectStore.index("weight").openCursor(null, NEXT);
|
||||
request = objectStore.index("weight").openKeyCursor(null, NEXT);
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = function (event) {
|
||||
let cursor = event.result;
|
||||
|
@ -218,7 +218,7 @@
|
|||
|
||||
keyIndex = objectStoreDataNameSort.length - 1;
|
||||
|
||||
request = objectStore.index("name").openCursor(null, PREV);
|
||||
request = objectStore.index("name").openKeyCursor(null, PREV);
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = function (event) {
|
||||
let cursor = event.result;
|
||||
|
@ -250,7 +250,7 @@
|
|||
keyIndex = 1;
|
||||
let keyRange = IDBKeyRange.bound("Bob", "Ron");
|
||||
|
||||
request = objectStore.index("name").openCursor(keyRange);
|
||||
request = objectStore.index("name").openKeyCursor(keyRange);
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = function (event) {
|
||||
let cursor = event.result;
|
||||
|
@ -276,7 +276,7 @@
|
|||
keyIndex = 2;
|
||||
let keyRange = IDBKeyRange.bound("Bob", "Ron", true);
|
||||
|
||||
request = objectStore.index("name").openCursor(keyRange);
|
||||
request = objectStore.index("name").openKeyCursor(keyRange);
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = function (event) {
|
||||
let cursor = event.result;
|
||||
|
@ -302,7 +302,7 @@
|
|||
keyIndex = 1;
|
||||
let keyRange = IDBKeyRange.bound("Bob", "Ron", false, true);
|
||||
|
||||
request = objectStore.index("name").openCursor(keyRange);
|
||||
request = objectStore.index("name").openKeyCursor(keyRange);
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = function (event) {
|
||||
let cursor = event.result;
|
||||
|
@ -328,7 +328,7 @@
|
|||
keyIndex = 2;
|
||||
keyRange = IDBKeyRange.bound("Bob", "Ron", true, true);
|
||||
|
||||
request = objectStore.index("name").openCursor(keyRange);
|
||||
request = objectStore.index("name").openKeyCursor(keyRange);
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = function (event) {
|
||||
let cursor = event.result;
|
||||
|
@ -354,7 +354,7 @@
|
|||
keyIndex = 1;
|
||||
keyRange = IDBKeyRange.lowerBound("Bob");
|
||||
|
||||
request = objectStore.index("name").openCursor(keyRange);
|
||||
request = objectStore.index("name").openKeyCursor(keyRange);
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = function (event) {
|
||||
let cursor = event.result;
|
||||
|
@ -380,7 +380,7 @@
|
|||
keyIndex = 2;
|
||||
keyRange = IDBKeyRange.lowerBound("Bob", true);
|
||||
|
||||
request = objectStore.index("name").openCursor(keyRange);
|
||||
request = objectStore.index("name").openKeyCursor(keyRange);
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = function (event) {
|
||||
let cursor = event.result;
|
||||
|
@ -406,7 +406,7 @@
|
|||
keyIndex = 0;
|
||||
keyRange = IDBKeyRange.upperBound("Joe");
|
||||
|
||||
request = objectStore.index("name").openCursor(keyRange);
|
||||
request = objectStore.index("name").openKeyCursor(keyRange);
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = function (event) {
|
||||
let cursor = event.result;
|
||||
|
@ -432,7 +432,7 @@
|
|||
keyIndex = 0;
|
||||
keyRange = IDBKeyRange.upperBound("Joe", true);
|
||||
|
||||
request = objectStore.index("name").openCursor(keyRange);
|
||||
request = objectStore.index("name").openKeyCursor(keyRange);
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = function (event) {
|
||||
let cursor = event.result;
|
||||
|
@ -458,7 +458,7 @@
|
|||
keyIndex = 3;
|
||||
keyRange = IDBKeyRange.only("Pat");
|
||||
|
||||
request = objectStore.index("name").openCursor(keyRange);
|
||||
request = objectStore.index("name").openKeyCursor(keyRange);
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = function (event) {
|
||||
let cursor = event.result;
|
||||
|
@ -483,7 +483,7 @@
|
|||
|
||||
keyIndex = 0;
|
||||
|
||||
request = objectStore.index("name").openObjectCursor();
|
||||
request = objectStore.index("name").openCursor();
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = function (event) {
|
||||
let cursor = event.result;
|
||||
|
@ -530,7 +530,7 @@
|
|||
|
||||
keyIndex = objectStoreDataNameSort.length - 1;
|
||||
|
||||
request = objectStore.index("name").openObjectCursor(null, PREV);
|
||||
request = objectStore.index("name").openCursor(null, PREV);
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = function (event) {
|
||||
let cursor = event.result;
|
||||
|
@ -578,7 +578,7 @@
|
|||
keyIndex = 1;
|
||||
keyRange = IDBKeyRange.bound("Bob", "Ron");
|
||||
|
||||
request = objectStore.index("name").openObjectCursor(keyRange);
|
||||
request = objectStore.index("name").openCursor(keyRange);
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = function (event) {
|
||||
let cursor = event.result;
|
||||
|
@ -626,7 +626,7 @@
|
|||
keyIndex = 2;
|
||||
keyRange = IDBKeyRange.bound("Bob", "Ron", true);
|
||||
|
||||
request = objectStore.index("name").openObjectCursor(keyRange);
|
||||
request = objectStore.index("name").openCursor(keyRange);
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = function (event) {
|
||||
let cursor = event.result;
|
||||
|
@ -674,7 +674,7 @@
|
|||
keyIndex = 1;
|
||||
keyRange = IDBKeyRange.bound("Bob", "Ron", false, true);
|
||||
|
||||
request = objectStore.index("name").openObjectCursor(keyRange);
|
||||
request = objectStore.index("name").openCursor(keyRange);
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = function (event) {
|
||||
let cursor = event.result;
|
||||
|
@ -722,7 +722,7 @@
|
|||
keyIndex = 2;
|
||||
keyRange = IDBKeyRange.bound("Bob", "Ron", true, true);
|
||||
|
||||
request = objectStore.index("name").openObjectCursor(keyRange);
|
||||
request = objectStore.index("name").openCursor(keyRange);
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = function (event) {
|
||||
let cursor = event.result;
|
||||
|
@ -770,7 +770,7 @@
|
|||
keyIndex = 4;
|
||||
keyRange = IDBKeyRange.bound("Bob", "Ron");
|
||||
|
||||
request = objectStore.index("name").openObjectCursor(keyRange, PREV);
|
||||
request = objectStore.index("name").openCursor(keyRange, PREV);
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = function (event) {
|
||||
let cursor = event.result;
|
||||
|
@ -819,7 +819,7 @@
|
|||
keyIndex = 3;
|
||||
keyRange = IDBKeyRange.only(65);
|
||||
|
||||
request = objectStore.index("height").openCursor(keyRange, NEXT);
|
||||
request = objectStore.index("height").openKeyCursor(keyRange, NEXT);
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = function (event) {
|
||||
let cursor = event.result;
|
||||
|
@ -845,8 +845,8 @@
|
|||
keyIndex = 3;
|
||||
keyRange = IDBKeyRange.only(65);
|
||||
|
||||
request = objectStore.index("height").openCursor(keyRange,
|
||||
NEXT_NO_DUPLICATE);
|
||||
request = objectStore.index("height").openKeyCursor(keyRange,
|
||||
NEXT_NO_DUPLICATE);
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = function (event) {
|
||||
let cursor = event.result;
|
||||
|
@ -871,8 +871,8 @@
|
|||
|
||||
keyIndex = 5;
|
||||
|
||||
request = objectStore.index("height").openCursor(null,
|
||||
PREV_NO_DUPLICATE);
|
||||
request = objectStore.index("height").openKeyCursor(null,
|
||||
PREV_NO_DUPLICATE);
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = function (event) {
|
||||
let cursor = event.result;
|
||||
|
@ -901,7 +901,7 @@
|
|||
keyIndex = 3;
|
||||
keyRange = IDBKeyRange.only(65);
|
||||
|
||||
request = objectStore.index("height").openObjectCursor(keyRange, NEXT);
|
||||
request = objectStore.index("height").openCursor(keyRange, NEXT);
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = function (event) {
|
||||
let cursor = event.result;
|
||||
|
@ -935,8 +935,8 @@
|
|||
keyIndex = 3;
|
||||
keyRange = IDBKeyRange.only(65);
|
||||
|
||||
request = objectStore.index("height").openObjectCursor(keyRange,
|
||||
NEXT_NO_DUPLICATE);
|
||||
request = objectStore.index("height").openCursor(keyRange,
|
||||
NEXT_NO_DUPLICATE);
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = function (event) {
|
||||
let cursor = event.result;
|
||||
|
@ -969,8 +969,8 @@
|
|||
|
||||
keyIndex = 5;
|
||||
|
||||
request = objectStore.index("height").openObjectCursor(null,
|
||||
PREV_NO_DUPLICATE);
|
||||
request = objectStore.index("height").openCursor(null,
|
||||
PREV_NO_DUPLICATE);
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = function (event) {
|
||||
let cursor = event.result;
|
||||
|
@ -1006,7 +1006,7 @@
|
|||
|
||||
keyIndex = 0;
|
||||
|
||||
request = objectStore.index("name").openCursor();
|
||||
request = objectStore.index("name").openKeyCursor();
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = function (event) {
|
||||
let cursor = event.result;
|
||||
|
@ -1044,7 +1044,7 @@
|
|||
|
||||
keyIndex = 0;
|
||||
|
||||
request = objectStore.index("name").openCursor();
|
||||
request = objectStore.index("name").openKeyCursor();
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = function (event) {
|
||||
let cursor = event.result;
|
||||
|
@ -1077,7 +1077,7 @@
|
|||
|
||||
keyIndex = 0;
|
||||
|
||||
request = objectStore.index("name").openObjectCursor();
|
||||
request = objectStore.index("name").openCursor();
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = function (event) {
|
||||
let cursor = event.result;
|
||||
|
@ -1131,7 +1131,7 @@
|
|||
|
||||
keyIndex = 0;
|
||||
|
||||
request = objectStore.index("name").openObjectCursor();
|
||||
request = objectStore.index("name").openCursor();
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = function (event) {
|
||||
let cursor = event.result;
|
||||
|
|
|
@ -99,7 +99,7 @@
|
|||
|
||||
let keyIndex = 0;
|
||||
|
||||
request = objectStore.index("weight").openCursor();
|
||||
request = objectStore.index("weight").openKeyCursor();
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = function (event) {
|
||||
let cursor = event.result;
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
.objectStore(objectStores[i].name);
|
||||
let index = objectStore.index(indexes[j].name);
|
||||
|
||||
request = index.openObjectCursor();
|
||||
request = index.openCursor();
|
||||
request.onerror = errorHandler;
|
||||
request.onsuccess = function (event) {
|
||||
is(event.result.value.name, "Ben", "Good object");
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
|
||||
objectStore.deleteIndex(indexName);
|
||||
|
||||
is(event.result, undefined, "Correct result");
|
||||
is(objectStore.indexNames.length, 0, "Correct indexNames list");
|
||||
|
||||
finishTest();
|
||||
|
|
Загрузка…
Ссылка в новой задаче