Home | History | Annotate | Download | only in indexeddb
      1 Test IndexedDB's webkitIDBObjectStore.clear().
      2 
      3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
      4 
      5 
      6 webkitIndexedDB.open('objectstore-clear')
      7 db = event.target.result
      8 db.setVersion('new version')
      9 trans = event.target.result
     10 PASS trans !== null is true
     11 Deleted all object stores.
     12 store = db.createObjectStore('storeName', null)
     13 store.createIndex('indexName', '')
     14 PASS store.indexNames.contains('indexName') is true
     15 store.add('value', 'key')
     16 otherStore = db.createObjectStore('otherStoreName', null)
     17 otherStore.add('value', 'key')
     18 store.clear()
     19 PASS event.target.result is undefined.
     20 store.openCursor()
     21 PASS event.target.result is null
     22 index = store.index('indexName')
     23 index.openKeyCursor()
     24 openKeyCursorSuccess():
     25 PASS event.target.result is null
     26 db.transaction({mode: webkitIDBTransaction.READ_WRITE})
     27 otherStore = transaction.objectStore('otherStoreName')
     28 otherStore.get('key')
     29 PASS event.target.result is "value"
     30 PASS successfullyParsed is true
     31 
     32 TEST COMPLETE
     33 
     34