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