Add two additional test cases for removing puted items, and a small fix to make sure all cases of put are actually inserted.

This commit is contained in:
Shawn Wilsher 2010-05-10 14:26:56 -07:00
parent 7825f33ec2
commit 1864a37944
2 changed files with 17 additions and 2 deletions

View File

@ -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;

View File

@ -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;