43 lines
1.1 KiB
Plaintext
43 lines
1.1 KiB
Plaintext
Test IndexedDB key comparison
|
|
|
|
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
|
|
|
|
|
|
indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
|
|
|
|
indexedDB.deleteDatabase(dbname)
|
|
indexedDB.open(dbname)
|
|
db.createObjectStore('foo');
|
|
request = objectStore.add([], Infinity);
|
|
request = objectStore.add([], -Infinity);
|
|
request = objectStore.add([], 1.0);
|
|
request = objectStore.add([], '');
|
|
request = objectStore.add([], '1.0');
|
|
sortedKey = [-Infinity, 1.0, Infinity, '', '1.0'];
|
|
request = objectStore.openCursor();
|
|
cursor = event.target.result;
|
|
PASS cursor.key is sortedKeys[keyIndex]
|
|
cursor.continue();
|
|
keyIndex++;
|
|
cursor = event.target.result;
|
|
PASS cursor.key is sortedKeys[keyIndex]
|
|
cursor.continue();
|
|
keyIndex++;
|
|
cursor = event.target.result;
|
|
PASS cursor.key is sortedKeys[keyIndex]
|
|
cursor.continue();
|
|
keyIndex++;
|
|
cursor = event.target.result;
|
|
PASS cursor.key is sortedKeys[keyIndex]
|
|
cursor.continue();
|
|
keyIndex++;
|
|
cursor = event.target.result;
|
|
PASS cursor.key is sortedKeys[keyIndex]
|
|
cursor.continue();
|
|
keyIndex++;
|
|
cursor = event.target.result;
|
|
PASS successfullyParsed is true
|
|
|
|
TEST COMPLETE
|
|
|