Bug 1637141 - Send an empty response to callers of getFreeBusyIntervals to indicate there are no providers. r=pmorris
--HG-- extra : rebase_source : d92a3c7e3f8d4e07614c7faf5d7161c1a18640fa extra : amend_source : 9a033bf0d68c3f5a51bab86d19a8cd21c5ecdaf1
This commit is contained in:
Родитель
c128222e75
Коммит
42ab267330
|
@ -36,7 +36,7 @@ CalFreeBusyListener.prototype = {
|
|||
if (this.mFinalListener) {
|
||||
if (!aOperation || !aOperation.isPending) {
|
||||
--this.mNumOperations;
|
||||
if (this.mNumOperations == 0) {
|
||||
if (this.mNumOperations <= 0) {
|
||||
this.opGroup.notifyCompleted();
|
||||
}
|
||||
}
|
||||
|
@ -63,6 +63,9 @@ CalFreeBusyService.prototype = {
|
|||
// calIFreeBusyProvider:
|
||||
getFreeBusyIntervals(aCalId, aRangeStart, aRangeEnd, aBusyTypes, aListener) {
|
||||
let groupListener = new CalFreeBusyListener(this.mProviders.size, aListener);
|
||||
if (this.mProviders.size == 0) {
|
||||
groupListener.onResult(null, []);
|
||||
}
|
||||
for (let provider of this.mProviders.values()) {
|
||||
let operation = provider.getFreeBusyIntervals(
|
||||
aCalId,
|
||||
|
|
|
@ -10,6 +10,7 @@ function run_test() {
|
|||
|
||||
function really_run_test() {
|
||||
test_found();
|
||||
test_noproviders();
|
||||
test_failure();
|
||||
test_cancel();
|
||||
}
|
||||
|
@ -76,6 +77,28 @@ function test_found() {
|
|||
);
|
||||
}
|
||||
|
||||
function test_noproviders() {
|
||||
_clearProviders();
|
||||
|
||||
let listener = {
|
||||
onResult(request, result) {
|
||||
ok(!this.called);
|
||||
equal(result.length, 0);
|
||||
equal(request.status, 0);
|
||||
do_test_finished();
|
||||
},
|
||||
};
|
||||
|
||||
do_test_pending();
|
||||
freebusy.getFreeBusyIntervals(
|
||||
"email",
|
||||
cal.createDateTime("20120101T010101"),
|
||||
cal.createDateTime("20120102T010101"),
|
||||
Ci.calIFreeBusyInterval.BUSY_ALL,
|
||||
listener
|
||||
);
|
||||
}
|
||||
|
||||
function test_failure() {
|
||||
_clearProviders();
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче