OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <title>IndexedDB: Prevented errors do not trigger window.onerror</title> |
| 3 <script src="../../resources/testharness.js"></script> |
| 4 <script src="../../resources/testharnessreport.js"></script> |
| 5 <script> |
| 6 |
| 7 var t = async_test('Prevented error on request does not cause window.onerror to
fire'); |
| 8 t.step(function() { |
| 9 var dbName = location.pathname; |
| 10 var deleteRequest = indexedDB.deleteDatabase(dbName); |
| 11 deleteRequest.onsuccess = t.step_func(function() { |
| 12 var openRequest = indexedDB.open(dbName); |
| 13 openRequest.onupgradeneeded = t.step_func(function() { |
| 14 var db = openRequest.result; |
| 15 var store = db.createObjectStore('store'); |
| 16 }); |
| 17 openRequest.onsuccess = t.step_func(function() { |
| 18 var db = openRequest.result; |
| 19 var tx = db.transaction('store', 'readwrite'); |
| 20 var store = tx.objectStore('store'); |
| 21 store.add({}, 'k1'); |
| 22 store.add({}, 'k1').onerror = t.step_func(function(e) { |
| 23 e.preventDefault(); |
| 24 }); |
| 25 tx.oncomplete = t.step_func(function() { |
| 26 t.done(); |
| 27 }); |
| 28 tx.onabort = t.step_func(function() { |
| 29 assert_unreached('transaction should have aborted'); |
| 30 }); |
| 31 }); |
| 32 }); |
| 33 |
| 34 window.onerror = t.step_func(function(message, url, line, column) { |
| 35 assert_unreached('window.onerror should not be called'); |
| 36 }); |
| 37 }); |
| 38 |
| 39 </script> |
OLD | NEW |