Bug 1126198 - Part 2: Add test coverage to ensure that 'presentationType' is only available in STK_CMD_SELECT_ITEM. r=echen

This commit is contained in:
Bevis Tseng 2015-01-27 18:51:20 +08:00
parent aa3666273e
commit de1f1c4471
3 changed files with 5 additions and 2 deletions

View File

@ -217,6 +217,7 @@ function testSelectItem(aCommand, aExpect) {
is(aCommand.typeOfCommand, MozIccManager.STK_CMD_SELECT_ITEM, "typeOfCommand");
is(aCommand.commandQualifier, aExpect.commandQualifier, "commandQualifier");
is(aCommand.options.title, aExpect.title, "options.title");
is(aCommand.options.presentationType, aCommand.commandQualifier & 0x03, "presentationType");
for (let index in aExpect.items) {
let item = aCommand.options.items[index];

View File

@ -158,6 +158,8 @@ function testSetupMenu(aCommand, aExpect) {
is(aCommand.typeOfCommand, MozIccManager.STK_CMD_SET_UP_MENU, "typeOfCommand");
is(aCommand.commandQualifier, aExpect.commandQualifier, "commandQualifier");
is(aCommand.options.title, aExpect.title, "options.title");
// To ensure that 'presentationType' will only be available in SELECT_ITEM.
is(aCommand.options.presentationType, undefined, "presentationType");
for (let index in aExpect.items) {
let item = aCommand.options.items[index];

View File

@ -725,7 +725,6 @@ add_test(function test_icc_notify_stk_proactive_command() {
{ identifier: 0x02, text: "Menu Item 2" },
{ identifier: 0x03, text: "Menu Item 3" }
],
presentationType: RIL.STK_PRESENTATION_TYPE_NOT_SPECIFIED,
isHelpAvailable: true
}
},
@ -762,7 +761,6 @@ add_test(function test_icc_notify_stk_proactive_command() {
],
iconSelfExplanatory: false,
icons: [basicIcon, colorIcon, colorTransparencyIcon],
presentationType: RIL.STK_PRESENTATION_TYPE_NOT_SPECIFIED,
isHelpAvailable: false
}
},
@ -777,6 +775,7 @@ add_test(function test_icc_notify_stk_proactive_command() {
{ identifier: 0x02, text: "Menu Item 2" },
{ identifier: 0x03, text: "Menu Item 3" }
],
presentationType: RIL.STK_PRESENTATION_TYPE_NOT_SPECIFIED,
isHelpAvailable: false
}
},
@ -814,6 +813,7 @@ add_test(function test_icc_notify_stk_proactive_command() {
defaultItem: 0x02,
iconSelfExplanatory: false,
icons: [basicIcon, colorIcon, colorTransparencyIcon],
presentationType: RIL.STK_PRESENTATION_TYPE_NAVIGATION_OPTIONS,
isHelpAvailable: false
}
},