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

Unified Diff: third_party/WebKit/LayoutTests/storage/indexeddb/resources/observer.js

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/resources/observer.js
diff --git a/third_party/WebKit/LayoutTests/storage/indexeddb/resources/observer.js b/third_party/WebKit/LayoutTests/storage/indexeddb/resources/observer.js
index dfcf7295440e7e2788cec51475714d9e63e9bcbe..9445dbc0facae5e112b26a65da71694accf245a3 100644
--- a/third_party/WebKit/LayoutTests/storage/indexeddb/resources/observer.js
+++ b/third_party/WebKit/LayoutTests/storage/indexeddb/resources/observer.js
@@ -5,6 +5,7 @@ if (this.importScripts) {
async_test(function(t) {
var dbname = location.pathname + ' - ' + 'empty transaction';
+ indexedDB.deleteDatabase(dbname);
var openRequest = indexedDB.open(dbname);
var callback_count = 0;
var obs = new IDBObserver(t.step_func(function() { callback_count++; }));
@@ -32,6 +33,7 @@ async_test(function(t) {
async_test(function(t) {
var dbname = location.pathname + ' - ' + 'observer in version change';
+ indexedDB.deleteDatabase(dbname);
var openRequest = indexedDB.open(dbname);
var callback_count = 0;
var obs;
@@ -60,6 +62,7 @@ async_test(function(t) {
async_test(function(t) {
var dbname = location.pathname + ' - ' + 'ignore observe call';
+ indexedDB.deleteDatabase(dbname);
var openRequest = indexedDB.open(dbname);
var callback_count = 0;
var obs = new IDBObserver(t.step_func(function() { callback_count++; }));
@@ -82,6 +85,7 @@ async_test(function(t) {
async_test(function(t) {
var dbname = location.pathname + ' - ' + 'abort associated transaction';
+ indexedDB.deleteDatabase(dbname);
var openRequest = indexedDB.open(dbname);
var callback_count = 0;
var obs = new IDBObserver(t.step_func(function() { callback_count++; }));
@@ -90,6 +94,10 @@ async_test(function(t) {
});
openRequest.onsuccess = t.step_func(function() {
var db = openRequest.result;
+
+ // Prevent propagation to global error handler.
+ db.onerror = e => { e.preventDefault(); };
+
var tx1 = db.transaction('store', 'readwrite');
var tx2 = db.transaction('store', 'readwrite');
tx1.objectStore('store').get(1);
@@ -111,6 +119,7 @@ async_test(function(t) {
async_test(function(t) {
var dbname = location.pathname + ' - ' + 'abort transaction';
+ indexedDB.deleteDatabase(dbname);
var openRequest = indexedDB.open(dbname);
var callback_count = 0;
var obs = new IDBObserver(t.step_func(function() { callback_count++; }));
@@ -119,6 +128,10 @@ async_test(function(t) {
});
openRequest.onsuccess = t.step_func(function() {
var db = openRequest.result;
+
+ // Prevent propagation to global error handler.
+ db.onerror = e => { e.preventDefault(); };
+
var tx1 = db.transaction('store', 'readwrite');
var tx2 = db.transaction('store', 'readwrite');
var tx3 = db.transaction('store', 'readwrite');
@@ -143,4 +156,4 @@ async_test(function(t) {
});
}, 'Abort transaction recorded by observer');
-done();
+done();

Powered by Google App Engine
This is Rietveld 408576698