Index: LayoutTests/storage/indexeddb/window-onerror-prevented.html |
diff --git a/LayoutTests/storage/indexeddb/window-onerror-prevented.html b/LayoutTests/storage/indexeddb/window-onerror-prevented.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..326267a6f835d50267e35f5f9579e250db9a5259 |
--- /dev/null |
+++ b/LayoutTests/storage/indexeddb/window-onerror-prevented.html |
@@ -0,0 +1,39 @@ |
+<!DOCTYPE html> |
+<title>IndexedDB: Prevented errors do not trigger window.onerror</title> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<script> |
+ |
+var t = async_test('Prevented error on request does not cause window.onerror to fire'); |
+t.step(function() { |
+ var dbName = location.pathname; |
+ var deleteRequest = indexedDB.deleteDatabase(dbName); |
+ deleteRequest.onsuccess = t.step_func(function() { |
+ var openRequest = indexedDB.open(dbName); |
+ openRequest.onupgradeneeded = t.step_func(function() { |
+ var db = openRequest.result; |
+ var store = db.createObjectStore('store'); |
+ }); |
+ openRequest.onsuccess = t.step_func(function() { |
+ var db = openRequest.result; |
+ var tx = db.transaction('store', 'readwrite'); |
+ var store = tx.objectStore('store'); |
+ store.add({}, 'k1'); |
+ store.add({}, 'k1').onerror = t.step_func(function(e) { |
+ e.preventDefault(); |
+ }); |
+ tx.oncomplete = t.step_func(function() { |
+ t.done(); |
+ }); |
+ tx.onabort = t.step_func(function() { |
+ assert_unreached('transaction should have aborted'); |
+ }); |
+ }); |
+ }); |
+ |
+ window.onerror = t.step_func(function(message, url, line, column) { |
+ assert_unreached('window.onerror should not be called'); |
+ }); |
+}); |
+ |
+</script> |