Bug 835255 - Part 2: adding marionette test for PNN/OPL. r=vicamo

This commit is contained in:
Patrick Wang 2013-05-22 16:36:03 +08:00
Родитель 357786abe2
Коммит 1341003b78
1 изменённых файлов: 39 добавлений и 1 удалений

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

@ -30,6 +30,21 @@ function sendEmulatorCommand(cmd, callback) {
});
}
function setEmulatorOperatorNamesAndMccMnc(which, longName, shortName,
mcc, mnc, callback) {
let cmd = "operator set " + which + " " + longName + "," +
shortName + "," + mcc + mnc;
sendEmulatorCommand(cmd, function (result) {
let re = new RegExp("^" + longName + "," +
shortName + "," + mcc + mnc);
ok(result[which].match(re), "Long/short name and mcc/mnc should be changed.");
if (callback) {
window.setTimeout(callback, 0);
}
});
}
function setEmulatorOperatorNames(which, longName, shortName, callback) {
let cmd = "operator set " + which + " " + longName + "," + shortName;
sendEmulatorCommand(cmd, function (result) {
@ -87,13 +102,36 @@ function testMobileOperatorNames() {
doTestMobileOperatorNames("Mozilla", "", function () {
doTestMobileOperatorNames("", "B2G", function () {
doTestMobileOperatorNames("", "", function () {
doTestMobileOperatorNames("Android", "Android", testRoamingCheck);
doTestMobileOperatorNames("Android", "Android", testOperatorPLMNList);
});
});
});
});
}
function doTestOperatorPLMNList(mcc, mnc, expectedLongName,
expectedShortName, callback) {
log("Testing mcc = " + mcc + ", mnc = " + mnc + ":");
waitForVoiceChange(function () {
is(network.longName, expectedLongName, "network.longName");
is(network.shortName, expectedShortName, "network.shortName");
is(network.mcc, mcc, "network.mcc");
is(network.mnc, mnc, "network.mnc");
window.setTimeout(callback, 0);
});
setEmulatorOperatorNamesAndMccMnc(OPERATOR_HOME, "Android", "Android", mcc, mnc);
}
function testOperatorPLMNList() {
doTestOperatorPLMNList("123", "456", "Android", "Android", function() {
doTestOperatorPLMNList("310", "070", "AT&T", "", function() {
doTestOperatorPLMNList("310", "260", "Android", "Android", testRoamingCheck);
});
});
}
// See bug 797972 - B2G RIL: False roaming situation
//
// Steps to test: