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

Unified Diff: LayoutTests/storage/indexeddb/lazy-index-population.html

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/lazy-index-population.html
diff --git a/LayoutTests/storage/indexeddb/lazy-index-population.html b/LayoutTests/storage/indexeddb/lazy-index-population.html
index aae18ab543b3148e9dd5c2c2bb2506f08400d853..0285a8e189380535fc2ba80918bb5af1f28959f3 100644
--- a/LayoutTests/storage/indexeddb/lazy-index-population.html
+++ b/LayoutTests/storage/indexeddb/lazy-index-population.html
@@ -33,12 +33,15 @@ function verifyPreExistingIndex()
request2.onerror = function () {
debug("request2 received error event");
shouldBe("++state", "2");
+ waitForError(/ConstraintError/, function() {
+ shouldBe("++state", "3");
+ });
};
trans.oncomplete = unexpectedCompleteCallback;
trans.onabort = function () {
debug("transaction aborted");
- shouldBe("++state", "3");
+ shouldBe("++state", "4");
shouldBe("trans.error.name", "'ConstraintError'");
verifyCreateThenPut();
};
@@ -76,19 +79,24 @@ function verifyCreateThenPut()
request2.onerror = function () {
debug("request2 (index2) received error event");
shouldBe("++state", "2");
+ waitForError(/ConstraintError/, function() {
+ shouldBe("++state", "3");
+ });
};
trans.oncomplete = unexpectedCompleteCallback;
trans.onabort = function () {
debug("transaction aborted");
- shouldBe("++state", "3");
+ shouldBe("++state", "4");
shouldBe("trans.error.name", "'ConstraintError'");
};
};
}
-function verifyPutThenCreate()
+function verifyPutThenCreate(evt)
{
+ evt.preventDefault();
+
debug("");
debug("Verify that uniqueness constraints are enforced when index is created after puts:");
@@ -129,8 +137,10 @@ function verifyPutThenCreate()
};
}
-function verifyPutThenCreateThenPut()
+function verifyPutThenCreateThenPut(evt)
{
+ evt.preventDefault();
+
debug("");
debug("Verify that uniqueness constraints are enforced when index is created between puts:");
@@ -160,12 +170,15 @@ function verifyPutThenCreateThenPut()
request2.onerror = function () {
debug("request2 received error event");
shouldBe("++state", "2");
+ waitForError(/ConstraintError/, function() {
+ shouldBe("++state", "3");
+ });
};
trans.oncomplete = unexpectedCompleteCallback;
trans.onabort = function () {
debug("transaction aborted");
- shouldBe("++state", "3");
+ shouldBe("++state", "4");
shouldBe("trans.error.name", "'ConstraintError'");
};
};

Powered by Google App Engine
This is Rietveld 408576698