mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 11:55:49 +00:00
Bug 855556 - Test the cached branch of getAll more extensively. r=gwagner
This commit is contained in:
parent
7124b8a0a0
commit
82cfae8d50
@ -72,7 +72,7 @@ function ContactDispatcher(aContacts, aFullContacts, aCallback, aNewTxn, aClearD
|
||||
aCallback(chunk);
|
||||
chunk.length = 0;
|
||||
nextIndex += CHUNK_SIZE;
|
||||
interval = setTimeout(this.sendChunk, CHUNK_INTERVAL);
|
||||
interval = setTimeout(sendChunk, CHUNK_INTERVAL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -195,20 +195,9 @@ let index = 0;
|
||||
let req;
|
||||
let mozContacts = window.navigator.mozContacts;
|
||||
|
||||
let steps = [
|
||||
clearDatabase,
|
||||
function() {
|
||||
// add a contact
|
||||
createResult1 = new mozContact();
|
||||
createResult1.init({});
|
||||
req = navigator.mozContacts.save(createResult1);
|
||||
req.onsuccess = function() {
|
||||
next();
|
||||
};
|
||||
req.onerror = onFailure;
|
||||
},
|
||||
function() {
|
||||
ok(true, "Retrieving one contact with getAll");
|
||||
function getOne(msg) {
|
||||
return function() {
|
||||
ok(true, msg || "Retrieving one contact with getAll");
|
||||
req = mozContacts.getAll({});
|
||||
let count = 0;
|
||||
req.onsuccess = function(event) {
|
||||
@ -223,13 +212,12 @@ let steps = [
|
||||
}
|
||||
};
|
||||
req.onerror = onFailure;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
clearDatabase,
|
||||
addContacts,
|
||||
|
||||
function() {
|
||||
ok(true, "Retrieving 40 contacts with getAll");
|
||||
function getAll(msg) {
|
||||
return function() {
|
||||
ok(true, msg || "Retrieving 40 contacts with getAll");
|
||||
req = mozContacts.getAll({
|
||||
sortBy: "familyName",
|
||||
sortOrder: "ascending"
|
||||
@ -251,7 +239,31 @@ let steps = [
|
||||
}
|
||||
};
|
||||
req.onerror = onFailure;
|
||||
}
|
||||
}
|
||||
|
||||
let steps = [
|
||||
clearDatabase,
|
||||
function() {
|
||||
// add a contact
|
||||
createResult1 = new mozContact();
|
||||
createResult1.init({});
|
||||
req = navigator.mozContacts.save(createResult1);
|
||||
req.onsuccess = function() {
|
||||
next();
|
||||
};
|
||||
req.onerror = onFailure;
|
||||
},
|
||||
|
||||
getOne(),
|
||||
getOne("Retrieving one contact with getAll - cached"),
|
||||
|
||||
clearDatabase,
|
||||
addContacts,
|
||||
|
||||
getAll(),
|
||||
getAll("Retrieving 40 contacts with getAll - cached"),
|
||||
|
||||
function() {
|
||||
ok(true, "Deleting one contact");
|
||||
req = mozContacts.remove(createResult1);
|
||||
|
Loading…
Reference in New Issue
Block a user