tenfourfox/dom/mobileconnection/tests/marionette/test_call_barring_get_error.js
Cameron Kaiser c9b2922b70 hello FPR
2017-04-19 00:56:45 -07:00

49 lines
1.4 KiB
JavaScript

/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
MARIONETTE_TIMEOUT = 60000;
MARIONETTE_HEAD_JS = "head.js";
function testGetCallBarringOption(aExpectedError, aOptions) {
log("Test getCallBarringOption with " + JSON.stringify(aOptions));
return getCallBarringOption(aOptions)
.then(function resolve(aResult) {
ok(false, "should be rejected");
}, function reject(aError) {
is(aError.name, aExpectedError, "failed to getCallBarringOption");
});
}
// Start tests
startTestCommon(function() {
return Promise.resolve()
// Test program
.then(() => testGetCallBarringOption("InvalidParameter", {
program: 8, /* Invalid program */
serviceClass: 0
}))
.then(() => testGetCallBarringOption("InvalidParameter", {
program: null, /* Invalid program */
serviceClass: 0
}))
.then(() => testGetCallBarringOption("InvalidParameter", {
/* Undefined program */
serviceClass: 0
}))
// Test serviceClass
.then(() => testGetCallBarringOption("InvalidParameter", {
program: MozMobileConnection.CALL_BARRING_PROGRAM_ALL_OUTGOING,
serviceClass: null /* Invalid serviceClass */
}))
.then(() => testGetCallBarringOption("InvalidParameter", {
program: MozMobileConnection.CALL_BARRING_PROGRAM_ALL_OUTGOING,
/* Undefined serviceClass */
}));
});