diff --git a/dom/indexedDB/IDBObjectStoreRequest.cpp b/dom/indexedDB/IDBObjectStoreRequest.cpp index 620fafad98a..ed33d1adbab 100644 --- a/dom/indexedDB/IDBObjectStoreRequest.cpp +++ b/dom/indexedDB/IDBObjectStoreRequest.cpp @@ -194,6 +194,7 @@ GetKeyFromVariant(nsIVariant* aKey, // See xpcvariant.cpp, these are the only types we should expect. switch (type) { + case nsIDataType::VTYPE_VOID: case nsIDataType::VTYPE_EMPTY: if (!aAutoIncrement || aGetting) { return NS_ERROR_INVALID_ARG; diff --git a/dom/indexedDB/test/test_objectStore_remove_values.html b/dom/indexedDB/test/test_objectStore_remove_values.html index 2f19f73ad6d..ce1e2e8bc80 100644 --- a/dom/indexedDB/test/test_objectStore_remove_values.html +++ b/dom/indexedDB/test/test_objectStore_remove_values.html @@ -61,18 +61,32 @@ function testSteps() { name: "inline key; key generator", autoIncrement: true, storedObject: {name: "Lincoln"}, + keyName: "id", keyValue: undefined, }, { name: "inline key; no key generator", autoIncrement: false, storedObject: {id: 1, name: "Lincoln"}, + keyName: "id", keyValue: undefined, }, - // TODO add the other two cases + { name: "out of line key; key generator", + autoIncrement: true, + storedObject: {name: "Lincoln"}, + keyName: null, + keyValue: undefined, + }, + { name: "out of line key; no key generator", + autoIncrement: false, + storedObject: {name: "Lincoln"}, + keyName: null, + keyValue: 1, + }, ]; for (let i = 0; i < data.length; i++) { let test = data[i]; - let request = db.createObjectStore(test.name, "id", test.autoIncrement); + let request = db.createObjectStore(test.name, test.keyName, + test.autoIncrement); request.onerror = errorHandler; request.onsuccess = continueTest; event = yield;