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

Unified Diff: LayoutTests/storage/indexeddb/resources/transaction-basics.js

Issue 243523003: Fire window.onerror for uncaught IndexedDB errors (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased and linkage fix Created 5 years, 3 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: LayoutTests/storage/indexeddb/resources/transaction-basics.js
diff --git a/LayoutTests/storage/indexeddb/resources/transaction-basics.js b/LayoutTests/storage/indexeddb/resources/transaction-basics.js
index 3834165fd1289cb63c70aa8e1d32ed238848e7ab..c170f06b147688701cc92cab0f6e96392766aa93 100644
--- a/LayoutTests/storage/indexeddb/resources/transaction-basics.js
+++ b/LayoutTests/storage/indexeddb/resources/transaction-basics.js
@@ -37,14 +37,15 @@ function addRemoveIDBObjects()
trans.abort();
}
-function testSetVersionAbort2()
+function testSetVersionAbort2(evt)
{
- debug("");
- debug("testSetVersionAbort2():");
+ preamble(evt);
+ evt.preventDefault();
+
checkMetadataEmpty();
evalAndLog("request = newConnection()");
request.onupgradeneeded = addRemoveAddIDBObjects;
- request.onerror = null;
+ request.onerror = function(e) { e.preventDefault(); };
}
function addRemoveAddIDBObjects()
@@ -53,7 +54,7 @@ function addRemoveAddIDBObjects()
db = event.target.result;
var trans = evalAndLog("trans = event.target.transaction");
shouldBeNonNull("trans");
- trans.addEventListener('abort', testSetVersionAbort3, false);
+ trans.onabort = testSetVersionAbort3;
trans.oncomplete = unexpectedCompleteCallback;
var store = evalAndLog("store = db.createObjectStore('storeFail', null)");
@@ -62,16 +63,16 @@ function addRemoveAddIDBObjects()
evalAndLog("db.deleteObjectStore('storeFail')");
evalAndExpectException("store.deleteIndex('indexFail')", "DOMException.INVALID_STATE_ERR", "'InvalidStateError'");
- var store = evalAndLog("store = db.createObjectStore('storeFail', null)");
- var index = evalAndLog("index = store.createIndex('indexFail', 'x')");
+ store = evalAndLog("store = db.createObjectStore('storeFail', null)");
+ index = evalAndLog("index = store.createIndex('indexFail', 'x')");
trans.abort();
}
-function testSetVersionAbort3()
+function testSetVersionAbort3(evt)
{
- debug("");
- debug("testSetVersionAbort3():");
+ preamble(evt);
+
shouldBeFalse("event.cancelable");
checkMetadataEmpty();
evalAndLog("request = newConnection()");
@@ -114,10 +115,11 @@ function testInactiveAbortedTransaction()
evalAndExpectException("store.openCursor()", "0", "'TransactionInactiveError'");
}
-function testSetVersionAbort4()
+function testSetVersionAbort4(evt)
{
- debug("");
- debug("testSetVersionAbort4():");
+ preamble(evt);
+ evt.preventDefault();
+
checkMetadataEmpty();
evalAndLog("request = newConnection()");
request.onupgradeneeded = addIDBObjectsAndCommit;
@@ -183,10 +185,11 @@ function removeIDBObjects()
trans.abort();
}
-function testSetVersionAbort6()
+function testSetVersionAbort6(evt)
{
- debug("");
- debug("testSetVersionAbort6():");
+ preamble(evt);
+ evt.preventDefault();
+
checkMetadataExistingObjectStore();
evalAndLog("request = newConnection()");
request.onupgradeneeded = setVersionSuccess;

Powered by Google App Engine
This is Rietveld 408576698