Bug 943198 - Follow-up of bug 814637: enable new marionette tests of IccManager. r=hsinyi

This commit is contained in:
Edgar Chen 2013-11-26 13:19:32 +08:00
Родитель 89e2fbba42
Коммит 2c9697303d
3 изменённых файлов: 18 добавлений и 34 удалений

Просмотреть файл

@ -24,6 +24,4 @@ qemu = true
[test_stk_setup_idle_mode_text.js]
[test_stk_bip_command.js]
[test_icc_access_invalid_object.js]
disabled = Bug 933654
[test_icc_detected_undetected_event.js]
disabled = Bug 933654

Просмотреть файл

@ -5,25 +5,18 @@ MARIONETTE_TIMEOUT = 30000;
MARIONETTE_HEAD_JS = "icc_header.js";
function setRadioEnabled(enabled) {
SpecialPowers.addPermission("settings-write", true, document);
let connection = navigator.mozMobileConnections[0];
ok(connection);
// TODO: Bug 856553 - [B2G] RIL: need an API to enable/disable radio
let settings = navigator.mozSettings;
let setLock = settings.createLock();
let obj = {
"ril.radio.disabled": !enabled
let request = connection.setRadioEnabled(enabled);
request.onsuccess = function onsuccess() {
log('setRadioEnabled: ' + enabled);
};
let setReq = setLock.set(obj);
setReq.addEventListener("success", function onSetSuccess() {
log("set 'ril.radio.disabled' to " + enabled);
});
setReq.addEventListener("error", function onSetError() {
ok(false, "cannot set 'ril.radio.disabled' to " + enabled);
});
SpecialPowers.removePermission("settings-write", document);
request.onerror = function onerror() {
ok(false, "setRadioEnabled should be ok");
};
}
/* Test access invalid icc object */

Просмотреть файл

@ -5,25 +5,18 @@ MARIONETTE_TIMEOUT = 30000;
MARIONETTE_HEAD_JS = "icc_header.js";
function setRadioEnabled(enabled) {
SpecialPowers.addPermission("settings-write", true, document);
let connection = navigator.mozMobileConnections[0];
ok(connection);
// TODO: Bug 856553 - [B2G] RIL: need an API to enable/disable radio
let settings = navigator.mozSettings;
let setLock = settings.createLock();
let obj = {
"ril.radio.disabled": !enabled
let request = connection.setRadioEnabled(enabled);
request.onsuccess = function onsuccess() {
log('setRadioEnabled: ' + enabled);
};
let setReq = setLock.set(obj);
setReq.addEventListener("success", function onSetSuccess() {
log("set 'ril.radio.disabled' to " + enabled);
});
setReq.addEventListener("error", function onSetError() {
ok(false, "cannot set 'ril.radio.disabled' to " + enabled);
});
SpecialPowers.removePermission("settings-write", document);
request.onerror = function onerror() {
ok(false, "setRadioEnabled should be ok");
};
}
/* Test iccundetected event */