This commit is contained in:
Ryan VanderMeulen 2015-02-09 16:36:09 -05:00
Родитель d22477cea4 67c4b20687
Коммит b0272eb2e1
36 изменённых файлов: 2162 добавлений и 1545 удалений

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e06971db7acf7a35c32eb74d675a4e12e288e6be">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0d7b35f23402c4cb29bca6b98280fec48a196dec"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0cf517083f7eb5fc269e1236edba50534f65e3cd"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2262d4a77d4f46ab230fd747bb91e9b77bad36cb"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -23,7 +23,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="0d6ed91bdcc40fe0878fac9a6b7362c7b2680d57"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="da777082e02eec11c4b7e27679bdb15f47a44f66"/>
<!-- Stock Android things -->
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="ebdad82e61c16772f6cd47e9f11936bf6ebe9aa0"/>
@ -35,7 +35,7 @@
<project name="device/sample" path="device/sample" revision="1a3d8efa0ad32ec8f145367a3cf0f54b97385c3c"/>
<project name="platform/abi/cpp" path="abi/cpp" revision="18f1b5e28734183ff8073fe86dc46bc4ebba8a59"/>
<project name="platform/bionic" path="bionic" revision="86b1f589c313422a7da1812512b9ec8d1cf9ba3c"/>
<project name="platform/bootable/recovery" path="bootable/recovery" revision="75a2463ff719f242759de5c6c7555473dab05b68"/>
<project name="platform/bootable/recovery" path="bootable/recovery" revision="286354e69491f7cba5b9ec6b551831fe6f85ad0d"/>
<project name="platform/external/aac" path="external/aac" revision="fa3eba16446cc8f2f5e2dfc20d86a49dbd37299e"/>
<project name="platform/external/bison" path="external/bison" revision="c2418b886165add7f5a31fc5609f0ce2d004a90e"/>
<project name="platform/external/bluetooth/bluedroid" path="external/bluetooth/bluedroid" revision="c8e99ca7e11c00f8124196fe1726a15e6e976587"/>
@ -134,9 +134,9 @@
<project name="platform/hardware/akm" path="hardware/akm" revision="6d3be412647b0eab0adff8a2768736cf4eb68039"/>
<project groups="invensense" name="platform/hardware/invensense" path="hardware/invensense" revision="e6d9ab28b4f4e7684f6c07874ee819c9ea0002a2"/>
<project name="platform/hardware/ril" path="hardware/ril" revision="865ce3b4a2ba0b3a31421ca671f4d6c5595f8690"/>
<project name="kernel/common" path="kernel" revision="6c6f012cea17fb8b3263605737816cf6663432f1"/>
<project name="kernel/common" path="kernel" revision="b1b623fcc5c8a22f4e9cb30470378496e03c9404"/>
<project name="platform/system/core" path="system/core" revision="53d584d4a4b4316e4de9ee5f210d662f89b44e7e"/>
<project name="u-boot" path="u-boot" revision="cb37a7434073bb47c4c066f6922006442dcd8531"/>
<project name="u-boot" path="u-boot" revision="64b93dbec64421a05bc7ffdbc03917700d171570"/>
<project name="vendor/sprd/gps" path="vendor/sprd/gps" revision="6974f8e771d4d8e910357a6739ab124768891e8f"/>
<project name="vendor/sprd/open-source" path="vendor/sprd/open-source" revision="f56ab768cb9f1ad42fb0809ffec1424b1e693369"/>
<project name="vendor/sprd/partner" path="vendor/sprd/partner" revision="8649c7145972251af11b0639997edfecabfc7c2e"/>

Просмотреть файл

@ -19,13 +19,13 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="0d7b35f23402c4cb29bca6b98280fec48a196dec"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="0cf517083f7eb5fc269e1236edba50534f65e3cd"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2262d4a77d4f46ab230fd747bb91e9b77bad36cb"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="eb1795a9002eb142ac58c8d68f8f4ba094af07ca"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="2c31ac3a31a340b40ecd9c291df9b9613d3afa72"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="0d6ed91bdcc40fe0878fac9a6b7362c7b2680d57"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="da777082e02eec11c4b7e27679bdb15f47a44f66"/>
<!-- Stock Android things -->
<project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
<project name="platform_bionic" path="bionic" remote="b2g" revision="e2b3733ba3fa5e3f404e983d2e4142b1f6b1b846"/>

Просмотреть файл

@ -17,10 +17,10 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0d7b35f23402c4cb29bca6b98280fec48a196dec"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0cf517083f7eb5fc269e1236edba50534f65e3cd"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2262d4a77d4f46ab230fd747bb91e9b77bad36cb"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="0d6ed91bdcc40fe0878fac9a6b7362c7b2680d57"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="da777082e02eec11c4b7e27679bdb15f47a44f66"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<!-- Stock Android things -->

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e06971db7acf7a35c32eb74d675a4e12e288e6be">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0d7b35f23402c4cb29bca6b98280fec48a196dec"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0cf517083f7eb5fc269e1236edba50534f65e3cd"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2262d4a77d4f46ab230fd747bb91e9b77bad36cb"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -23,7 +23,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="0d6ed91bdcc40fe0878fac9a6b7362c7b2680d57"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="da777082e02eec11c4b7e27679bdb15f47a44f66"/>
<!-- Stock Android things -->
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="f92a936f2aa97526d4593386754bdbf02db07a12"/>
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="6e47ff2790f5656b5b074407829ceecf3e6188c4"/>

Просмотреть файл

@ -19,13 +19,13 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="0d7b35f23402c4cb29bca6b98280fec48a196dec"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="0cf517083f7eb5fc269e1236edba50534f65e3cd"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2262d4a77d4f46ab230fd747bb91e9b77bad36cb"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="eb1795a9002eb142ac58c8d68f8f4ba094af07ca"/>
<project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="2c31ac3a31a340b40ecd9c291df9b9613d3afa72"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="0d6ed91bdcc40fe0878fac9a6b7362c7b2680d57"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="da777082e02eec11c4b7e27679bdb15f47a44f66"/>
<!-- Stock Android things -->
<project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
<project name="platform_bionic" path="bionic" remote="b2g" revision="e2b3733ba3fa5e3f404e983d2e4142b1f6b1b846"/>

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="e06971db7acf7a35c32eb74d675a4e12e288e6be">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0d7b35f23402c4cb29bca6b98280fec48a196dec"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0cf517083f7eb5fc269e1236edba50534f65e3cd"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2262d4a77d4f46ab230fd747bb91e9b77bad36cb"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -23,7 +23,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="0d6ed91bdcc40fe0878fac9a6b7362c7b2680d57"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="da777082e02eec11c4b7e27679bdb15f47a44f66"/>
<!-- Stock Android things -->
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
<project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="ebdad82e61c16772f6cd47e9f11936bf6ebe9aa0"/>

Просмотреть файл

@ -17,10 +17,10 @@
</project>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0d7b35f23402c4cb29bca6b98280fec48a196dec"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0cf517083f7eb5fc269e1236edba50534f65e3cd"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2262d4a77d4f46ab230fd747bb91e9b77bad36cb"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="0d6ed91bdcc40fe0878fac9a6b7362c7b2680d57"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="da777082e02eec11c4b7e27679bdb15f47a44f66"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<!-- Stock Android things -->

Просмотреть файл

@ -1,9 +1,9 @@
{
"git": {
"git_revision": "0d7b35f23402c4cb29bca6b98280fec48a196dec",
"git_revision": "0cf517083f7eb5fc269e1236edba50534f65e3cd",
"remote": "https://git.mozilla.org/releases/gaia.git",
"branch": ""
},
"revision": "42545ce7016477c408fe5c009709f07a88b1325d",
"revision": "13fba23da899bce302aa98aaf4a429eb52fb341b",
"repo_path": "integration/gaia-central"
}

Просмотреть файл

@ -17,10 +17,10 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0d7b35f23402c4cb29bca6b98280fec48a196dec"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0cf517083f7eb5fc269e1236edba50534f65e3cd"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2262d4a77d4f46ab230fd747bb91e9b77bad36cb"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="fe893bb760a3bb64375f62fdf4762a58c59df9ef"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="0d6ed91bdcc40fe0878fac9a6b7362c7b2680d57"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="da777082e02eec11c4b7e27679bdb15f47a44f66"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<!-- Stock Android things -->

Просмотреть файл

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="7f2ee9f4cb926684883fc2a2e407045fd9db2199">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0d7b35f23402c4cb29bca6b98280fec48a196dec"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="0cf517083f7eb5fc269e1236edba50534f65e3cd"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2262d4a77d4f46ab230fd747bb91e9b77bad36cb"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
@ -23,7 +23,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
<project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="0d6ed91bdcc40fe0878fac9a6b7362c7b2680d57"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="da777082e02eec11c4b7e27679bdb15f47a44f66"/>
<!-- Stock Android things -->
<project groups="pdk,linux" name="platform/prebuilts/clang/linux-x86/host/3.5" path="prebuilts/clang/linux-x86/host/3.5" revision="50d1ca4ab8add54523b7bc692860d57e8ee4c0d1"/>
<project groups="pdk,linux,arm" name="platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.8" path="prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.8" revision="fb3845864573857677f9b500040a8f011eaf5078"/>

Просмотреть файл

@ -149,7 +149,7 @@ StkIconInfo.prototype = {
function StkItem(aIdentifier, aText, aStkIconInfo) {
this.identifier = aIdentifier;
if (aText) {
if (aText !== undefined) {
this.text = aText;
}
this.iconInfo = aStkIconInfo;
@ -318,7 +318,7 @@ function StkSetUpMenuCmd(aCommandDetails) {
let options = aCommandDetails.options;
if (options.title) {
if (options.title !== undefined) {
this.title = options.title;
}
@ -414,13 +414,10 @@ function StkSetUpMenuMessage(aStkSetUpMenuCmd) {
return item;
}),
isHelpAvailable: aStkSetUpMenuCmd.isHelpAvailable
isHelpAvailable: aStkSetUpMenuCmd.isHelpAvailable,
title: aStkSetUpMenuCmd.title
};
if (aStkSetUpMenuCmd.title) {
this.options.title = aStkSetUpMenuCmd.title;
}
let nextActionList = aStkSetUpMenuCmd.getNextActionList();
if (nextActionList && nextActionList.length > 0) {
this.options.nextActionList = nextActionList;
@ -482,7 +479,7 @@ function StkTextMessageCmd(aCommandDetails) {
let options = aCommandDetails.options;
if (options.text) {
if (options.text !== undefined) {
this.text = options.text;
}
@ -503,11 +500,9 @@ function StkTextMessage(aStkTextMessageCmd) {
// Call |StkCommandMessage| constructor.
StkCommandMessage.call(this, aStkTextMessageCmd);
this.options = {};
if (aStkTextMessageCmd.text) {
this.options.text = aStkTextMessageCmd.text;
}
this.options = {
text: aStkTextMessageCmd.text
};
if (aStkTextMessageCmd.iconInfo) {
appendIconInfo(this.options, aStkTextMessageCmd.iconInfo);
@ -562,13 +557,13 @@ function StkInputCmd(aCommandDetails) {
let options = aCommandDetails.options;
if (options.text) {
if (options.text !== undefined) {
this.text = options.text;
}
this.duration = mapDurationToStkDuration(options.duration);
if (options.defaultText) {
if (options.defaultText !== undefined) {
this.defaultText = options.defaultText;
}
@ -607,6 +602,7 @@ function StkInputMessage(aStkInputCmd) {
isAlphabet: aStkInputCmd.isAlphabet,
isUCS2: aStkInputCmd.isUCS2,
isHelpAvailable: aStkInputCmd.isHelpAvailable,
defaultText: aStkInputCmd.defaultText
};
if (aStkInputCmd.duration) {
@ -614,10 +610,6 @@ function StkInputMessage(aStkInputCmd) {
appendDuration(this.options.duration, aStkInputCmd.duration);
}
if (aStkInputCmd.defaultText) {
this.options.defaultText = aStkInputCmd.defaultText;
}
if (aStkInputCmd.iconInfo) {
appendIconInfo(this.options, aStkInputCmd.iconInfo);
}
@ -699,14 +691,14 @@ function StkSetUpCallCmd(aCommandDetails) {
this.address = options.address;
if(confirmMessage) {
if (confirmMessage.text) {
if (confirmMessage.text !== undefined) {
this.confirmText = confirmMessage.text;
}
this.confirmIconInfo = mapIconInfoToStkIconInfo(confirmMessage);
}
if(callMessage) {
if (callMessage.text) {
if (callMessage.text !== undefined) {
this.callText = callMessage.text;
}
this.callIconInfo = mapIconInfoToStkIconInfo(callMessage);
@ -737,22 +729,22 @@ function StkSetUpCallMessage(aStkSetUpCallCmd) {
address: aStkSetUpCallCmd.address
};
if (aStkSetUpCallCmd.confirmText || aStkSetUpCallCmd.confirmIconInfo) {
let confirmMessage = {};
if (aStkSetUpCallCmd.confirmText) {
confirmMessage.text = aStkSetUpCallCmd.confirmText;
}
if (aStkSetUpCallCmd.confirmText !== null ||
aStkSetUpCallCmd.confirmIconInfo) {
let confirmMessage = {
text: aStkSetUpCallCmd.confirmText
};
if (aStkSetUpCallCmd.confirmIconInfo) {
appendIconInfo(confirmMessage, aStkSetUpCallCmd.confirmIconInfo);
}
this.options.confirmMessage = confirmMessage;
}
if (aStkSetUpCallCmd.callText || aStkSetUpCallCmd.callIconInfo) {
let callMessage = {};
if (aStkSetUpCallCmd.callText) {
callMessage.text = aStkSetUpCallCmd.callText;
}
if (aStkSetUpCallCmd.callText !== null ||
aStkSetUpCallCmd.callIconInfo) {
let callMessage = {
text: aStkSetUpCallCmd.callText
};
if (aStkSetUpCallCmd.callIconInfo) {
appendIconInfo(callMessage, aStkSetUpCallCmd.callIconInfo);
}
@ -779,7 +771,7 @@ function StkBrowserSettingCmd(aCommandDetails) {
let confirmMessage = options.confirmMessage;
if(confirmMessage) {
if (confirmMessage.text) {
if (confirmMessage.text !== undefined) {
this.confirmText = confirmMessage.text;
}
this.confirmIconInfo = mapIconInfoToStkIconInfo(confirmMessage);
@ -807,11 +799,11 @@ function StkBrowserSettingMessage(aStkBrowserSettingCmd) {
mode: aStkBrowserSettingCmd.mode
};
if (aStkBrowserSettingCmd.confirmText || aStkBrowserSettingCmd.confirmIconInfo) {
let confirmMessage = {};
if (aStkBrowserSettingCmd.confirmText) {
confirmMessage.text = aStkBrowserSettingCmd.confirmText;
}
if (aStkBrowserSettingCmd.confirmText !== null ||
aStkBrowserSettingCmd.confirmIconInfo) {
let confirmMessage = {
text: aStkBrowserSettingCmd.confirmText
};
if (aStkBrowserSettingCmd.confirmIconInfo) {
appendIconInfo(confirmMessage, aStkBrowserSettingCmd.confirmIconInfo);
}
@ -826,7 +818,7 @@ function StkPlayToneCmd(aCommandDetails) {
let options = aCommandDetails.options;
if(options.text) {
if(options.text !== undefined) {
this.text = options.text;
}
@ -862,13 +854,10 @@ function StkPlayToneMessage(aStkPlayToneCmd) {
StkCommandMessage.call(this, aStkPlayToneCmd);
this.options = {
isVibrate: aStkPlayToneCmd.isVibrate
isVibrate: aStkPlayToneCmd.isVibrate,
text: aStkPlayToneCmd.text
};
if (aStkPlayToneCmd.text) {
this.options.text = aStkPlayToneCmd.text;
}
if (aStkPlayToneCmd.tone != Ci.nsIStkPlayToneCmd.TONE_TYPE_INVALID) {
this.options.tone = aStkPlayToneCmd.tone;
}

Просмотреть файл

@ -287,6 +287,36 @@ function waitForTargetEvent(aEventTarget, aEventName, aMatchFun) {
});
}
/**
* Wait for one named system message.
*
* Resolve if that named message is received. Never reject.
*
* Fulfill params: the message passed.
*
* @param aEventName
* A string message name.
* @param aMatchFun [optional]
* A matching function returns true or false to filter the message. If no
* matching function passed the promise is resolved after receiving the
* first message.
*
* @return A deferred promise.
*/
function waitForSystemMessage(aMessageName, aMatchFun) {
let target = workingFrame.contentWindow.navigator;
return new Promise(function(aResolve, aReject) {
target.mozSetMessageHandler(aMessageName, function(aMessage) {
if (!aMatchFun || aMatchFun(aMessage)) {
target.mozSetMessageHandler(aMessageName, null);
ok(true, "System message '" + aMessageName + "' got.");
aResolve(aMessage);
}
});
});
}
/**
* Set radio enabling state and wait for "radiostatechange" event.
*

Просмотреть файл

@ -12,7 +12,9 @@ qemu = true
[test_icc_card_state.js]
[test_icc_info.js]
[test_stk_refresh.js]
[test_stk_play_tone.js]
[test_stk_poll_off.js]
[test_stk_poll_interval.js]
[test_stk_setup_event_list.js]
[test_stk_setup_call.js]
[test_stk_send_ss.js]

Просмотреть файл

@ -6,36 +6,102 @@ MARIONETTE_HEAD_JS = "head.js";
const TEST_DATA = [
// Open channel.
{command: "d04f81030140018202818205074f70656e204944350702030403041f0239020578470a065465737447700272730d08f4557365724c6f670d08f4557365725077643c0301ad9c3e0521010101019e020007",
{command: "D02E" + // Length
"8103014001" + // Command details
"82028182" + // Device identities
"05074F70656E204944" + // Alpha identifier
"9E020007" + // Icon identifier
"86099111223344556677F8" + // Address
"350702030403041F02" + // Bear description
"39020578", // Buffer size
expect: {typeOfCommand: MozIccManager.STK_CMD_OPEN_CHANNEL,
commandQualifier: 0x01,
text: "Open ID",
iconSelfExplanatory: true,
icons: [COLOR_ICON, COLOR_TRANSPARENCY_ICON]}},
{command: "d0448103014001820281820500350702030403041f0239020578470a065465737447700272730d08f4557365724c6f670d08f4557365725077643c0301ad9c3e052101010101",
{command: "D023" + // Length
"8103014001" + // Command details
"82028182" + // Device identities
"0500" + // Alpha identifier
"86099111223344556677F8" + // Address
"350702030403041F02" + // Bear description
"39020578", // Buffer size
expect: {typeOfCommand: MozIccManager.STK_CMD_OPEN_CHANNEL,
commandQualifier: 0x01,
text: ""}},
{command: "d05381030140018202818205094f70656e2049442031350702030403041f0239020578470a065465737447700272730d08f4557365724c6f670d08f4557365725077643c0301ad9c3e052101010101d004000900b4",
{command: "D02C" + // Length
"8103014001" + // Command details
"82028182" + // Device identities
"05094F70656E2049442031" + // Alpha identifier
"86099111223344556677F8" + // Address
"350702030403041F02" + // Bear description
"39020578", // Buffer size
expect: {typeOfCommand: MozIccManager.STK_CMD_OPEN_CHANNEL,
commandQualifier: 0x01,
text: "Open ID 1"}},
// Close channel.
{command: "d01b810301410082028121850a436c6f73652049442031d004000a00b4",
{command: "D00D" + // Length
"8103014100" + // Command details
"82028182" + // Device identities
"9E020007", // Icon identifier
expect: {typeOfCommand: MozIccManager.STK_CMD_CLOSE_CHANNEL,
commandQualifier: 0x00,
iconSelfExplanatory: true,
icons: [COLOR_ICON, COLOR_TRANSPARENCY_ICON]}},
{command: "D015" + // Length
"8103014100" + // Command details
"82028121" + // Device identities
"850A436C6F73652049442031", // Alpha identifier
expect: {typeOfCommand: MozIccManager.STK_CMD_CLOSE_CHANNEL,
commandQualifier: 0x00,
text: "Close ID 1"}},
// Recive data.
{command: "d022810301420082028121850e5265636569766520446174612031b701c8d004000e00b4",
// Receive data.
{command: "D00C" + // Length
"8103014200" + // Command details
"82028121" + // Device identities
"B701C8", // Channel data length
expect: {typeOfCommand: MozIccManager.STK_CMD_RECEIVE_DATA,
commandQualifier: 0x00}},
{command: "D01C" + // Length
"8103014200" + // Command details
"82028121" + // Device identities
"850E5265636569766520446174612031" + // Alpha identifier
"B701C8", // Channel data length
expect: {typeOfCommand: MozIccManager.STK_CMD_RECEIVE_DATA,
commandQualifier: 0x00,
text: "Receive Data 1"}},
// Send data.
{command: "d026810301430182028121850b53656e6420446174612031b6080001020304050607d004000b00b4",
{command: "D017" + // Length
"8103014301" + // Command details
"82028121" + // Device identities
"9E020007" + // Icon identifier
"B6080001020304050607", // Channel data
expect: {typeOfCommand: MozIccManager.STK_CMD_SEND_DATA,
commandQualifier: 0x01,
iconSelfExplanatory: true,
icons: [COLOR_ICON, COLOR_TRANSPARENCY_ICON]}},
{command: "D020" + // Length
"8103014301" + // Command details
"82028121" + // Device identities
"850B53656E6420446174612031" + // Alpha identifier
"B6080001020304050607", // Channel data
expect: {typeOfCommand: MozIccManager.STK_CMD_SEND_DATA,
commandQualifier: 0x01,
text: "Send Data 1"}},
];
function testBipCommand(aCommand, aExpect) {
is(aCommand.commandNumber, 0x01, "commandNumber");
is(aCommand.typeOfCommand, aExpect.typeOfCommand, "typeOfCommand");
is(aCommand.options.text, aExpect.text, "options.text");
is(aCommand.commandQualifier, aExpect.commandQualifier, "commandQualifier");
if (aExpect.icons) {
// text is optional.
if ("text" in aExpect) {
is(aCommand.options.text, aExpect.text, "options.text");
}
// icons is optional.
if ("icons" in aExpect) {
isIcons(aCommand.options.icons, aExpect.icons);
is(aCommand.options.iconSelfExplanatory, aExpect.iconSelfExplanatory,
"options.iconSelfExplanatory");
@ -55,6 +121,12 @@ startTestCommon(function() {
// Wait onstkcommand event.
promises.push(waitForTargetEvent(icc, "stkcommand")
.then((aEvent) => testBipCommand(aEvent.command, data.expect)));
// Wait icc-stkcommand system message.
promises.push(waitForSystemMessage("icc-stkcommand")
.then((aMessage) => {
is(aMessage.iccId, icc.iccInfo.iccid, "iccId");
testBipCommand(aMessage.command, data.expect);
}));
// Send emulator command to generate stk unsolicited event.
promises.push(sendEmulatorStkPdu(data.command));

Просмотреть файл

@ -5,150 +5,176 @@ MARIONETTE_TIMEOUT = 60000;
MARIONETTE_HEAD_JS = "head.js";
const TEST_DATA = [
{command: "d01a8103012180820281028d0f04546f6f6c6b697420546573742031",
expect: {commandQualifier: 0x80,
{command: "D01A" + // Length
"8103012101" + // Command details
"82028102" + // Device identities
"8D0F04546F6F6C6B697420546573742031", // Text string
expect: {commandQualifier: 0x01,
text: "Toolkit Test 1",
userClear: true}},
{command: "d01a8103012181820281028d0f04546f6f6c6b697420546573742032",
responseNeeded: false}},
{command: "D01C" + // Length
"8103012181" + // Command details
"82028102" + // Device identities
"8D0F04546F6F6C6B697420546573742032" + // Text string
"2B00", // Immediate response
expect: {commandQualifier: 0x81,
text: "Toolkit Test 2",
isHighPriority: true,
userClear: true}},
{command: "d0198103012180820281028d0e00d4f79bbd4ed341d4f29c0e9a01",
responseNeeded: true}},
{command: "D081AD" + // Length
"8103012180" + // Command details
"82028102" + // Device identities
"8D81A1045468697320636F6D6D616E6420696E73747275" + // Text string
"63747320746865204D4520746F20646973706C61792061" +
"2074657874206D6573736167652E20497420616C6C6F77" +
"73207468652053494D20746F20646566696E6520746865" +
"207072696F72697479206F662074686174206D65737361" +
"67652C20616E6420746865207465787420737472696E67" +
"20666F726D61742E2054776F207479706573206F662070" +
"72696F",
expect: {commandQualifier: 0x80,
text: "Toolkit Test 3",
userClear: true}},
{command: "d01a8103012100820281028d0f04546f6f6c6b697420546573742034",
expect: {commandQualifier: 0x00,
text: "Toolkit Test 4"}},
{command: "d081ad8103012180820281028d81a1045468697320636f6d6d616e6420696e7374727563747320746865204d4520746f20646973706c617920612074657874206d6573736167652e20497420616c6c6f7773207468652053494d20746f20646566696e6520746865207072696f72697479206f662074686174206d6573736167652c20616e6420746865207465787420737472696e6720666f726d61742e2054776f207479706573206f66207072696f",
expect: {commandQualifier: 0x80,
text: "This command instructs the ME to display a text message. It allows the SIM to define the priority of that message, and the text string format. Two types of prio",
userClear: true}},
{command: "d01a8103012180820281028d0f043c474f2d4241434b57415244533e",
text: "This command instructs the ME to display a text message. " +
"It allows the SIM to define the priority of that message," +
" and the text string format. Two types of prio",
responseNeeded: false}},
{command: "D01A" + // Length
"8103012180" + // Command details
"82028102" + // Device identities
"8D0F043C474F2D4241434B57415244533E", // Text string
expect: {commandQualifier: 0x80,
text: "<GO-BACKWARDS>",
userClear: true}},
{command: "d0248103012180820281028d1908041704140420041004120421042204120423041904220415",
responseNeeded: false}},
{command: "D024" + // Length
"8103012180" + // Command details
"82028102" + // Device identities
"8D19080417041404200410041204210422041204230419" + // Text string
"04220415",
expect: {commandQualifier: 0x80,
text: "ЗДРАВСТВУЙТЕ",
userClear: true}},
{command: "d0108103012180820281028d05084f60597d",
responseNeeded: false}},
{command: "D010" + // Length
"8103012180" + // Command details
"82028102" + // Device identities
"8D05084F60597D", // Text string
expect: {commandQualifier: 0x80,
text: "你好",
userClear: true}},
{command: "d0128103012180820281028d07080038003030eb",
expect: {commandQualifier: 0x80,
text: "80ル",
userClear: true}},
{command: "d0288103012180820281020d1d00d3309bfc06c95c301aa8e80259c3ec34b9ac07c9602f58ed159bb940",
responseNeeded: false}},
{command: "D028" + // Length
"8103012180" + // Command details
"82028102" + // Device identities
"0D1D00D3309BFC06C95C301AA8E80259C3EC34B9AC07C9" + // Text string
"602F58ED159BB940",
expect: {commandQualifier: 0x80,
text: "Saldo 2.04 E. Validez 20/05/13. ",
userClear: true}},
{command: "d0198103012180820281028D0A043130205365636F6E648402010A",
responseNeeded: false}},
{command: "D019" + // Length
"8103012180" + // Command details
"82028102" + // Device identities
"8D0A043130205365636F6E64" + // Text string
"8402010A", // Duration
expect: {commandQualifier: 0x80,
text: "10 Second",
userClear: true,
responseNeeded: false,
duration: {timeUnit: MozIccManager.STK_TIME_UNIT_SECOND,
timeInterval: 0x0A}}},
{command: "d01a8103012180820281028d0b0442617369632049636f6e9e020001",
{command: "D01A" + // Length
"8103012180" + // Command details
"82028102" + // Device identities
"8D0B0442617369632049636F6E" + // Text string
"9E020001", // Icon identifier
expect: {commandQualifier: 0x80,
text: "Basic Icon",
userClear: true,
responseNeeded: false,
iconSelfExplanatory: true,
icons: [BASIC_ICON]}},
{command: "D026810301210082028102" +
"8D" +
"1B" +
{command: "D026" + // Length
"8103012100" + // Command details
"82028102" + // Device identities
"8D1B" + // Text string
"00" + // 7BIT
"D4F79BBD4ED341D4F29C0E3A4A9F55A8" +
"0E8687C158A09B304905",
"D4F79BBD4ED341D4F29C0E3A4A9F55A80E8687C158A09B304905",
expect: {commandQualifier: 0x00,
text: "Toolkit Test GROUP:0x00, 7BIT"}},
{command: "D029810301210082028102" +
"8D" +
"1E" +
text: "Toolkit Test GROUP:0x00, 7BIT",
responseNeeded: false}},
{command: "D029" + // Length
"8103012100" + // Command details
"82028102" + // Device identities
"8D1E" + // Text string
"04" + // 8BIT
"546F6F6C6B697420546573742047524F" +
"55503A307830302C2038424954",
"546F6F6C6B697420546573742047524F55503A307830302C2038424954",
expect: {commandQualifier: 0x00,
text: "Toolkit Test GROUP:0x00, 8BIT"}},
{command: "D046810301210082028102" +
"8D" +
"3B" +
text: "Toolkit Test GROUP:0x00, 8BIT",
responseNeeded: false}},
{command: "D046" + // Length
"8103012100" + // Command details
"82028102" + // Device identities
"8D3B" + // Text string
"08" + // UCS2
"0054006F006F006C006B006900740020" +
"0054006500730074002000470052004F" +
"00550050003A0030007800300030002C" +
"00200055004300530032",
"0054006F006F006C006B0069007400200054006500730074002000470052004F" +
"00550050003A0030007800300030002C00200055004300530032",
expect: {commandQualifier: 0x00,
text: "Toolkit Test GROUP:0x00, UCS2"}},
{command: "D026810301210082028102" +
"8D" +
"1B" +
text: "Toolkit Test GROUP:0x00, UCS2",
responseNeeded: false}},
{command: "D026" + // Length
"8103012100" + // Command details
"82028102" + // Device identities
"8D1B" + // Text string
"12" + // 7BIT + Class 2
"D4F79BBD4ED341D4F29C0E3A4A9F55A8" +
"0E868FC158A09B304905",
"D4F79BBD4ED341D4F29C0E3A4A9F55A80E868FC158A09B304905",
expect: {commandQualifier: 0x00,
text: "Toolkit Test GROUP:0x10, 7BIT"}},
{command: "D029810301210082028102" +
"8D" +
"1E" +
text: "Toolkit Test GROUP:0x10, 7BIT",
responseNeeded: false}},
{command: "D029" + // Length
"8103012100" + // Command details
"82028102" + // Device identities
"8D1E" + // Text string
"16" + // 8BIT + Class 2
"546F6F6C6B697420546573742047524F" +
"55503A307831302C2038424954",
"546F6F6C6B697420546573742047524F55503A307831302C2038424954",
expect: {commandQualifier: 0x00,
text: "Toolkit Test GROUP:0x10, 8BIT"}},
{command: "D046810301210082028102" +
"8D" +
"3B" +
text: "Toolkit Test GROUP:0x10, 8BIT",
responseNeeded: false}},
{command: "D046" + // Length
"8103012100" + // Command details
"82028102" + // Device identities
"8D3B" + // Text string
"1A" + // UCS2 + Class 2
"0054006F006F006C006B006900740020" +
"0054006500730074002000470052004F" +
"00550050003A0030007800310030002C" +
"00200055004300530032",
"0054006F006F006C006B0069007400200054006500730074002000470052004F" +
"00550050003A0030007800310030002C00200055004300530032",
expect: {commandQualifier: 0x00,
text: "Toolkit Test GROUP:0x10, UCS2"}},
{command: "D026810301210082028102" +
"8D" +
"1B" +
text: "Toolkit Test GROUP:0x10, UCS2",
responseNeeded: false}},
{command: "D026" + // Length
"8103012100" + // Command details
"82028102" + // Device identities
"8D1B" + // Text string
"F2" + // 7BIT + Class 2
"D4F79BBD4ED341D4F29C0E3A4A9F55A8" +
"0E8637C258A09B304905",
"D4F79BBD4ED341D4F29C0E3A4A9F55A80E8637C258A09B304905",
expect: {commandQualifier: 0x00,
text: "Toolkit Test GROUP:0xF0, 7BIT"}},
{command: "D029810301210082028102" +
"8D" +
"1E" +
text: "Toolkit Test GROUP:0xF0, 7BIT",
responseNeeded: false}},
{command: "D029" + // Length
"8103012100" + // Command details
"82028102" + // Device identities
"8D1E" + // Text string
"F6" + // 8BIT + Class 2
"546F6F6C6B697420546573742047524F" +
"55503A307846302C2038424954",
"546F6F6C6B697420546573742047524F55503A307846302C2038424954",
expect: {commandQualifier: 0x00,
text: "Toolkit Test GROUP:0xF0, 8BIT"}},
text: "Toolkit Test GROUP:0xF0, 8BIT",
responseNeeded: false}},
// Bug 1088573: this test case is to ensure that we provide |length| argument
// in |integer| format to GsmPDUHelper.readSeptetsToString().
{command: "D0" +
"81" + // 2-byte length encoded:
"FC" + // 252
"810301210082028102" +
"8D" +
"81" + // 2-byte length encoded:
"F0" + // 240
{command: "D081FC" + // Length (2-byte length encoded: 252)
"8103012100" + // Command details
"82028102" + // Device identities
"8D" + // Text string
"81F0" + // 2-byte length encoded: 240
"00" + // 7BIT
"C332A85D9ECFC3E732685E068DDF6DF8" +
"7B5E0691CB20D96D061A87E5E131BD2C" +
"2FCF416537A8FD269741E3771B2E2FCF" +
"E76517685806B5CBF379F85C0695E774" +
"50D86C4E8FD165D0BC2E07C1D9F579BA" +
"5C97CF41E5B13CEC9E83CA7490BB0C22" +
"BFD374103C3C0795E9F232882E7FBBE3" +
"F5B20B24BBCD40E5391DC42E83DCEFB6" +
"585E06B5C3F874BBDE0691CBA071581E" +
"1ED3CBF2F21C14369BD3637458CC2EBB" +
"40C3329D5E0699DFEE313DFD76BBC3EC" +
"34BD0C0A83CAF432280C87CBDF757BB9" +
"0C8287E5207619346D1E73A0783D0D9A" +
"9FCA733A885C96BFEBEC32280C9A6689" +
"C332A85D9ECFC3E732685E068DDF6DF87B5E0691CB20D96D061A87E5E131BD2C" +
"2FCF416537A8FD269741E3771B2E2FCFE76517685806B5CBF379F85C0695E774" +
"50D86C4E8FD165D0BC2E07C1D9F579BA5C97CF41E5B13CEC9E83CA7490BB0C22" +
"BFD374103C3C0795E9F232882E7FBBE3F5B20B24BBCD40E5391DC42E83DCEFB6" +
"585E06B5C3F874BBDE0691CBA071581E1ED3CBF2F21C14369BD3637458CC2EBB" +
"40C3329D5E0699DFEE313DFD76BBC3EC34BD0C0A83CAF432280C87CBDF757BB9" +
"0C8287E5207619346D1E73A0783D0D9A9FCA733A885C96BFEBEC32280C9A6689" +
"CE621654768382D529551A64268B2E",
expect: {commandQualifier: 0x00,
text: "Ce message se compose de 273 caracteres en mode " +
@ -156,19 +182,26 @@ const TEST_DATA = [
"ecrans et ne doit pas etre tronque. 273 est le " +
"nombre maximum de caracteres affichable. Cette " +
"fonctionnalite a ete approuvee par le SMG9 qui s'est " +
"deroule a SYDNEY en AUSTRALIE."}},
"deroule a SYDNEY en AUSTRALIE.",
responseNeeded: false}},
];
function testDisplayText(aCommand, aExpect) {
is(aCommand.commandNumber, 0x01, "commandNumber");
is(aCommand.typeOfCommand, MozIccManager.STK_CMD_DISPLAY_TEXT,
"typeOfCommand");
is(aCommand.commandQualifier, aExpect.commandQualifier, "commandQualifier");
is(aCommand.options.text, aExpect.text, "options.text");
is(aCommand.options.userClear, aExpect.userClear, "options.userClear");
is(aCommand.options.isHighPriority, aExpect.isHighPriority,
"options.isHighPriority");
if (aExpect.duration) {
is(aCommand.options.userClear, !!(aExpect.commandQualifier & 0x80),
"options.userClear");
is(aCommand.options.isHighPriority, !!(aExpect.commandQualifier & 0x01),
"options.isHighPriority");
is(aCommand.options.text, aExpect.text, "options.text");
is(aCommand.options.responseNeeded, aExpect.responseNeeded,
"options.responseNeeded");
// duration is optional.
if ("duration" in aExpect) {
let duration = aCommand.options.duration;
is(duration.timeUnit, aExpect.duration.timeUnit,
"options.duration.timeUnit");
@ -176,7 +209,8 @@ function testDisplayText(aCommand, aExpect) {
"options.duration.timeInterval");
}
if (aExpect.icons) {
// icons is optional.
if ("icons" in aExpect) {
isIcons(aCommand.options.icons, aExpect.icons);
is(aCommand.options.iconSelfExplanatory, aExpect.iconSelfExplanatory,
"options.iconSelfExplanatory");
@ -196,6 +230,12 @@ startTestCommon(function() {
// Wait onstkcommand event.
promises.push(waitForTargetEvent(icc, "stkcommand")
.then((aEvent) => testDisplayText(aEvent.command, data.expect)));
// Wait icc-stkcommand system message.
promises.push(waitForSystemMessage("icc-stkcommand")
.then((aMessage) => {
is(aMessage.iccId, icc.iccInfo.iccid, "iccId");
testDisplayText(aMessage.command, data.expect);
}));
// Send emulator command to generate stk unsolicited event.
promises.push(sendEmulatorStkPdu(data.command));

Просмотреть файл

@ -5,54 +5,93 @@ MARIONETTE_TIMEOUT = 60000;
MARIONETTE_HEAD_JS = "head.js";
const TEST_DATA = [
{command: "d0158103012200820281828d0a04456e74657220222b22",
expect: {commandQualifier: 0x00,
text: "Enter \"+\""}},
{command: "d0148103012200820281828d09004537bd2c07896022",
{command: "D014" + // Length
"8103012200" + // Command details
"82028182" + // Device identities
"8D09004537BD2C07896022", // Text string
expect: {commandQualifier: 0x00,
text: "Enter \"0\""}},
{command: "d01a8103012200820281828d0f043c474f2d4241434b57415244533e",
{command: "D00B" + // Length
"8103012200" + // Command details
"82028182" + // Device identities
"8D00", // Text string
expect: {commandQualifier: 0x00,
text: "<GO-BACKWARDS>"}},
{command: "d0138103012200820281828d08043c41424f52543e",
text: null}},
{command: "D00C" + // Length
"8103012200" + // Command details
"82028182" + // Device identities
"8D0100", // Text string
expect: {commandQualifier: 0x00,
text: "<ABORT>"}},
{command: "d0158103012201820281828d0a04456e74657220227122",
text: ""}},
{command: "D081AD" + // Length
"8103012201" + // Command details
"82028182" + // Device identities
"8D81A104456E746572202278222E205468697320636F6D" + // Text string
"6D616E6420696E7374727563747320746865204D452074" +
"6F20646973706C617920746578742C20616E6420746F20" +
"65787065637420746865207573657220746F20656E7465" +
"7220612073696E676C65206368617261637465722E2041" +
"6E7920726573706F6E736520656E746572656420627920" +
"7468652075736572207368616C6C206265207061737365" +
"642074",
expect: {commandQualifier: 0x01,
text: "Enter \"q\"",
isAlphabet: true}},
{command: "d081ad8103012201820281828d81a104456e746572202278222e205468697320636f6d6d616e6420696e7374727563747320746865204d4520746f20646973706c617920746578742c20616e6420746f2065787065637420746865207573657220746f20656e74657220612073696e676c65206368617261637465722e20416e7920726573706f6e736520656e7465726564206279207468652075736572207368616c6c206265207061737365642074",
expect: {commandQualifier: 0x01,
text: "Enter \"x\". This command instructs the ME to display text, and to expect the user to enter a single character. Any response entered by the user shall be passed t",
isAlphabet: true}},
{command: "d0168103012200820281828d0b043c54494d452d4f55543e",
text: "Enter \"x\". This command instructs the ME to display " +
"text, and to expect the user to enter a single character. " +
"Any response entered by the user shall be passed t"}},
{command: "D016" + // Length
"8103012200" + // Command details
"82028182" + // Device identities
"8D0B043C54494D452D4F55543E", // Text string
expect: {commandQualifier: 0x00,
text: "<TIME-OUT>"}},
{command: "d0248103012200820281828d1908041704140420041004120421042204120423041904220415",
{command: "D08199" + // Length
"8103012200" + // Command details
"82028182" + // Device identities
"8D818D0804170414042004100412042104220412042304" + // Text string
"1904220415041704140420041004120421042204120423" +
"0419042204150417041404200410041204210422041204" +
"2304190422041504170414042004100412042104220412" +
"0423041904220415041704140420041004120421042204" +
"1204230419042204150417041404200410041204210422" +
"041204230419",
expect: {commandQualifier: 0x00,
text: "ЗДРАВСТВУЙТЕ"}},
{command: "d081998103012200820281828d818d080417041404200410041204210422041204230419042204150417041404200410041204210422041204230419042204150417041404200410041204210422041204230419042204150417041404200410041204210422041204230419042204150417041404200410041204210422041204230419042204150417041404200410041204210422041204230419",
expect: {commandQualifier: 0x00,
text: "ЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕЗДРАВСТВУЙ"}},
{command: "d0118103012203820281828d0604456e746572",
text: "ЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕЗДР" +
"АВСТВУЙТЕЗДРАВСТВУЙ"}},
{command: "D011" + // Length
"8103012203" + // Command details
"82028182" + // Device identities
"8D0604456E746572", // Text string
expect: {commandQualifier: 0x03,
text: "Enter",
isAlphabet: true,
isUCS2: true}},
{command: "d0158103012204820281828d0a04456e74657220594553",
text: "Enter"}},
{command: "D015" + // Length
"8103012204" + // Command details
"82028182" + // Device identities
"8D0A04456E74657220594553", // Text string
expect: {commandQualifier: 0x04,
text: "Enter YES",
isYesNoRequested: true}},
{command: "d0148103012204820281828d0904456e746572204e4f",
expect: {commandQualifier: 0x04,
text: "Enter NO",
isYesNoRequested: true}},
{command: "d0198103012200820281828d0a043c4e4f2d49434f4e3e1e020002",
text: "Enter YES"}},
{command: "D019" + // Length
"8103012200" + // Command details
"82028182" + // Device identities
"8D0A043C4E4F2D49434F4E3E" + // Text string
"1E020002", // Icon identifier
expect: {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",
{command: "D016" + // Length
"8103012280" + // Command details
"82028182" + // Device identities
"8D07043C49434F4E3E" + // Text string
"1E020101", // Icon identifier
expect: {commandQualifier: 0x80,
text: "<ICON>",
iconSelfExplanatory: false,
icons : [BASIC_ICON]}},
{command: "D019" + // Length
"8103012200" + // Command details
"82028182" + // Device identities
"8D0A04456E74657220222B22" + // Text string
"8402010A", // Duration
expect: {commandQualifier: 0x00,
text: "Enter \"+\"",
duration: {timeUnit: MozIccManager.STK_TIME_UNIT_SECOND,
@ -60,15 +99,24 @@ const TEST_DATA = [
];
function testGetInKey(aCommand, aExpect) {
is(aCommand.commandNumber, 0x01, "commandNumber");
is(aCommand.typeOfCommand, MozIccManager.STK_CMD_GET_INKEY, "typeOfCommand");
is(aCommand.commandQualifier, aExpect.commandQualifier, "commandQualifier");
is(aCommand.options.text, aExpect.text, "options.text");
is(aCommand.options.isAlphabet, aExpect.isAlphabet, "options.isAlphabet");
is(aCommand.options.isUCS2, aExpect.isUCS2, "options.isUCS2");
is(aCommand.options.isYesNoRequested, aExpect.isYesNoRequested,
"options.isYesNoRequested");
if (aExpect.duration) {
is(aCommand.options.isAlphabet, !!(aExpect.commandQualifier & 0x01),
"options.isAlphabet");
is(aCommand.options.isUCS2, !!(aExpect.commandQualifier & 0x02),
"options.isUCS2");
is(aCommand.options.isYesNoRequested, !!(aExpect.commandQualifier & 0x04),
"options.isYesNoRequested");
is(aCommand.options.isHelpAvailable, !!(aExpect.commandQualifier & 0x80),
"options.isHelpAvailable");
is(aCommand.options.text, aExpect.text, "options.text");
is(aCommand.options.minLength, 1, "options.minLength");
is(aCommand.options.maxLength, 1, "options.maxLength");
// duration is optional.
if ("duration" in aExpect) {
let duration = aCommand.options.duration;
is(duration.timeUnit, aExpect.duration.timeUnit,
"options.duration.timeUnit");
@ -76,7 +124,8 @@ function testGetInKey(aCommand, aExpect) {
"options.duration.timeInterval");
}
if (aExpect.icons) {
// icons is optional.
if ("icons" in aExpect) {
isIcons(aCommand.options.icons, aExpect.icons);
is(aCommand.options.iconSelfExplanatory, aExpect.iconSelfExplanatory,
"options.iconSelfExplanatory");
@ -96,6 +145,12 @@ startTestCommon(function() {
// Wait onstkcommand event.
promises.push(waitForTargetEvent(icc, "stkcommand")
.then((aEvent) => testGetInKey(aEvent.command, data.expect)));
// Wait icc-stkcommand system message.
promises.push(waitForSystemMessage("icc-stkcommand")
.then((aMessage) => {
is(aMessage.iccId, icc.iccInfo.iccid, "iccId");
testGetInKey(aMessage.command, data.expect);
}));
// Send emulator command to generate stk unsolicited event.
promises.push(sendEmulatorStkPdu(data.command));

Просмотреть файл

@ -5,106 +5,135 @@ MARIONETTE_TIMEOUT = 60000;
MARIONETTE_HEAD_JS = "head.js";
const TEST_DATA = [
{command: "d01b8103012300820281828d0c04456e74657220313233343591020505",
{command: "D01B" + // Length
"8103012300" + // Command details
"82028182" + // Device identities
"8D0C04456E746572203132333435" + // Text string
"91020505", // Response length
expect: {commandQualifier: 0x00,
text: "Enter 12345",
minLength: 5,
maxLength: 5}},
{command: "d01a8103012308820281828d0b004537bd2c07d96eaad10a91020505",
{command: "D01A" + // Length
"8103012308" + // Command details
"82028182" + // Device identities
"8D0B004537BD2C07D96EAAD10A" + // Text string
"91020505", // Response length
expect: {commandQualifier: 0x08,
text: "Enter 67*#+",
minLength: 5,
maxLength: 5,
isPacked: true}},
{command: "d01b8103012301820281828d0c04456e74657220416243644591020505",
maxLength: 5}},
{command: "D01B" + // Length
"8103012301" + // Command details
"82028182" + // Device identities
"8D0C04456E746572204162436445" + // Text string
"91020505", // Response length
expect: {commandQualifier: 0x01,
text: "Enter AbCdE",
minLength: 5,
maxLength: 5,
isAlphabet: true}},
{command: "d0278103012304820281828d180450617373776f726420313c53454e443e3233343536373891020408",
maxLength: 5}},
{command: "D027" + // Length
"8103012304" + // Command details
"82028182" + // Device identities
"8D180450617373776F726420313C53454E443E323334" + // Text string
"35363738" +
"91020408", // Response length
expect: {commandQualifier: 0x04,
text: "Password 1<SEND>2345678",
minLength: 4,
maxLength: 8,
hideInput: true}},
{command: "d0248103012300820281828d1504456e74657220312e2e392c302e2e392c3028312991020114",
expect: {commandQualifier: 0x00,
text: "Enter 1..9,0..9,0(1)",
minLength: 1,
maxLength: 20}},
{command: "d01e8103012300820281828d0f043c474f2d4241434b57415244533e91020008",
maxLength: 8}},
{command: "D01E" + // Length
"8103012300" + // Command details
"82028182" + // Device identities
"8D0F043C474F2D4241434B57415244533E" + // Text string
"91020008", // Response length
expect: {commandQualifier: 0x00,
text: "<GO-BACKWARDS>",
minLength: 0,
maxLength: 8}},
{command: "d0178103012300820281828d08043c41424f52543e91020008",
{command: "D081B1" + // Length
"8103012300" + // Command details
"82028182" + // Device identities
"8D81A1042A2A2A313131313131313131312323232A2A2A" + // Text string
"323232323232323232322323232A2A2A33333333333333" +
"3333332323232A2A2A343434343434343434342323232A" +
"2A2A353535353535353535352323232A2A2A3636363636" +
"36363636362323232A2A2A373737373737373737372323" +
"232A2A2A383838383838383838382323232A2A2A393939" +
"393939393939392323232A2A2A30303030303030303030" +
"232323" +
"9102A0A0", // Response length
expect: {commandQualifier: 0x00,
text: "<ABORT>",
minLength: 0,
maxLength: 8}},
{command: "d081b18103012300820281828d81a1042a2a2a313131313131313131312323232a2a2a323232323232323232322323232a2a2a333333333333333333332323232a2a2a343434343434343434342323232a2a2a353535353535353535352323232a2a2a363636363636363636362323232a2a2a373737373737373737372323232a2a2a383838383838383838382323232a2a2a393939393939393939392323232a2a2a303030303030303030302323239102a0a0",
expect: {commandQualifier: 0x00,
text: "***1111111111###***2222222222###***3333333333###***4444444444###***5555555555###***6666666666###***7777777777###***8888888888###***9999999999###***0000000000###",
text: "***1111111111###***2222222222###***3333333333###***444444" +
"4444###***5555555555###***6666666666###***7777777777###**" +
"*8888888888###***9999999999###***0000000000###",
minLength: 160,
maxLength: 160}},
{command: "d0168103012300820281828d07043c53454e443e91020001",
expect: {commandQualifier: 0x00,
text: "<SEND>",
minLength: 0,
maxLength: 1}},
{command: "d01a8103012300820281828d0b043c54494d452d4f55543e9102000a",
expect: {commandQualifier: 0x00,
text: "<TIME-OUT>",
minLength: 0,
maxLength: 10}},
{command: "d0288103012301820281828d190804170414042004100412042104220412042304190422041591020505",
{command: "D0819D" + // Length
"8103012301" + // Command details
"82028182" + // Device identities
"8D818D0804170414042004100412042104220412042304" + // Text string
"1904220415041704140420041004120421042204120423" +
"0419042204150417041404200410041204210422041204" +
"2304190422041504170414042004100412042104220412" +
"0423041904220415041704140420041004120421042204" +
"1204230419042204150417041404200410041204210422" +
"041204230419" +
"91020505", // Response length
expect: {commandQualifier: 0x01,
text: "ЗДРАВСТВУЙТЕ",
text: "ЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕЗДРАВСТВУ" +
"ЙТЕЗДРАВСТВУЙ",
minLength: 5,
maxLength: 5,
isAlphabet: true}},
{command: "d0819d8103012301820281828d818d08041704140420041004120421042204120423041904220415041704140420041004120421042204120423041904220415041704140420041004120421042204120423041904220415041704140420041004120421042204120423041904220415041704140420041004120421042204120423041904220415041704140420041004120421042204120423041991020505",
expect: {commandQualifier: 0x01,
text: "ЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕЗДРАВСТВУЙ",
minLength: 5,
maxLength: 5,
isAlphabet: true}},
{command: "d01b8103012303820281828d0c04456e7465722048656c6c6f91020c0c",
expect: {commandQualifier: 0x03,
text: "Enter Hello",
minLength: 12,
maxLength: 12,
isAlphabet: true,
isUCS2: true}},
{command: "d01b8103012303820281828d0c04456e7465722048656c6c6f910205ff",
maxLength: 5}},
{command: "D01B" + // Length
"8103012303" + // Command details
"82028182" + // Device identities
"8D0C04456E7465722048656C6C6F" + // Text string
"910205FF", // Response length
expect: {commandQualifier: 0x03,
text: "Enter Hello",
minLength: 5,
maxLength: 0xFF,
isAlphabet: true,
isUCS2: true}},
{command: "d0238103012300820281828d0c04456e746572203132333435910205051706043132333435",
expect: {commandQualifier: 0x00,
text: "Enter 12345",
minLength: 5,
maxLength: 5,
defaultText: "12345"}},
{command: "d081ba8103012300820281828d0704456e7465723a9102a0a01781a1042a2a2a313131313131313131312323232a2a2a323232323232323232322323232a2a2a333333333333333333332323232a2a2a343434343434343434342323232a2a2a353535353535353535352323232a2a2a363636363636363636362323232a2a2a373737373737373737372323232a2a2a383838383838383838382323232a2a2a393939393939393939392323232a2a2a30303030303030303030232323",
maxLength: 0xFF}},
{command: "D081BA" + // Length
"8103012300" + // Command details
"82028182" + // Device identities
"8D0704456E7465723A" + // Text string
"9102A0A0" + // Response length
"1781A1042A2A2A313131313131313131312323232A2A2A" + // Default text
"323232323232323232322323232A2A2A33333333333333" +
"3333332323232A2A2A343434343434343434342323232A" +
"2A2A353535353535353535352323232A2A2A3636363636" +
"36363636362323232A2A2A373737373737373737372323" +
"232A2A2A383838383838383838382323232A2A2A393939" +
"393939393939392323232A2A2A30303030303030303030" +
"232323",
expect: {commandQualifier: 0x00,
text: "Enter:",
minLength: 160,
maxLength: 160,
defaultText: "***1111111111###***2222222222###***3333333333###***4444444444###***5555555555###***6666666666###***7777777777###***8888888888###***9999999999###***0000000000###"}},
{command: "d01d8103012300820281828d0a043c4e4f2d49434f4e3e9102000a1e020002",
defaultText: "***1111111111###***2222222222###***3333333333###**" +
"*4444444444###***5555555555###***6666666666###***7" +
"777777777###***8888888888###***9999999999###***000" +
"0000000###"}},
{command: "D01D" + // Length
"8103012300" + // Command details
"82028182" + // Device identities
"8D0A043C4E4F2D49434F4E3E" + // Text string
"9102000A" + // Response length
"1E020002", // Icon identifier
expect: {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}},
{command: "d0208103012300820281828d0d043c42415349432d49434f4e3e9102000a1e020101",
expect: {commandQualifier: 0x00,
{command: "D020" + // Length
"8103012380" + // Command details
"82028182" + // Device identities
"8D0D043C42415349432D49434F4E3E" + // Text string
"9102000A" + // Response length
"1E020101", // Icon identifier
expect: {commandQualifier: 0x80,
text: "<BASIC-ICON>",
minLength: 0,
maxLength: 10,
@ -113,33 +142,31 @@ const TEST_DATA = [
];
function testGetInput(aCommand, aExpect) {
is(aCommand.commandNumber, 0x01, "commandNumber");
is(aCommand.typeOfCommand, MozIccManager.STK_CMD_GET_INPUT, "typeOfCommand");
is(aCommand.commandQualifier, aExpect.commandQualifier, "commandQualifier");
is(aCommand.options.isAlphabet, !!(aExpect.commandQualifier & 0x01),
"options.isAlphabet");
is(aCommand.options.isUCS2, !!(aExpect.commandQualifier & 0x02),
"options.isUCS2");
is(aCommand.options.hideInput, !!(aExpect.commandQualifier & 0x04),
"options.hideInput");
is(aCommand.options.isPacked, !!(aExpect.commandQualifier & 0x08),
"options.isPacked");
is(aCommand.options.isHelpAvailable, !!(aExpect.commandQualifier & 0x80),
"options.isHelpAvailable");
is(aCommand.options.text, aExpect.text, "options.text");
is(aCommand.options.minLength, aExpect.minLength, "options.minLength");
is(aCommand.options.maxLength, aExpect.maxLength, "options.maxLength");
if (aExpect.defaultText) {
// defaultText is optional.
if ("defaultText" in aExpect) {
is(aCommand.options.defaultText, aExpect.defaultText, "options.defaultText");
}
if (aExpect.isAlphabet) {
is(aCommand.options.isAlphabet, aExpect.isAlphabet, "options.isAlphabet");
}
if (aExpect.isUCS2) {
is(aCommand.options.isUCS2, aExpect.isUCS2, "options.isUCS2");
}
if (aExpect.isPacked) {
is(aCommand.options.isPacked, aExpect.isPacked, "options.isPacked");
}
if (aExpect.hideInput) {
is(aCommand.options.hideInput, aExpect.hideInput, "options.hideInput");
}
if (aExpect.icons) {
// icons is optional.
if ("icons" in aExpect) {
isIcons(aCommand.options.icons, aExpect.icons);
is(aCommand.options.iconSelfExplanatory, aExpect.iconSelfExplanatory,
"options.iconSelfExplanatory");
@ -159,6 +186,12 @@ startTestCommon(function() {
// Wait onstkcommand event.
promises.push(waitForTargetEvent(icc, "stkcommand")
.then((aEvent) => testGetInput(aEvent.command, data.expect)));
// Wait icc-stkcommand system message.
promises.push(waitForSystemMessage("icc-stkcommand")
.then((aMessage) => {
is(aMessage.iccId, icc.iccInfo.iccid, "iccId");
testGetInput(aMessage.command, data.expect);
}));
// Send emulator command to generate stk unsolicited event.
promises.push(sendEmulatorStkPdu(data.command));

Просмотреть файл

@ -5,181 +5,118 @@ MARIONETTE_TIMEOUT = 60000;
MARIONETTE_HEAD_JS = "head.js";
const TEST_DATA = [
{command: "d0188103011500820281823100050b44656661756c742055524c",
{command: "D018" + // Length
"8103011500" + // Command details
"82028182" + // Device identities
"3100" + // URL
"050B44656661756C742055524C", // Alpha identifier
expect: {commandQualifier: 0x00,
url: "",
mode: MozIccManager.STK_BROWSER_MODE_LAUNCH_IF_NOT_ALREADY_LAUNCHED,
confirmMessage: { text: "Default URL" }}},
{command: "d01f8103011500820281823112687474703a2f2f7878782e7979792e7a7a7a0500",
{command: "D01F" + // Length
"8103011500" + // Command details
"82028182" + // Device identities
"3112687474703A2F2F7878782E7979792E7A7A7A" + // URL
"0500", // Alpha identifier
expect: {commandQualifier: 0x00,
url: "http://xxx.yyy.zzz",
mode: MozIccManager.STK_BROWSER_MODE_LAUNCH_IF_NOT_ALREADY_LAUNCHED,
confirmMessage: { text: "" }}},
{command: "d00e8103011500820281823001003100",
{command: "D023" + // Length
"8103011500" + // Command details
"82028182" + // Device identities
"300100" + // Browser identity
"3100" + // URL
"320103" + // Bear
"0D10046162632E6465662E6768692E6A6B6C", // Text string
expect: {commandQualifier: 0x00,
url: ""}},
{command: "d0208103011500820281823100320103" +
"0d10046162632e6465662e6768692e6a6b6c", // "0D" String TLV is useless for Launch Browser.
expect: {commandQualifier: 0x00,
url: ""}},
{command: "d0188103011502820281823100050b44656661756c742055524c",
// Browser identity, Bear and Text string are useless.
url: "",
mode: MozIccManager.STK_BROWSER_MODE_LAUNCH_IF_NOT_ALREADY_LAUNCHED}},
{command: "D018" + // Length
"8103011502" + // Command details
"82028182" + // Device identities
"3100" + // URL
"050B44656661756C742055524C", // Alpha identifier
expect: {commandQualifier: 0x02,
url: "",
mode: MozIccManager.STK_BROWSER_MODE_USING_EXISTING_BROWSER,
confirmMessage: { text: "Default URL" }}},
{command: "d0188103011503820281823100050b44656661756c742055524c",
{command: "D018" + // Length
"8103011503" + // Command details
"82028182" + // Device identities
"3100" + // URL
"050B44656661756C742055524C", // Alpha identifier
expect: {commandQualifier: 0x03,
url: "",
mode: MozIccManager.STK_BROWSER_MODE_USING_NEW_BROWSER,
confirmMessage: { text: "Default URL"}}},
{command: "d00b8103011500820281823100",
expect: {commandQualifier: 0x00,
url: ""}},
{command: "d0268103011502820281823100051980041704140420041004120421042204120423041904220415",
{command: "D026" + // Length
"8103011502" + // Command details
"82028182" + // Device identities
"3100" + // URL
"051980041704140420041004120421042204120423" + // Alpha identifier
"041904220415",
expect: {commandQualifier: 0x02,
url: "",
mode: MozIccManager.STK_BROWSER_MODE_USING_EXISTING_BROWSER,
confirmMessage: { text: "ЗДРАВСТВУЙТЕ" }}},
{command: "d021810301150282028182310005104e6f742073656c66206578706c616e2e1e020101",
{command: "D021" + // Length
"8103011502" + // Command details
"82028182" + // Device identities
"3100" + // URL
"05104E6F742073656C66206578706C616E2E" + // Alpha identifier
"1E020101", // Icon identifier
expect: {commandQualifier: 0x02,
url: "",
mode: MozIccManager.STK_BROWSER_MODE_USING_EXISTING_BROWSER,
confirmMessage: { text: "Not self explan.",
iconSelfExplanatory: false,
icons : [BASIC_ICON] }
}},
{command: "d01d8103011502820281823100050c53656c66206578706c616e2e1e020001",
expect: {commandQualifier: 0x02,
url: "",
confirmMessage: { text: "Self explan.",
iconSelfExplanatory: true,
icons : [BASIC_ICON] }
}},
{command: "d0208103011500820281823100050d44656661756c742055524c2031d004000d00b4",
expect: {commandQualifier: 0x00,
url: "",
confirmMessage: { text: "Default URL 1" }}},
{command: "d01a8103011500820281823100050d44656661756c742055524c2032",
expect: {commandQualifier: 0x00,
url: "",
confirmMessage: { text: "Default URL 2" }}},
{command: "d0208103011500820281823100050d44656661756c742055524c2031d004000d01b4",
expect: {commandQualifier: 0x00,
url: "",
confirmMessage: { text: "Default URL 1" }}},
{command: "d01a8103011500820281823100050d44656661756c742055524c2032",
expect: {commandQualifier: 0x00,
url: "",
confirmMessage: { text: "Default URL 2" }}},
{command: "d0208103011500820281823100050d44656661756c742055524c2031d004000d02b4",
expect: {commandQualifier: 0x00,
url: "",
confirmMessage: { text: "Default URL 1" }}},
{command: "d01a8103011500820281823100050d44656661756c742055524c2032",
expect: {commandQualifier: 0x00,
url: "",
confirmMessage: { text: "Default URL 2" }}},
{command: "d0208103011500820281823100050d44656661756c742055524c2031d004000d04b4",
expect: {commandQualifier: 0x00,
url: "",
confirmMessage: { text: "Default URL 1" }}},
{command: "d0208103011500820281823100050d44656661756c742055524c2032d004000d00b4",
expect: {commandQualifier: 0x00,
url: "",
confirmMessage: { text: "Default URL 2" }}},
{command: "d01a8103011500820281823100050d44656661756c742055524c2033",
expect: {commandQualifier: 0x00,
url: "",
confirmMessage: { text: "Default URL 3" }}},
{command: "d0208103011500820281823100050d44656661756c742055524c2031d004000d08b4",
expect: {commandQualifier: 0x00,
url: "",
confirmMessage: { text: "Default URL 1" }}},
{command: "d0208103011500820281823100050d44656661756c742055524c2032d004000d00b4",
expect: {commandQualifier: 0x00,
url: "",
confirmMessage: { text: "Default URL 2" }}},
{command: "d01a8103011500820281823100050d44656661756c742055524c2033",
expect: {commandQualifier: 0x00,
url: "",
confirmMessage: { text: "Default URL 3" }}},
{command: "d0208103011500820281823100050d44656661756c742055524c2031d004000d10b4",
expect: {commandQualifier: 0x00,
url: "",
confirmMessage: { text: "Default URL 1" }}},
{command: "d0208103011500820281823100050d44656661756c742055524c2032d004000d00b4",
expect: {commandQualifier: 0x00,
url: "",
confirmMessage: { text: "Default URL 2" }}},
{command: "d01a8103011500820281823100050d44656661756c742055524c2033",
expect: {commandQualifier: 0x00,
url: "",
confirmMessage: { text: "Default URL 3" }}},
{command: "d0208103011500820281823100050d44656661756c742055524c2031d004000d20b4",
expect: {commandQualifier: 0x00,
url: "",
confirmMessage: { text: "Default URL 1" }}},
{command: "d0208103011500820281823100050d44656661756c742055524c2032d004000d00b4",
expect: {commandQualifier: 0x00,
url: "",
confirmMessage: { text: "Default URL 2" }}},
{command: "d01a8103011500820281823100050d44656661756c742055524c2033",
expect: {commandQualifier: 0x00,
url: "",
confirmMessage: { text: "Default URL 3" }}},
{command: "d0208103011500820281823100050d44656661756c742055524c2031d004000d40b4",
expect: {commandQualifier: 0x00,
url: "",
confirmMessage: { text: "Default URL 1" }}},
{command: "d0208103011500820281823100050d44656661756c742055524c2032d004000d00b4",
expect: {commandQualifier: 0x00,
url: "",
confirmMessage: { text: "Default URL 2" }}},
{command: "d01a8103011500820281823100050d44656661756c742055524c2033",
expect: {commandQualifier: 0x00,
url: "",
confirmMessage: { text: "Default URL 3" }}},
{command: "d0208103011500820281823100050d44656661756c742055524c2031d004000d80b4",
expect: {commandQualifier: 0x00,
url: "",
confirmMessage: { text: "Default URL 1" }}},
{command: "d0208103011500820281823100050d44656661756c742055524c2032d004000d00b4",
expect: {commandQualifier: 0x00,
url: "",
confirmMessage: { text: "Default URL 2" }}},
{command: "d01a8103011500820281823100050d44656661756c742055524c2033",
expect: {commandQualifier: 0x00,
url: "",
confirmMessage: { text: "Default URL 3" }}},
{command: "d0208103011500820281823100050d44656661756c742055524c2031d004000d00b4",
expect: {commandQualifier: 0x00,
url: "",
confirmMessage: { text: "Default URL 1" }}},
{command: "d01a8103011500820281823100050d44656661756c742055524c2032",
expect: {commandQualifier: 0x00,
url: "",
confirmMessage: { text: "Default URL 2" }}},
{command: "d01281030115028202818231000505804f60597d",
{command: "D012" + // Length
"8103011502" + // Command details
"82028182" + // Device identities
"3100" + // URL
"0505804F60597D", // Alpha identifier
expect: {commandQualifier: 0x02,
url: "",
mode: MozIccManager.STK_BROWSER_MODE_USING_EXISTING_BROWSER,
confirmMessage: { text: "你好" }}},
{command: "d010810301150282028182310005038030eb",
expect: {commandQualifier: 0x02,
url: "",
confirmMessage: { text: "ル" }}},
{command: "d01281030115008202818230010031001e020001",
{command: "D00F" + // Length
"8103011500" + // Command details
"82028182" + // Device identities
"3100" + // URL
"1E020001", // Icon identifier
expect: {commandQualifier: 0x00,
url: "",
mode: MozIccManager.STK_BROWSER_MODE_LAUNCH_IF_NOT_ALREADY_LAUNCHED,
confirmMessage: { iconSelfExplanatory: true,
icons: [BASIC_ICON] }}},
{command: "d01281030115008202818230010031001e020003",
{command: "D00F" + // Length
"8103011500" + // Command details
"82028182" + // Device identities
"3100" + // URL
"1E020003", // Icon identifier
expect: {commandQualifier: 0x00,
url: "",
mode: MozIccManager.STK_BROWSER_MODE_LAUNCH_IF_NOT_ALREADY_LAUNCHED,
confirmMessage: { iconSelfExplanatory: true,
icons: [COLOR_ICON] }}},
];
function testLaunchBrowser(aCommand, aExpect) {
is(aCommand.commandNumber, 0x01, "commandNumber");
is(aCommand.typeOfCommand, MozIccManager.STK_CMD_LAUNCH_BROWSER,
"typeOfCommand");
is(aCommand.commandQualifier, aExpect.commandQualifier, "commandQualifier");
is(aCommand.options.url, aExpect.url, "options.url");
if (aExpect.confirmMessage) {
is(aCommand.options.url, aExpect.url, "options.url");
is(aCommand.options.mode, aExpect.mode, "options.mode");
// confirmMessage is optional
if ("confirmMessage" in aExpect) {
isStkText(aCommand.options.confirmMessage, aExpect.confirmMessage,
"options.confirmMessage");
}
@ -198,6 +135,12 @@ startTestCommon(function() {
// Wait onstkcommand event.
promises.push(waitForTargetEvent(icc, "stkcommand")
.then((aEvent) => testLaunchBrowser(aEvent.command, data.expect)));
// Wait icc-stkcommand system message.
promises.push(waitForSystemMessage("icc-stkcommand")
.then((aMessage) => {
is(aMessage.iccId, icc.iccInfo.iccid, "iccId");
testLaunchBrowser(aMessage.command, data.expect);
}));
// Send emulator command to generate stk unsolicited event.
promises.push(sendEmulatorStkPdu(data.command));

Просмотреть файл

@ -6,31 +6,38 @@ MARIONETTE_HEAD_JS = "head.js";
const TEST_DATA = [
// Location
{command: "d009810301260082028182",
expect: {commandNumber: 0x01,
commandQualifier: MozIccManager.STK_LOCAL_INFO_LOCATION_INFO,
{command: "D009" + // Length
"8103012600" + // Command details
"82028182", // Device identities
expect: {commandQualifier: MozIccManager.STK_LOCAL_INFO_LOCATION_INFO,
localInfoType: MozIccManager.STK_LOCAL_INFO_LOCATION_INFO}},
// Imei
{command: "d009810301260182028182",
expect: {commandNumber: 0x01,
commandQualifier: MozIccManager.STK_LOCAL_INFO_IMEI,
{command: "D009" + // Length
"8103012601" + // Command details
"82028182", // Device identities
expect: {commandQualifier: MozIccManager.STK_LOCAL_INFO_IMEI,
localInfoType: MozIccManager.STK_LOCAL_INFO_IMEI}},
// Data
{command: "d009810301260382028182",
expect: {commandNumber: 0x01,
commandQualifier: MozIccManager.STK_LOCAL_INFO_DATE_TIME_ZONE,
{command: "D009" + // Length
"8103012603" + // Command details
"82028182", // Device identities
expect: {commandQualifier: MozIccManager.STK_LOCAL_INFO_DATE_TIME_ZONE,
localInfoType: MozIccManager.STK_LOCAL_INFO_DATE_TIME_ZONE}},
// Language
{command: "d009810301260482028182",
expect: {commandNumber: 0x01,
commandQualifier: MozIccManager.STK_LOCAL_INFO_LANGUAGE,
{command: "D009" + // Length
"8103012604" + // Command details
"82028182", // Device identities
expect: {commandQualifier: MozIccManager.STK_LOCAL_INFO_LANGUAGE,
localInfoType: MozIccManager.STK_LOCAL_INFO_LANGUAGE}},
];
function testLocalInfo(aCommand, aExpect) {
is(aCommand.typeOfCommand, MozIccManager.STK_CMD_PROVIDE_LOCAL_INFO, "typeOfCommand");
is(aCommand.commandNumber, 0x01, "commandNumber");
is(aCommand.typeOfCommand, MozIccManager.STK_CMD_PROVIDE_LOCAL_INFO,
"typeOfCommand");
is(aCommand.commandQualifier, aExpect.commandQualifier, "commandQualifier");
is(aCommand.options.localInfoType, aExpect.localInfoType, "options.localInfoType");
is(aCommand.options.localInfoType, aExpect.localInfoType,
"options.localInfoType");
}
// Start tests
@ -46,6 +53,12 @@ startTestCommon(function() {
// Wait onstkcommand event.
promises.push(waitForTargetEvent(icc, "stkcommand")
.then((aEvent) => testLocalInfo(aEvent.command, data.expect)));
// Wait icc-stkcommand system message.
promises.push(waitForSystemMessage("icc-stkcommand")
.then((aMessage) => {
is(aMessage.iccId, icc.iccInfo.iccid, "iccId");
testLocalInfo(aMessage.command, data.expect);
}));
// Send emulator command to generate stk unsolicited event.
promises.push(sendEmulatorStkPdu(data.command));

Просмотреть файл

@ -0,0 +1,120 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
MARIONETTE_TIMEOUT = 60000;
MARIONETTE_HEAD_JS = "head.js";
const TEST_DATA = [
{command: "D009" + // Length
"8103012000" + // Command details
"82028182", // Device identities
expect: {commandQualifier: 0x00}},
{command: "D014" + // Length
"8103012001" + // Command details
"82028182" + // Device identities
"8509506C617920546F6E65", // Alpha identifier
expect: {commandQualifier: 0x01,
text: "Play Tone"}},
{command: "D00B" + // Length
"8103012001" + // Command details
"82028182" + // Device identities
"8500", // Alpha identifier
expect: {commandQualifier: 0x01,
text: ""}},
{command: "D00C" + // Length
"8103012000" + // Command details
"82028182" + // Device identities
"8E0101", // Tone
expect: {commandQualifier: 0x00,
tone: 0x01}},
{command: "D00D" + // Length
"8103012000" + // Command details
"82028182" + // Device identities
"84020205", // Duration
expect: {commandQualifier: 0x00,
duration: {timeUnit: MozIccManager.STK_TIME_UNIT_TENTH_SECOND,
timeInterval: 0x05}}},
{command: "D00D" + // Length
"8103012000" + // Command details
"82028182" + // Device identities
"1E020101", // Icon identifier
expect: {commandQualifier: 0x00,
iconSelfExplanatory: false,
icons: [BASIC_ICON]}},
{command: "D01F" + // Length
"8103012001" + // Command details
"82028182" + // Device identities
"8509506C617920546F6E65" + // Alpha identifier
"8E0101" + // Tone
"84020202" + // Duration
"1E020003", // Icon identifier
expect: {commandQualifier: 0x01,
text: "Play Tone",
duration: {timeUnit: MozIccManager.STK_TIME_UNIT_TENTH_SECOND,
timeInterval: 0x02},
iconSelfExplanatory: true,
icons: [COLOR_ICON]}},
];
function testPlayTone(aCommand, aExpect) {
is(aCommand.commandNumber, 0x01, "commandNumber");
is(aCommand.typeOfCommand, MozIccManager.STK_CMD_PLAY_TONE, "typeOfCommand");
is(aCommand.commandQualifier, aExpect.commandQualifier, "commandQualifier");
is(aCommand.options.isVibrate, !!(aExpect.commandQualifier & 0x01),
"options.isVibrate");
// text is optional.
if ("text" in aExpect) {
is(aCommand.options.text, aExpect.text, "options.text");
}
// tone is optional.
if ("tone" in aExpect) {
is(aCommand.options.tone, aExpect.tone, "options.tone");
}
// duration is optional.
if ("duration" in aExpect) {
let duration = aCommand.options.duration;
is(duration.timeUnit, aExpect.duration.timeUnit,
"options.duration.timeUnit");
is(duration.timeInterval, aExpect.duration.timeInterval,
"options.duration.timeInterval");
}
// icons is optional.
if ("icons" in aExpect) {
isIcons(aCommand.options.icons, aExpect.icons);
is(aCommand.options.iconSelfExplanatory, aExpect.iconSelfExplanatory,
"options.iconSelfExplanatory");
}
}
// Start tests
startTestCommon(function() {
let icc = getMozIcc();
let promise = Promise.resolve();
for (let i = 0; i < TEST_DATA.length; i++) {
let data = TEST_DATA[i];
promise = promise.then(() => {
log("play_tone_cmd: " + data.command);
let promises = [];
// Wait onstkcommand event.
promises.push(waitForTargetEvent(icc, "stkcommand")
.then((aEvent) => testPlayTone(aEvent.command, data.expect)));
// Wait icc-stkcommand system message.
promises.push(waitForSystemMessage("icc-stkcommand")
.then((aMessage) => {
is(aMessage.iccId, icc.iccInfo.iccid, "iccId");
testPlayTone(aMessage.command, data.expect);
}));
// Send emulator command to generate stk unsolicited event.
promises.push(sendEmulatorStkPdu(data.command));
return Promise.all(promises);
});
}
return promise;
});

Просмотреть файл

@ -0,0 +1,68 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
MARIONETTE_TIMEOUT = 60000;
MARIONETTE_HEAD_JS = "head.js";
const TEST_DATA = [
{command: "D00D" + // Length
"8103010300" + // Command details
"82028182" + // Device identities
"8402001A", // Duration
expect: {commandQualifier: 0x00,
timeUnit: MozIccManager.STK_TIME_UNIT_MINUTE,
timeInterval: 0x1A}},
{command: "D00D" + // Length
"8103010300" + // Command details
"82028182" + // Device identities
"8402010A", // Duration
expect: {commandQualifier: 0x00,
timeUnit: MozIccManager.STK_TIME_UNIT_SECOND,
timeInterval: 0x0A}},
{command: "D00D" + // Length
"8103010300" + // Command details
"82028182" + // Device identities
"84020205", // Duration
expect: {commandQualifier: 0x00,
timeUnit: MozIccManager.STK_TIME_UNIT_TENTH_SECOND,
timeInterval: 0x05}},
];
function testPollOff(aCommand, aExpect) {
is(aCommand.commandNumber, 0x01, "commandNumber");
is(aCommand.typeOfCommand, MozIccManager.STK_CMD_POLL_INTERVAL,
"typeOfCommand");
is(aCommand.commandQualifier, aExpect.commandQualifier, "commandQualifier");
is(aCommand.options.timeUnit, aExpect.timeUnit,
"options.timeUnit");
is(aCommand.options.timeInterval, aExpect.timeInterval,
"options.timeInterval");
}
// Start tests
startTestCommon(function() {
let icc = getMozIcc();
let promise = Promise.resolve();
for (let i = 0; i < TEST_DATA.length; i++) {
let data = TEST_DATA[i];
promise = promise.then(() => {
log("poll_interval_cmd: " + data.command);
let promises = [];
// Wait onstkcommand event.
promises.push(waitForTargetEvent(icc, "stkcommand")
.then((aEvent) => testPollOff(aEvent.command, data.expect)));
// Wait icc-stkcommand system message.
promises.push(waitForSystemMessage("icc-stkcommand")
.then((aMessage) => {
is(aMessage.iccId, icc.iccInfo.iccid, "iccId");
testPollOff(aMessage.command, data.expect);
}));
// Send emulator command to generate stk unsolicited event.
promises.push(sendEmulatorStkPdu(data.command));
return Promise.all(promises);
});
}
return promise;
});

Просмотреть файл

@ -5,11 +5,14 @@ MARIONETTE_TIMEOUT = 60000;
MARIONETTE_HEAD_JS = "head.js";
const TEST_DATA = [
{command: "d009810301040082028182",
{command: "D009" + // Length
"8103010400" + // Command details
"82028182", // Device identities
expect: {commandQualifier: 0x00}}
];
function testPollOff(aCommand, aExpect) {
is(aCommand.commandNumber, 0x01, "commandNumber");
is(aCommand.typeOfCommand, MozIccManager.STK_CMD_POLL_OFF, "typeOfCommand");
is(aCommand.commandQualifier, aExpect.commandQualifier, "commandQualifier");
}
@ -21,12 +24,18 @@ startTestCommon(function() {
for (let i = 0; i < TEST_DATA.length; i++) {
let data = TEST_DATA[i];
promise = promise.then(() => {
log("pull_off_cmd: " + data.command);
log("poll_off_cmd: " + data.command);
let promises = [];
// Wait onstkcommand event.
promises.push(waitForTargetEvent(icc, "stkcommand")
.then((aEvent) => testPollOff(aEvent.command, data.expect)));
// Wait icc-stkcommand system message.
promises.push(waitForSystemMessage("icc-stkcommand")
.then((aMessage) => {
is(aMessage.iccId, icc.iccInfo.iccid, "iccId");
testPollOff(aMessage.command, data.expect);
}));
// Send emulator command to generate stk unsolicited event.
promises.push(sendEmulatorStkPdu(data.command));

Просмотреть файл

@ -5,13 +5,19 @@ MARIONETTE_TIMEOUT = 60000;
MARIONETTE_HEAD_JS = "head.js";
const TEST_DATA = [
{command: "d0108103010101820281829205013f002fe2",
{command: "D010" + // Length
"8103010101" + // Command details
"82028182" + // Device identities
"9205013F002FE2", // File list
expect: {commandQualifier: 0x01}},
{command: "d009810301010482028182",
{command: "D009" + // Length
"8103010104" + // Command details
"82028182", // Device identities
expect: {commandQualifier: 0x04}}
];
function testRefresh(aCommand, aExpect) {
is(aCommand.commandNumber, 0x01, "commandNumber");
is(aCommand.typeOfCommand, MozIccManager.STK_CMD_REFRESH, "typeOfCommand");
is(aCommand.commandQualifier, aExpect.commandQualifier, "commandQualifier");
}
@ -29,6 +35,12 @@ startTestCommon(function() {
// Wait onstkcommand event.
promises.push(waitForTargetEvent(icc, "stkcommand")
.then((aEvent) => testRefresh(aEvent.command, data.expect)));
// Wait icc-stkcommand system message.
promises.push(waitForSystemMessage("icc-stkcommand")
.then((aMessage) => {
is(aMessage.iccId, icc.iccInfo.iccid, "iccId");
testRefresh(aMessage.command, data.expect);
}));
// Send emulator command to generate stk unsolicited event.
promises.push(sendEmulatorStkPdu(data.command));

Просмотреть файл

@ -5,44 +5,160 @@ MARIONETTE_TIMEOUT = 60000;
MARIONETTE_HEAD_JS = "head.js";
const TEST_DATA = [
{command: "d03d810301240082028182850e546f6f6c6b69742053656c6563748f07014974656d20318f07024974656d20328f07034974656d20338f07044974656d2034",
{command: "D03D" + // Length
"8103012400" + // Command details
"82028182" + // Device identities
"850E546F6F6C6B69742053656C656374" + // Alpha identifier
"8F07014974656D2031" + // Item
"8F07024974656D2032" + // Item
"8F07034974656D2033" + // Item
"8F07044974656D2034", // Item
expect: {commandQualifier: 0x00,
title: "Toolkit Select",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}, {identifier: 3, text: "Item 3"}, {identifier: 4, text: "Item 4"}]}},
{command: "d081fc810301240082028182850a4c617267654d656e75318f05505a65726f8f044f4f6e658f044e54776f8f064d54687265658f054c466f75728f054b466976658f044a5369788f0649536576656e8f064845696768748f05474e696e658f0646416c7068618f0645427261766f8f0844436861726c69658f064344656c74618f05424563686f8f0941466f782d74726f748f0640426c61636b8f063f42726f776e8f043e5265648f073d4f72616e67658f073c59656c6c6f778f063b477265656e8f053a426c75658f073956696f6c65748f0538477265798f063757686974658f06366d696c6c698f06356d6963726f8f05346e616e6f8f05337069636f",
items: [{identifier: 1, text: "Item 1"},
{identifier: 2, text: "Item 2"},
{identifier: 3, text: "Item 3"},
{identifier: 4, text: "Item 4"}]}},
{command: "D081FC" + // Length
"8103012400" + // Command details
"82028182" + // Device identities
"850A4C617267654D656E7531" + // Alpha identifier
"8F05505A65726F" + // Item
"8F044F4F6E65" + // Item
"8F044E54776F" + // Item
"8F064D5468726565" + // Item
"8F054C466F7572" + // Item
"8F054B46697665" + // Item
"8F044A536978" + // Item
"8F0649536576656E" + // Item
"8F06484569676874" + // Item
"8F05474E696E65" + // Item
"8F0646416C706861" + // Item
"8F0645427261766F" + // Item
"8F0844436861726C6965" + // Item
"8F064344656C7461" + // Item
"8F05424563686F" + // Item
"8F0941466F782D74726F74" + // Item
"8F0640426C61636B" + // Item
"8F063F42726F776E" + // Item
"8F043E526564" + // Item
"8F073D4F72616E6765" + // Item
"8F073C59656C6C6F77" + // Item
"8F063B477265656E" + // Item
"8F053A426C7565" + // Item
"8F073956696F6C6574" + // Item
"8F053847726579" + // Item
"8F06375768697465" + // Item
"8F06366D696C6C69" + // Item
"8F06356D6963726F" + // Item
"8F05346E616E6F" + // Item
"8F05337069636F", // Item
expect: {commandQualifier: 0x00,
title: "LargeMenu1",
items: [{identifier: 80, text: "Zero"}, {identifier: 79, text: "One"}, {identifier: 78, text: "Two"}, {identifier: 77, text: "Three"}, {identifier: 76, text: "Four"}, {identifier: 75, text: "Five"}, {identifier: 74, text: "Six"}, {identifier: 73, text: "Seven"}, {identifier: 72, text: "Eight"}, {identifier: 71, text: "Nine"}, {identifier: 70, text: "Alpha"}, {identifier: 69, text: "Bravo"}, {identifier: 68, text: "Charlie"}, {identifier: 67, text: "Delta"}, {identifier: 66, text: "Echo"}, {identifier: 65, text: "Fox-trot"}, {identifier: 64, text: "Black"}, {identifier: 63, text: "Brown"}, {identifier: 62, text: "Red"}, {identifier: 61, text: "Orange"}, {identifier: 60, text: "Yellow"}, {identifier: 59, text: "Green"}, {identifier: 58, text: "Blue"}, {identifier: 57, text: "Violet"}, {identifier: 56, text: "Grey"}, {identifier: 55, text: "White"}, {identifier: 54, text: "milli"}, {identifier: 53, text: "micro"}, {identifier: 52, text: "nano"}, {identifier: 51, text: "pico"}]}},
{command: "d081fb810301240082028182850a4c617267654d656e75328f1eff43616c6c20466f7277617264696e6720556e636f6e646974696f6e616c8f1dfe43616c6c20466f7277617264696e67204f6e205573657220427573798f1cfd43616c6c20466f7277617264696e67204f6e204e6f205265706c798f26fc43616c6c20466f7277617264696e67204f6e2055736572204e6f7420526561636861626c658f1efb42617272696e67204f6620416c6c204f7574676f696e672043616c6c738f2cfa42617272696e67204f6620416c6c204f7574676f696e6720496e7465726e6174696f6e616c2043616c6c738f11f9434c492050726573656e746174696f6e",
items: [{identifier: 80, text: "Zero"},
{identifier: 79, text: "One"},
{identifier: 78, text: "Two"},
{identifier: 77, text: "Three"},
{identifier: 76, text: "Four"},
{identifier: 75, text: "Five"},
{identifier: 74, text: "Six"},
{identifier: 73, text: "Seven"},
{identifier: 72, text: "Eight"},
{identifier: 71, text: "Nine"},
{identifier: 70, text: "Alpha"},
{identifier: 69, text: "Bravo"},
{identifier: 68, text: "Charlie"},
{identifier: 67, text: "Delta"},
{identifier: 66, text: "Echo"},
{identifier: 65, text: "Fox-trot"},
{identifier: 64, text: "Black"},
{identifier: 63, text: "Brown"},
{identifier: 62, text: "Red"},
{identifier: 61, text: "Orange"},
{identifier: 60, text: "Yellow"},
{identifier: 59, text: "Green"},
{identifier: 58, text: "Blue"},
{identifier: 57, text: "Violet"},
{identifier: 56, text: "Grey"},
{identifier: 55, text: "White"},
{identifier: 54, text: "milli"},
{identifier: 53, text: "micro"},
{identifier: 52, text: "nano"},
{identifier: 51, text: "pico"}]}},
{command: "D081FB" + // Length
"8103012400" + // Command details
"82028182" + // Device identities
"850A4C617267654D656E7532" + // Alpha identifier
"8F1EFF43616C6C20466F7277617264696E6720556E636F6E6469" + // Item
"74696F6E616C" +
"8F1DFE43616C6C20466F7277617264696E67204F6E2055736572" + // Item
"2042757379" +
"8F1CFD43616C6C20466F7277617264696E67204F6E204E6F2052" + // Item
"65706C79" +
"8F26FC43616C6C20466F7277617264696E67204F6E2055736572" + // Item
"204E6F7420526561636861626C65" +
"8F1EFB42617272696E67204F6620416C6C204F7574676F696E67" + // Item
"2043616C6C73" +
"8F2CFA42617272696E67204F6620416C6C204F7574676F696E67" + // Item
"20496E7465726E6174696F6E616C2043616C6C73" +
"8F11F9434C492050726573656E746174696F6E", // Item
expect: {commandQualifier: 0x00,
title: "LargeMenu2",
items: [{identifier: 255, text: "Call Forwarding Unconditional"}, {identifier: 254, text: "Call Forwarding On User Busy"}, {identifier: 253, text: "Call Forwarding On No Reply"}, {identifier: 252, text: "Call Forwarding On User Not Reachable"}, {identifier: 251, text: "Barring Of All Outgoing Calls"}, {identifier: 250, text: "Barring Of All Outgoing International Calls"}, {identifier: 249, text: "CLI Presentation"}]}},
{command: "d022810301240082028182850b53656c656374204974656d8f04114f6e658f041254776f",
items: [{identifier: 255, text: "Call Forwarding Unconditional"},
{identifier: 254, text: "Call Forwarding On User Busy"},
{identifier: 253, text: "Call Forwarding On No Reply"},
{identifier: 252, text: "Call Forwarding On User Not Reachable"},
{identifier: 251, text: "Barring Of All Outgoing Calls"},
{identifier: 250, text: "Barring Of All Outgoing International Calls"},
{identifier: 249, text: "CLI Presentation"}]}},
{command: "D081FD" + // Length
"8103012400" + // Command details
"82028182" + // Device identities
"8581ED5468652053494D207368616C6C20737570" + // Alpha identifier
"706C79206120736574206F66206974656D732066" +
"726F6D207768696368207468652075736572206D" +
"61792063686F6F7365206F6E652E204561636820" +
"6974656D20636F6D70726973657320612073686F" +
"7274206964656E74696669657220287573656420" +
"746F20696E646963617465207468652073656C65" +
"6374696F6E2920616E6420612074657874207374" +
"72696E672E204F7074696F6E616C6C7920746865" +
"2053494D206D617920696E636C75646520616E20" +
"616C706861206964656E7469666965722E205468" +
"6520616C706861206964656E7469666965722069" +
"8F020159", // Item
expect: {commandQualifier: 0x00,
title: "Select Item",
items: [{identifier: 17, text: "One"}, {identifier: 18, text: "Two"}]}},
{command: "d081fd8103012400820281828581ed5468652053494d207368616c6c20737570706c79206120736574206f66206974656d732066726f6d207768696368207468652075736572206d61792063686f6f7365206f6e652e2045616368206974656d20636f6d70726973657320612073686f7274206964656e74696669657220287573656420746f20696e646963617465207468652073656c656374696f6e2920616e642061207465787420737472696e672e204f7074696f6e616c6c79207468652053494d206d617920696e636c75646520616e20616c706861206964656e7469666965722e2054686520616c706861206964656e74696669657220698f020159",
expect: {commandQualifier: 0x00,
title: "The SIM shall supply a set of items from which the user may choose one. Each item comprises a short identifier (used to indicate the selection) and a text string. Optionally the SIM may include an alpha identifier. The alpha identifier i",
title: "The SIM shall supply a set of items from which the user " +
"may choose one. Each item comprises a short identifier " +
"(used to indicate the selection) and a text string. " +
"Optionally the SIM may include an alpha identifier. " +
"The alpha identifier i",
items: [{identifier: 1, text: "Y"}]}},
{command: "d081f3810301240082028182850a304c617267654d656e758f1dff312043616c6c20466f727761726420556e636f6e646974696f6e616c8f1cfe322043616c6c20466f7277617264204f6e205573657220427573798f1bfd332043616c6c20466f7277617264204f6e204e6f205265706c798f25fc342043616c6c20466f7277617264204f6e2055736572204e6f7420526561636861626c658f20fb352042617272696e67204f6620416c6c204f7574676f696e672043616c6c738f24fa362042617272696e67204f6620416c6c204f7574676f696e6720496e742043616c6c738f13f93720434c492050726573656e746174696f6e",
expect: {commandQualifier: 0x00,
title: "0LargeMenu",
items: [{identifier: 255, text: "1 Call Forward Unconditional"}, {identifier: 254, text: "2 Call Forward On User Busy"}, {identifier: 253, text: "3 Call Forward On No Reply"}, {identifier: 252, text: "4 Call Forward On User Not Reachable"}, {identifier: 251, text: "5 Barring Of All Outgoing Calls"}, {identifier: 250, text: "6 Barring Of All Outgoing Int Calls"}, {identifier: 249, text: "7 CLI Presentation"}]}},
{command: "d039810301240082028182850e546f6f6c6b69742053656c6563748f07014974656d20318f07024974656d20328f07034974656d20331803131026",
{command: "D039" + // Length
"8103012400" + // Command details
"82028182" + // Device identities
"850E546F6F6C6B69742053656C656374" + // Alpha identifier
"8F07014974656D2031" + // Item
"8F07024974656D2032" + // Item
"8F07034974656D2033" + // Item
"1803131026", // Items next action indicator
expect: {commandQualifier: 0x00,
title: "Toolkit Select",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}, {identifier: 3, text: "Item 3"}],
nextActionList: [MozIccManager.STK_CMD_SEND_SMS, MozIccManager.STK_CMD_SET_UP_CALL, MozIccManager.STK_CMD_PROVIDE_LOCAL_INFO]}},
{command: "d037810301240082028182850e546f6f6c6b69742053656c6563748f07014974656d20318f07024974656d20328f07034974656d2033900102",
expect: {commandQualifier: 0x00,
title: "Toolkit Select",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}, {identifier: 3, text: "Item 3"}]}},
{command: "d034810301248082028182850e546f6f6c6b69742053656c6563748f07014974656d20318f07024974656d20328f07034974656d2033",
expect: {commandQualifier: 0x80,
title: "Toolkit Select",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}, {identifier: 3, text: "Item 3"}]}},
{command: "d03e810301240082028182850e546f6f6c6b69742053656c6563748f07014974656d20318f07024974656d20328f07034974656d20339e0201019f0401030303",
items: [{identifier: 1, text: "Item 1"},
{identifier: 2, text: "Item 2"},
{identifier: 3, text: "Item 3"}],
nextActionList: [MozIccManager.STK_CMD_SEND_SMS,
MozIccManager.STK_CMD_SET_UP_CALL,
MozIccManager.STK_CMD_PROVIDE_LOCAL_INFO]}},
{command: "D03E" + // Length
"8103012400" + // Command details
"82028182" + // Device identities
"850E546F6F6C6B69742053656C656374" + // Alpha identifier
"8F07014974656D2031" + // Item
"8F07024974656D2032" + // Item
"8F07034974656D2033" + // Item
"9E020101" + // Icon identifier
"9F0401030303", // Item icon identifier list
expect: {commandQualifier: 0x00,
title: "Toolkit Select",
iconSelfExplanatory: false,
@ -50,174 +166,121 @@ const TEST_DATA = [
items: [{identifier: 1, text: "Item 1", iconSelfExplanatory: false, icons: [COLOR_ICON]},
{identifier: 2, text: "Item 2", iconSelfExplanatory: false, icons: [COLOR_ICON]},
{identifier: 3, text: "Item 3", iconSelfExplanatory: false, icons: [COLOR_ICON]}]}},
{command: "d03e810301240082028182850e546f6f6c6b69742053656c6563748f07014974656d20318f07024974656d20328f07034974656d20339e0200019f0400050505",
{command: "D028" + // Length
"8103012400" + // Command details
"82028182" + // Device identities
"850E546F6F6C6B69742053656C656374" + // Alpha identifier
"8F0101" + // Item
"8F0102" + // Item
"8F0103" + // Item
"9F0400050505", // Item icon identifier list
expect: {commandQualifier: 0x00,
title: "Toolkit Select",
iconSelfExplanatory: true,
icons: [BASIC_ICON],
items: [{identifier: 1, text: "Item 1", iconSelfExplanatory: true, icons: [COLOR_TRANSPARENCY_ICON]},
{identifier: 2, text: "Item 2", iconSelfExplanatory: true, icons: [COLOR_TRANSPARENCY_ICON]},
{identifier: 3, text: "Item 3", iconSelfExplanatory: true, icons: [COLOR_TRANSPARENCY_ICON]}]}},
{command: "d034810301240382028182850e546f6f6c6b69742053656c6563748f07014974656d20318f07024974656d20328f07034974656d2033",
expect: {commandQualifier: 0x03,
items: [{identifier: 1, text: "", iconSelfExplanatory: true, icons: [COLOR_TRANSPARENCY_ICON]},
{identifier: 2, text: "", iconSelfExplanatory: true, icons: [COLOR_TRANSPARENCY_ICON]},
{identifier: 3, text: "", iconSelfExplanatory: true, icons: [COLOR_TRANSPARENCY_ICON]}]}},
{command: "D034" + // Length
"8103012483" + // Command details
"82028182" + // Device identities
"850E546F6F6C6B69742053656C656374" + // Alpha identifier
"8F07014974656D2031" + // Item
"8F07024974656D2032" + // Item
"8F07034974656D2033", // Item
expect: {commandQualifier: 0x83,
title: "Toolkit Select",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}, {identifier: 3, text: "Item 3"}]}},
{command: "d034810301240182028182850e546f6f6c6b69742053656c6563748f07014974656d20318f07024974656d20328f07034974656d2033",
expect: {commandQualifier: 0x01,
title: "Toolkit Select",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}, {identifier: 3, text: "Item 3"}]}},
{command: "d02b810301240482028182850e546f6f6c6b69742053656c6563748f07014974656d20318f07024974656d2032",
expect: {commandQualifier: 0x04,
title: "Toolkit Select",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}]}},
{command: "d030810301240082028182850a3c54494d452d4f55543e8f07014974656d20318f07024974656d20328f07034974656d2033",
expect: {commandQualifier: 0x00,
title: "<TIME-OUT>",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}, {identifier: 3, text: "Item 3"}]}},
{command: "d03d8103012400820281828510546f6f6c6b69742053656c65637420318f07014974656d20318f07024974656d2032d004001000b4d108000600b4000600b4",
items: [{identifier: 1, text: "Item 1"},
{identifier: 2, text: "Item 2"},
{identifier: 3, text: "Item 3"}]}},
{command: "D03D" + // Length
"8103012400" + // Command details
"82028182" + // Device identities
"8510546F6F6C6B69742053656C6563742031" + // Alpha identifier
"8F07014974656D2031" + // Item
"8F07024974656D2032" + // Item
"D004001000B4" + // Text attribute
"D108000600B4000600B4", // Item text attribute list
expect: {commandQualifier: 0x00,
title: "Toolkit Select 1",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}]}},
{command: "d02d8103012400820281828510546f6f6c6b69742053656c65637420328f07014974656d20338f07024974656d2034",
expect: {commandQualifier: 0x00,
title: "Toolkit Select 2",
items: [{identifier: 1, text: "Item 3"}, {identifier: 2, text: "Item 4"}]}},
{command: "d03d8103012400820281828510546f6f6c6b69742053656c65637420318f07014974656d20318f07024974656d2032d004001001b4d108000601b4000601b4",
expect: {commandQualifier: 0x00,
title: "Toolkit Select 1",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}]}},
{command: "d02d8103012400820281828510546f6f6c6b69742053656c65637420328f07014974656d20338f07024974656d2034",
expect: {commandQualifier: 0x00,
title: "Toolkit Select 2",
items: [{identifier: 1, text: "Item 3"}, {identifier: 2, text: "Item 4"}]}},
{command: "d03d8103012400820281828510546f6f6c6b69742053656c65637420318f07014974656d20318f07024974656d2032d004001002b4d108000602b4000602b4",
expect: {commandQualifier: 0x00,
title: "Toolkit Select 1",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}]}},
{command: "d02d8103012400820281828510546f6f6c6b69742053656c65637420328f07014974656d20338f07024974656d2034",
expect: {commandQualifier: 0x00,
title: "Toolkit Select 2",
items: [{identifier: 1, text: "Item 3"}, {identifier: 2, text: "Item 4"}]}},
{command: "d03d8103012400820281828510546f6f6c6b69742053656c65637420318f07014974656d20318f07024974656d2032d004001004b4d108000604b4000604b4",
expect: {commandQualifier: 0x00,
title: "Toolkit Select 1",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}]}},
{command: "d03d8103012400820281828510546f6f6c6b69742053656c65637420328f07014974656d20338f07024974656d2034d004001000b4d108000600b4000600b4",
expect: {commandQualifier: 0x00,
title: "Toolkit Select 2",
items: [{identifier: 1, text: "Item 3"}, {identifier: 2, text: "Item 4"}]}},
{command: "d02d8103012400820281828510546f6f6c6b69742053656c65637420338f07014974656d20358f07024974656d2036",
expect: {commandQualifier: 0x00,
title: "Toolkit Select 3",
items: [{identifier: 1, text: "Item 5"}, {identifier: 2, text: "Item 6"}]}},
{command: "d03d8103012400820281828510546f6f6c6b69742053656c65637420318f07014974656d20318f07024974656d2032d004001008b4d108000608b4000608b4",
expect: {commandQualifier: 0x00,
title: "Toolkit Select 1",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}]}},
{command: "d03d8103012400820281828510546f6f6c6b69742053656c65637420328f07014974656d20338f07024974656d2034d004001000b4d108000600b4000600b4",
expect: {commandQualifier: 0x00,
title: "Toolkit Select 2",
items: [{identifier: 1, text: "Item 3"}, {identifier: 2, text: "Item 4"}]}},
{command: "d02d8103012400820281828510546f6f6c6b69742053656c65637420338f07014974656d20358f07024974656d2036",
expect: {commandQualifier: 0x00,
title: "Toolkit Select 3",
items: [{identifier: 1, text: "Item 5"}, {identifier: 2, text: "Item 6"}]}},
{command: "d03d8103012400820281828510546f6f6c6b69742053656c65637420318f07014974656d20318f07024974656d2032d004001010b4d108000610b4000610b4",
expect: {commandQualifier: 0x00,
title: "Toolkit Select 1",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}]}},
{command: "d03d8103012400820281828510546f6f6c6b69742053656c65637420328f07014974656d20338f07024974656d2034d004001000b4d108000600b4000600b4",
expect: {commandQualifier: 0x00,
title: "Toolkit Select 2",
items: [{identifier: 1, text: "Item 3"}, {identifier: 2, text: "Item 4"}]}},
{command: "d02d8103012400820281828510546f6f6c6b69742053656c65637420338f07014974656d20358f07024974656d2036",
expect: {commandQualifier: 0x00,
title: "Toolkit Select 3",
items: [{identifier: 1, text: "Item 5"}, {identifier: 2, text: "Item 6"}]}},
{command: "d03d8103012400820281828510546f6f6c6b69742053656c65637420318f07014974656d20318f07024974656d2032d004001020b4d108000620b4000620b4",
expect: {commandQualifier: 0x00,
title: "Toolkit Select 1",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}]}},
{command: "d03d8103012400820281828510546f6f6c6b69742053656c65637420328f07014974656d20338f07024974656d2034d004001000b4d108000600b4000600b4",
expect: {commandQualifier: 0x00,
title: "Toolkit Select 2",
items: [{identifier: 1, text: "Item 3"}, {identifier: 2, text: "Item 4"}]}},
{command: "d02d8103012400820281828510546f6f6c6b69742053656c65637420338f07014974656d20358f07024974656d2036",
expect: {commandQualifier: 0x00,
title: "Toolkit Select 3",
items: [{identifier: 1, text: "Item 5"}, {identifier: 2, text: "Item 6"}]}},
{command: "d03d8103012400820281828510546f6f6c6b69742053656c65637420318f07014974656d20318f07024974656d2032d004001040b4d108000640b4000640b4",
expect: {commandQualifier: 0x00,
title: "Toolkit Select 1",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}]}},
{command: "d03d8103012400820281828510546f6f6c6b69742053656c65637420328f07014974656d20338f07024974656d2034d004001000b4d108000600b4000600b4",
expect: {commandQualifier: 0x00,
title: "Toolkit Select 2",
items: [{identifier: 1, text: "Item 3"}, {identifier: 2, text: "Item 4"}]}},
{command: "d02d8103012400820281828510546f6f6c6b69742053656c65637420338f07014974656d20358f07024974656d2036",
expect: {commandQualifier: 0x00,
title: "Toolkit Select 3",
items: [{identifier: 1, text: "Item 5"}, {identifier: 2, text: "Item 6"}]}},
{command: "d03d8103012400820281828510546f6f6c6b69742053656c65637420318f07014974656d20318f07024974656d2032d004001080b4d108000680b4000680b4",
expect: {commandQualifier: 0x00,
title: "Toolkit Select 1",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}]}},
{command: "d03d8103012400820281828510546f6f6c6b69742053656c65637420328f07014974656d20338f07024974656d2034d004001000b4d108000600b4000600b4",
expect: {commandQualifier: 0x00,
title: "Toolkit Select 2",
items: [{identifier: 1, text: "Item 3"}, {identifier: 2, text: "Item 4"}]}},
{command: "d02d8103012400820281828510546f6f6c6b69742053656c65637420338f07014974656d20358f07024974656d2036",
expect: {commandQualifier: 0x00,
title: "Toolkit Select 3",
items: [{identifier: 1, text: "Item 5"}, {identifier: 2, text: "Item 6"}]}},
{command: "d03d8103012400820281828510546f6f6c6b69742053656c65637420318f07014974656d20318f07024974656d2032d004001000b4d108000600b4000600b4",
expect: {commandQualifier: 0x00,
title: "Toolkit Select 1",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}]}},
{command: "d02d8103012400820281828510546f6f6c6b69742053656c65637420328f07014974656d20338f07024974656d2034",
expect: {commandQualifier: 0x00,
title: "Toolkit Select 2",
items: [{identifier: 1, text: "Item 3"}, {identifier: 2, text: "Item 4"}]}},
{command: "d07e8103012400820281828519800417041404200410041204210422041204230419042204158f1c018004170414042004100412042104220412042304190422041500318f1c028004170414042004100412042104220412042304190422041500328f1c03800417041404200410041204210422041204230419042204150033",
items: [{identifier: 1, text: "Item 1"},
{identifier: 2, text: "Item 2"}]}},
{command: "D069" + // Length
"8103012400" + // Command details
"82028182" + // Device identities
"851980041704140420041004120421042204120423041904220415" + // Alpha identifier
"8F1C01800417041404200410041204210422041204230419042204150031" + // Item
"8F1102810D089794A09092A1A292A399A29532" + // Item
"8F1203820D041087849080829192829389928533", // Item
expect: {commandQualifier: 0x00,
title: "ЗДРАВСТВУЙТЕ",
items: [{identifier: 1, text: "ЗДРАВСТВУЙТЕ1"}, {identifier: 2, text: "ЗДРАВСТВУЙТЕ2"}, {identifier: 3, text: "ЗДРАВСТВУЙТЕ3"}]}},
{command: "d053810301240082028182850f810c089794a09092a1a292a399a2958f1101810d089794a09092a1a292a399a295318f1102810d089794a09092a1a292a399a295328f1103810d089794a09092a1a292a399a29533",
expect: {commandQualifier: 0x00,
title: "ЗДРАВСТВУЙТЕ",
items: [{identifier: 1, text: "ЗДРАВСТВУЙТЕ1"}, {identifier: 2, text: "ЗДРАВСТВУЙТЕ2"}, {identifier: 3, text: "ЗДРАВСТВУЙТЕ3"}]}},
{command: "d0578103012400820281828510820c04108784908082919282938992858f1201820d0410878490808291928293899285318f1202820d0410878490808291928293899285328f1203820d041087849080829192829389928533",
expect: {commandQualifier: 0x00,
title: "ЗДРАВСТВУЙТЕ",
items: [{identifier: 1, text: "ЗДРАВСТВУЙТЕ1"}, {identifier: 2, text: "ЗДРАВСТВУЙТЕ2"}, {identifier: 3, text: "ЗДРАВСТВУЙТЕ3"}]}},
{command: "d03e810301240082028182850b805de551777bb1900962e98f080180987976ee4e008f080280987976ee4e8c8f080380987976ee4e098f080480987976ee56db",
expect: {commandQualifier: 0x00,
title: "工具箱选择",
items: [{identifier: 1, text: "项目一"}, {identifier: 2, text: "项目二"}, {identifier: 3, text: "项目三"}, {identifier: 4, text: "项目四"}]}},
{command: "d0388103012400820281828509800038003030eb00308f0a01800038003030eb00318f0a02800038003030eb00328f0a03800038003030eb0033",
items: [{identifier: 1, text: "ЗДРАВСТВУЙТЕ1"},
{identifier: 2, text: "ЗДРАВСТВУЙТЕ2"},
{identifier: 3, text: "ЗДРАВСТВУЙТЕ3"}]}},
{command: "D038" + // Length
"8103012400" + // Command details
"82028182" + // Device identities
"8509800038003030EB0030" + // Alpha identifier
"8F0A01800038003030EB0031" + // Item
"8F0A02800038003030EB0032" + // Item
"8F0A03800038003030EB0033", // Item
expect: {commandQualifier: 0x00,
title: "80ル0",
items: [{identifier: 1, text: "80ル1"}, {identifier: 2, text: "80ル2"}, {identifier: 3, text: "80ル3"}]}},
{command: "d03081030124008202818285078104613831eb308f08018104613831eb318f08028104613831eb328f08038104613831eb33",
items: [{identifier: 1, text: "80ル1"},
{identifier: 2, text: "80ル2"},
{identifier: 3, text: "80ル3"}]}},
{command: "D030" + // Length
"8103012400" + // Command details
"82028182" + // Device identities
"85078104613831EB30" + // Alpha identifier
"8F08018104613831EB31" + // Item
"8F08028104613831EB32" + // Item
"8F08038104613831EB33", // Item
expect: {commandQualifier: 0x00,
title: "81ル0",
items: [{identifier: 1, text: "81ル1"}, {identifier: 2, text: "81ル2"}, {identifier: 3, text: "81ル3"}]}},
{command: "d0348103012400820281828508820430a03832cb308f0901820430a03832cb318f0902820430a03832cb328f0903820430a03832cb33",
items: [{identifier: 1, text: "81ル1"},
{identifier: 2, text: "81ル2"},
{identifier: 3, text: "81ル3"}]}},
{command: "D034" + // Length
"8103012400" + // Command details
"82028182" + // Device identities
"8508820430A03832CB30" + // Alpha identifier
"8F0901820430A03832CB31" + // Item
"8F0902820430A03832CB32" + // Item
"8F0903820430A03832CB33", // Item
expect: {commandQualifier: 0x00,
title: "82ル0",
items: [{identifier: 1, text: "82ル1"}, {identifier: 2, text: "82ル2"}, {identifier: 3, text: "82ル3"}]}},
{command: "d039810301240082028182850e546f6f6c6b69742053656c6563748f07014974656d20318f07024974656d20328f07034974656d20331803000081",
items: [{identifier: 1, text: "82ル1"},
{identifier: 2, text: "82ル2"},
{identifier: 3, text: "82ル3"}]}},
{command: "D03C" + // Length
"8103012400" + // Command details
"82028182" + // Device identities
"850E546F6F6C6B69742053656C656374" + // Alpha identifier
"8F07014974656D2031" + // Item
"8F07024974656D2032" + // Item
"8F07034974656D2033" + // Item
"1803000081" + // Items next action indicator
"100102", // Item identifier
expect: {commandQualifier: 0x00,
title: "Toolkit Select",
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]}},
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],
defaultItem: 1}},
];
function testSelectItem(aCommand, aExpect) {
is(aCommand.commandNumber, 0x01, "commandNumber");
is(aCommand.typeOfCommand, MozIccManager.STK_CMD_SELECT_ITEM, "typeOfCommand");
is(aCommand.commandQualifier, aExpect.commandQualifier, "commandQualifier");
is(aCommand.options.presentationType, aCommand.commandQualifier & 0x03,
"presentationType");
is(aCommand.options.isHelpAvailable, !!(aCommand.commandQualifier & 0x80),
"isHelpAvailable");
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];
@ -234,18 +297,25 @@ function testSelectItem(aCommand, aExpect) {
}
}
if (aExpect.icons) {
// icons is optional.
if ("icons" in aExpect) {
isIcons(aCommand.options.icons, aExpect.icons);
is(aCommand.options.iconSelfExplanatory, aExpect.iconSelfExplanatory,
"options.iconSelfExplanatory");
}
if (aExpect.nextActionList) {
// nextActionList is optional.
if ("nextActionList" in aExpect) {
for (let index in aExpect.nextActionList) {
is(aCommand.options.nextActionList[index], aExpect.nextActionList[index],
"options.nextActionList[" + index + "]");
}
}
// defaultItem is optional.
if ("defaultItem" in aExpect) {
is(aCommand.options.defaultItem, aExpect.defaultItem, "options.defaultItem");
}
}
// Start tests
@ -261,6 +331,12 @@ startTestCommon(function() {
// Wait onstkcommand event.
promises.push(waitForTargetEvent(icc, "stkcommand")
.then((aEvent) => testSelectItem(aEvent.command, data.expect)));
// Wait icc-stkcommand system message.
promises.push(waitForSystemMessage("icc-stkcommand")
.then((aMessage) => {
is(aMessage.iccId, icc.iccInfo.iccid, "iccId");
testSelectItem(aMessage.command, data.expect);
}));
// Send emulator command to generate stk unsolicited event.
promises.push(sendEmulatorStkPdu(data.command));

Просмотреть файл

@ -5,110 +5,79 @@ MARIONETTE_TIMEOUT = 60000;
MARIONETTE_HEAD_JS = "head.js";
const TEST_DATA = [
{command: "d01b810301140082028183850953656e642044544d46ac052143658709",
{command: "D01B" + // Length
"8103011400" + // Command details
"82028183" + // Device identities
"850953656E642044544D46" + // Alpha identifier
"AC052143658709", // DTMF string
expect: {commandQualifier: 0x00,
text: "Send DTMF"}},
{command: "d010810301140082028183ac052143658709",
{command: "D010" + // Length
"8103011400" + // Command details
"82028183" + // Device identities
"AC052143658709", // DTMF string
expect: {commandQualifier: 0x00}},
{command: "d0138103011400820281838500ac06c1cccccccc2c",
{command: "D013" + // Length
"8103011400" + // Command details
"82028183" + // Device identities
"8500" + // Alpha identifier
"AC06C1CCCCCCCC2C", // DTMF string
expect: {commandQualifier: 0x00,
text: ""}},
{command: "d011810301140082028183ac06c1cccccccc2c",
expect: {commandQualifier: 0x00}},
{command: "d01d810301140082028183850a42617369632049636f6eac02c1f29e020001",
{command: "D01D" + // Length
"8103011400" + // Command details
"82028183" + // Device identities
"850A42617369632049636F6E" + // Alpha identifier
"AC02C1F2" + // DTMF string
"9E020001", // Icon identifier
expect: {commandQualifier: 0x00,
text: "Basic Icon",
iconSelfExplanatory: true,
icons: [BASIC_ICON]}},
{command: "d011810301140082028183ac02c1f29e020005",
{command: "D011" + // Length
"8103011400" + // Command details
"82028183" + // Device identities
"AC02C1F2" + // DTMF string
"9E020005", // Icon identifier
expect: {commandQualifier: 0x00,
iconSelfExplanatory: true,
icons: [COLOR_TRANSPARENCY_ICON]}},
{command: "d01c810301140082028183850953656e642044544d46ac02c1f29e020101",
expect: {commandQualifier: 0x00,
text: "Send DTMF",
iconSelfExplanatory: false,
icons: [BASIC_ICON]}},
{command: "d011810301140082028183ac02c1f29e020105",
expect: {commandQualifier: 0x00,
iconSelfExplanatory: false,
icons: [COLOR_TRANSPARENCY_ICON]}},
{command: "d028810301140082028183851980041704140420041004120421042204120423041904220415ac02c1f2",
{command: "D028" + // Length
"8103011400" + // Command details
"82028183" + // Device identities
"851980041704140420041004120421042204120423041904220415" + // Alpha identifier
"AC02C1F2", // DTMF string
expect: {commandQualifier: 0x00,
text: "ЗДРАВСТВУЙТЕ"}},
{command: "d00d810301140082028183ac02c1f2",
expect: {commandQualifier: 0x00}},
{command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b00b4",
{command: "D023" + // Length
"8103011400" + // Command details
"82028183" + // Device identities
"850B53656E642044544D462031" + // Alpha identifier
"AC052143658709" + // DTMF string
"D004000B00B4", // Text attribute
expect: {commandQualifier: 0x00,
text: "Send DTMF 1"}},
{command: "d016810301140082028183ac052143658709d004000b00b4",
expect: {commandQualifier: 0x00}},
{command: "d01d810301140082028183850b53656e642044544d462032ac052143658709",
expect: {commandQualifier: 0x00,
text: "Send DTMF 2"}},
{command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b01b4",
expect: {commandQualifier: 0x00,
text: "Send DTMF 1"}},
{command: "d016810301140082028183ac052143658709d004000b01b4",
expect: {commandQualifier: 0x00}},
{command: "d023810301140082028183850b53656e642044544d462031ac052143658709d00400b002b4",
expect: {commandQualifier: 0x00,
text: "Send DTMF 1"}},
{command: "d016810301140082028183ac052143658709d00400b002b4",
expect: {commandQualifier: 0x00}},
{command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b04b4",
expect: {commandQualifier: 0x00,
text: "Send DTMF 1"}},
{command: "d016810301140082028183ac052143658709d004000b04b4",
expect: {commandQualifier: 0x00}},
{command: "d023810301140082028183850b53656e642044544d462032ac052143658709d004000b00b4",
expect: {commandQualifier: 0x00,
text: "Send DTMF 2"}},
{command: "d01d810301140082028183850b53656e642044544d462033ac052143658709",
expect: {commandQualifier: 0x00,
text: "Send DTMF 3"}},
{command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b08b4",
expect: {commandQualifier: 0x00,
text: "Send DTMF 1"}},
{command: "d016810301140082028183ac052143658709d004000b08b4",
expect: {commandQualifier: 0x00}},
{command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b10b4",
expect: {commandQualifier: 0x00,
text: "Send DTMF 1"}},
{command: "d016810301140082028183ac052143658709d004000b10b4",
expect: {commandQualifier: 0x00}},
{command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b20b4",
expect: {commandQualifier: 0x00,
text: "Send DTMF 1"}},
{command: "d016810301140082028183ac052143658709d004000b20b4",
expect: {commandQualifier: 0x00}},
{command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b40b4",
expect: {commandQualifier: 0x00,
text: "Send DTMF 1"}},
{command: "d016810301140082028183ac052143658709d004000b40b4",
expect: {commandQualifier: 0x00}},
{command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b80b4",
expect: {commandQualifier: 0x00,
text: "Send DTMF 1"}},
{command: "d016810301140082028183ac052143658709d004000b80b4",
expect: {commandQualifier: 0x00}},
{command: "d0148103011400820281838505804f60597dac02c1f2",
{command: "D014" + // Length
"8103011400" + // Command details
"82028183" + // Device identities
"8505804F60597D" + // Alpha identifier
"AC02C1F2", // DTMF string
expect: {commandQualifier: 0x00,
text: "你好"}},
{command: "d01281030114008202818385038030ebac02c1f2",
expect: {commandQualifier: 0x00,
text: "ル"}}
];
function testSendDTMF(aCommand, aExpect) {
is(aCommand.commandNumber, 0x01, "commandNumber");
is(aCommand.typeOfCommand, MozIccManager.STK_CMD_SEND_DTMF, "typeOfCommand");
is(aCommand.commandQualifier, aExpect.commandQualifier, "commandQualifier");
if (aExpect.text) {
// text is optional.
if ("text" in aExpect) {
is(aCommand.options.text, aExpect.text, "options.text");
}
if (aExpect.icons) {
// icons is optional.
if ("icons" in aExpect) {
isIcons(aCommand.options.icons, aExpect.icons);
is(aCommand.options.iconSelfExplanatory, aExpect.iconSelfExplanatory,
"options.iconSelfExplanatory");
@ -128,6 +97,12 @@ startTestCommon(function() {
// Wait onstkcommand event.
promises.push(waitForTargetEvent(icc, "stkcommand")
.then((aEvent) => testSendDTMF(aEvent.command, data.expect)));
// Wait icc-stkcommand system message.
promises.push(waitForSystemMessage("icc-stkcommand")
.then((aMessage) => {
is(aMessage.iccId, icc.iccInfo.iccid, "iccId");
testSendDTMF(aMessage.command, data.expect);
}));
// Send emulator command to generate stk unsolicited event.
promises.push(sendEmulatorStkPdu(data.command));

Просмотреть файл

@ -5,157 +5,173 @@ MARIONETTE_TIMEOUT = 60000;
MARIONETTE_HEAD_JS = "head.js";
const TEST_DATA = [
{command: "d037810301130082028183850753656e6420534d86099111223344556677f88b180100099110325476f840f40c54657374204d657373616765",
expect: {commandQualifier: 0x00,
text: "Send SM"}},
{command: "d02e81030113008202818386099111223344556677f88b180100099110325476f840f40c54657374204d657373616765",
{command: "D02E" + // Length
"8103011300" + // Command details
"82028183" + // Device identities
"86099111223344556677F8" + // Address
"8B180100099110325476F840F40C54657374204D657373616765", // 3GPP-SMS TPDU
expect: {commandQualifier: 0x00}},
{command: "d032810301130182028183850753656e6420534d86099111223344556677f88b130100099110325476f840f40753656e6420534d",
expect: {commandQualifier: 0x01,
text: "Send SM"}},
{command: "d02981030113018202818386099111223344556677f88b130100099110325476f840f40753656e6420534d",
expect: {commandQualifier: 0x01}},
{command: "d03d810301130082028183850d53686f7274204d65737361676586099111223344556677f88b180100099110325476f840f00d53f45b4e0735cbf379f85c06",
{command: "D03D" + // Length
"8103011300" + // Command details
"82028183" + // Device identities
"850D53686F7274204D657373616765" + // Alpha identifier
"86099111223344556677F8" + // Address
"8B180100099110325476F840F00D53F45B4E0735CBF379F85C06", // 3GPP-SMS TPDU
expect: {commandQualifier: 0x00,
text: "Short Message"}},
{command: "d02e81030113008202818386099111223344556677f88b180100099110325476f840f00d53f45b4e0735cbf379f85c06",
expect: {commandQualifier: 0x00}},
{command: "d081fd810301130182028183853854686520616464726573732064617461206f626a65637420686f6c6473207468652052501144657374696e6174696f6e114164647265737386099111223344556677f88b81ac0100099110325476f840f4a054776f2074797065732061726520646566696e65643a202d20412073686f7274206d65737361676520746f2062652073656e7420746f20746865206e6574776f726b20696e20616e20534d532d5355424d4954206d6573736167652c206f7220616e20534d532d434f4d4d414e44206d6573736167652c20776865726520746865207573657220646174612063616e20626520706173736564207472616e7370",
{command: "D081FD" + // Length
"8103011301" + // Command details
"82028183" + // Device identities
"853854686520616464726573732064617461206F62" + // Alpha identifier
"6A65637420686F6C64732074686520525011446573" +
"74696E6174696F6E1141646472657373" +
"86099111223344556677F8" + // Address
"8B81AC0100099110325476F840F4A054776F20747970" + // 3GPP-SMS TPDU
"65732061726520646566696E65643A202D2041207368" +
"6F7274206D65737361676520746F2062652073656E74" +
"20746F20746865206E6574776F726B20696E20616E20" +
"534D532D5355424D4954206D6573736167652C206F72" +
"20616E20534D532D434F4D4D414E44206D6573736167" +
"652C2077686572652074686520757365722064617461" +
"2063616E20626520706173736564207472616E7370",
expect: {commandQualifier: 0x01,
text: "The address data object holds the RP_Destination_Address"}},
{command: "d081c381030113018202818386099111223344556677f88b81ac0100099110325476f840f4a054776f2074797065732061726520646566696e65643a202d20412073686f7274206d65737361676520746f2062652073656e7420746f20746865206e6574776f726b20696e20616e20534d532d5355424d4954206d6573736167652c206f7220616e20534d532d434f4d4d414e44206d6573736167652c20776865726520746865207573657220646174612063616e20626520706173736564207472616e7370",
{command: "D081C3" + // Length
"8103011301" + // Command details
"82028183" + // Device identities
"86099111223344556677F8" + // Address
"8B81AC0100099110325476F840F4A054776F20747970" + // 3GPP-SMS TPDU
"65732061726520646566696E65643A202D2041207368" +
"6F7274206D65737361676520746F2062652073656E74" +
"20746F20746865206E6574776F726B20696E20616E20" +
"534D532D5355424D4954206D6573736167652C206F72" +
"20616E20534D532D434F4D4D414E44206D6573736167" +
"652C2077686572652074686520757365722064617461" +
"2063616E20626520706173736564207472616E7370",
expect: {commandQualifier: 0x01}},
{command: "d081e9810301130082028183853854686520616464726573732064617461206f626a65637420686f6c6473207468652052502044657374696e6174696f6e204164647265737386099111223344556677f88b81980100099110325476f840f0a0d4fb1b44cfc3cb7350585e0691cbe6b4bb4cd6815aa020688e7ecbe9a076793e0f9fcb20fa1b242e83e665371d447f83e8e832c85da6dfdff23528ed0685dda06973da9a5685cd2415d42ecfe7e17399057acb41613768da9cb686cf6633e82482dae5f93c7c2eb3407774595e06d1d165507d5e9683c8617a18340ebb41e232081e9ecfcb64105d1e76cfe1",
{command: "D081FD" + // Length
"8103011300" + // Command details
"82028183" + // Device identities
"8581E654776F207479706573206172652064656669" + // Alpha identifier
"6E65643A202D20412073686F7274206D6573736167" +
"6520746F2062652073656E7420746F20746865206E" +
"6574776F726B20696E20616E20534D532D5355424D" +
"4954206D6573736167652C206F7220616E20534D53" +
"2D434F4D4D414E44206D6573736167652C20776865" +
"726520746865207573657220646174612063616E20" +
"626520706173736564207472616E73706172656E74" +
"6C793B202D20412073686F7274206D657373616765" +
"20746F2062652073656E7420746F20746865206E65" +
"74776F726B20696E20616E20534D532D5355424D49" +
"5420" +
"8B09010002911040F00120", // 3GPP-SMS TPDU
expect: {commandQualifier: 0x00,
text: "The address data object holds the RP Destination Address"}},
{command: "d081af81030113008202818386099111223344556677f88b81980100099110325476f840f0a0d4fb1b44cfc3cb7350585e0691cbe6b4bb4cd6815aa020688e7ecbe9a076793e0f9fcb20fa1b242e83e665371d447f83e8e832c85da6dfdff23528ed0685dda06973da9a5685cd2415d42ecfe7e17399057acb41613768da9cb686cf6633e82482dae5f93c7c2eb3407774595e06d1d165507d5e9683c8617a18340ebb41e232081e9ecfcb64105d1e76cfe1",
expect: {commandQualifier: 0x00}},
{command: "d081fd8103011300820281838581e654776f2074797065732061726520646566696e65643a202d20412073686f7274206d65737361676520746f2062652073656e7420746f20746865206e6574776f726b20696e20616e20534d532d5355424d4954206d6573736167652c206f7220616e20534d532d434f4d4d414e44206d6573736167652c20776865726520746865207573657220646174612063616e20626520706173736564207472616e73706172656e746c793b202d20412073686f7274206d65737361676520746f2062652073656e7420746f20746865206e6574776f726b20696e20616e20534d532d5355424d4954208b09010002911040f00120",
expect: {commandQualifier: 0x00,
text: "Two types are defined: - A short message to be sent to the network in an SMS-SUBMIT message, or an SMS-COMMAND message, where the user data can be passed transparently; - A short message to be sent to the network in an SMS-SUBMIT "}},
{command: "d0148103011300820281838b09010002911040f00120",
expect: {commandQualifier: 0x00}},
{command: "d030810301130082028183850086099111223344556677f88b180100099110325476f840f40c54657374204d657373616765",
func: testSendSMS,
text: "Two types are defined: - A short message to be sent to " +
"the network in an SMS-SUBMIT message, or an SMS-COMMAND " +
"message, where the user data can be passed transparently; " +
"- A short message to be sent to the network in an " +
"SMS-SUBMIT "}},
{command: "D030" + // Length
"8103011300" + // Command details
"82028183" + // Device identities
"8500" + // Alpha identifier
"86099111223344556677F8" + // Address
"8B180100099110325476F840F40C54657374204D657373616765", // 3GPP-SMS TPDU
expect: {commandQualifier: 0x00,
text: ""}},
{command: "d05581030113008202818385198004170414042004100412042104220412042304190422041586099111223344556677f88b240100099110325476f8400818041704140420041004120421042204120423041904220415",
{command: "D055" + // Length
"8103011300" + // Command details
"82028183" + // Device identities
"851980041704140420041004120421042204120423041904220415" + // Alpha identifier
"86099111223344556677F8" + // Address
"8B240100099110325476F8400818041704140420041004120421042204120423041904220415", // 3GPP-SMS TPDU
expect: {commandQualifier: 0x00,
text: "ЗДРАВСТВУЙТЕ"}},
{command: "d03a81030113008202818386099111223344556677f88b240100099110325476f8400818041704140420041004120421042204120423041904220415",
expect: {commandQualifier: 0x00}},
{command: "d04b810301130082028183850f810c089794a09092a1a292a399a29586099111223344556677f88b240100099110325476f8400818041704140420041004120421042204120423041904220415",
{command: "D04B" + // Length
"8103011300" + // Command details
"82028183" + // Device identities
"850F810C089794A09092A1A292A399A295" + // Alpha identifier
"86099111223344556677F8" + // Address
"8B240100099110325476F8400818041704140420041004120421042204120423041904220415", // 3GPP-SMS TPDU
expect: {commandQualifier: 0x00,
text: "ЗДРАВСТВУЙТЕ"}},
{command: "d03b81030113008202818385074e4f2049434f4e86099111223344556677f88b180100099110325476f840f40c54657374204d6573736167659e020002",
{command: "D03B" + // Length
"8103011300" + // Command details
"82028183" + // Device identities
"85074E4F2049434F4E" + // Alpha identifier
"86099111223344556677F8" + // Address
"8B180100099110325476F840F40C54657374204D657373616765" + // 3GPP-SMS TPDU
"9E020002", // Icon identifier
expect: {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: "d03281030113008202818386099111223344556677f88b180100099110325476f840f40c54657374204d6573736167659e020001",
{command: "D032" + // Length
"8103011300" + // Command details
"82028183" + // Device identities
"86099111223344556677F8" + // Address
"8B180100099110325476F840F40C54657374204D657373616765" + // 3GPP-SMS TPDU
"9E020001", // Icon identifier
expect: {commandQualifier: 0x00,
iconSelfExplanatory: true,
icons: [BASIC_ICON]}},
{command: "d03b810301130082028183850753656e6420534d86099111223344556677f88b180100099110325476f840f40c54657374204d6573736167651e020101",
{command: "D03B" + // Length
"8103011300" + // Command details
"82028183" + // Device identities
"850753656E6420534D" + // Alpha identifier
"86099111223344556677F8" + // Address
"8B180100099110325476F840F40C54657374204D657373616765" + // 3GPP-SMS TPDU
"1E020101", // Icon identifier
expect: {commandQualifier: 0x00,
text: "Send SM",
iconSelfExplanatory: false,
icons: [BASIC_ICON]}},
{command: "d03281030113008202818386099111223344556677f88b180100099110325476f840f40c54657374204d6573736167651e020101",
expect: {commandQualifier: 0x00,
iconSelfExplanatory: false,
icons: [BASIC_ICON]}},
{command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001000b4",
{command: "D02C" + // Length
"8103011300" + // Command details
"82028183" + // Device identities
"851054657874204174747269627574652031" + // Alpha identifier
"8B09010002911040F00120" + // 3GPP-SMS TPDU
"D004001000B4", // Text attribute
expect: {commandQualifier: 0x00,
text: "Text Attribute 1"}},
{command: "d01a8103011300820281838b09010002911040f00120d004001000b4",
expect: {commandQualifier: 0x00}},
{command: "d0268103011300820281838510546578742041747472696275746520328b09010002911040f00120",
expect: {commandQualifier: 0x00,
text: "Text Attribute 2"}},
{command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001001b4",
expect: {commandQualifier: 0x00,
text: "Text Attribute 1"}},
{command: "d01a8103011300820281838b09010002911040f00120d004001001b4",
expect: {commandQualifier: 0x00}},
{command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001002b4",
expect: {commandQualifier: 0x00,
text: "Text Attribute 1"}},
{command: "d01a8103011300820281838b09010002911040f00120d004001002b4",
expect: {commandQualifier: 0x00}},
{command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001004b4",
expect: {commandQualifier: 0x00,
text: "Text Attribute 1"}},
{command: "d01a8103011300820281838b09010002911040f00120d004001004b4",
expect: {commandQualifier: 0x00}},
{command: "d02c8103011300820281838510546578742041747472696275746520328b09010002911040f00120d004001000b4",
expect: {commandQualifier: 0x00,
text: "Text Attribute 2"}},
{command: "d0268103011300820281838510546578742041747472696275746520338b09010002911040f00120",
expect: {commandQualifier: 0x00,
text: "Text Attribute 3"}},
{command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001008b4",
expect: {commandQualifier: 0x00,
text: "Text Attribute 1"}},
{command: "d01a8103011300820281838b09010002911040f00120d004001008b4",
expect: {commandQualifier: 0x00}},
{command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001010b4",
expect: {commandQualifier: 0x00,
text: "Text Attribute 1"}},
{command: "d01a8103011300820281838b09010002911040f00120d004001010b4",
expect: {commandQualifier: 0x00}},
{command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001020b4",
expect: {commandQualifier: 0x00,
text: "Text Attribute 1"}},
{command: "d01a8103011300820281838b09010002911040f00120d004001020b4",
expect: {commandQualifier: 0x00}},
{command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001040b4",
expect: {commandQualifier: 0x00,
text: "Text Attribute 1"}},
{command: "d01a8103011300820281838b09010002911040f00120d004001040b4",
expect: {commandQualifier: 0x00}},
{command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001080b4",
expect: {commandQualifier: 0x00,
text: "Text Attribute 1"}},
{command: "d01a8103011300820281838b09010002911040f00120d004001080b4",
expect: {commandQualifier: 0x00}},
{command: "d02d8103011300820281838505804e2d4e0086099111223344556677f88b100100099110325476f84008044e2d4e00",
expect: {commandQualifier: 0x00,
text: "中一"}},
{command: "d02681030113008202818386099111223344556677f88b100100099110325476f84008044e2d4e00",
expect: {commandQualifier: 0x00}},
{command: "d02d810301130082028183850581029cad8086099111223344556677f88b100100099110325476f84008044e2d4e00",
expect: {commandQualifier: 0x00,
text: "中一"}},
{command: "d02e810301130082028183850682024e00ad8086099111223344556677f88b100100099110325476f84008044e2d4e00",
expect: {commandQualifier: 0x00,
text: "中一"}},
{command: "d0358103011300820281838509800038003030eb003086099111223344556677f88b140100099110325476f84008080038003030eb0031",
expect: {commandQualifier: 0x00,
{command: "D035" + // Length
"8103011300" + // Command details
"82028183" + // Device identities
"8509800038003030EB0030" + // Alpha identifier
"86099111223344556677F8" + // Address
"8B140100099110325476F84008080038003030EB0031",
expect: {commandQualifier: 0x00, // 3GPP-SMS TPDU
text: "80ル0"}},
{command: "d02a81030113008202818386099111223344556677f88b140100099110325476f84008080038003030eb0031",
expect: {commandQualifier: 0x00}},
{command: "d03381030113008202818385078104613831eb3186099111223344556677f88b140100099110325476f84008080038003030eb0032",
expect: {commandQualifier: 0x00,
{command: "D033" + // Length
"8103011300" + // Command details
"82028183" + // Device identities
"85078104613831EB31" + // Alpha identifier
"86099111223344556677F8" + // Address
"8B140100099110325476F84008080038003030EB0032",
expect: {commandQualifier: 0x00, // 3GPP-SMS TPDU
text: "81ル1"}},
{command: "d02a81030113008202818386099111223344556677f88b140100099110325476f84008080038003030eb0032",
expect: {commandQualifier: 0x00}},
{command: "d0348103011300820281838508820430a03832cb3286099111223344556677f88b140100099110325476f84008080038003030eb0033",
expect: {commandQualifier: 0x00,
{command: "D034" + // Length
"8103011300" + // Command details
"82028183" + // Device identities
"8508820430A03832CB32" + // Alpha identifier
"86099111223344556677F8" + // Address
"8B140100099110325476F84008080038003030EB0033",
expect: {commandQualifier: 0x00, // 3GPP-SMS TPDU
text: "82ル2"}},
{command: "d02a81030113008202818386099111223344556677f88b140100099110325476f84008080038003030eb0033",
expect: {commandQualifier: 0x00}}
];
function testSendSMS(aCommand, aExpect) {
is(aCommand.commandNumber, 0x01, "commandNumber");
is(aCommand.typeOfCommand, MozIccManager.STK_CMD_SEND_SMS, "typeOfCommand");
is(aCommand.commandQualifier, aExpect.commandQualifier, "commandQualifier");
if (aExpect.text) {
// text is optional.
if ("text" in aExpect) {
is(aCommand.options.text, aExpect.text, "options.text");
}
if (aExpect.icons) {
// icons is optional.
if ("icons" in aExpect) {
isIcons(aCommand.options.icons, aExpect.icons);
is(aCommand.options.iconSelfExplanatory, aExpect.iconSelfExplanatory,
"options.iconSelfExplanatory");
@ -175,6 +191,12 @@ startTestCommon(function() {
// Wait onstkcommand event.
promises.push(waitForTargetEvent(icc, "stkcommand")
.then((aEvent) => testSendSMS(aEvent.command, data.expect)));
// Wait icc-stkcommand system message.
promises.push(waitForSystemMessage("icc-stkcommand")
.then((aMessage) => {
is(aMessage.iccId, icc.iccInfo.iccid, "iccId");
testSendSMS(aMessage.command, data.expect);
}));
// Send emulator command to generate stk unsolicited event.
promises.push(sendEmulatorStkPdu(data.command));

Просмотреть файл

@ -5,127 +5,101 @@ MARIONETTE_TIMEOUT = 60000;
MARIONETTE_HEAD_JS = "head.js";
const TEST_DATA = [
{command: "d029810301110082028183850c43616c6c20466f7277617264891091aa120a214365870921436587a901fb",
{command: "D029" + // Length
"8103011100" + // Command details
"82028183" + // Device identities
"850C43616C6C20466F7277617264" + // Alpha identifier
"891091AA120A214365870921436587A901FB", // SS string
expect: {commandQualifier: 0x00,
text: "Call Forward"}},
{command: "d01b810301110082028183891091aa120a214365870921436587a901fb",
expect: {name: "send_ss_cmd_1_without_alpha_identifier",
commandQualifier: 0x00}},
{command: "d02d810301110082028183850c43616c6c20466f7277617264891491aa120a21436587092143658709214365a711fb",
expect: {name: "send_ss_cmd_2_with_alpha_identifier",
commandQualifier: 0x00,
text: "Call Forward"}},
{command: "d01f810301110082028183891491aa120a21436587092143658709214365a711fb",
{command: "D01B" + // Length
"8103011100" + // Command details
"82028183" + // Device identities
"891091AA120A214365870921436587A901FB", // SS string
expect: {commandQualifier: 0x00}},
{command: "d081fd8103011100820281838581eb4576656e20696620746865204669786564204469616c6c696e67204e756d626572207365727669636520697320656e61626c65642c2074686520737570706c656d656e74617279207365727669636520636f6e74726f6c20737472696e6720696e636c7564656420696e207468652053454e442053532070726f61637469766520636f6d6d616e64207368616c6c206e6f7420626520636865636b656420616761696e73742074686f7365206f66207468652046444e206c6973742e2055706f6e20726563656976696e67207468697320636f6d6d616e642c20746865204d45207368616c6c20646563698904ffba13fb",
{command: "D081FD" + // Length
"8103011100" + // Command details
"82028183" + // Device identities
"8581EB4576656E2069662074686520466978656420" + // Alpha identifier
"4469616C6C696E67204E756D626572207365727669" +
"636520697320656E61626C65642C20746865207375" +
"70706C656D656E7461727920736572766963652063" +
"6F6E74726F6C20737472696E6720696E636C756465" +
"6420696E207468652053454E442053532070726F61" +
"637469766520636F6D6D616E64207368616C6C206E" +
"6F7420626520636865636B656420616761696E7374" +
"2074686F7365206F66207468652046444E206C6973" +
"742E2055706F6E20726563656976696E6720746869" +
"7320636F6D6D616E642C20746865204D4520736861" +
"6C6C2064656369" +
"8904FFBA13FB", // SS string
expect: {commandQualifier: 0x00,
text: "Even if the Fixed Dialling Number service is enabled, the supplementary service control string included in the SEND SS proactive command shall not be checked against those of the FDN list. Upon receiving this command, the ME shall deci"}},
{command: "d00f8103011100820281838904ffba13fb",
expect: {commandQualifier: 0x00}},
{command: "d01d8103011100820281838500891091aa120a214365870921436587a901fb",
text: "Even if the Fixed Dialling Number service is enabled, " +
"the supplementary service control string included in the " +
"SEND SS proactive command shall not be checked against " +
"those of the FDN list. Upon receiving this command, the " +
"ME shall deci"}},
{command: "D01D" + // Length
"8103011100" + // Command details
"82028183" + // Device identities
"8500" + // Alpha identifier
"891091AA120A214365870921436587A901FB", // SS string
expect: {commandQualifier: 0x00,
text: ""}},
{command: "d02b810301110082028183850a42617369632049636f6e891091aa120a214365870921436587a901fb9e020001",
{command: "D02B" + // Length
"8103011100" + // Command details
"82028183" + // Device identities
"850A42617369632049636F6E" + // Alpha identifier
"891091AA120A214365870921436587A901FB" + // SS string
"9E020001", // Icon identifier
expect: {commandQualifier: 0x00,
text: "Basic Icon",
iconSelfExplanatory: true,
icons: [BASIC_ICON]}},
{command: "d01f810301110082028183891091aa120a214365870921436587a901fb9e020001",
expect: {commandQualifier: 0x00,
iconSelfExplanatory: true,
icons: [BASIC_ICON]}},
{command: "d02c810301110082028183850b436f6c6f75722049636f6e891091aa120a214365870921436587a901fb9e020003",
expect: {commandQualifier: 0x00,
text: "Colour Icon",
iconSelfExplanatory: true,
icons: [COLOR_ICON]}},
{command: "d01f810301110082028183891091aa120a214365870921436587a901fb9e020003",
expect: {commandQualifier: 0x00,
iconSelfExplanatory: true,
icons: [COLOR_ICON]}},
{command: "d02b810301110082028183850a42617369632049636f6e891091aa120a214365870921436587a901fb9e020101",
expect: {commandQualifier: 0x00,
text: "Basic Icon",
iconSelfExplanatory: false,
icons: [BASIC_ICON]}},
{command: "d01f810301110082028183891091aa120a214365870921436587a901fb9e020101",
{command: "D01F" + // Length
"8103011100" + // Command details
"82028183" + // Device identities
"891091AA120A214365870921436587A901FB" + // SS string
"9E020103", // Icon identifier
expect: {commandQualifier: 0x00,
iconSelfExplanatory: false,
icons: [BASIC_ICON]}},
{command: "d036810301110082028183851980041704140420041004120421042204120423041904220415891091aa120a214365870921436587a901fb",
icons: [COLOR_ICON]}},
{command: "D036" + // Length
"8103011100" + // Command details
"82028183" + // Device identities
"851980041704140420041004120421042204120423041904220415" + // Alpha identifier
"891091AA120A214365870921436587A901FB", // SS string
expect: {commandQualifier: 0x00,
text: "ЗДРАВСТВУЙТЕ"}},
{command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001000b4",
{command: "D033" + // Length
"8103011100" + // Command details
"82028183" + // Device identities
"851054657874204174747269627574652031" + // Alpha identifier
"891091AA120A214365870921436587A901FB" + // SS string
"D004001000B4", // Text attribute
expect: {commandQualifier: 0x00,
text: "Text Attribute 1"}},
{command: "d021810301110082028183891091aa120a214365870921436587a901fbd004001000b4",
expect: {commandQualifier: 0x00}},
{command: "d02d810301110082028183851054657874204174747269627574652032891091aa120a214365870921436587a901fb",
expect: {commandQualifier: 0x00,
text: "Text Attribute 2"}},
{command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001001b4",
expect: {commandQualifier: 0x00,
text: "Text Attribute 1"}},
{command: "d021810301110082028183891091aa120a214365870921436587a901fbd004001001b4",
expect: {commandQualifier: 0x00}},
{command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001002b4",
expect: {commandQualifier: 0x00,
text: "Text Attribute 1"}},
{command: "d021810301110082028183891091aa120a214365870921436587a901fbd004001002b4",
expect: {commandQualifier: 0x00}},
{command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001004b4",
expect: {commandQualifier: 0x00,
text: "Text Attribute 1"}},
{command: "d021810301110082028183891091aa120a214365870921436587a901fbd004001004b4",
expect: {commandQualifier: 0x00}},
{command: "d033810301110082028183851054657874204174747269627574652032891091aa120a214365870921436587a901fbd004001000b4",
expect: {commandQualifier: 0x00,
text: "Text Attribute 2"}},
{command: "d02d810301110082028183851054657874204174747269627574652033891091aa120a214365870921436587a901fb",
expect: {commandQualifier: 0x00,
text: "Text Attribute 3"}},
{command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001008b4",
expect: {commandQualifier: 0x00,
text: "Text Attribute 1"}},
{command: "d021810301110082028183891091aa120a214365870921436587a901fbd004001008b4",
expect: {commandQualifier: 0x00}},
{command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001010b4",
expect: {commandQualifier: 0x00,
text: "Text Attribute 1"}},
{command: "d021810301110082028183891091aa120a214365870921436587a901fbd004001010b4",
expect: {commandQualifier: 0x00}},
{command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001020b4",
expect: {commandQualifier: 0x00,
text: "Text Attribute 1"}},
{command: "d021810301110082028183891091aa120a214365870921436587a901fbd004001020b4",
expect: {commandQualifier: 0x00}},
{command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001040b4",
expect: {commandQualifier: 0x00,
text: "Text Attribute 1"}},
{command: "d021810301110082028183891091aa120a214365870921436587a901fbd004001040b4",
expect: {commandQualifier: 0x00}},
{command: "d033810301110082028183851054657874204174747269627574652031891091aa120a214365870921436587a901fbd004001080b4",
expect: {commandQualifier: 0x00,
text: "Text Attribute 1"}},
{command: "d021810301110082028183891091aa120a214365870921436587a901fbd004001080b4",
expect: {commandQualifier: 0x00}},
{command: "d0228103011100820281838505804f60597d891091aa120a214365870921436587a901fb",
{command: "D022" + // Length
"8103011100" + // Command details
"82028183" + // Device identities
"8505804F60597D" + // Alpha identifier
"891091AA120A214365870921436587A901FB", // SS string
expect: {commandQualifier: 0x00,
text: "你好"}},
{command: "d02081030111008202818385038030eb891091aa120a214365870921436587a901fb",
expect: {commandQualifier: 0x00,
text: "ル"}},
];
function testSendSS(aCommand, aExpect) {
is(aCommand.commandNumber, 0x01, "commandNumber");
is(aCommand.typeOfCommand, MozIccManager.STK_CMD_SEND_SS, "typeOfCommand");
is(aCommand.commandQualifier, aExpect.commandQualifier, "commandQualifier");
if (aExpect.text) {
// text is optional.
if ("text" in aExpect) {
is(aCommand.options.text, aExpect.text, "options.text");
}
if (aExpect.icons) {
// icons is optional.
if ("icons" in aExpect) {
isIcons(aCommand.options.icons, aExpect.icons);
is(aCommand.options.iconSelfExplanatory, aExpect.iconSelfExplanatory,
"options.iconSelfExplanatory");
@ -145,6 +119,12 @@ startTestCommon(function() {
// Wait onstkcommand event.
promises.push(waitForTargetEvent(icc, "stkcommand")
.then((aEvent) => testSendSS(aEvent.command, data.expect)));
// Wait icc-stkcommand system message.
promises.push(waitForSystemMessage("icc-stkcommand")
.then((aMessage) => {
is(aMessage.iccId, icc.iccInfo.iccid, "iccId");
testSendSS(aMessage.command, data.expect);
}));
// Send emulator command to generate stk unsolicited event.
promises.push(sendEmulatorStkPdu(data.command));

Просмотреть файл

@ -5,128 +5,139 @@ MARIONETTE_TIMEOUT = 60000;
MARIONETTE_HEAD_JS = "head.js";
const TEST_DATA = [
{command: "d050810301120082028183850a372d62697420555353448a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
{command: "D050" + // Length
"8103011200" + // Command details
"82028183" + // Device identities
"850A372D6269742055535344" + // Alpha identifier
"8A39F041E19058341E9149E592D9743EA151E9945AB55E" + // USSD string
"B1596D2B2C1E93CBE6333AAD5EB3DBEE373C2E9FD3EBF6" +
"3B3EAF6FC564335ACD76C3E560",
expect: {commandQualifier: 0x00,
text: "7-bit USSD"}},
{command: "d0448103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
{command: "D044" + // Length
"8103011200" + // Command details
"82028183" + // Device identities
"8A39F041E19058341E9149E592D9743EA151E9945AB55E" + // USSD string
"B1596D2B2C1E93CBE6333AAD5EB3DBEE373C2E9FD3EBF6" +
"3B3EAF6FC564335ACD76C3E560",
expect: {commandQualifier: 0x00}},
{command: "d058810301120082028183850a382d62697420555353448a41444142434445464748494a4b4c4d4e4f505152535455565758595a2d6162636465666768696a6b6c6d6e6f707172737475767778797a2d31323334353637383930",
{command: "D058" + // Length
"8103011200" + // Command details
"82028183" + // Device identities
"850A382D6269742055535344" + // Alpha identifier
"8A41444142434445464748494A4B4C4D4E4F5051525354" + // USSD string
"55565758595A2D6162636465666768696A6B6C6D6E6F70" +
"7172737475767778797A2D31323334353637383930",
expect: {commandQualifier: 0x00,
text: "8-bit USSD"}},
{command: "d04c8103011200820281838a41444142434445464748494a4b4c4d4e4f505152535455565758595a2d6162636465666768696a6b6c6d6e6f707172737475767778797a2d31323334353637383930",
expect: {commandQualifier: 0x00}},
{command: "d02f81030112008202818385095543533220555353448a1948041704140420041004120421042204120423041904220415",
{command: "D02F" + // Length
"8103011200" + // Command details
"82028183" + // Device identities
"8509554353322055535344" + // Alpha identifier
"8A1948041704140420041004120421042204120423041904220415", // USSD string
expect: {commandQualifier: 0x00,
text: "UCS2 USSD"}},
{command: "d0248103011200820281838a1948041704140420041004120421042204120423041904220415",
expect: {commandQualifier: 0x00}},
{command: "d081fd8103011200820281838581b66f6e636520612052454c4541534520434f4d504c455445206d65737361676520636f6e7461696e696e672074686520555353442052657475726e20526573756c74206d657373616765206e6f7420636f6e7461696e696e6720616e206572726f7220686173206265656e2072656365697665642066726f6d20746865206e6574776f726b2c20746865204d45207368616c6c20696e666f726d207468652053494d20746861742074686520636f6d6d616e64206861738a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
{command: "D081FD" + // Length
"8103011200" + // Command details
"82028183" + // Device identities
"8581B66F6E636520612052454C4541534520434F4D" + // Alpha identifier
"504C455445206D65737361676520636F6E7461696E" +
"696E672074686520555353442052657475726E2052" +
"6573756C74206D657373616765206E6F7420636F6E" +
"7461696E696E6720616E206572726F722068617320" +
"6265656E2072656365697665642066726F6D207468" +
"65206E6574776F726B2C20746865204D4520736861" +
"6C6C20696E666F726D207468652053494D20746861" +
"742074686520636F6D6D616E6420686173" +
"8A39F041E19058341E9149E592D9743EA151E9945AB55E" + // USSD string
"B1596D2B2C1E93CBE6333AAD5EB3DBEE373C2E9FD3EBF6" +
"3B3EAF6FC564335ACD76C3E560",
expect: {commandQualifier: 0x00,
text: "once a RELEASE COMPLETE message containing the USSD Return Result message not containing an error has been received from the network, the ME shall inform the SIM that the command has"}},
{command: "d04681030112008202818385008a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
text: "once a RELEASE COMPLETE message containing the USSD " +
"Return Result message not containing an error has been " +
"received from the network, the ME shall inform the SIM " +
"that the command has"}},
{command: "D046" + // Length
"8103011200" + // Command details
"82028183" + // Device identities
"8500" + // Alpha identifier
"8A39F041E19058341E9149E592D9743EA151E9945AB55E" + // USSD string
"B1596D2B2C1E93CBE6333AAD5EB3DBEE373C2E9FD3EBF6" +
"3B3EAF6FC564335ACD76C3E560",
expect: {commandQualifier: 0x00,
text: ""}},
{command: "d054810301120082028183850a42617369632049636f6e8a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e5609e020001",
{command: "D054" + // Length
"8103011200" + // Command details
"82028183" + // Device identities
"850A42617369632049636F6E" + // Alpha identifier
"8A39F041E19058341E9149E592D9743EA151E9945AB55E" + // USSD string
"B1596D2B2C1E93CBE6333AAD5EB3DBEE373C2E9FD3EBF6" +
"3B3EAF6FC564335ACD76C3E560" +
"9E020001", // Icon identifier
expect: {commandQualifier: 0x00,
text: "Basic Icon",
iconSelfExplanatory: true,
icons: [BASIC_ICON]}},
{command: "d0488103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e5609e020001",
expect: {commandQualifier: 0x00,
iconSelfExplanatory: true,
icons: [BASIC_ICON]}},
{command: "d054810301120082028183850a436f6c6f722049636f6e8a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e5609e020003",
expect: {commandQualifier: 0x00,
text: "Color Icon",
iconSelfExplanatory: true,
icons: [COLOR_ICON]}},
{command: "d0488103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e5609e020003",
expect: {commandQualifier: 0x00,
iconSelfExplanatory: true,
icons: [COLOR_ICON]}},
{command: "d054810301120082028183850a42617369632049636f6e8a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e5609e020101",
expect: {commandQualifier: 0x00,
text: "Basic Icon",
iconSelfExplanatory: false,
icons: [BASIC_ICON]}},
{command: "d0488103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e5609e020101",
{command: "D048" + // Length
"8103011200" + // Command details
"82028183" + // Device identities
"8A39F041E19058341E9149E592D9743EA151E9945AB55E" + // USSD string
"B1596D2B2C1E93CBE6333AAD5EB3DBEE373C2E9FD3EBF6" +
"3B3EAF6FC564335ACD76C3E560" +
"9E020103", // Icon identifier
expect: {commandQualifier: 0x00,
iconSelfExplanatory: false,
icons: [BASIC_ICON]}},
{command: "d05f8103011200820281838519800417041404200410041204210422041204230419042204158a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
icons: [COLOR_ICON]}},
{command: "D05F" + // Length
"8103011200" + // Command details
"82028183" + // Device identities
"851980041704140420041004120421042204120423041904220415" + // Alpha identifier
"8A39F041E19058341E9149E592D9743EA151E9945AB55E" + // USSD string
"B1596D2B2C1E93CBE6333AAD5EB3DBEE373C2E9FD3EBF6" +
"3B3EAF6FC564335ACD76C3E560",
expect: {commandQualifier: 0x00,
text: "ЗДРАВСТВУЙТЕ"}},
{command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4",
{command: "D05C" + // Length
"8103011200" + // Command details
"82028183" + // Device identities
"851054657874204174747269627574652031" + // Alpha identifier
"8A39F041E19058341E9149E592D9743EA151E9945AB55E" + // USSD string
"B1596D2B2C1E93CBE6333AAD5EB3DBEE373C2E9FD3EBF6" +
"3B3EAF6FC564335ACD76C3E560" +
"D004001000B4", // Text attribute
expect: {commandQualifier: 0x00,
text: "Text Attribute 1"}},
{command: "d04a8103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4",
{command: "D04A" + // Length
"8103011200" + // Command details
"82028183" + // Device identities
"8A39F041E19058341E9149E592D9743EA151E9945AB55E" + // USSD string
"B1596D2B2C1E93CBE6333AAD5EB3DBEE373C2E9FD3EBF6" +
"3B3EAF6FC564335ACD76C3E560" +
"D004001000B4", // Text attribute
expect: {commandQualifier: 0x00}},
{command: "d0568103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
expect: {commandQualifier: 0x00,
text: "Text Attribute 2"}},
{command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001001b4",
expect: {commandQualifier: 0x00,
text: "Text Attribute 1"}},
{command: "d04a8103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001001b4",
expect: {commandQualifier: 0x00}},
{command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001002b4",
expect: {commandQualifier: 0x00,
text: "Text Attribute 1"}},
{command: "d04a8103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001002b4",
expect: {commandQualifier: 0x00}},
{command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001004b4",
expect: {commandQualifier: 0x00,
text: "Text Attribute 1"}},
{command: "d04a8103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001004b4",
expect: {commandQualifier: 0x00}},
{command: "d05c8103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4",
expect: {commandQualifier: 0x00,
text: "Text Attribute 2"}},
{command: "d0568103011200820281838510546578742041747472696275746520338a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
expect: {commandQualifier: 0x00,
text: "Text Attribute 3"}},
{command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001008b4",
expect: {commandQualifier: 0x00,
text: "Text Attribute 1"}},
{command: "d04a8103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001008b4",
expect: {commandQualifier: 0x00}},
{command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001010b4",
expect: {commandQualifier: 0x00,
text: "Text Attribute 1"}},
{command: "d04a8103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001010b4",
expect: {commandQualifier: 0x00}},
{command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001020b4",
expect: {commandQualifier: 0x00,
text: "Text Attribute 1"}},
{command: "d04a8103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001020b4",
expect: {commandQualifier: 0x00}},
{command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001040b4",
expect: {commandQualifier: 0x00,
text: "Text Attribute 1"}},
{command: "d04a8103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001040b4",
expect: {commandQualifier: 0x00}},
{command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001080b4",
expect: {commandQualifier: 0x00,
text: "Text Attribute 1"}},
{command: "d04a8103011200820281838a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001080b4",
expect: {commandQualifier: 0x00}},
{command: "d04b8103011200820281838505804f60597d8a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
{command: "D04B" + // Length
"8103011200" + // Command details
"82028183" + // Device identities
"8505804F60597D" + // Alpha identifier
"8A39F041E19058341E9149E592D9743EA151E9945AB55E" + // USSD string
"B1596D2B2C1E93CBE6333AAD5EB3DBEE373C2E9FD3EBF6" +
"3B3EAF6FC564335ACD76C3E560",
expect: {commandQualifier: 0x00,
text: "你好"}},
{command: "d04981030112008202818385038030eb8a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
expect: {commandQualifier: 0x00,
text: "ル"}},
];
function testSendUSSD(aCommand, aExpect) {
is(aCommand.commandNumber, 0x01, "commandNumber");
is(aCommand.typeOfCommand, MozIccManager.STK_CMD_SEND_USSD, "typeOfCommand");
is(aCommand.commandQualifier, aExpect.commandQualifier, "commandQualifier");
if (aExpect.text) {
// text is optional.
if ("text" in aExpect) {
is(aCommand.options.text, aExpect.text, "options.text");
}
if (aExpect.icons) {
// icons is optional.
if ("icons" in aExpect) {
isIcons(aCommand.options.icons, aExpect.icons);
is(aCommand.options.iconSelfExplanatory, aExpect.iconSelfExplanatory,
"options.iconSelfExplanatory");
@ -146,6 +157,12 @@ startTestCommon(function() {
// Wait onstkcommand event.
promises.push(waitForTargetEvent(icc, "stkcommand")
.then((aEvent) => testSendUSSD(aEvent.command, data.expect)));
// Wait icc-stkcommand system message.
promises.push(waitForSystemMessage("icc-stkcommand")
.then((aMessage) => {
is(aMessage.iccId, icc.iccInfo.iccid, "iccId");
testSendUSSD(aMessage.command, data.expect);
}));
// Send emulator command to generate stk unsolicited event.
promises.push(sendEmulatorStkPdu(data.command));

Просмотреть файл

@ -5,247 +5,174 @@ MARIONETTE_TIMEOUT = 60000;
MARIONETTE_HEAD_JS = "head.js";
const TEST_DATA = [
{command: "d01e81030110008202818385084e6f7420627573798609911032042143651c2c",
{command: "D01E" + // Length
"8103011000" + // Command details
"82028183" + // Device identities
"85084E6F742062757379" + // Alpha identifier
"8609911032042143651C2C", // Address
expect: {commandQualifier: 0x00,
confirmMessage: { text: "Not busy" },
address: "+012340123456,1,2"}},
{command: "d01d81030110028202818385074f6e20686f6c648609911032042143651c2c",
{command: "D01D" + // Length
"8103011002" + // Command details
"82028183" + // Device identities
"85074F6E20686F6C64" + // Alpha identifier
"8609911032042143651C2C", // Address
expect: {commandQualifier: 0x02,
confirmMessage: { text: "On hold" },
address: "+012340123456,1,2"}},
{command: "d020810301100482028183850a446973636f6e6e6563748609911032042143651c2c",
{command: "D020" + // Length
"8103011004" + // Command details
"82028183" + // Device identities
"850A446973636F6E6E656374" + // Alpha identifier
"8609911032042143651C2C", // Address
expect: {commandQualifier: 0x04,
confirmMessage: { text: "Disconnect" },
address: "+012340123456,1,2"}},
{command: "d02b81030110008202818385114361706162696c69747920636f6e6669678609911032042143651c2c870201a0",
{command: "D02B" + // Length
"8103011000" + // Command details
"82028183" + // Device identities
"85114361706162696C69747920636F6E666967" + // Alpha identifier
"8609911032042143651C2C" + // Address
"870201A0", // Capability configuration parameters
expect: {commandQualifier: 0x00,
confirmMessage: { text: "Capability config" },
address: "+012340123456,1,2"}},
{command: "d01c81030110018202818386119110325476981032547698103254769810",
{command: "D01C" + // Length
"8103011001" + // Command details
"82028183" + // Device identities
"86119110325476981032547698103254769810", // Address
expect: {commandQualifier: 0x01,
address: "+01234567890123456789012345678901"}},
{command: "d081fd8103011001820281838581ed54687265652074797065732061726520646566696e65643a202d2073657420757020612063616c6c2c20627574206f6e6c79206966206e6f742063757272656e746c792062757379206f6e20616e6f746865722063616c6c3b202d2073657420757020612063616c6c2c2070757474696e6720616c6c206f746865722063616c6c732028696620616e7929206f6e20686f6c643b202d2073657420757020612063616c6c2c20646973636f6e6e656374696e6720616c6c206f746865722063616c6c732028696620616e79292066697273742e20466f722065616368206f662074686573652074797065732c2086029110",
{command: "D081FD" + // Length
"8103011001" + // Command details
"82028183" + // Device identities
"8581ED546872656520747970657320617265206465" + // Alpha identifier
"66696E65643A202D2073657420757020612063616C" +
"6C2C20627574206F6E6C79206966206E6F74206375" +
"7272656E746C792062757379206F6E20616E6F7468" +
"65722063616C6C3B202D2073657420757020612063" +
"616C6C2C2070757474696E6720616C6C206F746865" +
"722063616C6C732028696620616E7929206F6E2068" +
"6F6C643B202D2073657420757020612063616C6C2C" +
"20646973636F6E6E656374696E6720616C6C206F74" +
"6865722063616C6C732028696620616E7929206669" +
"7273742E20466F722065616368206F662074686573" +
"652074797065732C20" +
"86029110", // Address
expect: {commandQualifier: 0x01,
confirmMessage: { text: "Three types are defined: - set up a call, but only if not currently busy on another call; - set up a call, putting all other calls (if any) on hold; - set up a call, disconnecting all other calls (if any) first. For each of these types, " },
confirmMessage: {
text: "Three types are defined: - set up a call, but only if " +
"not currently busy on another call; - set up a call, " +
"putting all other calls (if any) on hold; - set up a " +
"call, disconnecting all other calls (if any) first. For " +
"each of these types, "
},
address: "+01"}},
{command: "d02b810301100082028183850c43616c6c65642070617274798609911032042143651c2c880780509595959595",
expect: {commandQualifier: 0x00,
confirmMessage: { text: "Called party" },
address: "+012340123456,1,2"}},
{command: "d02281030110018202818385084475726174696f6e8609911032042143651c2c8402010a",
{command: "D022" + // Length
"8103011001" + // Command details
"82028183" + // Device identities
"85084475726174696F6E" + // Alpha identifier
"8609911032042143651C2C" + // Address
"8402010A", // Duration
expect: {commandQualifier: 0x01,
confirmMessage: { text: "Duration" },
address: "+012340123456,1,2",
duration: {timeUnit: MozIccManager.STK_TIME_UNIT_SECOND,
timeInterval: 0x0A}}},
{command: "d028810301100082028183850c434f4e4649524d4154494f4e8609911032042143651c2c850443414c4c",
{command: "D028" + // Length
"8103011000" + // Command details
"82028183" + // Device identities
"850C434F4E4649524D4154494F4E" + // Alpha identifier
"8609911032042143651C2C" + // Address
"850443414C4C", // Alpha identifier
expect: {commandQualifier: 0x00,
confirmMessage: { text: "CONFIRMATION" },
callMessage: { text: "CALL" },
address: "+012340123456,1,2"}},
{command: "d03081030110008202818385165365742075702063616c6c2049636f6e20332e312e318609911032042143651c2c9e020101",
{command: "D030" + // Length
"8103011000" + // Command details
"82028183" + // Device identities
"85165365742075702063616C6C2049636F6E20332E312E31" + // Alpha identifier
"8609911032042143651C2C" + // Address
"9E020101", // Icon identifier
expect: {commandQualifier: 0x00,
confirmMessage: { text: "Set up call Icon 3.1.1",
iconSelfExplanatory: false,
icons: [BASIC_ICON] },
address: "+012340123456,1,2"}},
{command: "d03081030110008202818385165365742075702063616c6c2049636f6e20332e322e318609911032042143651c2c9e020001",
expect: {commandQualifier: 0x00,
confirmMessage: { text: "Set up call Icon 3.2.1",
iconSelfExplanatory: true,
icons: [BASIC_ICON] },
address: "+012340123456,1,2"}},
{command: "d03081030110008202818385165365742075702063616c6c2049636f6e20332e332e318609911032042143651c2c9e020103",
expect: {commandQualifier: 0x00,
confirmMessage: { text: "Set up call Icon 3.3.1",
iconSelfExplanatory: false,
icons: [COLOR_ICON] },
address: "+012340123456,1,2"}},
{command: "d04c81030110008202818385165365742075702063616c6c2049636f6e20332e342e318609911032042143651c2c9e02000185165365742075702063616c6c2049636f6e20332e342e329e020001",
{command: "D04C" + // Length
"8103011000" + // Command details
"82028183" + // Device identities
"85165365742075702063616C6C2049636F6E20332E342E31" + // Alpha identifier
"8609911032042143651C2C" + // Address
"9E020001" + // Icon identifier
"85165365742075702063616C6C2049636F6E20332E342E32" + // Alpha identifier
"9E020003", // Icon identifier
expect: {commandQualifier: 0x00,
confirmMessage: { text: "Set up call Icon 3.4.1",
iconSelfExplanatory: true,
icons: [BASIC_ICON] },
callMessage: { text: "Set up call Icon 3.4.2" },
callMessage: { text: "Set up call Icon 3.4.2" ,
iconSelfExplanatory: true,
icons: [COLOR_ICON] },
address: "+012340123456,1,2"}},
{command: "d038810301100082028183850e434f4e4649524d4154494f4e20318609911032042143651c2c850643414c4c2031d004000e00b4d004000600b4",
{command: "D038" + // Length
"8103011000" + // Command details
"82028183" + // Device identities
"850E434F4E4649524D4154494F4E2031" + // Alpha identifier
"8609911032042143651C2C" + // Address
"850643414C4C2031" + // Alpha identifier
"D004000E00B4" + // Text attribute
"D004000600B4", // Text attribute
expect: {commandQualifier: 0x00,
confirmMessage: { text: "CONFIRMATION 1" },
callMessage: { text: "CALL 1" },
address: "+012340123456,1,2"}},
{command: "d02c810301100082028183850e434f4e4649524d4154494f4e20328609911032042143651c2c850643414c4c2032",
expect: {commandQualifier: 0x00,
confirmMessage: { text: "CONFIRMATION 2" },
callMessage: { text: "CALL 2" },
address: "+012340123456,1,2"}},
{command: "d038810301100082028183850e434f4e4649524d4154494f4e20318609911032042143651c2c850643414c4c2031d004000e01b4d004000601b4",
expect: {commandQualifier: 0x00,
confirmMessage: { text: "CONFIRMATION 1" },
callMessage: { text: "CALL 1" },
address: "+012340123456,1,2"}},
{command: "d02c810301100082028183850e434f4e4649524d4154494f4e20328609911032042143651c2c850643414c4c2032",
expect: {commandQualifier: 0x00,
confirmMessage: { text: "CONFIRMATION 2" },
callMessage: { text: "CALL 2" },
address: "+012340123456,1,2"}},
{command: "d038810301100082028183850e434f4e4649524d4154494f4e20318609911032042143651c2c850643414c4c2031d004000e02b4d004000602b4",
expect: {commandQualifier: 0x00,
confirmMessage: { text: "CONFIRMATION 1" },
callMessage: { text: "CALL 1" },
address: "+012340123456,1,2"}},
{command: "d02c810301100082028183850e434f4e4649524d4154494f4e20328609911032042143651c2c850643414c4c2032",
expect: {commandQualifier: 0x00,
confirmMessage: { text: "CONFIRMATION 2" },
callMessage: { text: "CALL 2" },
address: "+012340123456,1,2"}},
{command: "d038810301100082028183850e434f4e4649524d4154494f4e20318609911032042143651c2c850643414c4c2031d004000e04b4d004000604b4",
expect: {commandQualifier: 0x00,
confirmMessage: { text: "CONFIRMATION 1" },
callMessage: { text: "CALL 1" },
address: "+012340123456,1,2"}},
{command: "d038810301100082028183850e434f4e4649524d4154494f4e20328609911032042143651c2c850643414c4c2032d004000e00b4d004000600b4",
expect: {commandQualifier: 0x00,
confirmMessage: { text: "CONFIRMATION 2" },
callMessage: { text: "CALL 2" },
address: "+012340123456,1,2"}},
{command: "d02c810301100082028183850e434f4e4649524d4154494f4e20338609911032042143651c2c850643414c4c2033",
expect: {commandQualifier: 0x00,
confirmMessage: { text: "CONFIRMATION 3" },
callMessage: { text: "CALL 3" },
address: "+012340123456,1,2"}},
{command: "d038810301100082028183850e434f4e4649524d4154494f4e20318609911032042143651c2c850643414c4c2031d004000e08b4d004000608b4",
expect: {commandQualifier: 0x00,
confirmMessage: { text: "CONFIRMATION 1" },
callMessage: { text: "CALL 1" },
address: "+012340123456,1,2"}},
{command: "d038810301100082028183850e434f4e4649524d4154494f4e20328609911032042143651c2c850643414c4c2032d004000e00b4d004000600b4",
expect: {commandQualifier: 0x00,
confirmMessage: { text: "CONFIRMATION 2" },
callMessage: { text: "CALL 2" },
address: "+012340123456,1,2"}},
{command: "d02c810301100082028183850e434f4e4649524d4154494f4e20338609911032042143651c2c850643414c4c2033",
expect: {commandQualifier: 0x00,
confirmMessage: { text: "CONFIRMATION 3" },
callMessage: { text: "CALL 3" },
address: "+012340123456,1,2"}},
{command: "d038810301100082028183850e434f4e4649524d4154494f4e20318609911032042143651c2c850643414c4c2031d004000e10b4d004000610b4",
expect: {commandQualifier: 0x00,
confirmMessage: { text: "CONFIRMATION 1" },
callMessage: { text: "CALL 1" },
address: "+012340123456,1,2"}},
{command: "d038810301100082028183850e434f4e4649524d4154494f4e20328609911032042143651c2c850643414c4c2032d004000e00b4d004000600b4",
expect: {commandQualifier: 0x00,
confirmMessage: { text: "CONFIRMATION 2" },
callMessage: { text: "CALL 2" },
address: "+012340123456,1,2"}},
{command: "d02c810301100082028183850e434f4e4649524d4154494f4e20338609911032042143651c2c850643414c4c2033",
expect: {commandQualifier: 0x00,
confirmMessage: { text: "CONFIRMATION 3" },
callMessage: { text: "CALL 3" },
address: "+012340123456,1,2"}},
{command: "d038810301100082028183850e434f4e4649524d4154494f4e20318609911032042143651c2c850643414c4c2031d004000e20b4d004000620b4",
expect: {commandQualifier: 0x00,
confirmMessage: { text: "CONFIRMATION 1" },
callMessage: { text: "CALL 1" },
address: "+012340123456,1,2"}},
{command: "d038810301100082028183850e434f4e4649524d4154494f4e20328609911032042143651c2c850643414c4c2032d004000e00b4d004000600b4",
expect: {commandQualifier: 0x00,
confirmMessage: { text: "CONFIRMATION 2" },
callMessage: { text: "CALL 2" },
address: "+012340123456,1,2"}},
{command: "d02c810301100082028183850e434f4e4649524d4154494f4e20338609911032042143651c2c850643414c4c2033",
expect: {commandQualifier: 0x00,
confirmMessage: { text: "CONFIRMATION 3" },
callMessage: { text: "CALL 3" },
address: "+012340123456,1,2"}},
{command: "d038810301100082028183850e434f4e4649524d4154494f4e20318609911032042143651c2c850643414c4c2031d004000e40b4d004000640b4",
expect: {commandQualifier: 0x00,
confirmMessage: { text: "CONFIRMATION 1" },
callMessage: { text: "CALL 1" },
address: "+012340123456,1,2"}},
{command: "d038810301100082028183850e434f4e4649524d4154494f4e20328609911032042143651c2c850643414c4c2032d004000e00b4d004000600b4",
expect: {commandQualifier: 0x00,
confirmMessage: { text: "CONFIRMATION 2" },
callMessage: { text: "CALL 2" },
address: "+012340123456,1,2"}},
{command: "d02c810301100082028183850e434f4e4649524d4154494f4e20338609911032042143651c2c850643414c4c2033",
expect: {commandQualifier: 0x00,
confirmMessage: { text: "CONFIRMATION 3" },
callMessage: { text: "CALL 3" },
address: "+012340123456,1,2"}},
{command: "d038810301100082028183850e434f4e4649524d4154494f4e20318609911032042143651c2c850643414c4c2031d004000e80b4d004000680b4",
expect: {commandQualifier: 0x00,
confirmMessage: { text: "CONFIRMATION 1" },
callMessage: { text: "CALL 1" },
address: "+012340123456,1,2"}},
{command: "d038810301100082028183850e434f4e4649524d4154494f4e20328609911032042143651c2c850643414c4c2032d004000e00b4d004000600b4",
expect: {commandQualifier: 0x00,
confirmMessage: { text: "CONFIRMATION 2" },
callMessage: { text: "CALL 2" },
address: "+012340123456,1,2"}},
{command: "d02c810301100082028183850e434f4e4649524d4154494f4e20338609911032042143651c2c850643414c4c2033",
expect: {commandQualifier: 0x00,
confirmMessage: { text: "CONFIRMATION 3" },
callMessage: { text: "CALL 3" },
address: "+012340123456,1,2"}},
{command: "d038810301100082028183850e434f4e4649524d4154494f4e20318609911032042143651c2c850643414c4c2031d004000e00b4d0040006004b",
expect: {commandQualifier: 0x00,
confirmMessage: { text: "CONFIRMATION 1" },
callMessage: { text: "CALL 1" },
address: "+012340123456,1,2"}},
{command: "d02c810301100082028183850e434f4e4649524d4154494f4e20328609911032042143651c2c850643414c4c2032",
expect: {commandQualifier: 0x00,
confirmMessage: { text: "CONFIRMATION 2" },
callMessage: { text: "CALL 2" },
address: "+012340123456,1,2"}},
{command: "d02d810301100082028183851980041704140420041004120421042204120423041904220415860791103204214365",
expect: {commandQualifier: 0x00,
confirmMessage: { text: "ЗДРАВСТВУЙТЕ" },
address: "+012340123456"}},
{command: "d04c810301100082028183851b800417041404200410041204210422041204230419042204150031860791103204214365851b800417041404200410041204210422041204230419042204150032",
{command: "D04C" + // Length
"8103011000" + // Command details
"82028183" + // Device identities
"851B800417041404200410041204210422041204230419042204150031" + // Alpha identifier
"860791103204214365" + // Address
"851B800417041404200410041204210422041204230419042204150032", // Alpha identifier
expect: {commandQualifier: 0x00,
confirmMessage: { text: "ЗДРАВСТВУЙТЕ1" },
callMessage: { text: "ЗДРАВСТВУЙТЕ2" },
address: "+012340123456"}},
{command: "d0198103011000820281838505804e0d5fd9860791103204214365",
{command: "D019" + // Length
"8103011000" + // Command details
"82028183" + // Device identities
"8505804E0D5FD9" + // Alpha identifier
"860791103204214365", // Address
expect: {commandQualifier: 0x00,
confirmMessage: { text: "不忙" },
address: "+012340123456"}},
{command: "d022810301100082028183850580786e5b9a860791103204214365850780625375358bdd",
{command: "D022" + // Length
"8103011000" + // Command details
"82028183" + // Device identities
"850580786E5B9A" + // Alpha identifier
"860791103204214365" + // Address
"850780625375358BDD", // Alpha identifier
expect: {commandQualifier: 0x00,
confirmMessage: { text: "确定" },
callMessage: { text: "打电话" },
address: "+012340123456"}},
{command: "d01781030110008202818385038030eb860791103204214365",
{command: "D016" + // Length
"8103011000" + // Command details
"82028183" + // Device identities
"8500" + // Alpha identifier
"860791103204214365" + // Address
"8500", // Alpha identifier
expect: {commandQualifier: 0x00,
confirmMessage: { text: "ル" },
confirmMessage: { text: "" },
callMessage: { text: "" },
address: "+012340123456"}},
{command: "d02081030110008202818385058030eb003186079110320421436585058030eb0032",
expect: {commandQualifier: 0x00,
confirmMessage: { text: "ル1" },
callMessage: { text: "ル2" },
address: "+012340123456"}},
{command: "d029810301100482028182050a446973636f6e6e6563748609811032042143651c2c05074d657373616765",
expect: {commandQualifier: 0x04,
confirmMessage: { text: "Disconnect" },
address: "012340123456,1,2",
callMessage: { text: "Message"}}},
{command: "d02281030110008202818385084E6F7420627573798609911032042143651C2C8402010A",
expect: {commandQualifier: 0x00,
confirmMessage: { text: "Not busy" },
address: "+012340123456,1,2",
duration: {timeUnit: MozIccManager.STK_TIME_UNIT_SECOND,
timeInterval: 0x0A}}},
{command: "d04c81030110008202818385165365742075702063616c6c2049636f6e20332e352e318609911032042143651c2c9e02000185165365742075702063616c6c2049636f6e20332e352e329e020103",
expect: {commandQualifier: 0x00,
confirmMessage: { text: "Set up call Icon 3.5.1",
iconSelfExplanatory: true,
icons: [BASIC_ICON] },
callMessage: { text: "Set up call Icon 3.5.2",
iconSelfExplanatory: false,
icons: [COLOR_ICON] },
address: "+012340123456,1,2"}},
{command: "d01c8103011000820281838609911032042143651c2c9e0200019e020103",
{command: "D01C" + // Length
"8103011000" + // Command details
"82028183" + // Device identities
"8609911032042143651C2C" + // Address
"9E020001" + // Icon identifier
"9E020103", // Icon identifier
expect: {commandQualifier: 0x00,
confirmMessage: { iconSelfExplanatory: true,
icons: [BASIC_ICON] },
@ -255,23 +182,25 @@ const TEST_DATA = [
];
function testSetupCall(aCommand, aExpect) {
is(aCommand.commandNumber, 0x01, "commandNumber");
is(aCommand.typeOfCommand, MozIccManager.STK_CMD_SET_UP_CALL,
"typeOfCommand");
is(aCommand.commandQualifier, aExpect.commandQualifier,
"commandQualifier");
is(aCommand.options.address, aExpect.address,
"options.address");
is(aCommand.commandQualifier, aExpect.commandQualifier, "commandQualifier");
is(aCommand.options.address, aExpect.address, "options.address");
if (aExpect.confirmMessage) {
// confirmMessage is optional.
if ("confirmMessage" in aExpect) {
isStkText(aCommand.options.confirmMessage, aExpect.confirmMessage);
}
if (aExpect.callMessage) {
// callMessage is optional.
if ("callMessage" in aExpect) {
isStkText(aCommand.options.callMessage, aExpect.callMessage);
}
let duration = aCommand.options.duration;
if (duration) {
// duration is optional.
if ("duration" in aExpect) {
let duration = aCommand.options.duration;
is(duration.timeUnit, aExpect.duration.timeUnit, "duration.timeUnit");
is(duration.timeInterval, aExpect.duration.timeInterval,
"duration.timeInterval");
@ -291,6 +220,12 @@ startTestCommon(function() {
// Wait onstkcommand event.
promises.push(waitForTargetEvent(icc, "stkcommand")
.then((aEvent) => testSetupCall(aEvent.command, data.expect)));
// Wait icc-stkcommand system message.
promises.push(waitForSystemMessage("icc-stkcommand")
.then((aMessage) => {
is(aMessage.iccId, icc.iccInfo.iccid, "iccId");
testSetupCall(aMessage.command, data.expect);
}));
// Send emulator command to generate stk unsolicited event.
promises.push(sendEmulatorStkPdu(data.command));

Просмотреть файл

@ -5,27 +5,46 @@ MARIONETTE_TIMEOUT = 60000;
MARIONETTE_HEAD_JS = "head.js";
const TEST_DATA = [
{command: "d00c810301050082028182990104",
{command: "D00C" + // Length
"8103010500" + // Command details
"82028182" + // Device identities
"990104", // Event list
expect: {commandQualifier: 0x00,
eventList: [4]}},
{command: "d00d81030105008202818299020507",
{command: "D00D" + // Length
"8103010500" + // Command details
"82028182" + // Device identities
"99020507", // Event list
expect: {commandQualifier: 0x00,
eventList: [5, 7]}},
{command: "d00c810301050082028182990107",
{command: "D00C" + // Length
"8103010500" + // Command details
"82028182" + // Device identities
"990107", // Event list
expect: {commandQualifier: 0x00,
eventList: [7]}},
{command: "d00c810301050082028182990107",
{command: "D00C" + // Length
"8103010500" + // Command details
"82028182" + // Device identities
"990107", // Event list
expect: {commandQualifier: 0x00,
eventList: [7]}},
{command: "d00b8103010500820281829900",
{command: "D00B" + // Length
"8103010500" + // Command details
"82028182" + // Device identities
"9900", // Event list
expect: {commandQualifier: 0x00,
eventList: null}},
{command: "d00c810301050082028182990107",
{command: "D00C" + // Length
"8103010500" + // Command details
"82028182" + // Device identities
"990107", // Event list
expect: {commandQualifier: 0x00,
eventList: [7]}}
];
function testSetupEventList(aCommand, aExpect) {
is(aCommand.commandNumber, 0x01, "commandNumber");
is(aCommand.typeOfCommand, MozIccManager.STK_CMD_SET_UP_EVENT_LIST,
"typeOfCommand");
is(aCommand.commandQualifier, aExpect.commandQualifier, "commandQualifier");
@ -49,6 +68,12 @@ startTestCommon(function() {
// Wait onstkcommand event.
promises.push(waitForTargetEvent(icc, "stkcommand")
.then((aEvent) => testSetupEventList(aEvent.command, data.expect)));
// Wait icc-stkcommand system message.
promises.push(waitForSystemMessage("icc-stkcommand")
.then((aMessage) => {
is(aMessage.iccId, icc.iccInfo.iccid, "iccId");
testSetupEventList(aMessage.command, data.expect);
}));
// Send emulator command to generate stk unsolicited event.
promises.push(sendEmulatorStkPdu(data.command));

Просмотреть файл

@ -5,126 +5,81 @@ MARIONETTE_TIMEOUT = 60000;
MARIONETTE_HEAD_JS = "head.js";
const TEST_DATA = [
{command: "d01a8103012800820281828d0f0449646c65204d6f64652054657874",
{command: "D01A" + // Length
"8103012800" + // Command details
"82028182" + // Device identities
"8D0F0449646C65204D6F64652054657874", // Text string
expect: {commandQualifier: 0x00,
text: "Idle Mode Text"}},
{command: "d0188103012800820281828d0d04546f6f6c6b69742054657374",
{command: "D081FD" + // Length
"8103012800" + // Command details
"82028182" + // Device identities
"8D81F100547419344D3641737498CD06CDEB70383B0F0A" + // Text string
"83E8653C1D34A7CBD3EE330B7447A7C768D01C1D66B341" +
"E232889C9EC3D9E17C990C12E741747419D42C82C27350" +
"D80D4A93D96550FB4D2E83E8653C1D943683E8E832A859" +
"04A5E7A0B0985D06D1DF20F21B94A6BBA8E832082E2FCF" +
"CB6E7A989E7EBB41737A9E5D06A5E72076D94C0785E7A0" +
"B01B946EC3D9E576D94D0FD3D36F37885C1EA7E7E9B71B" +
"447F83E8E832A85904B5C3EEBA393CA6D7E565B90B4445" +
"97416932BB0C6ABFC96510BD8CA783E6E8309B0D129741" +
"E4F41CCE0EE7CB6450DA0D0A83DA61B7BB2C07D1D1613A" +
"A8EC9ED7E5E539888E0ED341EE32",
expect: {commandQualifier: 0x00,
text: "Toolkit Test"}},
{command: "d081fd8103012800820281828d81f100547419344d3641737498cd06cdeb70383b0f0a83e8653c1d34a7cbd3ee330b7447a7c768d01c1d66b341e232889c9ec3d9e17c990c12e741747419d42c82c27350d80d4a93d96550fb4d2e83e8653c1d943683e8e832a85904a5e7a0b0985d06d1df20f21b94a6bba8e832082e2fcfcb6e7a989e7ebb41737a9e5d06a5e72076d94c0785e7a0b01b946ec3d9e576d94d0fd3d36f37885c1ea7e7e9b71b447f83e8e832a85904b5c3eeba393ca6d7e565b90b444597416932bb0c6abfc96510bd8ca783e6e8309b0d129741e4f41cce0ee7cb6450da0d0a83da61b7bb2c07d1d1613aa8ec9ed7e5e539888e0ed341ee32",
expect: {commandQualifier: 0x00,
text: "The SIM shall supply a text string, which shall be displayed by the ME as an idle mode text if the ME is able to do it.The presentation style is left as an implementation decision to the ME manufacturer. The idle mode text shall be displayed in a manner that ensures that ne"}},
{command: "d0198103012800820281828d0a0449646c6520746578749e020001",
expect: {commandQualifier: 0x00,
text: "Idle text",
iconSelfExplanatory: true,
icons: [BASIC_ICON]}},
{command: "d0198103012800820281828d0a0449646c6520746578749e020105",
text: "The SIM shall supply a text string, which shall be " +
"displayed by the ME as an idle mode text if the ME is " +
"able to do it.The presentation style is left as an " +
"implementation decision to the ME manufacturer. The idle " +
"mode text shall be displayed in a manner that ensures " +
"that ne"}},
{command: "D019" + // Length
"8103012800" + // Command details
"82028182" + // Device identities
"8D0A0449646C652074657874" + // Text string
"9E020101", // Icon identifier
expect: {commandQualifier: 0x00,
text: "Idle text",
iconSelfExplanatory: false,
icons: [COLOR_TRANSPARENCY_ICON]}},
{command: "d0198103012800820281828d0a0449646c6520746578749e020007",
icons: [BASIC_ICON]}},
{command: "D019" + // Length
"8103012800" + // Command details
"82028182" + // Device identities
"8D0A0449646C652074657874" + // Text string
"9E020007", // Icon identifier
expect: {commandQualifier: 0x00,
text: "Idle text",
iconSelfExplanatory: true,
icons: [COLOR_ICON, COLOR_TRANSPARENCY_ICON]}},
{command: "d0248103012800820281828d1908041704140420041004120421042204120423041904220415",
{command: "D024" + // Length
"8103012800" + // Command details
"82028182" + // Device identities
"8D1908041704140420041004120421042204120423041904220415", // Text string
expect: {commandQualifier: 0x00,
text: "ЗДРАВСТВУЙТЕ"}},
{command: "d0228103012800820281828d110449646c65204d6f646520546578742031d004001000b4",
{command: "D022" + // Length
"8103012800" + // Command details
"82028182" + // Device identities
"8D110449646C65204D6F646520546578742031" + // Text string
"D004001000B4", // Text attribute
expect: {commandQualifier: 0x00,
text: "Idle Mode Text 1"}},
{command: "d01c8103012800820281828d110449646c65204d6f646520546578742032",
expect: {commandQualifier: 0x00,
text: "Idle Mode Text 2"}},
{command: "d0228103012800820281828d110449646c65204d6f646520546578742031d004001001b4",
expect: {commandQualifier: 0x00,
text: "Idle Mode Text 1"}},
{command: "d01c8103012800820281828d110449646c65204d6f646520546578742032",
expect: {commandQualifier: 0x00,
text: "Idle Mode Text 2"}},
{command: "d0228103012800820281828d110449646c65204d6f646520546578742031d004001002b4",
expect: {commandQualifier: 0x00,
text: "Idle Mode Text 1"}},
{command: "d01c8103012800820281828d110449646c65204d6f646520546578742032",
expect: {commandQualifier: 0x00,
text: "Idle Mode Text 2"}},
{command: "d0228103012800820281828d110449646c65204d6f646520546578742031d004001004b4",
expect: {commandQualifier: 0x00,
text: "Idle Mode Text 1"}},
{command: "d0228103012800820281828d110449646c65204d6f646520546578742032d004001000b4",
expect: {commandQualifier: 0x00,
text: "Idle Mode Text 2"}},
{command: "d01c8103012800820281828d110449646c65204d6f646520546578742033",
expect: {commandQualifier: 0x00,
text: "Idle Mode Text 3"}},
{command: "d0228103012800820281828d110449646c65204d6f646520546578742031d004001008b4",
expect: {commandQualifier: 0x00,
text: "Idle Mode Text 1"}},
{command: "d0228103012800820281828d110449646c65204d6f646520546578742032d004001000b4",
expect: {commandQualifier: 0x00,
text: "Idle Mode Text 2"}},
{command: "d01c8103012800820281828d110449646c65204d6f646520546578742033",
expect: {commandQualifier: 0x00,
text: "Idle Mode Text 3"}},
{command: "d0228103012800820281828d110449646c65204d6f646520546578742031d004001010b4",
expect: {commandQualifier: 0x00,
text: "Idle Mode Text 1"}},
{command: "d0228103012800820281828d110449646c65204d6f646520546578742032d004001000b4",
expect: {commandQualifier: 0x00,
text: "Idle Mode Text 2"}},
{command: "d01c8103012800820281828d110449646c65204d6f646520546578742033",
expect: {commandQualifier: 0x00,
text: "Idle Mode Text 3"}},
{command: "d0228103012800820281828d110449646c65204d6f646520546578742031d004001020b4",
expect: {commandQualifier: 0x00,
text: "Idle Mode Text 1"}},
{command: "d0228103012800820281828d110449646c65204d6f646520546578742032d004001000b4",
expect: {commandQualifier: 0x00,
text: "Idle Mode Text 2"}},
{command: "d01c8103012800820281828d110449646c65204d6f646520546578742033",
expect: {commandQualifier: 0x00,
text: "Idle Mode Text 3"}},
{command: "d0228103012800820281828d110449646c65204d6f646520546578742031d004001040b4",
expect: {commandQualifier: 0x00,
text: "Idle Mode Text 1"}},
{command: "d0228103012800820281828d110449646c65204d6f646520546578742032d004001000b4",
expect: {commandQualifier: 0x00,
text: "Idle Mode Text 2"}},
{command: "d01c8103012800820281828d110449646c65204d6f646520546578742033",
expect: {commandQualifier: 0x00,
text: "Idle Mode Text 3"}},
{command: "d0228103012800820281828d110449646c65204d6f646520546578742031d004001080b4",
expect: {commandQualifier: 0x00,
text: "Idle Mode Text 1"}},
{command: "d0228103012800820281828d110449646c65204d6f646520546578742032d004001000b4",
expect: {commandQualifier: 0x00,
text: "Idle Mode Text 2"}},
{command: "d01c8103012800820281828d110449646c65204d6f646520546578742033",
expect: {commandQualifier: 0x00,
text: "Idle Mode Text 3"}},
{command: "d0228103012800820281828d110449646c65204d6f646520546578742031d004001000b4",
expect: {commandQualifier: 0x00,
text: "Idle Mode Text 1"}},
{command: "d01c8103012800820281828d110449646c65204d6f646520546578742032",
expect: {commandQualifier: 0x00,
text: "Idle Mode Text 2"}},
{command: "d0108103012800820281828d05084f60597d",
{command: "D010" + // Length
"8103012800" + // Command details
"82028182" + // Device identities
"8D05084F60597D", // Text string
expect: {commandQualifier: 0x00,
text: "你好"}},
{command: "d0148103012800820281828d09080038003030eb0030",
expect: {commandQualifier: 0x00,
text: "80ル0"}},
];
function testSetupIdleModeText(aCommand, aExpect) {
is(aCommand.commandNumber, 0x01, "commandNumber");
is(aCommand.typeOfCommand, MozIccManager.STK_CMD_SET_UP_IDLE_MODE_TEXT,
"typeOfCommand");
is(aCommand.commandQualifier, aExpect.commandQualifier, "commandQualifier");
is(aCommand.options.text, aExpect.text, "options.text");
if (aExpect.icons) {
// icons is optional.
if ("icons" in aExpect) {
isIcons(aCommand.options.icons, aExpect.icons);
is(aCommand.options.iconSelfExplanatory, aExpect.iconSelfExplanatory,
"options.iconSelfExplanatory");
@ -144,6 +99,12 @@ startTestCommon(function() {
// Wait onstkcommand event.
promises.push(waitForTargetEvent(icc, "stkcommand")
.then((aEvent) => testSetupIdleModeText(aEvent.command, data.expect)));
// Wait icc-stkcommand system message.
promises.push(waitForSystemMessage("icc-stkcommand")
.then((aMessage) => {
is(aMessage.iccId, icc.iccInfo.iccid, "iccId");
testSetupIdleModeText(aMessage.command, data.expect);
}));
// Send emulator command to generate stk unsolicited event.
promises.push(sendEmulatorStkPdu(data.command));

Просмотреть файл

@ -5,44 +5,163 @@ MARIONETTE_TIMEOUT = 60000;
MARIONETTE_HEAD_JS = "head.js";
const TEST_DATA = [
{command: "d03b810301250082028182850c546f6f6c6b6974204d656e758f07014974656d20318f07024974656d20328f07034974656d20338f07044974656d2034",
expect: {commandQualifier: 0x00,
title: "Toolkit Menu",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}, {identifier: 3, text: "Item 3"}, {identifier: 4, text: "Item 4"}]}},
{command: "d023810301250082028182850c546f6f6c6b6974204d656e758f04114f6e658f041254776f",
expect: {commandQualifier: 0x00,
title: "Toolkit Menu",
items: [{identifier: 17, text: "One"}, {identifier: 18, text: "Two"}]}},
{command: "d081fc810301250082028182850a4c617267654d656e75318f05505a65726f8f044f4f6e658f044e54776f8f064d54687265658f054c466f75728f054b466976658f044a5369788f0649536576656e8f064845696768748f05474e696e658f0646416c7068618f0645427261766f8f0844436861726c69658f064344656c74618f05424563686f8f0941466f782d74726f748f0640426c61636b8f063f42726f776e8f043e5265648f073d4f72616e67658f073c59656c6c6f778f063b477265656e8f053a426c75658f073956696f6c65748f0538477265798f063757686974658f06366d696c6c698f06356d6963726f8f05346e616e6f8f05337069636f",
{command: "D081FC" + // Length
"8103012500" + // Command details
"82028182" + // Device identities
"850A4C617267654D656E7531" + // Alpha identifier
"8F05505A65726F" + // Item
"8F044F4F6E65" + // Item
"8F044E54776F" + // Item
"8F064D5468726565" + // Item
"8F054C466F7572" + // Item
"8F054B46697665" + // Item
"8F044A536978" + // Item
"8F0649536576656E" + // Item
"8F06484569676874" + // Item
"8F05474E696E65" + // Item
"8F0646416C706861" + // Item
"8F0645427261766F" + // Item
"8F0844436861726C6965" + // Item
"8F064344656C7461" + // Item
"8F05424563686F" + // Item
"8F0941466F782D74726F74" + // Item
"8F0640426C61636B" + // Item
"8F063F42726F776E" + // Item
"8F043E526564" + // Item
"8F073D4F72616E6765" + // Item
"8F073C59656C6C6F77" + // Item
"8F063B477265656E" + // Item
"8F053A426C7565" + // Item
"8F073956696F6C6574" + // Item
"8F053847726579" + // Item
"8F06375768697465" + // Item
"8F06366D696C6C69" + // Item
"8F06356D6963726F" + // Item
"8F05346E616E6F" + // Item
"8F05337069636F", // Item
expect: {commandQualifier: 0x00,
title: "LargeMenu1",
items: [{identifier: 80, text: "Zero"}, {identifier: 79, text: "One"}, {identifier: 78, text: "Two"}, {identifier: 77, text: "Three"}, {identifier: 76, text: "Four"}, {identifier: 75, text: "Five"}, {identifier: 74, text: "Six"}, {identifier: 73, text: "Seven"}, {identifier: 72, text: "Eight"}, {identifier: 71, text: "Nine"}, {identifier: 70, text: "Alpha"}, {identifier: 69, text: "Bravo"}, {identifier: 68, text: "Charlie"}, {identifier: 67, text: "Delta"}, {identifier: 66, text: "Echo"}, {identifier: 65, text: "Fox-trot"}, {identifier: 64, text: "Black"}, {identifier: 63, text: "Brown"}, {identifier: 62, text: "Red"}, {identifier: 61, text: "Orange"}, {identifier: 60, text: "Yellow"}, {identifier: 59, text: "Green"}, {identifier: 58, text: "Blue"}, {identifier: 57, text: "Violet"}, {identifier: 56, text: "Grey"}, {identifier: 55, text: "White"}, {identifier: 54, text: "milli"}, {identifier: 53, text: "micro"}, {identifier: 52, text: "nano"}, {identifier: 51, text: "pico"}]}},
{command: "d081f3810301250082028182850a4c617267654d656e75328f1dff312043616c6c20466f727761726420556e636f6e646974696f6e616c8f1cfe322043616c6c20466f7277617264204f6e205573657220427573798f1bfd332043616c6c20466f7277617264204f6e204e6f205265706c798f25fc342043616c6c20466f7277617264204f6e2055736572204e6f7420526561636861626c658f20fb352042617272696e67204f6620416c6c204f7574676f696e672043616c6c738f24fa362042617272696e67204f6620416c6c204f7574676f696e6720496e742043616c6c738f13f93720434c492050726573656e746174696f6e",
items: [{identifier: 80, text: "Zero"},
{identifier: 79, text: "One"},
{identifier: 78, text: "Two"},
{identifier: 77, text: "Three"},
{identifier: 76, text: "Four"},
{identifier: 75, text: "Five"},
{identifier: 74, text: "Six"},
{identifier: 73, text: "Seven"},
{identifier: 72, text: "Eight"},
{identifier: 71, text: "Nine"},
{identifier: 70, text: "Alpha"},
{identifier: 69, text: "Bravo"},
{identifier: 68, text: "Charlie"},
{identifier: 67, text: "Delta"},
{identifier: 66, text: "Echo"},
{identifier: 65, text: "Fox-trot"},
{identifier: 64, text: "Black"},
{identifier: 63, text: "Brown"},
{identifier: 62, text: "Red"},
{identifier: 61, text: "Orange"},
{identifier: 60, text: "Yellow"},
{identifier: 59, text: "Green"},
{identifier: 58, text: "Blue"},
{identifier: 57, text: "Violet"},
{identifier: 56, text: "Grey"},
{identifier: 55, text: "White"},
{identifier: 54, text: "milli"},
{identifier: 53, text: "micro"},
{identifier: 52, text: "nano"},
{identifier: 51, text: "pico"}]}},
{command: "D081F3" + // Length
"8103012500" + // Command details
"82028182" + // Device identities
"850A4C617267654D656E7532" + // Alpha identifier
"8F1DFF312043616C6C20466F727761726420556E636F6E646974" + // Item
"696F6E616C" +
"8F1CFE322043616C6C20466F7277617264204F6E205573657220" + // Item
"42757379" +
"8F1BFD332043616C6C20466F7277617264204F6E204E6F205265" + // Item
"706C79" +
"8F25FC342043616C6C20466F7277617264204F6E205573657220" + // Item
"4E6F7420526561636861626C65" +
"8F20FB352042617272696E67204F6620416C6C204F7574676F69" + // Item
"6E672043616C6C73" +
"8F24FA362042617272696E67204F6620416C6C204F7574676F69" + // Item
"6E6720496E742043616C6C73" +
"8F13F93720434C492050726573656E746174696F6E", // Item
expect: {commandQualifier: 0x00,
title: "LargeMenu2",
items: [{identifier: 255, text: "1 Call Forward Unconditional"}, {identifier: 254, text: "2 Call Forward On User Busy"}, {identifier: 253, text: "3 Call Forward On No Reply"}, {identifier: 252, text: "4 Call Forward On User Not Reachable"}, {identifier: 251, text: "5 Barring Of All Outgoing Calls"}, {identifier: 250, text: "6 Barring Of All Outgoing Int Calls"}, {identifier: 249, text: "7 CLI Presentation"}]}},
{command: "d081fc8103012500820281828581ec5468652053494d207368616c6c20737570706c79206120736574206f66206d656e75206974656d732c207768696368207368616c6c20626520696e7465677261746564207769746820746865206d656e752073797374656d20286f72206f74686572204d4d4920666163696c6974792920696e206f7264657220746f206769766520746865207573657220746865206f70706f7274756e69747920746f2063686f6f7365206f6e65206f66207468657365206d656e75206974656d7320617420686973206f776e2064697363726574696f6e2e2045616368206974656d20636f6d70726973657320612073688f020159",
items: [{identifier: 255, text: "1 Call Forward Unconditional"},
{identifier: 254, text: "2 Call Forward On User Busy"},
{identifier: 253, text: "3 Call Forward On No Reply"},
{identifier: 252, text: "4 Call Forward On User Not Reachable"},
{identifier: 251, text: "5 Barring Of All Outgoing Calls"},
{identifier: 250, text: "6 Barring Of All Outgoing Int Calls"},
{identifier: 249, text: "7 CLI Presentation"}]}},
{command: "D081FC" + // Length
"8103012500" + // Command details
"82028182" + // Device identities
"8581EC5468652053494D207368616C6C20737570" + // Alpha identifier
"706C79206120736574206F66206D656E75206974" +
"656D732C207768696368207368616C6C20626520" +
"696E746567726174656420776974682074686520" +
"6D656E752073797374656D20286F72206F746865" +
"72204D4D4920666163696C6974792920696E206F" +
"7264657220746F20676976652074686520757365" +
"7220746865206F70706F7274756E69747920746F" +
"2063686F6F7365206F6E65206F66207468657365" +
"206D656E75206974656D7320617420686973206F" +
"776E2064697363726574696F6E2E204561636820" +
"6974656D20636F6D7072697365732061207368" +
"8F020159", // Item
expect: {commandQualifier: 0x00,
title: "The SIM shall supply a set of menu items, which shall be integrated with the menu system (or other MMI facility) in order to give the user the opportunity to choose one of these menu items at his own discretion. Each item comprises a sh",
title: "The SIM shall supply a set of menu items, which shall " +
"be integrated with the menu system (or other MMI " +
"facility) in order to give the user the opportunity to " +
"choose one of these menu items at his own discretion. " +
"Each item comprises a sh",
items: [{identifier: 1, text: "Y"}]}},
{command: "d03b810301258082028182850c546f6f6c6b6974204d656e758f07014974656d20318f07024974656d20328f07034974656d20338f07044974656d2034",
{command: "D03B" + // Length
"8103012580" + // Command details
"82028182" + // Device identities
"850C546F6F6C6B6974204D656E75" + // Alpha identifier
"8F07014974656D2031" + // Item
"8F07024974656D2032" + // Item
"8F07034974656D2033" + // Item
"8F07044974656D2034", // Item
expect: {commandQualifier: 0x80,
title: "Toolkit Menu",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}, {identifier: 3, text: "Item 3"}, {identifier: 4, text: "Item 4"}]}},
{command: "d041810301250082028182850c546f6f6c6b6974204d656e758f07014974656d20318f07024974656d20328f07034974656d20338f07044974656d2034180413101526",
items: [{identifier: 1, text: "Item 1"},
{identifier: 2, text: "Item 2"},
{identifier: 3, text: "Item 3"},
{identifier: 4, text: "Item 4"}]}},
{command: "D041" + // Length
"8103012500" + // Command details
"82028182" + // Device identities
"850C546F6F6C6B6974204D656E75" + // Alpha identifier
"8F07014974656D2031" + // Item
"8F07024974656D2032" + // Item
"8F07034974656D2033" + // Item
"8F07044974656D2034" + // Item
"180413101526", // Items next action indicator
expect: {commandQualifier: 0x00,
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: [MozIccManager.STK_CMD_SEND_SMS, MozIccManager.STK_CMD_SET_UP_CALL, MozIccManager.STK_CMD_LAUNCH_BROWSER, MozIccManager.STK_CMD_PROVIDE_LOCAL_INFO]}},
{command: "d03c810301250082028182850c546f6f6c6b6974204d656e758f07014974656d20318f07024974656d20328f07034974656d20339e0201019f0401030303",
expect: {commandQualifier: 0x00,
title: "Toolkit Menu",
iconSelfExplanatory: false,
icons: [BASIC_ICON],
items: [{identifier: 1, text: "Item 1", iconSelfExplanatory: false, icons: [COLOR_ICON]},
{identifier: 2, text: "Item 2", iconSelfExplanatory: false, icons: [COLOR_ICON]},
{identifier: 3, text: "Item 3", iconSelfExplanatory: false, icons: [COLOR_ICON]}]}},
{command: "d03c810301250082028182850c546f6f6c6b6974204d656e758f07014974656d20318f07024974656d20328f07034974656d20339e0200019f0400050505",
items: [{identifier: 1, text: "Item 1"},
{identifier: 2, text: "Item 2"},
{identifier: 3, text: "Item 3"},
{identifier: 4, text: "Item 4"}],
nextActionList: [MozIccManager.STK_CMD_SEND_SMS,
MozIccManager.STK_CMD_SET_UP_CALL,
MozIccManager.STK_CMD_LAUNCH_BROWSER,
MozIccManager.STK_CMD_PROVIDE_LOCAL_INFO]}},
{command: "D03C" + // Length
"8103012500" + // Command details
"82028182" + // Device identities
"850C546F6F6C6B6974204D656E75" + // Alpha identifier
"8F07014974656D2031" + // Item
"8F07024974656D2032" + // Item
"8F07034974656D2033" + // Item
"9E020001" + // Icon identifier
"9F0400050505", // Item icon identifier list
expect: {commandQualifier: 0x00,
title: "Toolkit Menu",
iconSelfExplanatory: true,
@ -50,116 +169,83 @@ const TEST_DATA = [
items: [{identifier: 1, text: "Item 1", iconSelfExplanatory: true, icons: [COLOR_TRANSPARENCY_ICON]},
{identifier: 2, text: "Item 2", iconSelfExplanatory: true, icons: [COLOR_TRANSPARENCY_ICON]},
{identifier: 3, text: "Item 3", iconSelfExplanatory: true, icons: [COLOR_TRANSPARENCY_ICON]}]}},
{command: "d029810301250182028182850c546f6f6c6b6974204d656e758f07014974656d20318f07024974656d2032",
expect: {commandQualifier: 0x01,
title: "Toolkit Menu",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}]}},
{command: "d048810301250082028182850e546f6f6c6b6974204d656e7520318f07014974656d20318f07024974656d20328f07034974656d2033d004000e00b4d10c000600b4000600b4000600b4",
expect: {commandQualifier: 0x00,
title: "Toolkit Menu 1",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}, {identifier: 3, text: "Item 3"}]}},
{command: "d034810301250082028182850e546f6f6c6b6974204d656e7520328f07044974656d20348f07054974656d20358f07064974656d2036",
expect: {commandQualifier: 0x00,
title: "Toolkit Menu 2",
items: [{identifier: 4, text: "Item 4"}, {identifier: 5, text: "Item 5"}, {identifier: 6, text: "Item 6"}]}},
{command: "d048810301250082028182850e546f6f6c6b6974204d656e7520318f07014974656d20318f07024974656d20328f07034974656d2033d004000e01b4d10c000601b4000601b4000601b4",
expect: {commandQualifier: 0x00,
title: "Toolkit Menu 1",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}, {identifier: 3, text: "Item 3"}]}},
{command: "d034810301250082028182850e546f6f6c6b6974204d656e7520328f07044974656d20348f07054974656d20358f07064974656d2036",
expect: {commandQualifier: 0x00,
title: "Toolkit Menu 2",
items: [{identifier: 4, text: "Item 4"}, {identifier: 5, text: "Item 5"}, {identifier: 6, text: "Item 6"}]}},
{command: "d048810301250082028182850e546f6f6c6b6974204d656e7520318f07014974656d20318f07024974656d20328f07034974656d2033d004000e02b4d10c000602b4000602b4000602b4",
expect: {commandQualifier: 0x00,
title: "Toolkit Menu 1",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}, {identifier: 3, text: "Item 3"}]}},
{command: "d034810301250082028182850e546f6f6c6b6974204d656e7520328f07044974656d20348f07054974656d20358f07064974656d2036",
expect: {commandQualifier: 0x00,
title: "Toolkit Menu 2",
items: [{identifier: 4, text: "Item 4"}, {identifier: 5, text: "Item 5"}, {identifier: 6, text: "Item 6"}]}},
{command: "d048810301250082028182850e546f6f6c6b6974204d656e7520318f07014974656d20318f07024974656d20328f07034974656d2033d004000e04b4d10c000604b4000604b4000604b4",
expect: {commandQualifier: 0x00,
title: "Toolkit Menu 1",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}, {identifier: 3, text: "Item 3"}]}},
{command: "d048810301250082028182850e546f6f6c6b6974204d656e7520328f07044974656d20348f07054974656d20358f07064974656d2036d004000e00b4d10c000600b4000600b4000600b4",
expect: {commandQualifier: 0x00,
title: "Toolkit Menu 2",
items: [{identifier: 4, text: "Item 4"}, {identifier: 5, text: "Item 5"}, {identifier: 6, text: "Item 6"}]}},
{command: "d034810301250082028182850e546f6f6c6b6974204d656e7520338f07074974656d20378f07084974656d20388f07094974656d2039",
expect: {commandQualifier: 0x00,
title: "Toolkit Menu 3",
items: [{identifier: 7, text: "Item 7"}, {identifier: 8, text: "Item 8"}, {identifier: 9, text: "Item 9"}]}},
{command: "d048810301250082028182850e546f6f6c6b6974204d656e7520318f07014974656d20318f07024974656d20328f07034974656d2033d004000e08b4d10c000608b4000608b4000608b4",
expect: {commandQualifier: 0x00,
title: "Toolkit Menu 1",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}, {identifier: 3, text: "Item 3"}]}},
{command: "d048810301250082028182850e546f6f6c6b6974204d656e7520318f07014974656d20318f07024974656d20328f07034974656d2033d004000e10b4d10c000610b4000610b4000610b4",
expect: {commandQualifier: 0x00,
title: "Toolkit Menu 1",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}, {identifier: 3, text: "Item 3"}]}},
{command: "d048810301250082028182850e546f6f6c6b6974204d656e7520318f07014974656d20318f07024974656d20328f07034974656d2033d004000e20b4d10c000620b4000620b4000620b4",
expect: {commandQualifier: 0x00,
title: "Toolkit Menu 1",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}, {identifier: 3, text: "Item 3"}]}},
{command: "d048810301250082028182850e546f6f6c6b6974204d656e7520318f07014974656d20318f07024974656d20328f07034974656d2033d004000e40b4d10c000640b4000640b4000640b4",
expect: {commandQualifier: 0x00,
title: "Toolkit Menu 1",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}, {identifier: 3, text: "Item 3"}]}},
{command: "d048810301250082028182850e546f6f6c6b6974204d656e7520318f07014974656d20318f07024974656d20328f07034974656d2033d004000e80b4d10c000680b4000680b4000680b4",
expect: {commandQualifier: 0x00,
title: "Toolkit Menu 1",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}, {identifier: 3, text: "Item 3"}]}},
{command: "d046810301250082028182850c546f6f6c6b6974204d656e758f07014974656d20318f07024974656d20328f07034974656d2033d004000c00b4d10c000600b4000600b4000600b4",
{command: "D036" + // Length
"8103012500" + // Command details
"82028182" + // Device identities
"850C546F6F6C6B6974204D656E75" + // Alpha identifier
"8F07014974656D2031" + // Item
"8F07024974656D2032" + // Item
"8F07034974656D2033" + // Item
"9E020001", // Icon identifier
expect: {commandQualifier: 0x00,
title: "Toolkit Menu",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}, {identifier: 3, text: "Item 3"}]}},
{command: "d0819c8103012500820281828519800417041404200410041204210422041204230419042204158f1c018004170414042004100412042104220412042304190422041500318f1c028004170414042004100412042104220412042304190422041500328f1c038004170414042004100412042104220412042304190422041500338f1c04800417041404200410041204210422041204230419042204150034",
iconSelfExplanatory: true,
icons: [BASIC_ICON],
items: [{identifier: 1, text: "Item 1"},
{identifier: 2, text: "Item 2"},
{identifier: 3, text: "Item 3"}]}},
{command: "D038" + // Length
"8103012500" + // Command details
"82028182" + // Device identities
"850C546F6F6C6B6974204D656E75" + // Alpha identifier
"8F07014974656D2031" + // Item
"8F07024974656D2032" + // Item
"8F07034974656D2033" + // Item
"9F0400030303", // Item icon identifier list
expect: {commandQualifier: 0x00,
title: "Toolkit Menu",
items: [{identifier: 1, text: "Item 1", iconSelfExplanatory: true, icons: [COLOR_ICON]},
{identifier: 2, text: "Item 2", iconSelfExplanatory: true, icons: [COLOR_ICON]},
{identifier: 3, text: "Item 3", iconSelfExplanatory: true, icons: [COLOR_ICON]}]}},
{command: "D0819C" + // Length
"8103012500" + // Command details
"82028182" + // Device identities
"851980041704140420041004120421042204120423041904220415" + // Alpha identifier
"8F1C01800417041404200410041204210422041204230419042204150031" + // Item
"8F1C02800417041404200410041204210422041204230419042204150032" + // Item
"8F1C03800417041404200410041204210422041204230419042204150033" + // Item
"8F1C04800417041404200410041204210422041204230419042204150034", // Item
expect: {commandQualifier: 0x00,
title: "ЗДРАВСТВУЙТЕ",
items: [{identifier: 1, text: "ЗДРАВСТВУЙТЕ1"}, {identifier: 2, text: "ЗДРАВСТВУЙТЕ2"}, {identifier: 3, text: "ЗДРАВСТВУЙТЕ3"}, {identifier: 4, text: "ЗДРАВСТВУЙТЕ4"}]}},
{command: "d0608103012500820281828519800417041404200410041204210422041204230419042204158f1c118004170414042004100412042104220412042304190422041500358f1c12800417041404200410041204210422041204230419042204150036",
expect: {commandQualifier: 0x00,
title: "ЗДРАВСТВУЙТЕ",
items: [{identifier: 17, text: "ЗДРАВСТВУЙТЕ5"}, {identifier: 18, text: "ЗДРАВСТВУЙТЕ6"}]}},
{command: "d03c8103012500820281828509805de551777bb153558f080180987976ee4e008f080280987976ee4e8c8f080380987976ee4e098f080480987976ee56db",
items: [{identifier: 1, text: "ЗДРАВСТВУЙТЕ1"},
{identifier: 2, text: "ЗДРАВСТВУЙТЕ2"},
{identifier: 3, text: "ЗДРАВСТВУЙТЕ3"},
{identifier: 4, text: "ЗДРАВСТВУЙТЕ4"}]}},
{command: "D03C" + // Length
"8103012500" + // Command details
"82028182" + // Device identities
"8509805DE551777BB15355" + // Alpha identifier
"8F080180987976EE4E00" + // Item
"8F080280987976EE4E8C" + // Item
"8F080380987976EE4E09" + // Item
"8F080480987976EE56DB", // Item
expect: {commandQualifier: 0x00,
title: "工具箱单",
items: [{identifier: 1, text: "项目一"}, {identifier: 2, text: "项目二"}, {identifier: 3, text: "项目三"}, {identifier: 4, text: "项目四"}]}},
{command: "d0208103012500820281828509805de551777bb153558f0411804e008f0412804e8c",
expect: {commandQualifier: 0x00,
title: "工具箱单",
items: [{identifier: 17, text: "一"}, {identifier: 18, text: "二"}]}},
{command: "d0448103012500820281828509800038003030eb00308f0a01800038003030eb00318f0a02800038003030eb00328f0a03800038003030eb00338f0a04800038003030eb0034",
expect: {commandQualifier: 0x00,
title: "80ル0",
items: [{identifier: 1, text: "80ル1"}, {identifier: 2, text: "80ル2"}, {identifier: 3, text: "80ル3"}, {identifier: 4, text: "80ル4"}]}},
{command: "d02c8103012500820281828509800038003030eb00308f0a11800038003030eb00358f0a12800038003030eb0036",
expect: {commandQualifier: 0x00,
title: "80ル0",
items: [{identifier: 17, text: "80ル5"}, {identifier: 18, text: "80ル6"}]}},
{command: "d041810301250082028182850c546f6f6c6b6974204d656e758f07014974656d20318f07024974656d20328f07034974656d20338f07044974656d2034180481000000",
expect: {commandQualifier: 0x00,
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: [MozIccManager.STK_NEXT_ACTION_END_PROACTIVE_SESSION, MozIccManager.STK_NEXT_ACTION_NULL, MozIccManager.STK_NEXT_ACTION_NULL, MozIccManager.STK_NEXT_ACTION_NULL]}},
{command:"D03B810301250082028182850C546F6F6C6B6974204D656E758F07014974656D20318F07024974656D20328F07034974656D20338F07044974656D2034",
expect: {commandQualifier: 0x00,
title: "Toolkit Menu",
items: [{identifier: 1, text: "Item 1"}, {identifier: 2, text: "Item 2"}, {identifier: 3, text: "Item 3"}, {identifier: 4, text: "Item 4"}]}},
items: [{identifier: 1, text: "项目一"},
{identifier: 2, text: "项目二"},
{identifier: 3, text: "项目三"},
{identifier: 4, text: "项目四"}]}},
// Test remove setup menu.
{command: "D00D81030125008202818285008F00",
{command: "D00D" + // Length
"8103012500" + // Command details
"82028182" + // Device identities
"8500" + // Alpha identifier
"8F00", // Item
expect: {commandQualifier: 0x00,
title: "",
items: [null]}},
];
function testSetupMenu(aCommand, aExpect) {
is(aCommand.commandNumber, 0x01, "commandNumber");
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");
is(aCommand.options.isHelpAvailable, !!(aCommand.commandQualifier & 0x80),
"isHelpAvailable");
is(aCommand.options.title, aExpect.title, "options.title");
for (let index in aExpect.items) {
let item = aCommand.options.items[index];
@ -181,13 +267,15 @@ function testSetupMenu(aCommand, aExpect) {
}
}
if (aExpect.icons) {
// icons is optional.
if ("icons" in aExpect) {
isIcons(aCommand.options.icons, aExpect.icons);
is(aCommand.options.iconSelfExplanatory, aExpect.iconSelfExplanatory,
"options.iconSelfExplanatory");
}
if (aExpect.nextActionList) {
// nextActionList is optional.
if ("nextActionList" in aExpect) {
for (let index in aExpect.nextActionList) {
is(aCommand.options.nextActionList[index], aExpect.nextActionList[index],
"options.nextActionList[" + index + "]");
@ -208,6 +296,12 @@ startTestCommon(function() {
// Wait onstkcommand event.
promises.push(waitForTargetEvent(icc, "stkcommand")
.then((aEvent) => testSetupMenu(aEvent.command, data.expect)));
// Wait icc-stkcommand system message.
promises.push(waitForSystemMessage("icc-stkcommand")
.then((aMessage) => {
is(aMessage.iccId, icc.iccInfo.iccid, "iccId");
testSetupMenu(aMessage.command, data.expect);
}));
// Send emulator command to generate stk unsolicited event.
promises.push(sendEmulatorStkPdu(data.command));

Просмотреть файл

@ -6,34 +6,43 @@ MARIONETTE_HEAD_JS = "head.js";
const TEST_DATA = [
// Start
{command: "d011810301270082028182a40101a503102030",
expect: {commandNumber: 0x01,
commandQualifier: MozIccManager.STK_TIMER_START,
{command: "D011" + // Length
"8103012700" + // Command details
"82028182" + // Device identities
"A40101" + // Timer identifier
"A503102030", // Timer value
expect: {commandQualifier: MozIccManager.STK_TIMER_START,
timerAction: MozIccManager.STK_TIMER_START,
timerId: 0x01,
timerValue: (0x01 * 60 * 60) + (0x02 * 60) + 0x03}},
// Deactivate
{command: "d00c810301270182028182a40104",
expect: {commandNumber: 0x01,
commandQualifier: MozIccManager.STK_TIMER_DEACTIVATE,
{command: "D00C" + // Length
"8103012701" + // Command details
"82028182" + // Device identities
"A40104", // Timer identifier
expect: {commandQualifier: MozIccManager.STK_TIMER_DEACTIVATE,
timerAction: MozIccManager.STK_TIMER_DEACTIVATE,
timerId: 0x04}},
// Get current value
{command: "d00c810301270282028182a40108",
expect: {commandNumber: 0x01,
commandQualifier: MozIccManager.STK_TIMER_GET_CURRENT_VALUE,
{command: "D00C" + // Length
"8103012702" + // Command details
"82028182" + // Device identities
"A40108", // Timer identifier
expect: {commandQualifier: MozIccManager.STK_TIMER_GET_CURRENT_VALUE,
timerAction: MozIccManager.STK_TIMER_GET_CURRENT_VALUE,
timerId: 0x08}},
];
function testTimerManagement(aCommand, aExpect) {
is(aCommand.commandNumber, 0x01, "commandNumber");
is(aCommand.typeOfCommand, MozIccManager.STK_CMD_TIMER_MANAGEMENT,
"typeOfCommand");
is(aCommand.commandQualifier, aExpect.commandQualifier, "commandQualifier");
is(aCommand.options.timerAction, aExpect.timerAction, "options.timerAction");
is(aCommand.options.timerId, aExpect.timerId, "options.timerId");
if (aExpect.timerValue) {
if ("timerValue" in aExpect) {
is(aCommand.options.timerValue, aExpect.timerValue, "options.timerValue");
}
}
@ -51,6 +60,12 @@ startTestCommon(function() {
// Wait onstkcommand event.
promises.push(waitForTargetEvent(icc, "stkcommand")
.then((aEvent) => testTimerManagement(aEvent.command, data.expect)));
// Wait icc-stkcommand system message.
promises.push(waitForSystemMessage("icc-stkcommand")
.then((aMessage) => {
is(aMessage.iccId, icc.iccInfo.iccid, "iccId");
testTimerManagement(aMessage.command, data.expect);
}));
// Send emulator command to generate stk unsolicited event.
promises.push(sendEmulatorStkPdu(data.command));

Просмотреть файл

@ -10692,6 +10692,8 @@ StkCommandParamsFactoryObject.prototype = {
* The value object of CommandDetails TLV.
* @param ctlvs
* The all TLVs in this proactive command.
* @param onComplete
* Callback to be called when complete.
*/
processRefresh: function(cmdDetails, ctlvs, onComplete) {
let refreshType = cmdDetails.commandQualifier;
@ -10720,8 +10722,11 @@ StkCommandParamsFactoryObject.prototype = {
* The value object of CommandDetails TLV.
* @param ctlvs
* The all TLVs in this proactive command.
* @param onComplete
* Callback to be called when complete.
*/
processPollInterval: function(cmdDetails, ctlvs, onComplete) {
// Duration is mandatory.
let ctlv = this.context.StkProactiveCmdHelper.searchForTag(
COMPREHENSIONTLV_TAG_DURATION, ctlvs);
if (!ctlv) {
@ -10741,6 +10746,8 @@ StkCommandParamsFactoryObject.prototype = {
* The value object of CommandDetails TLV.
* @param ctlvs
* The all TLVs in this proactive command.
* @param onComplete
* Callback to be called when complete.
*/
processPollOff: function(cmdDetails, ctlvs, onComplete) {
onComplete(null);
@ -10753,8 +10760,11 @@ StkCommandParamsFactoryObject.prototype = {
* The value object of CommandDetails TLV.
* @param ctlvs
* The all TLVs in this proactive command.
* @param onComplete
* Callback to be called when complete.
*/
processSetUpEventList: function(cmdDetails, ctlvs, onComplete) {
// Event list is mandatory.
let ctlv = this.context.StkProactiveCmdHelper.searchForTag(
COMPREHENSIONTLV_TAG_EVENT_LIST, ctlvs);
if (!ctlv) {
@ -10768,16 +10778,21 @@ StkCommandParamsFactoryObject.prototype = {
},
/**
* Construct a param for Select Item.
* Construct a param for Setup Menu.
*
* @param cmdDetails
* The value object of CommandDetails TLV.
* @param ctlvs
* The all TLVs in this proactive command.
* @param onComplete
* Callback to be called when complete.
*/
processSelectItem: function(cmdDetails, ctlvs, onComplete) {
processSetupMenu: function(cmdDetails, ctlvs, onComplete) {
let StkProactiveCmdHelper = this.context.StkProactiveCmdHelper;
let menu = {};
let menu = {
// Help information available.
isHelpAvailable: !!(cmdDetails.commandQualifier & 0x80)
};
let selectedCtlvs = StkProactiveCmdHelper.searchForSelectedTags(ctlvs, [
COMPREHENSIONTLV_TAG_ALPHA_ID,
@ -10788,11 +10803,13 @@ StkCommandParamsFactoryObject.prototype = {
COMPREHENSIONTLV_TAG_ICON_ID_LIST
]);
// Alpha identifier is optional.
let ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_ALPHA_ID);
if (ctlv) {
menu.title = ctlv.value.identifier;
}
// Item data object for item 1 is mandatory.
let menuCtlvs = selectedCtlvs[COMPREHENSIONTLV_TAG_ITEM];
if (!menuCtlvs) {
this.context.RIL.sendStkTerminalResponse({
@ -10802,32 +10819,26 @@ StkCommandParamsFactoryObject.prototype = {
}
menu.items = menuCtlvs.map(aCtlv => aCtlv.value);
// Item identifier is optional.
ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_ITEM_ID);
if (ctlv) {
menu.defaultItem = ctlv.value.identifier - 1;
}
if (cmdDetails.typeOfCommand == STK_CMD_SELECT_ITEM) {
// The 1st bit and 2nd bit determines the presentation type.
menu.presentationType = cmdDetails.commandQualifier & 0x03;
}
// Help information available.
if (cmdDetails.commandQualifier & 0x80) {
menu.isHelpAvailable = true;
}
// Items next action indicator is optional.
ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_NEXT_ACTION_IND);
if (ctlv) {
menu.nextActionList = ctlv.value;
}
// Icon identifier is optional.
let iconIdCtlvs = null;
let menuIconCtlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_ICON_ID);
if (menuIconCtlv) {
iconIdCtlvs = [menuIconCtlv];
}
// Item icon identifier list is optional.
ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_ICON_ID_LIST);
if (ctlv) {
if (!iconIdCtlvs) {
@ -10860,9 +10871,40 @@ StkCommandParamsFactoryObject.prototype = {
});
},
/**
* Construct a param for Select Item.
*
* @param cmdDetails
* The value object of CommandDetails TLV.
* @param ctlvs
* The all TLVs in this proactive command.
* @param onComplete
* Callback to be called when complete.
*/
processSelectItem: function(cmdDetails, ctlvs, onComplete) {
this.processSetupMenu(cmdDetails, ctlvs, (menu) => {
// The 1st bit and 2nd bit determines the presentation type.
menu.presentationType = cmdDetails.commandQualifier & 0x03;
onComplete(menu);
});
},
/**
* Construct a param for Display Text.
*
* @param cmdDetails
* The value object of CommandDetails TLV.
* @param ctlvs
* The all TLVs in this proactive command.
* @param onComplete
* Callback to be called when complete.
*/
processDisplayText: function(cmdDetails, ctlvs, onComplete) {
let StkProactiveCmdHelper = this.context.StkProactiveCmdHelper;
let textMsg = {};
let textMsg = {
isHighPriority: !!(cmdDetails.commandQualifier & 0x01),
userClear: !!(cmdDetails.commandQualifier & 0x80)
};
let selectedCtlvs = StkProactiveCmdHelper.searchForSelectedTags(ctlvs, [
COMPREHENSIONTLV_TAG_TEXT_STRING,
@ -10871,6 +10913,7 @@ StkCommandParamsFactoryObject.prototype = {
COMPREHENSIONTLV_TAG_ICON_ID
]);
// Text string is mandatory.
let ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_TEXT_STRING);
if (!ctlv) {
this.context.RIL.sendStkTerminalResponse({
@ -10880,31 +10923,32 @@ StkCommandParamsFactoryObject.prototype = {
}
textMsg.text = ctlv.value.textString;
ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_IMMEDIATE_RESPONSE);
if (ctlv) {
textMsg.responseNeeded = true;
}
// Immediate response is optional.
textMsg.responseNeeded =
!!(selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_IMMEDIATE_RESPONSE));
// Duration is optional.
ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_DURATION);
if (ctlv) {
textMsg.duration = ctlv.value;
}
// High priority.
if (cmdDetails.commandQualifier & 0x01) {
textMsg.isHighPriority = true;
}
// User clear.
if (cmdDetails.commandQualifier & 0x80) {
textMsg.userClear = true;
}
// Icon identifier is optional.
this.appendIconIfNecessary(selectedCtlvs[COMPREHENSIONTLV_TAG_ICON_ID] || null,
textMsg,
onComplete);
},
/**
* Construct a param for Setup Idle Mode Text.
*
* @param cmdDetails
* The value object of CommandDetails TLV.
* @param ctlvs
* The all TLVs in this proactive command.
* @param onComplete
* Callback to be called when complete.
*/
processSetUpIdleModeText: function(cmdDetails, ctlvs, onComplete) {
let StkProactiveCmdHelper = this.context.StkProactiveCmdHelper;
let textMsg = {};
@ -10914,6 +10958,7 @@ StkCommandParamsFactoryObject.prototype = {
COMPREHENSIONTLV_TAG_ICON_ID
]);
// Text string is mandatory.
let ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_TEXT_STRING);
if (!ctlv) {
this.context.RIL.sendStkTerminalResponse({
@ -10923,14 +10968,35 @@ StkCommandParamsFactoryObject.prototype = {
}
textMsg.text = ctlv.value.textString;
// Icon identifier is optional.
this.appendIconIfNecessary(selectedCtlvs[COMPREHENSIONTLV_TAG_ICON_ID] || null,
textMsg,
onComplete);
},
/**
* Construct a param for Get Inkey.
*
* @param cmdDetails
* The value object of CommandDetails TLV.
* @param ctlvs
* The all TLVs in this proactive command.
* @param onComplete
* Callback to be called when complete.
*/
processGetInkey: function(cmdDetails, ctlvs, onComplete) {
let StkProactiveCmdHelper = this.context.StkProactiveCmdHelper;
let input = {};
let input = {
minLength: 1,
maxLength: 1,
isAlphabet: !!(cmdDetails.commandQualifier & 0x01),
isUCS2: !!(cmdDetails.commandQualifier & 0x02),
// Character sets defined in bit 1 and bit 2 are disable and
// the YES/NO reponse is required.
isYesNoRequested: !!(cmdDetails.commandQualifier & 0x04),
// Help information available.
isHelpAvailable: !!(cmdDetails.commandQualifier & 0x80)
};
let selectedCtlvs = StkProactiveCmdHelper.searchForSelectedTags(ctlvs, [
COMPREHENSIONTLV_TAG_TEXT_STRING,
@ -10938,6 +11004,7 @@ StkCommandParamsFactoryObject.prototype = {
COMPREHENSIONTLV_TAG_ICON_ID
]);
// Text string is mandatory.
let ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_TEXT_STRING);
if (!ctlv) {
this.context.RIL.sendStkTerminalResponse({
@ -10947,44 +11014,40 @@ StkCommandParamsFactoryObject.prototype = {
}
input.text = ctlv.value.textString;
// duration
// Duration is optional.
ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_DURATION);
if (ctlv) {
input.duration = ctlv.value;
}
input.minLength = 1;
input.maxLength = 1;
// isAlphabet
if (cmdDetails.commandQualifier & 0x01) {
input.isAlphabet = true;
}
// UCS2
if (cmdDetails.commandQualifier & 0x02) {
input.isUCS2 = true;
}
// Character sets defined in bit 1 and bit 2 are disable and
// the YES/NO reponse is required.
if (cmdDetails.commandQualifier & 0x04) {
input.isYesNoRequested = true;
}
// Help information available.
if (cmdDetails.commandQualifier & 0x80) {
input.isHelpAvailable = true;
}
// Icon identifier is optional.
this.appendIconIfNecessary(selectedCtlvs[COMPREHENSIONTLV_TAG_ICON_ID] || null,
input,
onComplete);
},
/**
* Construct a param for Get Input.
*
* @param cmdDetails
* The value object of CommandDetails TLV.
* @param ctlvs
* The all TLVs in this proactive command.
* @param onComplete
* Callback to be called when complete.
*/
processGetInput: function(cmdDetails, ctlvs, onComplete) {
let StkProactiveCmdHelper = this.context.StkProactiveCmdHelper;
let input = {};
let input = {
isAlphabet: !!(cmdDetails.commandQualifier & 0x01),
isUCS2: !!(cmdDetails.commandQualifier & 0x02),
// User input shall not be revealed
hideInput: !!(cmdDetails.commandQualifier & 0x04),
// User input in SMS packed format
isPacked: !!(cmdDetails.commandQualifier & 0x08),
// Help information available.
isHelpAvailable: !!(cmdDetails.commandQualifier & 0x80)
};
let selectedCtlvs = StkProactiveCmdHelper.searchForSelectedTags(ctlvs, [
COMPREHENSIONTLV_TAG_TEXT_STRING,
@ -10993,6 +11056,7 @@ StkCommandParamsFactoryObject.prototype = {
COMPREHENSIONTLV_TAG_ICON_ID
]);
// Text string is mandatory.
let ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_TEXT_STRING);
if (!ctlv) {
this.context.RIL.sendStkTerminalResponse({
@ -11002,47 +11066,39 @@ StkCommandParamsFactoryObject.prototype = {
}
input.text = ctlv.value.textString;
// Response length is mandatory.
ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_RESPONSE_LENGTH);
if (ctlv) {
input.minLength = ctlv.value.minLength;
input.maxLength = ctlv.value.maxLength;
if (!ctlv) {
this.context.RIL.sendStkTerminalResponse({
command: cmdDetails,
resultCode: STK_RESULT_REQUIRED_VALUES_MISSING});
throw new Error("Stk Get Input: Required value missing : Response Length");
}
input.minLength = ctlv.value.minLength;
input.maxLength = ctlv.value.maxLength;
// Default text is optional.
ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_DEFAULT_TEXT);
if (ctlv) {
input.defaultText = ctlv.value.textString;
}
// Alphabet only
if (cmdDetails.commandQualifier & 0x01) {
input.isAlphabet = true;
}
// UCS2
if (cmdDetails.commandQualifier & 0x02) {
input.isUCS2 = true;
}
// User input shall not be revealed
if (cmdDetails.commandQualifier & 0x04) {
input.hideInput = true;
}
// User input in SMS packed format
if (cmdDetails.commandQualifier & 0x08) {
input.isPacked = true;
}
// Help information available.
if (cmdDetails.commandQualifier & 0x80) {
input.isHelpAvailable = true;
}
// Icon identifier is optional.
this.appendIconIfNecessary(selectedCtlvs[COMPREHENSIONTLV_TAG_ICON_ID] || null,
input,
onComplete);
},
/**
* Construct a param for SendSS/SMS/USSD/DTMF.
*
* @param cmdDetails
* The value object of CommandDetails TLV.
* @param ctlvs
* The all TLVs in this proactive command.
* @param onComplete
* Callback to be called when complete.
*/
processEventNotify: function(cmdDetails, ctlvs, onComplete) {
let StkProactiveCmdHelper = this.context.StkProactiveCmdHelper;
let textMsg = {};
@ -11052,16 +11108,28 @@ StkCommandParamsFactoryObject.prototype = {
COMPREHENSIONTLV_TAG_ICON_ID
]);
// Alpha identifier is optional.
let ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_ALPHA_ID);
if (ctlv) {
textMsg.text = ctlv.value.identifier;
}
// Icon identifier is optional.
this.appendIconIfNecessary(selectedCtlvs[COMPREHENSIONTLV_TAG_ICON_ID] || null,
textMsg,
onComplete);
},
/**
* Construct a param for Setup Call.
*
* @param cmdDetails
* The value object of CommandDetails TLV.
* @param ctlvs
* The all TLVs in this proactive command.
* @param onComplete
* Callback to be called when complete.
*/
processSetupCall: function(cmdDetails, ctlvs, onComplete) {
let StkProactiveCmdHelper = this.context.StkProactiveCmdHelper;
let call = {};
@ -11075,6 +11143,7 @@ StkCommandParamsFactoryObject.prototype = {
COMPREHENSIONTLV_TAG_DURATION
]);
// Address is mandatory.
let ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_ADDRESS);
if (!ctlv) {
this.context.RIL.sendStkTerminalResponse({
@ -11084,24 +11153,27 @@ StkCommandParamsFactoryObject.prototype = {
}
call.address = ctlv.value.number;
// Alpha identifier (user confirmation phase) is optional.
ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_ALPHA_ID);
if (ctlv) {
confirmMessage.text = ctlv.value.identifier;
call.confirmMessage = confirmMessage;
}
// Alpha identifier (call set up phase) is optional.
ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_ALPHA_ID);
if (ctlv) {
callMessage.text = ctlv.value.identifier;
call.callMessage = callMessage;
}
// see 3GPP TS 31.111 section 6.4.13
// Duration is optional.
ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_DURATION);
if (ctlv) {
call.duration = ctlv.value;
}
// Icon identifier is optional.
let iconIdCtlvs = selectedCtlvs[COMPREHENSIONTLV_TAG_ICON_ID] || null;
this.loadIcons(iconIdCtlvs, (aIcons) => {
if (aIcons) {
@ -11122,9 +11194,21 @@ StkCommandParamsFactoryObject.prototype = {
});
},
/**
* Construct a param for Launch Browser.
*
* @param cmdDetails
* The value object of CommandDetails TLV.
* @param ctlvs
* The all TLVs in this proactive command.
* @param onComplete
* Callback to be called when complete.
*/
processLaunchBrowser: function(cmdDetails, ctlvs, onComplete) {
let StkProactiveCmdHelper = this.context.StkProactiveCmdHelper;
let browser = {};
let browser = {
mode: cmdDetails.commandQualifier & 0x03
};
let confirmMessage = {};
let selectedCtlvs = StkProactiveCmdHelper.searchForSelectedTags(ctlvs, [
@ -11133,6 +11217,7 @@ StkCommandParamsFactoryObject.prototype = {
COMPREHENSIONTLV_TAG_ICON_ID
]);
// URL is mandatory.
let ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_URL);
if (!ctlv) {
this.context.RIL.sendStkTerminalResponse({
@ -11142,14 +11227,14 @@ StkCommandParamsFactoryObject.prototype = {
}
browser.url = ctlv.value.url;
browser.mode = cmdDetails.commandQualifier & 0x03;
// Alpha identifier is optional.
ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_ALPHA_ID);
if (ctlv) {
confirmMessage.text = ctlv.value.identifier;
browser.confirmMessage = confirmMessage;
}
// Icon identifier is optional.
let iconIdCtlvs = selectedCtlvs[COMPREHENSIONTLV_TAG_ICON_ID] || null;
this.loadIcons(iconIdCtlvs, (aIcons) => {
if (aIcons) {
@ -11163,9 +11248,22 @@ StkCommandParamsFactoryObject.prototype = {
});
},
/**
* Construct a param for Play Tone.
*
* @param cmdDetails
* The value object of CommandDetails TLV.
* @param ctlvs
* The all TLVs in this proactive command.
* @param onComplete
* Callback to be called when complete.
*/
processPlayTone: function(cmdDetails, ctlvs, onComplete) {
let StkProactiveCmdHelper = this.context.StkProactiveCmdHelper;
let playTone = {};
let playTone = {
// The vibrate is only defined in TS 102.223.
isVibrate: !!(cmdDetails.commandQualifier & 0x01)
};
let selectedCtlvs = StkProactiveCmdHelper.searchForSelectedTags(ctlvs, [
COMPREHENSIONTLV_TAG_ALPHA_ID,
@ -11174,36 +11272,39 @@ StkCommandParamsFactoryObject.prototype = {
COMPREHENSIONTLV_TAG_ICON_ID
]);
// Alpha identifier is optional.
let ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_ALPHA_ID);
if (ctlv) {
playTone.text = ctlv.value.identifier;
}
// Tone is optional.
ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_TONE);
if (ctlv) {
playTone.tone = ctlv.value.tone;
}
// Duration is optional.
ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_DURATION);
if (ctlv) {
playTone.duration = ctlv.value;
}
// vibrate is only defined in TS 102.223
playTone.isVibrate = (cmdDetails.commandQualifier & 0x01) !== 0x00;
// Icon identifier is optional.
this.appendIconIfNecessary(selectedCtlvs[COMPREHENSIONTLV_TAG_ICON_ID] || null,
playTone,
onComplete);
},
/**
* Construct a param for Provide Local Information
* Construct a param for Provide Local Information.
*
* @param cmdDetails
* The value object of CommandDetails TLV.
* @param ctlvs
* The all TLVs in this proactive command.
* @param onComplete
* Callback to be called when complete.
*/
processProvideLocalInfo: function(cmdDetails, ctlvs, onComplete) {
let provideLocalInfo = {
@ -11213,6 +11314,16 @@ StkCommandParamsFactoryObject.prototype = {
onComplete(provideLocalInfo);
},
/**
* Construct a param for Timer Management.
*
* @param cmdDetails
* The value object of CommandDetails TLV.
* @param ctlvs
* The all TLVs in this proactive command.
* @param onComplete
* Callback to be called when complete.
*/
processTimerManagement: function(cmdDetails, ctlvs, onComplete) {
let StkProactiveCmdHelper = this.context.StkProactiveCmdHelper;
let timer = {
@ -11224,11 +11335,17 @@ StkCommandParamsFactoryObject.prototype = {
COMPREHENSIONTLV_TAG_TIMER_VALUE
]);
// Timer identifier is mandatory.
let ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_TIMER_IDENTIFIER);
if (ctlv) {
timer.timerId = ctlv.value.timerId;
if (!ctlv) {
this.context.RIL.sendStkTerminalResponse({
command: cmdDetails,
resultCode: STK_RESULT_REQUIRED_VALUES_MISSING});
throw new Error("Stk Timer Management: Required value missing : Timer Identifier");
}
timer.timerId = ctlv.value.timerId;
// Timer value is conditional.
ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_TIMER_VALUE);
if (ctlv) {
timer.timerValue = ctlv.value.timerValue;
@ -11244,6 +11361,8 @@ StkCommandParamsFactoryObject.prototype = {
* The value object of CommandDetails TLV.
* @param ctlvs
* The all TLVs in this proactive command.
* @param onComplete
* Callback to be called when complete.
*/
processBipMessage: function(cmdDetails, ctlvs, onComplete) {
let StkProactiveCmdHelper = this.context.StkProactiveCmdHelper;
@ -11254,11 +11373,13 @@ StkCommandParamsFactoryObject.prototype = {
COMPREHENSIONTLV_TAG_ICON_ID
]);
// Alpha identifier is optional.
let ctlv = selectedCtlvs.retrieve(COMPREHENSIONTLV_TAG_ALPHA_ID);
if (ctlv) {
bipMsg.text = ctlv.value.identifier;
}
// Icon identifier is optional.
this.appendIconIfNecessary(selectedCtlvs[COMPREHENSIONTLV_TAG_ICON_ID] || null,
bipMsg,
onComplete);
@ -11280,7 +11401,7 @@ StkCommandParamsFactoryObject.prototype[STK_CMD_SET_UP_EVENT_LIST] = function ST
return this.processSetUpEventList(cmdDetails, ctlvs, onComplete);
};
StkCommandParamsFactoryObject.prototype[STK_CMD_SET_UP_MENU] = function STK_CMD_SET_UP_MENU(cmdDetails, ctlvs, onComplete) {
return this.processSelectItem(cmdDetails, ctlvs, onComplete);
return this.processSetupMenu(cmdDetails, ctlvs, onComplete);
};
StkCommandParamsFactoryObject.prototype[STK_CMD_SELECT_ITEM] = function STK_CMD_SELECT_ITEM(cmdDetails, ctlvs, onComplete) {
return this.processSelectItem(cmdDetails, ctlvs, onComplete);

Просмотреть файл

@ -770,6 +770,7 @@ add_test(function test_icc_notify_stk_proactive_command() {
typeOfCommand: RIL.STK_CMD_SELECT_ITEM,
commandQualifier: RIL.STK_PRESENTATION_TYPE_NOT_SPECIFIED,
options: {
title: null,
items: [
{ identifier: 0x01, text: "Menu Item 1" },
{ identifier: 0x02, text: "Menu Item 2" },
@ -915,6 +916,7 @@ add_test(function test_icc_notify_stk_proactive_command() {
isUCS2: false,
isYesNoRequested: true,
isHelpAvailable: true,
defaultText: null,
iconSelfExplanatory: false,
icons: [colorIcon]
}
@ -934,6 +936,7 @@ add_test(function test_icc_notify_stk_proactive_command() {
hideInput: true,
isPacked: true,
isHelpAvailable: false,
defaultText: null,
iconSelfExplanatory: true,
icons: [basicIcon]
}
@ -1001,6 +1004,7 @@ add_test(function test_icc_notify_stk_proactive_command() {
typeOfCommand: RIL.STK_CMD_PLAY_TONE,
commandQualifier: 0x01, // isVibrate
options: {
text: null,
isVibrate: true
}
},
@ -1048,6 +1052,7 @@ add_test(function test_icc_notify_stk_proactive_command() {
typeOfCommand: RIL.STK_CMD_OPEN_CHANNEL,
commandQualifier: 0x00, //RFU
options: {
text: null,
}
},
// STK_CMD_OPEN_CHANNEL with optional properties.
@ -1078,6 +1083,7 @@ add_test(function test_icc_notify_stk_proactive_command() {
typeOfCommand: RIL.STK_CMD_SEND_DATA,
commandQualifier: 0x00, //RFU
options: {
text: null,
iconSelfExplanatory: false,
icons: [basicIcon]
}

Просмотреть файл

@ -507,9 +507,8 @@ TelephonyService.prototype = {
return;
}
// Dial a non-emergency call when only emergency call is allowed.
if (!isEmergencyNumber &&
(aIsDialEmergency || this._isEmergencyOnly(aClientId))) {
// DialEmergency accepts only emergency number.
if (aIsDialEmergency && !isEmergencyNumber) {
if (DEBUG) debug("Error: Dail a non-emergency by dialEmergency. Drop.");
aCallback.notifyError(DIAL_ERROR_BAD_NUMBER);
return;
@ -591,6 +590,11 @@ TelephonyService.prototype = {
}
let isEmergency = gDialNumberUtils.isEmergency(aNumber);
if (!isEmergency && this._isEmergencyOnly()) {
if (DEBUG) debug("Error: Dail a normal call when emergencyCallsOnly. Drop");
aCallback.notifyError(DIAL_ERROR_BAD_NUMBER);
}
if (isEmergency) {
// Automatically select a proper clientId for emergency call.
aClientId = gRadioInterfaceLayer.getClientIdForEmergencyCall() ;