43 lines
1.3 KiB
Plaintext
43 lines
1.3 KiB
Plaintext
Test IndexedDB odd value datatypes
|
|
|
|
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', {autoIncrement: true});
|
|
adding regexp value
|
|
objectStore.add(validTypes[nextToAdd].value)
|
|
adding date value
|
|
objectStore.add(validTypes[nextToAdd].value)
|
|
adding object value
|
|
objectStore.add(validTypes[nextToAdd].value)
|
|
adding imagedata value
|
|
objectStore.add(validTypes[nextToAdd].value)
|
|
request = objectStore.openCursor();
|
|
cursor = event.target.result;
|
|
PASS cursor.value.toString() is validTypes[valueIndex].value.toString()
|
|
cursor.continue();
|
|
valueIndex++;
|
|
cursor = event.target.result;
|
|
PASS cursor.value.toString() is validTypes[valueIndex].value.toString()
|
|
PASS cursor.value.toUTCString() is "Thu, 01 Jan 1970 00:00:00 GMT"
|
|
cursor.continue();
|
|
valueIndex++;
|
|
cursor = event.target.result;
|
|
PASS cursor.value.toString() is validTypes[valueIndex].value.toString()
|
|
cursor.continue();
|
|
valueIndex++;
|
|
cursor = event.target.result;
|
|
PASS cursor.value.toString() is validTypes[valueIndex].value.toString()
|
|
PASS cursor.value.width is 1
|
|
cursor.continue();
|
|
valueIndex++;
|
|
cursor = event.target.result;
|
|
PASS successfullyParsed is true
|
|
|
|
TEST COMPLETE
|
|
|