Bug 916000 - Part2: Add sim state xpcshell test case. r=yoshi

This commit is contained in:
Georgia Wang 2013-09-25 12:22:18 +08:00
parent bc01254f5f
commit 3f710ee1e6

View File

@ -1665,6 +1665,42 @@ add_test(function test_personalization_state() {
run_next_test();
});
/**
* Verify SIM app_state in _processICCStatus
*/
add_test(function test_card_app_state() {
let worker = newUint8Worker();
let ril = worker.RIL;
function testCardAppState(cardAppState, geckoCardState) {
let iccStatus = {
gsmUmtsSubscriptionAppIndex: 0,
apps: [
{
app_state: cardAppState
}],
};
ril._processICCStatus(iccStatus);
do_check_eq(ril.cardState, geckoCardState);
}
testCardAppState(CARD_APPSTATE_ILLEGAL,
GECKO_CARDSTATE_ILLEGAL);
testCardAppState(CARD_APPSTATE_PIN,
GECKO_CARDSTATE_PIN_REQUIRED);
testCardAppState(CARD_APPSTATE_PUK,
GECKO_CARDSTATE_PUK_REQUIRED);
testCardAppState(CARD_APPSTATE_READY,
GECKO_CARDSTATE_READY);
testCardAppState(CARD_APPSTATE_UNKNOWN,
GECKO_CARDSTATE_UNKNOWN);
testCardAppState(CARD_APPSTATE_DETECTED,
GECKO_CARDSTATE_UNKNOWN);
run_next_test();
});
/**
* Verify iccSetCardLock - Facility Lock.
*/