dom/icc/tests/marionette/test_stk_send_sms.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/icc/tests/marionette/test_stk_send_sms.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,240 @@
     1.4 +/* Any copyright is dedicated to the Public Domain.
     1.5 +   http://creativecommons.org/publicdomain/zero/1.0/ */
     1.6 +
     1.7 +MARIONETTE_HEAD_JS = "stk_helper.js";
     1.8 +
     1.9 +function testSendSMS(command, expect) {
    1.10 +  log("STK CMD " + JSON.stringify(command));
    1.11 +  is(command.typeOfCommand, iccManager.STK_CMD_SEND_SMS, expect.name);
    1.12 +  is(command.commandQualifier, expect.commandQualifier, expect.name);
    1.13 +  if (command.options.text) {
    1.14 +    is(command.options.text, expect.title, expect.name);
    1.15 +  }
    1.16 +
    1.17 +  runNextTest();
    1.18 +}
    1.19 +
    1.20 +let tests = [
    1.21 +  {command: "d037810301130082028183850753656e6420534d86099111223344556677f88b180100099110325476f840f40c54657374204d657373616765",
    1.22 +   func: testSendSMS,
    1.23 +   expect: {name: "send_sms_cmd_1",
    1.24 +            commandQualifier: 0x00,
    1.25 +            title: "Send SM"}},
    1.26 +  {command: "d032810301130182028183850753656e6420534d86099111223344556677f88b130100099110325476f840f40753656e6420534d",
    1.27 +   func: testSendSMS,
    1.28 +   expect: {name: "send_sms_cmd_2",
    1.29 +            commandQualifier: 0x01,
    1.30 +            title: "Send SM"}},
    1.31 +  {command: "d03d810301130082028183850d53686f7274204d65737361676586099111223344556677f88b180100099110325476f840f00d53f45b4e0735cbf379f85c06",
    1.32 +   func: testSendSMS,
    1.33 +   expect: {name: "send_sms_cmd_3",
    1.34 +            commandQualifier: 0x00,
    1.35 +            title: "Short Message"}},
    1.36 +  {command: "d081fd810301130182028183853854686520616464726573732064617461206f626a65637420686f6c6473207468652052501144657374696e6174696f6e114164647265737386099111223344556677f88b81ac0100099110325476f840f4a054776f2074797065732061726520646566696e65643a202d20412073686f7274206d65737361676520746f2062652073656e7420746f20746865206e6574776f726b20696e20616e20534d532d5355424d4954206d6573736167652c206f7220616e20534d532d434f4d4d414e44206d6573736167652c20776865726520746865207573657220646174612063616e20626520706173736564207472616e7370",
    1.37 +   func: testSendSMS,
    1.38 +   expect: {name: "send_sms_cmd_4",
    1.39 +            commandQualifier: 0x01,
    1.40 +            title: "The address data object holds the RP_Destination_Address"}},
    1.41 +  {command: "d081e9810301130082028183853854686520616464726573732064617461206f626a65637420686f6c6473207468652052502044657374696e6174696f6e204164647265737386099111223344556677f88b81980100099110325476f840f0a0d4fb1b44cfc3cb7350585e0691cbe6b4bb4cd6815aa020688e7ecbe9a076793e0f9fcb20fa1b242e83e665371d447f83e8e832c85da6dfdff23528ed0685dda06973da9a5685cd2415d42ecfe7e17399057acb41613768da9cb686cf6633e82482dae5f93c7c2eb3407774595e06d1d165507d5e9683c8617a18340ebb41e232081e9ecfcb64105d1e76cfe1",
    1.42 +   func: testSendSMS,
    1.43 +   expect: {name: "send_sms_cmd_5",
    1.44 +            commandQualifier: 0x00,
    1.45 +            title: "The address data object holds the RP Destination Address"}},
    1.46 +  {command: "d081fd8103011300820281838581e654776f2074797065732061726520646566696e65643a202d20412073686f7274206d65737361676520746f2062652073656e7420746f20746865206e6574776f726b20696e20616e20534d532d5355424d4954206d6573736167652c206f7220616e20534d532d434f4d4d414e44206d6573736167652c20776865726520746865207573657220646174612063616e20626520706173736564207472616e73706172656e746c793b202d20412073686f7274206d65737361676520746f2062652073656e7420746f20746865206e6574776f726b20696e20616e20534d532d5355424d4954208b09010002911040f00120",
    1.47 +   func: testSendSMS,
    1.48 +   expect: {name: "send_sms_cmd_6",
    1.49 +            commandQualifier: 0x00,
    1.50 +            title: "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 "}},
    1.51 +  {command: "d030810301130082028183850086099111223344556677f88b180100099110325476f840f40c54657374204d657373616765",
    1.52 +   func: testSendSMS,
    1.53 +   expect: {name: "send_sms_cmd_7",
    1.54 +            commandQualifier: 0x00,
    1.55 +            title: ""}},
    1.56 +  {command: "d05581030113008202818385198004170414042004100412042104220412042304190422041586099111223344556677f88b240100099110325476f8400818041704140420041004120421042204120423041904220415",
    1.57 +   func: testSendSMS,
    1.58 +   expect: {name: "send_sms_cmd_8",
    1.59 +            commandQualifier: 0x00,
    1.60 +            title: "ЗДРАВСТВУЙТЕ"}},
    1.61 +  {command: "d04b810301130082028183850f810c089794a09092a1a292a399a29586099111223344556677f88b240100099110325476f8400818041704140420041004120421042204120423041904220415",
    1.62 +   func: testSendSMS,
    1.63 +   expect: {name: "send_sms_cmd_9",
    1.64 +            commandQualifier: 0x00,
    1.65 +            title: "ЗДРАВСТВУЙТЕ"}},
    1.66 +  {command: "d04c8103011300820281838510820c041087849080829192829389928586099111223344556677f88b240100099110325476f8400818041704140420041004120421042204120423041904220415",
    1.67 +   func: testSendSMS,
    1.68 +   expect: {name: "send_sms_cmd_9",
    1.69 +            commandQualifier: 0x00,
    1.70 +            title: "ЗДРАВСТВУЙТЕ"}},
    1.71 +  {command: "d03b81030113008202818385074e4f2049434f4e86099111223344556677f88b180100099110325476f840f40c54657374204d6573736167659e020001",
    1.72 +   func: testSendSMS,
    1.73 +   expect: {name: "send_sms_cmd_10",
    1.74 +            commandQualifier: 0x00,
    1.75 +            title: "NO ICON"}},
    1.76 +  {command: "d03b810301130082028183850753656e6420534d86099111223344556677f88b180100099110325476f840f40c54657374204d6573736167651e020101",
    1.77 +   func: testSendSMS,
    1.78 +   expect: {name: "send_sms_cmd_11",
    1.79 +            commandQualifier: 0x00,
    1.80 +            title: "Send SM"}},
    1.81 +  {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001000b4",
    1.82 +   func: testSendSMS,
    1.83 +   expect: {name: "send_sms_cmd_12",
    1.84 +            commandQualifier: 0x00,
    1.85 +            title: "Text Attribute 1"}},
    1.86 +  {command: "d0268103011300820281838510546578742041747472696275746520328b09010002911040f00120",
    1.87 +   func: testSendSMS,
    1.88 +   expect: {name: "send_sms_cmd_13",
    1.89 +            commandQualifier: 0x00,
    1.90 +            title: "Text Attribute 2"}},
    1.91 +  {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001001b4",
    1.92 +   func: testSendSMS,
    1.93 +   expect: {name: "send_sms_cmd_14",
    1.94 +            commandQualifier: 0x00,
    1.95 +            title: "Text Attribute 1"}},
    1.96 +  {command: "d0268103011300820281838510546578742041747472696275746520328b09010002911040f00120",
    1.97 +   func: testSendSMS,
    1.98 +   expect: {name: "send_sms_cmd_15",
    1.99 +            commandQualifier: 0x00,
   1.100 +            title: "Text Attribute 2"}},
   1.101 +  {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001002b4",
   1.102 +   func: testSendSMS,
   1.103 +   expect: {name: "send_sms_cmd_16",
   1.104 +            commandQualifier: 0x00,
   1.105 +            title: "Text Attribute 1"}},
   1.106 +  {command: "d0268103011300820281838510546578742041747472696275746520328b09010002911040f00120",
   1.107 +   func: testSendSMS,
   1.108 +   expect: {name: "send_sms_cmd_17",
   1.109 +            commandQualifier: 0x00,
   1.110 +            title: "Text Attribute 2"}},
   1.111 +  {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001004b4",
   1.112 +   func: testSendSMS,
   1.113 +   expect: {name: "send_sms_cmd_18",
   1.114 +            commandQualifier: 0x00,
   1.115 +            title: "Text Attribute 1"}},
   1.116 +  {command: "d02c8103011300820281838510546578742041747472696275746520328b09010002911040f00120d004001000b4",
   1.117 +   func: testSendSMS,
   1.118 +   expect: {name: "send_sms_cmd_19",
   1.119 +            commandQualifier: 0x00,
   1.120 +            title: "Text Attribute 2"}},
   1.121 +  {command: "d0268103011300820281838510546578742041747472696275746520338b09010002911040f00120",
   1.122 +   func: testSendSMS,
   1.123 +   expect: {name: "send_sms_cmd_20",
   1.124 +            commandQualifier: 0x00,
   1.125 +            title: "Text Attribute 3"}},
   1.126 +  {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001008b4",
   1.127 +   func: testSendSMS,
   1.128 +   expect: {name: "send_sms_cmd_21",
   1.129 +            commandQualifier: 0x00,
   1.130 +            title: "Text Attribute 1"}},
   1.131 +  {command: "d02c8103011300820281838510546578742041747472696275746520328b09010002911040f00120d004001000b4",
   1.132 +   func: testSendSMS,
   1.133 +   expect: {name: "send_sms_cmd_22",
   1.134 +            commandQualifier: 0x00,
   1.135 +            title: "Text Attribute 2"}},
   1.136 +  {command: "d0268103011300820281838510546578742041747472696275746520338b09010002911040f00120",
   1.137 +   func: testSendSMS,
   1.138 +   expect: {name: "send_sms_cmd_23",
   1.139 +            commandQualifier: 0x00,
   1.140 +            title: "Text Attribute 3"}},
   1.141 +  {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001010b4",
   1.142 +   func: testSendSMS,
   1.143 +   expect: {name: "send_sms_cmd_24",
   1.144 +            commandQualifier: 0x00,
   1.145 +            title: "Text Attribute 1"}},
   1.146 +  {command: "d02c8103011300820281838510546578742041747472696275746520328b09010002911040f00120d004001000b4",
   1.147 +   func: testSendSMS,
   1.148 +   expect: {name: "send_sms_cmd_25",
   1.149 +            commandQualifier: 0x00,
   1.150 +            title: "Text Attribute 2"}},
   1.151 +  {command: "d0268103011300820281838510546578742041747472696275746520338b09010002911040f00120",
   1.152 +   func: testSendSMS,
   1.153 +   expect: {name: "send_sms_cmd_26",
   1.154 +            commandQualifier: 0x00,
   1.155 +            title: "Text Attribute 3"}},
   1.156 +  {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001020b4",
   1.157 +   func: testSendSMS,
   1.158 +   expect: {name: "send_sms_cmd_27",
   1.159 +            commandQualifier: 0x00,
   1.160 +            title: "Text Attribute 1"}},
   1.161 +  {command: "d02c8103011300820281838510546578742041747472696275746520328b09010002911040f00120d004001000b4",
   1.162 +   func: testSendSMS,
   1.163 +   expect: {name: "send_sms_cmd_28",
   1.164 +            commandQualifier: 0x00,
   1.165 +            title: "Text Attribute 2"}},
   1.166 +  {command: "d0268103011300820281838510546578742041747472696275746520338b09010002911040f00120",
   1.167 +   func: testSendSMS,
   1.168 +   expect: {name: "send_sms_cmd_29",
   1.169 +            commandQualifier: 0x00,
   1.170 +            title: "Text Attribute 3"}},
   1.171 +  {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001040b4",
   1.172 +   func: testSendSMS,
   1.173 +   expect: {name: "send_sms_cmd_30",
   1.174 +            commandQualifier: 0x00,
   1.175 +            title: "Text Attribute 1"}},
   1.176 +  {command: "d02c8103011300820281838510546578742041747472696275746520328b09010002911040f00120d004001000b4",
   1.177 +   func: testSendSMS,
   1.178 +   expect: {name: "send_sms_cmd_31",
   1.179 +            commandQualifier: 0x00,
   1.180 +            title: "Text Attribute 2"}},
   1.181 +  {command: "d0268103011300820281838510546578742041747472696275746520338b09010002911040f00120",
   1.182 +   func: testSendSMS,
   1.183 +   expect: {name: "send_sms_cmd_32",
   1.184 +            commandQualifier: 0x00,
   1.185 +            title: "Text Attribute 3"}},
   1.186 +  {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001080b4",
   1.187 +   func: testSendSMS,
   1.188 +   expect: {name: "send_sms_cmd_33",
   1.189 +            commandQualifier: 0x00,
   1.190 +            title: "Text Attribute 1"}},
   1.191 +  {command: "d02c8103011300820281838510546578742041747472696275746520328b09010002911040f00120d004001000b4",
   1.192 +   func: testSendSMS,
   1.193 +   expect: {name: "send_sms_cmd_34",
   1.194 +            commandQualifier: 0x00,
   1.195 +            title: "Text Attribute 2"}},
   1.196 +  {command: "d0268103011300820281838510546578742041747472696275746520338b09010002911040f00120",
   1.197 +   func: testSendSMS,
   1.198 +   expect: {name: "send_sms_cmd_35",
   1.199 +            commandQualifier: 0x00,
   1.200 +            title: "Text Attribute 3"}},
   1.201 +  {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001000b4",
   1.202 +   func: testSendSMS,
   1.203 +   expect: {name: "send_sms_cmd_36",
   1.204 +            commandQualifier: 0x00,
   1.205 +            title: "Text Attribute 1"}},
   1.206 +  {command: "d0268103011300820281838510546578742041747472696275746520328b09010002911040f00120",
   1.207 +   func: testSendSMS,
   1.208 +   expect: {name: "send_sms_cmd_37",
   1.209 +            commandQualifier: 0x00,
   1.210 +            title: "Text Attribute 2"}},
   1.211 +  {command: "d02d8103011300820281838505804e2d4e0086099111223344556677f88b100100099110325476f84008044e2d4e00",
   1.212 +   func: testSendSMS,
   1.213 +   expect: {name: "send_sms_cmd_38",
   1.214 +            commandQualifier: 0x00,
   1.215 +            title: "中一"}},
   1.216 +  {command: "d02d810301130082028183850581029cad8086099111223344556677f88b100100099110325476f84008044e2d4e00",
   1.217 +   func: testSendSMS,
   1.218 +   expect: {name: "send_sms_cmd_39",
   1.219 +            commandQualifier: 0x00,
   1.220 +            title: "中一"}},
   1.221 +  {command: "d02e810301130082028183850682024e00ad8086099111223344556677f88b100100099110325476f84008044e2d4e00",
   1.222 +   func: testSendSMS,
   1.223 +   expect: {name: "send_sms_cmd_40",
   1.224 +            commandQualifier: 0x00,
   1.225 +            title: "中一"}},
   1.226 +  {command: "d0358103011300820281838509800038003030eb003086099111223344556677f88b140100099110325476f84008080038003030eb0031",
   1.227 +   func: testSendSMS,
   1.228 +   expect: {name: "send_sms_cmd_41",
   1.229 +            commandQualifier: 0x00,
   1.230 +            title: "80ル0"}},
   1.231 +  {command: "d03381030113008202818385078104613831eb3186099111223344556677f88b140100099110325476f84008080038003030eb0032",
   1.232 +   func: testSendSMS,
   1.233 +   expect: {name: "send_sms_cmd_42",
   1.234 +            commandQualifier: 0x00,
   1.235 +            title: "81ル1"}},
   1.236 +  {command: "d0348103011300820281838508820430a03832cb3286099111223344556677f88b140100099110325476f84008080038003030eb0033",
   1.237 +   func: testSendSMS,
   1.238 +   expect: {name: "send_sms_cmd_43",
   1.239 +            commandQualifier: 0x00,
   1.240 +            title: "82ル2"}}
   1.241 +];
   1.242 +
   1.243 +runNextTest();

mercurial