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

Unified Diff: chrome/test/data/indexeddb/object_store_test.js

Issue 5904004: IndexedDB: Update browser tests to test for IDB exception codes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/indexeddb/object_store_test.js
diff --git a/chrome/test/data/indexeddb/object_store_test.js b/chrome/test/data/indexeddb/object_store_test.js
index c4a11579fc21b22a4f630e84de9216a57deeee47..7946c9a1fba3dca7d59be03671eeb835064e00b1 100644
--- a/chrome/test/data/indexeddb/object_store_test.js
+++ b/chrome/test/data/indexeddb/object_store_test.js
@@ -40,15 +40,26 @@ function getSuccess()
result.onerror = unexpectedErrorCallback;
}
-function dataAddedSuccess()
+function addWithSameKeyFailed()
{
- debug('Data added');
+ debug('Adding a record with same key failed');
+ shouldBe("event.code", "webkitIDBDatabaseException.CONSTRAINT_ERR");
var result = objectStore.get(1);
result.onsuccess = getSuccess;
result.onerror = unexpectedErrorCallback;
}
+function dataAddedSuccess()
+{
+ debug('Data added');
+
+ debug('Try to add employee with same id');
+ var result = objectStore.add({fname: "Tom", lname: "Jones", id: 1});
+ result.onsuccess = unexpectedSuccessCallback;
+ result.onerror = addWithSameKeyFailed;
+}
+
function populateObjectStore()
{
debug('Populating object store');
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698