Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(340)

Unified Diff: third_party/WebKit/LayoutTests/storage/indexeddb/window-onerror-prevented.html

Issue 1362953003: Fire window.onerror for uncaught IndexedDB errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/storage/indexeddb/window-onerror-prevented.html
diff --git a/third_party/WebKit/LayoutTests/storage/indexeddb/window-onerror-prevented.html b/third_party/WebKit/LayoutTests/storage/indexeddb/window-onerror-prevented.html
new file mode 100644
index 0000000000000000000000000000000000000000..326267a6f835d50267e35f5f9579e250db9a5259
--- /dev/null
+++ b/third_party/WebKit/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>

Powered by Google App Engine
This is Rietveld 408576698