Bug 824145 - Part 3: Support for STK icon display (marionette tests). r=edgar

This commit is contained in:
Jessica Jong 2014-08-25 10:32:35 +08:00
parent 421fdf9935
commit f86fce0ccf
14 changed files with 329 additions and 50 deletions

View File

@ -5,6 +5,13 @@ MARIONETTE_TIMEOUT = 30000;
SpecialPowers.addPermission("mobileconnection", true, document);
const WHT = 0xFFFFFFFF;
const BLK = 0x000000FF;
const RED = 0xFF0000FF;
const GRN = 0x00FF00FF;
const BLU = 0x0000FFFF;
const TSP = 0;
let iccManager = navigator.mozIccManager;
ok(iccManager instanceof MozIccManager,
"iccManager is instanceof " + iccManager.constructor);
@ -24,6 +31,67 @@ is(iccId, "89014103211118510720", "iccId is " + iccId);
let icc = iccManager.getIccById(iccId);
ok(icc instanceof MozIcc, "icc is instanceof " + icc.constructor);
// Basic Image, see record number 1 in EFimg.
let basicIcon = {
width: 8,
height: 8,
codingScheme: "basic",
pixels: [WHT, WHT, WHT, WHT, WHT, WHT, WHT, WHT,
BLK, BLK, BLK, BLK, BLK, BLK, WHT, WHT,
WHT, BLK, WHT, BLK, BLK, WHT, BLK, WHT,
WHT, BLK, BLK, WHT, WHT, BLK, BLK, WHT,
WHT, BLK, BLK, WHT, WHT, BLK, BLK, WHT,
WHT, BLK, WHT, BLK, BLK, WHT, BLK, WHT,
WHT, WHT, BLK, BLK, BLK, BLK, WHT, WHT,
WHT, WHT, WHT, WHT, WHT, WHT, WHT, WHT]
};
// Color Image, see record number 3 in EFimg.
let colorIcon = {
width: 8,
height: 8,
codingScheme: "color",
pixels: [BLU, BLU, BLU, BLU, BLU, BLU, BLU, BLU,
BLU, RED, RED, RED, RED, RED, RED, BLU,
BLU, RED, GRN, GRN, GRN, RED, RED, BLU,
BLU, RED, RED, GRN, GRN, RED, RED, BLU,
BLU, RED, RED, GRN, GRN, RED, RED, BLU,
BLU, RED, RED, GRN, GRN, GRN, RED, BLU,
BLU, RED, RED, RED, RED, RED, RED, BLU,
BLU, BLU, BLU, BLU, BLU, BLU, BLU, BLU]
};
// Color Image with Transparency, see record number 5 in EFimg.
let colorTransparencyIcon = {
width: 8,
height: 8,
codingScheme: "color-transparency",
pixels: [TSP, TSP, TSP, TSP, TSP, TSP, TSP, TSP,
TSP, RED, RED, RED, RED, RED, RED, TSP,
TSP, RED, GRN, GRN, GRN, RED, RED, TSP,
TSP, RED, RED, GRN, GRN, RED, RED, TSP,
TSP, RED, RED, GRN, GRN, RED, RED, TSP,
TSP, RED, RED, GRN, GRN, GRN, RED, TSP,
TSP, RED, RED, RED, RED, RED, RED, TSP,
TSP, TSP, TSP, TSP, TSP, TSP, TSP, TSP]
};
function isIcons(icons, expectedIcons, message) {
is(icons.length, expectedIcons.length, message);
for (let i = 0; i < icons.length; i++) {
let icon = icons[i];
let expectedIcon = expectedIcons[i];
is(icon.width, expectedIcon.width, message);
is(icon.height, expectedIcon.height, message);
is(icon.codingScheme, expectedIcon.codingScheme, message);
is(icon.pixels.length, expectedIcon.pixels.length);
for (let j = 0; j < icon.pixels.length; j++) {
is(icon.pixels[j], expectedIcon.pixels[j], message);
}
}
}
let pendingEmulatorCmdCount = 0;
function sendStkPduToEmulator(command, func, expect) {
++pendingEmulatorCmdCount;

View File

@ -9,15 +9,25 @@ function testBipCommand(command, expect) {
is(command.typeOfCommand, expect.typeOfCommand, expect.name);
is(command.options.text, expect.text, expect.name);
let icons = command.options.icons;
if (icons) {
isIcons(icons, expect.icons, expect.name);
let iconSelfExplanatory = command.options.iconSelfExplanatory;
is(iconSelfExplanatory, expect.iconSelfExplanatory, expect.name);
}
runNextTest();
}
let tests = [
{command: "d04b81030140018202818205074f70656e204944350702030403041f0239020578470a065465737447700272730d08f4557365724c6f670d08f4557365725077643c0301ad9c3e052101010101",
{command: "d04f81030140018202818205074f70656e204944350702030403041f0239020578470a065465737447700272730d08f4557365724c6f670d08f4557365725077643c0301ad9c3e0521010101019e020007",
func: testBipCommand,
expect: {name: "open_channel_1",
typeOfCommand: iccManager.STK_CMD_OPEN_CHANNEL,
text: "Open ID"}},
text: "Open ID",
iconSelfExplanatory: true,
icons: [colorIcon, colorTransparencyIcon]}},
{command: "d0448103014001820281820500350702030403041f0239020578470a065465737447700272730d08f4557365724c6f670d08f4557365725077643c0301ad9c3e052101010101",
func: testBipCommand,
expect: {name: "open_channel_2",

View File

@ -17,6 +17,14 @@ function testDisplayText(command, expect) {
is(duration.timeInterval, expect.duration.timeInterval, expect.name);
}
let icons = command.options.icons;
if (icons) {
isIcons(icons, expect.icons, expect.name);
let iconSelfExplanatory = command.options.iconSelfExplanatory;
is(iconSelfExplanatory, expect.iconSelfExplanatory, expect.name);
}
runNextTest();
}
@ -89,6 +97,14 @@ let tests = [
userClear: true,
duration: {timeUnit: iccManager.STK_TIME_UNIT_SECOND,
timeInterval: 0x0A}}},
{command: "d01a8103012180820281028d0b0442617369632049636f6e9e020001",
func: testDisplayText,
expect: {name: "display_text_cmd_12",
commandQualifier: 0x80,
text: "Basic Icon",
userClear: true,
iconSelfExplanatory: true,
icons: [basicIcon]}},
];
runNextTest();

View File

@ -18,6 +18,14 @@ function testGetInKey(command, expect) {
is(duration.timeInterval, expect.duration.timeInterval, expect.name);
}
let icons = command.options.icons;
if (icons) {
isIcons(icons, expect.icons, expect.name);
let iconSelfExplanatory = command.options.iconSelfExplanatory;
is(iconSelfExplanatory, expect.iconSelfExplanatory, expect.name);
}
runNextTest();
}
@ -88,10 +96,12 @@ let tests = [
commandQualifier: 0x04,
text: "Enter NO",
isYesNoRequested: true}},
{command: "d0198103012200820281828d0a043c4e4f2d49434f4e3e1e020001",
{command: "d0198103012200820281828d0a043c4e4f2d49434f4e3e1e020002",
func: testGetInKey,
expect: {name: "get_inkey_cmd_13",
commandQualifier: 0x00,
// The record number 02 in EFimg is not defined, so no icon will be
// shown, but the text string should still be displayed.
text: "<NO-ICON>"}},
{command: "D0198103012200820281828D0A04456E74657220222B228402010A",
func: testGetInKey,

View File

@ -25,6 +25,13 @@ function testGetInput(command, expect) {
if (command.options.hideInput) {
is(command.options.hideInput, expect.hideInput, expect.name);
}
let icons = command.options.icons;
if (icons) {
isIcons(icons, expect.icons, expect.name);
let iconSelfExplanatory = command.options.iconSelfExplanatory;
is(iconSelfExplanatory, expect.iconSelfExplanatory, expect.name);
}
runNextTest();
}
@ -153,10 +160,12 @@ let tests = [
minLength: 160,
maxLength: 160,
defaultText: "***1111111111###***2222222222###***3333333333###***4444444444###***5555555555###***6666666666###***7777777777###***8888888888###***9999999999###***0000000000###"}},
{command: "d01d8103012300820281828d0a043c4e4f2d49434f4e3e9102000a1e020001",
{command: "d01d8103012300820281828d0a043c4e4f2d49434f4e3e9102000a1e020002",
func: testGetInput,
expect: {name: "get_input_cmd_17",
commandQualifier: 0x00,
// The record number 02 in EFimg is not defined, so no icon will be
// shown, but the text string should still be displayed.
text: "<NO-ICON>",
minLength: 0,
maxLength: 10}},
@ -166,7 +175,9 @@ let tests = [
commandQualifier: 0x00,
text: "<BASIC-ICON>",
minLength: 0,
maxLength: 10}},
maxLength: 10,
iconSelfExplanatory: false,
icons: [basicIcon]}},
];
runNextTest();

View File

@ -12,6 +12,14 @@ function testLaunchBrowser(command, expect) {
is(command.options.confirmMessage, expect.text, expect.name);
}
let icons = command.options.icons;
if (icons) {
isIcons(icons, expect.icons, expect.name);
let iconSelfExplanatory = command.options.iconSelfExplanatory;
is(iconSelfExplanatory, expect.iconSelfExplanatory, expect.name);
}
runNextTest();
}
@ -69,13 +77,17 @@ let tests = [
expect: {name: "launch_browser_cmd_9",
commandQualifier: 0x02,
url: "",
text: "Not self explan."}},
text: "Not self explan.",
iconSelfExplanatory: false,
icons: [basicIcon]}},
{command: "d01d8103011502820281823100050c53656c66206578706c616e2e1e020001",
func: testLaunchBrowser,
expect: {name: "launch_browser_cmd_10",
commandQualifier: 0x02,
url: "",
text: "Self explan."}},
text: "Self explan.",
iconSelfExplanatory: true,
icons: [basicIcon]}},
{command: "d0208103011500820281823100050d44656661756c742055524c2031d004000d00b4",
func: testLaunchBrowser,
expect: {name: "launch_browser_cmd_11",

View File

@ -11,7 +11,24 @@ function testSelectItem(command, expect) {
for (let index in command.options.items) {
is(command.options.items[index].identifier, expect.items[index].identifier, expect.name);
is(command.options.items[index].text, expect.items[index].text, expect.name);
let itemIcons = command.options.items[index].icons;
if (itemIcons) {
isIcons(itemIcons, expect.items[index].icons, expect.name);
let iconSelfExplanatory = command.options.items[index].iconSelfExplanatory;
is(iconSelfExplanatory, expect.items[index].iconSelfExplanatory, expect.name);
}
}
let icons = command.options.icons;
if (icons) {
isIcons(icons, expect.icons, expect.name);
let iconSelfExplanatory = command.options.iconSelfExplanatory;
is(iconSelfExplanatory, expect.iconSelfExplanatory, expect.name);
}
let length = command.options.nextActionList ? command.options.nextActionList.length : 0;
for (let i = 0; i < length; i++) {
is(command.options.nextActionList[i], expect.nextActionList[i], expect.name);
@ -76,18 +93,26 @@ let tests = [
commandQualifier: 0x80,
title: "Toolkit Select",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}, {identifier: 3, text: "Item 3"}]}},
{command: "d03e810301240082028182850e546f6f6c6b69742053656c6563748f07014974656d20318f07024974656d20328f07034974656d20339e0201019f0401050505",
{command: "d03e810301240082028182850e546f6f6c6b69742053656c6563748f07014974656d20318f07024974656d20328f07034974656d20339e0201019f0401030303",
func: testSelectItem,
expect: {name: "select_item_cmd_10",
commandQualifier: 0x00,
title: "Toolkit Select",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}, {identifier: 3, text: "Item 3"}]}},
iconSelfExplanatory: false,
icons: [basicIcon],
items: [{identifier: 1, text: "Item 1", iconSelfExplanatory: false, icons: [colorIcon]},
{identifier: 2, text: "Item 2", iconSelfExplanatory: false, icons: [colorIcon]},
{identifier: 3, text: "Item 3", iconSelfExplanatory: false, icons: [colorIcon]}]}},
{command: "d03e810301240082028182850e546f6f6c6b69742053656c6563748f07014974656d20318f07024974656d20328f07034974656d20339e0200019f0400050505",
func: testSelectItem,
expect: {name: "select_item_cmd_11",
commandQualifier: 0x00,
title: "Toolkit Select",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}, {identifier: 3, text: "Item 3"}]}},
iconSelfExplanatory: true,
icons: [basicIcon],
items: [{identifier: 1, text: "Item 1", iconSelfExplanatory: true, icons: [colorTransparencyIcon]},
{identifier: 2, text: "Item 2", iconSelfExplanatory: true, icons: [colorTransparencyIcon]},
{identifier: 3, text: "Item 3", iconSelfExplanatory: true, icons: [colorTransparencyIcon]}]}},
{command: "d034810301240382028182850e546f6f6c6b69742053656c6563748f07014974656d20318f07024974656d20328f07034974656d2033",
func: testSelectItem,
expect: {name: "select_item_cmd_12",

View File

@ -9,6 +9,14 @@ function testSendDTMF(command, expect) {
is(command.commandQualifier, expect.commandQualifier, expect.name);
is(command.options.text, expect.text, expect.name);
let icons = command.options.icons;
if (icons) {
isIcons(icons, expect.icons, expect.name);
let iconSelfExplanatory = command.options.iconSelfExplanatory;
is(iconSelfExplanatory, expect.iconSelfExplanatory, expect.name);
}
runNextTest();
}
@ -35,20 +43,28 @@ let tests = [
func: testSendDTMF,
expect: {name: "send_dtmf_cmd_3_with_alpha_identifier",
commandQualifier: 0x00,
text: "Basic Icon"}},
{command: "d011810301140082028183ac02c1f29e020001",
text: "Basic Icon",
iconSelfExplanatory: true,
icons: [basicIcon]}},
{command: "d011810301140082028183ac02c1f29e020005",
func: testSendDTMF,
expect: {name: "send_dtmf_cmd_3_without_alpha_identifier",
commandQualifier: 0x00}},
commandQualifier: 0x00,
iconSelfExplanatory: true,
icons: [colorIcon]}},
{command: "d01c810301140082028183850953656e642044544d46ac02c1f29e020101",
func: testSendDTMF,
expect: {name: "send_dtmf_cmd_4_with_alpha_identifier",
commandQualifier: 0x00,
text: "Send DTMF"}},
{command: "d011810301140082028183ac02c1f29e020101",
text: "Send DTMF",
iconSelfExplanatory: false,
icons: [basicIcon]}},
{command: "d011810301140082028183ac02c1f29e020105",
func: testSendDTMF,
expect: {name: "send_dtmf_cmd_4_without_alpha_identifier",
commandQualifier: 0x00}},
commandQualifier: 0x00,
iconSelfExplanatory: false,
icons: [colorIcon]}},
{command: "d028810301140082028183851980041704140420041004120421042204120423041904220415ac02c1f2",
func: testSendDTMF,
expect: {name: "send_dtmf_cmd_5_with_alpha_identifier",

View File

@ -9,6 +9,14 @@ function testSendSMS(command, expect) {
is(command.commandQualifier, expect.commandQualifier, expect.name);
is(command.options.text, expect.title, expect.name);
let icons = command.options.icons;
if (icons) {
isIcons(icons, expect.icons, expect.name);
let iconSelfExplanatory = command.options.iconSelfExplanatory;
is(iconSelfExplanatory, expect.iconSelfExplanatory, expect.name);
}
runNextTest();
}
@ -90,24 +98,32 @@ let tests = [
title: "ЗДРАВСТВУЙТЕ"}},
// send_sms_cmd_9_without_alpha_identifier has the same pdu as
// send_sms_cmd_8_without_alpha_identifier.
{command: "d03b81030113008202818385074e4f2049434f4e86099111223344556677f88b180100099110325476f840f40c54657374204d6573736167659e020001",
{command: "d03b81030113008202818385074e4f2049434f4e86099111223344556677f88b180100099110325476f840f40c54657374204d6573736167659e020002",
func: testSendSMS,
expect: {name: "send_sms_cmd_10_with_alpha_identifier",
commandQualifier: 0x00,
// The record number 02 in EFimg is not defined, so no icon will be
// shown, but the text string should still be displayed.
title: "NO ICON"}},
{command: "d03281030113008202818386099111223344556677f88b180100099110325476f840f40c54657374204d6573736167659e020001",
func: testSendSMS,
expect: {name: "send_sms_cmd_10_without_alpha_identifier",
commandQualifier: 0x00}},
commandQualifier: 0x00,
iconSelfExplanatory: true,
icons: [basicIcon]}},
{command: "d03b810301130082028183850753656e6420534d86099111223344556677f88b180100099110325476f840f40c54657374204d6573736167651e020101",
func: testSendSMS,
expect: {name: "send_sms_cmd_11_with_alpha_identifier",
commandQualifier: 0x00,
title: "Send SM"}},
title: "Send SM",
iconSelfExplanatory: false,
icons: [basicIcon]}},
{command: "d03281030113008202818386099111223344556677f88b180100099110325476f840f40c54657374204d6573736167651e020101",
func: testSendSMS,
expect: {name: "send_sms_cmd_11_without_alpha_identifier",
commandQualifier: 0x00}},
commandQualifier: 0x00,
iconSelfExplanatory: false,
icons: [basicIcon]}},
{command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001000b4",
func: testSendSMS,
expect: {name: "send_sms_cmd_12_with_alpha_identifier",

View File

@ -9,6 +9,14 @@ function testSendSS(command, expect) {
is(command.commandQualifier, expect.commandQualifier, expect.name);
is(command.options.text, expect.title, expect.name);
let icons = command.options.icons;
if (icons) {
isIcons(icons, expect.icons, expect.name);
let iconSelfExplanatory = command.options.iconSelfExplanatory;
is(iconSelfExplanatory, expect.iconSelfExplanatory, expect.name);
}
runNextTest();
}
@ -51,29 +59,41 @@ let tests = [
func: testSendSS,
expect: {name: "send_ss_cmd_5_with_alpha_identifier",
commandQualifier: 0x00,
title: "Basic Icon"}},
title: "Basic Icon",
iconSelfExplanatory: true,
icons: [basicIcon]}},
{command: "d01f810301110082028183891091aa120a214365870921436587a901fb9e020001",
func: testSendSS,
expect: {name: "send_ss_cmd_5_without_alpha_identifier",
commandQualifier: 0x00}},
{command: "d02c810301110082028183850b436f6c6f75722049636f6e891091aa120a214365870921436587a901fb9e020002",
commandQualifier: 0x00,
iconSelfExplanatory: true,
icons: [basicIcon]}},
{command: "d02c810301110082028183850b436f6c6f75722049636f6e891091aa120a214365870921436587a901fb9e020003",
func: testSendSS,
expect: {name: "send_ss_cmd_6_with_alpha_identifier",
commandQualifier: 0x00,
title: "Colour Icon"}},
{command: "d01f810301110082028183891091aa120a214365870921436587a901fb9e020002",
title: "Colour Icon",
iconSelfExplanatory: true,
icons: [colorIcon]}},
{command: "d01f810301110082028183891091aa120a214365870921436587a901fb9e020003",
func: testSendSS,
expect: {name: "send_ss_cmd_6_without_alpha_identifier",
commandQualifier: 0x00}},
commandQualifier: 0x00,
iconSelfExplanatory: true,
icons: [colorIcon]}},
{command: "d02b810301110082028183850a42617369632049636f6e891091aa120a214365870921436587a901fb9e020101",
func: testSendSS,
expect: {name: "send_ss_cmd_7_with_alpha_identifier",
commandQualifier: 0x00,
title: "Basic Icon"}},
title: "Basic Icon",
iconSelfExplanatory: false,
icons: [basicIcon]}},
{command: "d01f810301110082028183891091aa120a214365870921436587a901fb9e020101",
func: testSendSS,
expect: {name: "send_ss_cmd_7_without_alpha_identifier",
commandQualifier: 0x00}},
commandQualifier: 0x00,
iconSelfExplanatory: false,
icons: [basicIcon]}},
{command: "d036810301110082028183851980041704140420041004120421042204120423041904220415891091aa120a214365870921436587a901fb",
func: testSendSS,
expect: {name: "send_ss_cmd_8_with_alpha_identifier",

View File

@ -9,6 +9,14 @@ function testSendUSSD(command, expect) {
is(command.commandQualifier, expect.commandQualifier, expect.name);
is(command.options.text, expect.title, expect.name);
let icons = command.options.icons;
if (icons) {
isIcons(icons, expect.icons, expect.name);
let iconSelfExplanatory = command.options.iconSelfExplanatory;
is(iconSelfExplanatory, expect.iconSelfExplanatory, expect.name);
}
runNextTest();
}
@ -58,29 +66,41 @@ let tests = [
func: testSendUSSD,
expect: {name: "send_ussd_cmd_6_with_alpha_identifier",
commandQualifier: 0x00,
title: "Basic Icon"}},
title: "Basic Icon",
iconSelfExplanatory: true,
icons: [basicIcon]}},
{command: "d0488103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e5609e020001",
func: testSendUSSD,
expect: {name: "send_ussd_cmd_6_without_alpha_identifier",
commandQualifier: 0x00}},
{command: "d054810301120082028183850a436f6c6f722049636f6e8a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e5609e020002",
commandQualifier: 0x00,
iconSelfExplanatory: true,
icons: [basicIcon]}},
{command: "d054810301120082028183850a436f6c6f722049636f6e8a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e5609e020003",
func: testSendUSSD,
expect: {name: "send_ussd_cmd_7_with_alpha_identifier",
commandQualifier: 0x00,
title: "Color Icon"}},
{command: "d0488103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e5609e020002",
title: "Color Icon",
iconSelfExplanatory: true,
icons: [colorIcon]}},
{command: "d0488103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e5609e020003",
func: testSendUSSD,
expect: {name: "send_ussd_cmd_7_without_alpha_identifier",
commandQualifier: 0x00}},
commandQualifier: 0x00,
iconSelfExplanatory: true,
icons: [colorIcon]}},
{command: "d054810301120082028183850a42617369632049636f6e8a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e5609e020101",
func: testSendUSSD,
expect: {name: "send_ussd_cmd_8_with_alpha_identifier",
commandQualifier: 0x00,
title: "Basic Icon"}},
title: "Basic Icon",
iconSelfExplanatory: false,
icons: [basicIcon]}},
{command: "d0488103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e5609e020101",
func: testSendUSSD,
expect: {name: "send_ussd_cmd_8_without_alpha_identifier",
commandQualifier: 0x00}},
commandQualifier: 0x00,
iconSelfExplanatory: false,
icons: [basicIcon]}},
{command: "d05f8103011200820281838519800417041404200410041204210422041204230419042204158a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
func: testSendUSSD,
expect: {name: "send_ussd_cmd_9_with_alpha_identifier",

View File

@ -17,6 +17,14 @@ function testSetupCall(command, expect) {
is(duration.timeInterval, expect.duration.timeInterval, expect.name);
}
let icons = command.options.icons;
if (icons) {
isIcons(icons, expect.icons, expect.name);
let iconSelfExplanatory = command.options.iconSelfExplanatory;
is(iconSelfExplanatory, expect.iconSelfExplanatory, expect.name);
}
runNextTest();
}
@ -82,26 +90,34 @@ let tests = [
expect: {name: "setup_call_cmd_10",
commandQualifier: 0x00,
confirmMessage: "Set up call Icon 3.1.1",
address: "+012340123456,1,2"}},
address: "+012340123456,1,2",
iconSelfExplanatory: false,
icons: [basicIcon]}},
{command: "d03081030110008202818385165365742075702063616c6c2049636f6e20332e322e318609911032042143651c2c9e020001",
func: testSetupCall,
expect: {name: "setup_call_cmd_11",
commandQualifier: 0x00,
confirmMessage: "Set up call Icon 3.2.1",
address: "+012340123456,1,2"}},
{command: "d03081030110008202818385165365742075702063616c6c2049636f6e20332e332e318609911032042143651c2c9e020102",
address: "+012340123456,1,2",
iconSelfExplanatory: true,
icons: [basicIcon]}},
{command: "d03081030110008202818385165365742075702063616c6c2049636f6e20332e332e318609911032042143651c2c9e020103",
func: testSetupCall,
expect: {name: "setup_call_cmd_12",
commandQualifier: 0x00,
confirmMessage: "Set up call Icon 3.3.1",
address: "+012340123456,1,2"}},
{command: "d04c81030110008202818385165365742075702063616c6c2049636f6e20332e342e318609911032042143651c2c9e02000185165365742075702063616c6c2049636f6e20332e342e329e020001",
address: "+012340123456,1,2",
iconSelfExplanatory: false,
icons: [colorIcon]}},
{command: "d04c81030110008202818385165365742075702063616c6c2049636f6e20332e342e318609911032042143651c2c9e02000185165365742075702063616c6c2049636f6e20332e342e329e020005",
func: testSetupCall,
expect: {name: "setup_call_cmd_13",
commandQualifier: 0x00,
confirmMessage: "Set up call Icon 3.4.1",
callMessage: "Set up call Icon 3.4.2",
address: "+012340123456,1,2"}},
address: "+012340123456,1,2",
iconSelfExplanatory: true,
icons: [colorTransparencyIcon]}},
{command: "d038810301100082028183850e434f4e4649524d4154494f4e20318609911032042143651c2c850643414c4c2031d004000e00b4d004000600b4",
func: testSetupCall,
expect: {name: "setup_call_cmd_14",

View File

@ -9,6 +9,14 @@ function testSetupIdleModeText(command, expect) {
is(command.commandQualifier, expect.commandQualifier, expect.name);
is(command.options.text, expect.text, expect.name);
let icons = command.options.icons;
if (icons) {
isIcons(icons, expect.icons, expect.name);
let iconSelfExplanatory = command.options.iconSelfExplanatory;
is(iconSelfExplanatory, expect.iconSelfExplanatory, expect.name);
}
runNextTest();
}
@ -32,17 +40,23 @@ let tests = [
func: testSetupIdleModeText,
expect: {name: "setup_idle_mode_text_cmd_4",
commandQualifier: 0x00,
text: "Idle text"}},
{command: "d0198103012800820281828d0a0449646c6520746578749e020101",
text: "Idle text",
iconSelfExplanatory: true,
icons: [basicIcon]}},
{command: "d0198103012800820281828d0a0449646c6520746578749e020105",
func: testSetupIdleModeText,
expect: {name: "setup_idle_mode_text_cmd_5",
commandQualifier: 0x00,
text: "Idle text"}},
{command: "d0198103012800820281828d0a0449646c6520746578749e020002",
text: "Idle text",
iconSelfExplanatory: false,
icons: [colorIcon]}},
{command: "d0198103012800820281828d0a0449646c6520746578749e020007",
func: testSetupIdleModeText,
expect: {name: "setup_idle_mode_text_cmd_6",
commandQualifier: 0x00,
text: "Idle text"}},
text: "Idle text",
iconSelfExplanatory: true,
icons: [colorIcon, colorTransparencyIcon]}},
{command: "d0248103012800820281828d1908041704140420041004120421042204120423041904220415",
func: testSetupIdleModeText,
expect: {name: "setup_idle_mode_text_cmd_7",

View File

@ -11,7 +11,24 @@ function testSetupMenu(command, expect) {
for (let index in command.options.items) {
is(command.options.items[index].identifier, expect.items[index].identifier, expect.name);
is(command.options.items[index].text, expect.items[index].text, expect.name);
let itemIcons = command.options.items[index].icons;
if (itemIcons) {
isIcons(itemIcons, expect.items[index].icons, expect.name);
let iconSelfExplanatory = command.options.items[index].iconSelfExplanatory;
is(iconSelfExplanatory, expect.items[index].iconSelfExplanatory, expect.name);
}
}
let icons = command.options.icons;
if (icons) {
isIcons(icons, expect.icons, expect.name);
let iconSelfExplanatory = command.options.iconSelfExplanatory;
is(iconSelfExplanatory, expect.iconSelfExplanatory, expect.name);
}
let length = command.options.nextActionList ? command.options.nextActionList.length : 0;
for (let i = 0; i < length; i++) {
is(command.options.nextActionList[i], expect.nextActionList[i], expect.name);
@ -83,18 +100,26 @@ let tests = [
title: "Toolkit Menu",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}, {identifier: 3, text: "Item 3"}, {identifier: 4, text: "Item 4"}],
nextActionList: [iccManager.STK_CMD_SEND_SMS, iccManager.STK_CMD_SET_UP_CALL, iccManager.STK_CMD_LAUNCH_BROWSER, iccManager.STK_CMD_PROVIDE_LOCAL_INFO]}},
{command: "d03c810301250082028182850c546f6f6c6b6974204d656e758f07014974656d20318f07024974656d20328f07034974656d20339e0201019f0401050505",
{command: "d03c810301250082028182850c546f6f6c6b6974204d656e758f07014974656d20318f07024974656d20328f07034974656d20339e0201019f0401030303",
func: testSetupMenu,
expect: {name: "setup_menu_cmd_8",
commandQualifier: 0x00,
title: "Toolkit Menu",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}, {identifier: 3, text: "Item 3"}]}},
iconSelfExplanatory: false,
icons: [basicIcon],
items: [{identifier: 1, text: "Item 1", iconSelfExplanatory: false, icons: [colorIcon]},
{identifier: 2, text: "Item 2", iconSelfExplanatory: false, icons: [colorIcon]},
{identifier: 3, text: "Item 3", iconSelfExplanatory: false, icons: [colorIcon]}]}},
{command: "d03c810301250082028182850c546f6f6c6b6974204d656e758f07014974656d20318f07024974656d20328f07034974656d20339e0200019f0400050505",
func: testSetupMenu,
expect: {name: "setup_menu_cmd_9",
commandQualifier: 0x00,
title: "Toolkit Menu",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}, {identifier: 3, text: "Item 3"}]}},
iconSelfExplanatory: true,
icons: [basicIcon],
items: [{identifier: 1, text: "Item 1", iconSelfExplanatory: true, icons: [colorTransparencyIcon]},
{identifier: 2, text: "Item 2", iconSelfExplanatory: true, icons: [colorTransparencyIcon]},
{identifier: 3, text: "Item 3", iconSelfExplanatory: true, icons: [colorTransparencyIcon]}]}},
{command: "d029810301250182028182850c546f6f6c6b6974204d656e758f07014974656d20318f07024974656d2032",
func: testSetupMenu,
expect: {name: "setup_menu_cmd_10",