Bug 1126198 - Part 2: Add test coverage to ensure that 'presentationType' is only available in STK_CMD_SELECT_ITEM. r=echen
authorBevis Tseng <btseng@mozilla.com>
Tue, 27 Jan 2015 18:51:20 +0800
changeset 226909 72ac9b4c7b823b2ee80f107a209f1a1274276f58
parent 226908 3e430f2ff603361fa9e453fc59ce8ac6c2c03ae1
child 226910 076504baa3a312c545d8676e986979ee3050ea0e
push id54950
push userphilringnalda@gmail.com
push dateSat, 31 Jan 2015 17:14:09 +0000
treeherdermozilla-inbound@37cbadfe1bc1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersechen
bugs1126198
milestone38.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
dom/icc/tests/marionette/test_stk_setup_menu.js
dom/system/gonk/tests/test_ril_system_messenger.js
--- a/dom/icc/tests/marionette/test_stk_select_item.js
+++ b/dom/icc/tests/marionette/test_stk_select_item.js
@@ -212,16 +212,17 @@ const TEST_DATA = [
             items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}, {identifier: 3, text: "Item 3"}],
             nextActionList: [MozIccManager.STK_NEXT_ACTION_NULL, MozIccManager.STK_NEXT_ACTION_NULL, MozIccManager.STK_NEXT_ACTION_END_PROACTIVE_SESSION]}},
 ];
 
 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];
     let itemExpect = aExpect.items[index];
     is(item.identifier, itemExpect.identifier,
        "options.items[" + index + "].identifier");
     is(item.text, itemExpect.text,
        "options.items[" + index + "].text");
--- a/dom/icc/tests/marionette/test_stk_setup_menu.js
+++ b/dom/icc/tests/marionette/test_stk_setup_menu.js
@@ -153,16 +153,18 @@ const TEST_DATA = [
             title: "",
             items: [null]}},
 ];
 
 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];
     let itemExpect = aExpect.items[index];
 
     if (!itemExpect) {
       is(item, itemExpect, "options.items[" + index + "]");
     } else {
--- a/dom/system/gonk/tests/test_ril_system_messenger.js
+++ b/dom/system/gonk/tests/test_ril_system_messenger.js
@@ -720,17 +720,16 @@ add_test(function test_icc_notify_stk_pr
       commandQualifier: 0x80, // bit 8: 1 = help information available
       options: {
         title: "Toolkit Menu 1",
         items: [
           { identifier: 0x01, text: "Menu Item 1" },
           { identifier: 0x02, text: "Menu Item 2" },
           { identifier: 0x03, text: "Menu Item 3" }
         ],
-        presentationType: RIL.STK_PRESENTATION_TYPE_NOT_SPECIFIED,
         isHelpAvailable: true
       }
     },
     // STK_CMD_SET_UP_MENU with optional properties including:
     // iconInfo for this menu, iconInfo for each item and nextActionList.
     {
       commandNumber: ++cmdCount,
       typeOfCommand: RIL.STK_CMD_SET_UP_MENU,
@@ -757,31 +756,31 @@ add_test(function test_icc_notify_stk_pr
         nextActionList: [
           RIL.STK_NEXT_ACTION_END_PROACTIVE_SESSION,
           RIL.STK_NEXT_ACTION_NULL,
           RIL.STK_NEXT_ACTION_NULL,
           RIL.STK_NEXT_ACTION_NULL
         ],
         iconSelfExplanatory: false,
         icons: [basicIcon, colorIcon, colorTransparencyIcon],
-        presentationType: RIL.STK_PRESENTATION_TYPE_NOT_SPECIFIED,
         isHelpAvailable: false
       }
     },
     // STK_CMD_SELECT_ITEM with mandatory properties.
     {
       commandNumber: ++cmdCount,
       typeOfCommand: RIL.STK_CMD_SELECT_ITEM,
       commandQualifier: RIL.STK_PRESENTATION_TYPE_NOT_SPECIFIED,
       options: {
         items: [
           { identifier: 0x01, text: "Menu Item 1" },
           { identifier: 0x02, text: "Menu Item 2" },
           { identifier: 0x03, text: "Menu Item 3" }
         ],
+        presentationType: RIL.STK_PRESENTATION_TYPE_NOT_SPECIFIED,
         isHelpAvailable: false
       }
     },
     // STK_CMD_SELECT_ITEM with optional properties including:
     // title, iconInfo for this menu, iconInfo for each item and nextActionList.
     {
       commandNumber: ++cmdCount,
       typeOfCommand: RIL.STK_CMD_SELECT_ITEM,
@@ -809,16 +808,17 @@ add_test(function test_icc_notify_stk_pr
           RIL.STK_NEXT_ACTION_END_PROACTIVE_SESSION,
           RIL.STK_NEXT_ACTION_NULL,
           RIL.STK_NEXT_ACTION_NULL,
           RIL.STK_NEXT_ACTION_NULL
         ],
         defaultItem: 0x02,
         iconSelfExplanatory: false,
         icons: [basicIcon, colorIcon, colorTransparencyIcon],
+        presentationType: RIL.STK_PRESENTATION_TYPE_NAVIGATION_OPTIONS,
         isHelpAvailable: false
       }
     },
     // STK_CMD_DISPLAY_TEXT with mandatory properties.
     {
       commandNumber: ++cmdCount,
       typeOfCommand: RIL.STK_CMD_DISPLAY_TEXT,
       commandQualifier: 0x01, // bit 1: High Priority