blob: 1938bcf261c351288c83afac7b2ef951cdcb6c8e [file] [log] [blame]
Test IndexedDB key comparison
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
dbname = "key-sort-order-date.html"
indexedDB.deleteDatabase(dbname)
indexedDB.open(dbname)
db.createObjectStore('foo');
date1 = new Date(1000);
request = objectStore.add([], date1);
date0 = new Date(0);
request = objectStore.add([], date0);
date3 = new Date(3000);
request = objectStore.add([], date3);
date2 = new Date(2000);
request = objectStore.add([], date2);
sortedKeys = [date0.toString(), date1.toString(), date2.toString(), date3.toString()];
request = objectStore.openCursor();
cursor = event.target.result;
PASS cursor.key.toString() is sortedKeys[keyIndex]
cursor.continue();
keyIndex++;
cursor = event.target.result;
PASS cursor.key.toString() is sortedKeys[keyIndex]
cursor.continue();
keyIndex++;
cursor = event.target.result;
PASS cursor.key.toString() is sortedKeys[keyIndex]
cursor.continue();
keyIndex++;
cursor = event.target.result;
PASS cursor.key.toString() is sortedKeys[keyIndex]
cursor.continue();
keyIndex++;
cursor = event.target.result;
PASS successfullyParsed is true
TEST COMPLETE