diff options
Diffstat (limited to 'LayoutTests/storage/indexeddb/objectstore-basics-expected.txt')
-rw-r--r-- | LayoutTests/storage/indexeddb/objectstore-basics-expected.txt | 63 |
1 files changed, 58 insertions, 5 deletions
diff --git a/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt b/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt index e0c9770..e736d2f 100644 --- a/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt +++ b/LayoutTests/storage/indexeddb/objectstore-basics-expected.txt @@ -3,7 +3,7 @@ Test the basics of IndexedDB's IDBObjectStore. On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". -webkitIndexedDB.open('name', 'description') +webkitIndexedDB.open('name') PASS 'onsuccess' in result is true PASS 'onerror' in result is true PASS 'readyState' in result is true @@ -45,7 +45,7 @@ PASS trans !== null is true Deleted all object stores. createObjectStore(): store = db.createObjectStore('storeName', null) -storeNames = db.objectStores +storeNames = db.objectStoreNames PASS store.name is "storeName" PASS store.keyPath is null PASS storeNames.contains('storeName') is true @@ -54,7 +54,7 @@ Ask for an index that doesn't exist: index = store.index('asdf') PASS Exception thrown. createIndex(): -index = store.createIndex('indexName', 'x', true) +index = store.createIndex('indexName', 'x', {unique: true}) PASS index !== null is true PASS store.indexNames.contains('indexName') is true index = store.index('indexName') @@ -97,6 +97,17 @@ PASS store.indexNames.item(1) is null PASS store.indexNames.item(100) is null transaction = db.transaction() store = transaction.objectStore('storeName') +Try to insert data with a Date key: +store.add({x: 'foo'}, new Date()) +PASS Exception thrown +PASS code is DOMException.TYPE_MISMATCH_ERR +Try to insert a value not handled by structured clone: +store.add({x: 'bar', y: document.getElementById('console')}, 'bar') +PASS Exception thrown +PASS code is DOMException.NOT_SUPPORTED_ERR +Try to insert data where key path yields a Date key: +store.add({x: new Date()}, 'foo') +PASS Adding data where key path yielded Date key resulted in error. store.add({x: 'value'}, 'key') PASS 'onsuccess' in result is true PASS 'onerror' in result is true @@ -137,6 +148,48 @@ PASS event.target.readyState is event.target.DONE PASS event.code is webkitIDBDatabaseException.UNKNOWN_ERR db.transaction() store = transaction.objectStore('storeName') +store.add({x: 'othervalue'}, null) +PASS 'onsuccess' in result is true +PASS 'onerror' in result is true +PASS 'readyState' in result is true +An event should fire shortly... + +addWithNullKeyFailre(): +Error event fired: +PASS 'result' in event is false +PASS 'code' in event is true +PASS 'message' in event is true +PASS 'source' in event is true +PASS event.source != null is true +PASS 'onsuccess' in event.target is true +PASS 'onerror' in event.target is true +PASS 'readyState' in event.target is true +PASS event.target.readyState is event.target.DONE + +PASS event.code is webkitIDBDatabaseException.DATA_ERR +db.transaction() +store = transaction.objectStore('storeName') +store.add({x: null}, 'validkey') +PASS 'onsuccess' in result is true +PASS 'onerror' in result is true +PASS 'readyState' in result is true +An event should fire shortly... + +addWithNullIndexFailure(): +Error event fired: +PASS 'result' in event is false +PASS 'code' in event is true +PASS 'message' in event is true +PASS 'source' in event is true +PASS event.source != null is true +PASS 'onsuccess' in event.target is true +PASS 'onerror' in event.target is true +PASS 'readyState' in event.target is true +PASS event.target.readyState is event.target.DONE + +PASS event.code is webkitIDBDatabaseException.DATA_ERR +db.transaction() +store = transaction.objectStore('storeName') store.get('key') PASS 'onsuccess' in result is true PASS 'onerror' in result is true @@ -157,7 +210,7 @@ PASS event.target.readyState is event.target.DONE PASS event.result.x is "value" store = event.source -store.remove('key') +store.delete('key') PASS 'onsuccess' in result is true PASS 'onerror' in result is true PASS 'readyState' in result is true @@ -179,7 +232,7 @@ PASS event.result is null store = event.source Passing an invalid key into store.get(). PASS Caught exception: Error: TYPE_MISMATCH_ERR: DOM Exception 17 -Passing an invalid key into store.remove(). +Passing an invalid key into store.delete(). PASS Caught exception: Error: TYPE_MISMATCH_ERR: DOM Exception 17 Passing an invalid key into store.add(). PASS Caught exception: Error: TYPE_MISMATCH_ERR: DOM Exception 17 |