| OLD | NEW | 
| (Empty) |  | 
 |   1 <!DOCTYPE html> | 
 |   2 <title>IndexedDB: Unprevented errors trigger window.onerror</title> | 
 |   3 <script src="../../resources/testharness.js"></script> | 
 |   4 <script src="../../resources/testharnessreport.js"></script> | 
 |   5 <script> | 
 |   6  | 
 |   7 setup({allow_uncaught_exception: true}); | 
 |   8  | 
 |   9 var t = async_test('Unprevented error on request causes window.onerror to fire')
    ; | 
 |  10 t.step(function() { | 
 |  11     var onerrorCalled = false; | 
 |  12     var dbName = location.pathname; | 
 |  13     var deleteRequest = indexedDB.deleteDatabase(dbName); | 
 |  14     deleteRequest.onsuccess = t.step_func(function() { | 
 |  15         var openRequest = indexedDB.open(dbName); | 
 |  16         openRequest.onupgradeneeded = t.step_func(function() { | 
 |  17             var db = openRequest.result; | 
 |  18             var store = db.createObjectStore('store'); | 
 |  19         }); | 
 |  20         openRequest.onsuccess = t.step_func(function() { | 
 |  21             var db = openRequest.result; | 
 |  22             var tx = db.transaction('store', 'readwrite'); | 
 |  23             var store = tx.objectStore('store'); | 
 |  24             store.add({}, 'k1'); | 
 |  25             store.add({}, 'k1'); | 
 |  26             tx.oncomplete = t.step_func(function() { | 
 |  27                 assert_unreached('transaction should have aborted'); | 
 |  28             }); | 
 |  29             tx.onabort = t.step_func(function() { | 
 |  30                 assert_true(onerrorCalled, 'onerror should have been called'); | 
 |  31                 t.done(); | 
 |  32             }); | 
 |  33         }); | 
 |  34     }); | 
 |  35  | 
 |  36     window.onerror = t.step_func(function(message, url, line, column) { | 
 |  37         onerrorCalled = true; | 
 |  38         assert_equals(message, 'ConstraintError: Key already exists in the objec
    t store.'); | 
 |  39         assert_equals(line, 25); | 
 |  40         assert_equals(column, 19); | 
 |  41     }); | 
 |  42 }); | 
 |  43  | 
 |  44 </script> | 
| OLD | NEW |