From de1f1c4471ca7407c34e0bea992a4f54ec2032fb Mon Sep 17 00:00:00 2001 From: Bevis Tseng Date: Tue, 27 Jan 2015 18:51:20 +0800 Subject: [PATCH] Bug 1126198 - Part 2: Add test coverage to ensure that 'presentationType' is only available in STK_CMD_SELECT_ITEM. r=echen --- dom/icc/tests/marionette/test_stk_select_item.js | 1 + dom/icc/tests/marionette/test_stk_setup_menu.js | 2 ++ dom/system/gonk/tests/test_ril_system_messenger.js | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dom/icc/tests/marionette/test_stk_select_item.js b/dom/icc/tests/marionette/test_stk_select_item.js index a3b1a2e1487d..70ccee2a8b10 100644 --- a/dom/icc/tests/marionette/test_stk_select_item.js +++ b/dom/icc/tests/marionette/test_stk_select_item.js @@ -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]; diff --git a/dom/icc/tests/marionette/test_stk_setup_menu.js b/dom/icc/tests/marionette/test_stk_setup_menu.js index 37db6678928f..d7da2bfa8890 100644 --- a/dom/icc/tests/marionette/test_stk_setup_menu.js +++ b/dom/icc/tests/marionette/test_stk_setup_menu.js @@ -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]; diff --git a/dom/system/gonk/tests/test_ril_system_messenger.js b/dom/system/gonk/tests/test_ril_system_messenger.js index 79330a5d001d..db7c21555b7d 100644 --- a/dom/system/gonk/tests/test_ril_system_messenger.js +++ b/dom/system/gonk/tests/test_ril_system_messenger.js @@ -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 } },