Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / storage / indexeddb / transaction-abort-expected.txt
1 Test transaction aborts send the proper onabort messages..
2
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6 indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
7
8 dbname = "transaction-abort.html"
9 indexedDB.deleteDatabase(dbname)
10 indexedDB.open(dbname)
11 store = db.createObjectStore('storeName', null)
12 store.add({x: 'value', y: 'zzz'}, 'key')
13 trans = db.transaction(['storeName'], 'readwrite')
14 trans.onabort = transactionAborted
15 trans.oncomplete = unexpectedCompleteCallback
16 store = trans.objectStore('storeName')
17 store.add({x: 'value2', y: 'zzz2'}, 'key2')
18 store.add({x: 'value3', y: 'zzz3'}, 'key3')
19 PASS event.target.error.name is 'AbortError'
20 PASS trans.error is null
21 PASS firstError is false
22 PASS secondError is false
23 PASS abortFired is false
24 Expecting exception from store.add({x: 'value4', y: 'zzz4'}, 'key4')
25 PASS Exception was thrown.
26 PASS code is 0
27 PASS ename is 'TransactionInactiveError'
28 Exception message: Failed to execute 'add' on 'IDBObjectStore': The transaction has finished.
29 PASS event.target.error.name is 'AbortError'
30 PASS trans.error is null
31 PASS firstError is true
32 PASS secondError is false
33 PASS abortFired is false
34 PASS firstError is true
35 PASS secondError is true
36 PASS abortFired is false
37 PASS trans.error is null
38 Expecting exception from store.add({x: 'value5', y: 'zzz5'}, 'key5')
39 PASS Exception was thrown.
40 PASS code is 0
41 PASS ename is 'TransactionInactiveError'
42 Exception message: Failed to execute 'add' on 'IDBObjectStore': The transaction has finished.
43 Expecting exception from trans.abort()
44 PASS Exception was thrown.
45 PASS code is DOMException.INVALID_STATE_ERR
46 PASS ename is 'InvalidStateError'
47 Exception message: Failed to execute 'abort' on 'IDBTransaction': The transaction has finished.
48 PASS successfullyParsed is true
49
50 TEST COMPLETE
51