dom/icc/tests/marionette/test_stk_send_sms.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /* Any copyright is dedicated to the Public Domain.
michael@0 2 http://creativecommons.org/publicdomain/zero/1.0/ */
michael@0 3
michael@0 4 MARIONETTE_HEAD_JS = "stk_helper.js";
michael@0 5
michael@0 6 function testSendSMS(command, expect) {
michael@0 7 log("STK CMD " + JSON.stringify(command));
michael@0 8 is(command.typeOfCommand, iccManager.STK_CMD_SEND_SMS, expect.name);
michael@0 9 is(command.commandQualifier, expect.commandQualifier, expect.name);
michael@0 10 if (command.options.text) {
michael@0 11 is(command.options.text, expect.title, expect.name);
michael@0 12 }
michael@0 13
michael@0 14 runNextTest();
michael@0 15 }
michael@0 16
michael@0 17 let tests = [
michael@0 18 {command: "d037810301130082028183850753656e6420534d86099111223344556677f88b180100099110325476f840f40c54657374204d657373616765",
michael@0 19 func: testSendSMS,
michael@0 20 expect: {name: "send_sms_cmd_1",
michael@0 21 commandQualifier: 0x00,
michael@0 22 title: "Send SM"}},
michael@0 23 {command: "d032810301130182028183850753656e6420534d86099111223344556677f88b130100099110325476f840f40753656e6420534d",
michael@0 24 func: testSendSMS,
michael@0 25 expect: {name: "send_sms_cmd_2",
michael@0 26 commandQualifier: 0x01,
michael@0 27 title: "Send SM"}},
michael@0 28 {command: "d03d810301130082028183850d53686f7274204d65737361676586099111223344556677f88b180100099110325476f840f00d53f45b4e0735cbf379f85c06",
michael@0 29 func: testSendSMS,
michael@0 30 expect: {name: "send_sms_cmd_3",
michael@0 31 commandQualifier: 0x00,
michael@0 32 title: "Short Message"}},
michael@0 33 {command: "d081fd810301130182028183853854686520616464726573732064617461206f626a65637420686f6c6473207468652052501144657374696e6174696f6e114164647265737386099111223344556677f88b81ac0100099110325476f840f4a054776f2074797065732061726520646566696e65643a202d20412073686f7274206d65737361676520746f2062652073656e7420746f20746865206e6574776f726b20696e20616e20534d532d5355424d4954206d6573736167652c206f7220616e20534d532d434f4d4d414e44206d6573736167652c20776865726520746865207573657220646174612063616e20626520706173736564207472616e7370",
michael@0 34 func: testSendSMS,
michael@0 35 expect: {name: "send_sms_cmd_4",
michael@0 36 commandQualifier: 0x01,
michael@0 37 title: "The address data object holds the RP_Destination_Address"}},
michael@0 38 {command: "d081e9810301130082028183853854686520616464726573732064617461206f626a65637420686f6c6473207468652052502044657374696e6174696f6e204164647265737386099111223344556677f88b81980100099110325476f840f0a0d4fb1b44cfc3cb7350585e0691cbe6b4bb4cd6815aa020688e7ecbe9a076793e0f9fcb20fa1b242e83e665371d447f83e8e832c85da6dfdff23528ed0685dda06973da9a5685cd2415d42ecfe7e17399057acb41613768da9cb686cf6633e82482dae5f93c7c2eb3407774595e06d1d165507d5e9683c8617a18340ebb41e232081e9ecfcb64105d1e76cfe1",
michael@0 39 func: testSendSMS,
michael@0 40 expect: {name: "send_sms_cmd_5",
michael@0 41 commandQualifier: 0x00,
michael@0 42 title: "The address data object holds the RP Destination Address"}},
michael@0 43 {command: "d081fd8103011300820281838581e654776f2074797065732061726520646566696e65643a202d20412073686f7274206d65737361676520746f2062652073656e7420746f20746865206e6574776f726b20696e20616e20534d532d5355424d4954206d6573736167652c206f7220616e20534d532d434f4d4d414e44206d6573736167652c20776865726520746865207573657220646174612063616e20626520706173736564207472616e73706172656e746c793b202d20412073686f7274206d65737361676520746f2062652073656e7420746f20746865206e6574776f726b20696e20616e20534d532d5355424d4954208b09010002911040f00120",
michael@0 44 func: testSendSMS,
michael@0 45 expect: {name: "send_sms_cmd_6",
michael@0 46 commandQualifier: 0x00,
michael@0 47 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 "}},
michael@0 48 {command: "d030810301130082028183850086099111223344556677f88b180100099110325476f840f40c54657374204d657373616765",
michael@0 49 func: testSendSMS,
michael@0 50 expect: {name: "send_sms_cmd_7",
michael@0 51 commandQualifier: 0x00,
michael@0 52 title: ""}},
michael@0 53 {command: "d05581030113008202818385198004170414042004100412042104220412042304190422041586099111223344556677f88b240100099110325476f8400818041704140420041004120421042204120423041904220415",
michael@0 54 func: testSendSMS,
michael@0 55 expect: {name: "send_sms_cmd_8",
michael@0 56 commandQualifier: 0x00,
michael@0 57 title: "ЗДРАВСТВУЙТЕ"}},
michael@0 58 {command: "d04b810301130082028183850f810c089794a09092a1a292a399a29586099111223344556677f88b240100099110325476f8400818041704140420041004120421042204120423041904220415",
michael@0 59 func: testSendSMS,
michael@0 60 expect: {name: "send_sms_cmd_9",
michael@0 61 commandQualifier: 0x00,
michael@0 62 title: "ЗДРАВСТВУЙТЕ"}},
michael@0 63 {command: "d04c8103011300820281838510820c041087849080829192829389928586099111223344556677f88b240100099110325476f8400818041704140420041004120421042204120423041904220415",
michael@0 64 func: testSendSMS,
michael@0 65 expect: {name: "send_sms_cmd_9",
michael@0 66 commandQualifier: 0x00,
michael@0 67 title: "ЗДРАВСТВУЙТЕ"}},
michael@0 68 {command: "d03b81030113008202818385074e4f2049434f4e86099111223344556677f88b180100099110325476f840f40c54657374204d6573736167659e020001",
michael@0 69 func: testSendSMS,
michael@0 70 expect: {name: "send_sms_cmd_10",
michael@0 71 commandQualifier: 0x00,
michael@0 72 title: "NO ICON"}},
michael@0 73 {command: "d03b810301130082028183850753656e6420534d86099111223344556677f88b180100099110325476f840f40c54657374204d6573736167651e020101",
michael@0 74 func: testSendSMS,
michael@0 75 expect: {name: "send_sms_cmd_11",
michael@0 76 commandQualifier: 0x00,
michael@0 77 title: "Send SM"}},
michael@0 78 {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001000b4",
michael@0 79 func: testSendSMS,
michael@0 80 expect: {name: "send_sms_cmd_12",
michael@0 81 commandQualifier: 0x00,
michael@0 82 title: "Text Attribute 1"}},
michael@0 83 {command: "d0268103011300820281838510546578742041747472696275746520328b09010002911040f00120",
michael@0 84 func: testSendSMS,
michael@0 85 expect: {name: "send_sms_cmd_13",
michael@0 86 commandQualifier: 0x00,
michael@0 87 title: "Text Attribute 2"}},
michael@0 88 {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001001b4",
michael@0 89 func: testSendSMS,
michael@0 90 expect: {name: "send_sms_cmd_14",
michael@0 91 commandQualifier: 0x00,
michael@0 92 title: "Text Attribute 1"}},
michael@0 93 {command: "d0268103011300820281838510546578742041747472696275746520328b09010002911040f00120",
michael@0 94 func: testSendSMS,
michael@0 95 expect: {name: "send_sms_cmd_15",
michael@0 96 commandQualifier: 0x00,
michael@0 97 title: "Text Attribute 2"}},
michael@0 98 {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001002b4",
michael@0 99 func: testSendSMS,
michael@0 100 expect: {name: "send_sms_cmd_16",
michael@0 101 commandQualifier: 0x00,
michael@0 102 title: "Text Attribute 1"}},
michael@0 103 {command: "d0268103011300820281838510546578742041747472696275746520328b09010002911040f00120",
michael@0 104 func: testSendSMS,
michael@0 105 expect: {name: "send_sms_cmd_17",
michael@0 106 commandQualifier: 0x00,
michael@0 107 title: "Text Attribute 2"}},
michael@0 108 {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001004b4",
michael@0 109 func: testSendSMS,
michael@0 110 expect: {name: "send_sms_cmd_18",
michael@0 111 commandQualifier: 0x00,
michael@0 112 title: "Text Attribute 1"}},
michael@0 113 {command: "d02c8103011300820281838510546578742041747472696275746520328b09010002911040f00120d004001000b4",
michael@0 114 func: testSendSMS,
michael@0 115 expect: {name: "send_sms_cmd_19",
michael@0 116 commandQualifier: 0x00,
michael@0 117 title: "Text Attribute 2"}},
michael@0 118 {command: "d0268103011300820281838510546578742041747472696275746520338b09010002911040f00120",
michael@0 119 func: testSendSMS,
michael@0 120 expect: {name: "send_sms_cmd_20",
michael@0 121 commandQualifier: 0x00,
michael@0 122 title: "Text Attribute 3"}},
michael@0 123 {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001008b4",
michael@0 124 func: testSendSMS,
michael@0 125 expect: {name: "send_sms_cmd_21",
michael@0 126 commandQualifier: 0x00,
michael@0 127 title: "Text Attribute 1"}},
michael@0 128 {command: "d02c8103011300820281838510546578742041747472696275746520328b09010002911040f00120d004001000b4",
michael@0 129 func: testSendSMS,
michael@0 130 expect: {name: "send_sms_cmd_22",
michael@0 131 commandQualifier: 0x00,
michael@0 132 title: "Text Attribute 2"}},
michael@0 133 {command: "d0268103011300820281838510546578742041747472696275746520338b09010002911040f00120",
michael@0 134 func: testSendSMS,
michael@0 135 expect: {name: "send_sms_cmd_23",
michael@0 136 commandQualifier: 0x00,
michael@0 137 title: "Text Attribute 3"}},
michael@0 138 {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001010b4",
michael@0 139 func: testSendSMS,
michael@0 140 expect: {name: "send_sms_cmd_24",
michael@0 141 commandQualifier: 0x00,
michael@0 142 title: "Text Attribute 1"}},
michael@0 143 {command: "d02c8103011300820281838510546578742041747472696275746520328b09010002911040f00120d004001000b4",
michael@0 144 func: testSendSMS,
michael@0 145 expect: {name: "send_sms_cmd_25",
michael@0 146 commandQualifier: 0x00,
michael@0 147 title: "Text Attribute 2"}},
michael@0 148 {command: "d0268103011300820281838510546578742041747472696275746520338b09010002911040f00120",
michael@0 149 func: testSendSMS,
michael@0 150 expect: {name: "send_sms_cmd_26",
michael@0 151 commandQualifier: 0x00,
michael@0 152 title: "Text Attribute 3"}},
michael@0 153 {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001020b4",
michael@0 154 func: testSendSMS,
michael@0 155 expect: {name: "send_sms_cmd_27",
michael@0 156 commandQualifier: 0x00,
michael@0 157 title: "Text Attribute 1"}},
michael@0 158 {command: "d02c8103011300820281838510546578742041747472696275746520328b09010002911040f00120d004001000b4",
michael@0 159 func: testSendSMS,
michael@0 160 expect: {name: "send_sms_cmd_28",
michael@0 161 commandQualifier: 0x00,
michael@0 162 title: "Text Attribute 2"}},
michael@0 163 {command: "d0268103011300820281838510546578742041747472696275746520338b09010002911040f00120",
michael@0 164 func: testSendSMS,
michael@0 165 expect: {name: "send_sms_cmd_29",
michael@0 166 commandQualifier: 0x00,
michael@0 167 title: "Text Attribute 3"}},
michael@0 168 {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001040b4",
michael@0 169 func: testSendSMS,
michael@0 170 expect: {name: "send_sms_cmd_30",
michael@0 171 commandQualifier: 0x00,
michael@0 172 title: "Text Attribute 1"}},
michael@0 173 {command: "d02c8103011300820281838510546578742041747472696275746520328b09010002911040f00120d004001000b4",
michael@0 174 func: testSendSMS,
michael@0 175 expect: {name: "send_sms_cmd_31",
michael@0 176 commandQualifier: 0x00,
michael@0 177 title: "Text Attribute 2"}},
michael@0 178 {command: "d0268103011300820281838510546578742041747472696275746520338b09010002911040f00120",
michael@0 179 func: testSendSMS,
michael@0 180 expect: {name: "send_sms_cmd_32",
michael@0 181 commandQualifier: 0x00,
michael@0 182 title: "Text Attribute 3"}},
michael@0 183 {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001080b4",
michael@0 184 func: testSendSMS,
michael@0 185 expect: {name: "send_sms_cmd_33",
michael@0 186 commandQualifier: 0x00,
michael@0 187 title: "Text Attribute 1"}},
michael@0 188 {command: "d02c8103011300820281838510546578742041747472696275746520328b09010002911040f00120d004001000b4",
michael@0 189 func: testSendSMS,
michael@0 190 expect: {name: "send_sms_cmd_34",
michael@0 191 commandQualifier: 0x00,
michael@0 192 title: "Text Attribute 2"}},
michael@0 193 {command: "d0268103011300820281838510546578742041747472696275746520338b09010002911040f00120",
michael@0 194 func: testSendSMS,
michael@0 195 expect: {name: "send_sms_cmd_35",
michael@0 196 commandQualifier: 0x00,
michael@0 197 title: "Text Attribute 3"}},
michael@0 198 {command: "d02c8103011300820281838510546578742041747472696275746520318b09010002911040f00120d004001000b4",
michael@0 199 func: testSendSMS,
michael@0 200 expect: {name: "send_sms_cmd_36",
michael@0 201 commandQualifier: 0x00,
michael@0 202 title: "Text Attribute 1"}},
michael@0 203 {command: "d0268103011300820281838510546578742041747472696275746520328b09010002911040f00120",
michael@0 204 func: testSendSMS,
michael@0 205 expect: {name: "send_sms_cmd_37",
michael@0 206 commandQualifier: 0x00,
michael@0 207 title: "Text Attribute 2"}},
michael@0 208 {command: "d02d8103011300820281838505804e2d4e0086099111223344556677f88b100100099110325476f84008044e2d4e00",
michael@0 209 func: testSendSMS,
michael@0 210 expect: {name: "send_sms_cmd_38",
michael@0 211 commandQualifier: 0x00,
michael@0 212 title: "中一"}},
michael@0 213 {command: "d02d810301130082028183850581029cad8086099111223344556677f88b100100099110325476f84008044e2d4e00",
michael@0 214 func: testSendSMS,
michael@0 215 expect: {name: "send_sms_cmd_39",
michael@0 216 commandQualifier: 0x00,
michael@0 217 title: "中一"}},
michael@0 218 {command: "d02e810301130082028183850682024e00ad8086099111223344556677f88b100100099110325476f84008044e2d4e00",
michael@0 219 func: testSendSMS,
michael@0 220 expect: {name: "send_sms_cmd_40",
michael@0 221 commandQualifier: 0x00,
michael@0 222 title: "中一"}},
michael@0 223 {command: "d0358103011300820281838509800038003030eb003086099111223344556677f88b140100099110325476f84008080038003030eb0031",
michael@0 224 func: testSendSMS,
michael@0 225 expect: {name: "send_sms_cmd_41",
michael@0 226 commandQualifier: 0x00,
michael@0 227 title: "80ル0"}},
michael@0 228 {command: "d03381030113008202818385078104613831eb3186099111223344556677f88b140100099110325476f84008080038003030eb0032",
michael@0 229 func: testSendSMS,
michael@0 230 expect: {name: "send_sms_cmd_42",
michael@0 231 commandQualifier: 0x00,
michael@0 232 title: "81ル1"}},
michael@0 233 {command: "d0348103011300820281838508820430a03832cb3286099111223344556677f88b140100099110325476f84008080038003030eb0033",
michael@0 234 func: testSendSMS,
michael@0 235 expect: {name: "send_sms_cmd_43",
michael@0 236 commandQualifier: 0x00,
michael@0 237 title: "82ル2"}}
michael@0 238 ];
michael@0 239
michael@0 240 runNextTest();

mercurial