|
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 testSendUSSD(command, expect) { |
|
7 log("STK CMD " + JSON.stringify(command)); |
|
8 is(command.typeOfCommand, iccManager.STK_CMD_SEND_USSD, 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: "d050810301120082028183850a372d62697420555353448a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560", |
|
19 func: testSendUSSD, |
|
20 expect: {name: "send_ussd_cmd_1", |
|
21 commandQualifier: 0x00, |
|
22 title: "7-bit USSD"}}, |
|
23 {command: "d058810301120082028183850a382d62697420555353448a41444142434445464748494a4b4c4d4e4f505152535455565758595a2d6162636465666768696a6b6c6d6e6f707172737475767778797a2d31323334353637383930", |
|
24 func: testSendUSSD, |
|
25 expect: {name: "send_ussd_cmd_2", |
|
26 commandQualifier: 0x00, |
|
27 title: "8-bit USSD"}}, |
|
28 {command: "d02f81030112008202818385095543533220555353448a1948041704140420041004120421042204120423041904220415", |
|
29 func: testSendUSSD, |
|
30 expect: {name: "send_ussd_cmd_3", |
|
31 commandQualifier: 0x00, |
|
32 title: "UCS2 USSD"}}, |
|
33 {command: "d081fd8103011200820281838581b66f6e636520612052454c4541534520434f4d504c455445206d65737361676520636f6e7461696e696e672074686520555353442052657475726e20526573756c74206d657373616765206e6f7420636f6e7461696e696e6720616e206572726f7220686173206265656e2072656365697665642066726f6d20746865206e6574776f726b2c20746865204d45207368616c6c20696e666f726d207468652053494d20746861742074686520636f6d6d616e64206861738a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560", |
|
34 func: testSendUSSD, |
|
35 expect: {name: "send_ussd_cmd_4", |
|
36 commandQualifier: 0x00, |
|
37 title: "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"}}, |
|
38 {command: "d04681030112008202818385008a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560", |
|
39 func: testSendUSSD, |
|
40 expect: {name: "send_ussd_cmd_5", |
|
41 commandQualifier: 0x00, |
|
42 title: ""}}, |
|
43 {command: "d054810301120082028183850a42617369632049636f6e8a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e5609e020001", |
|
44 func: testSendUSSD, |
|
45 expect: {name: "send_ussd_cmd_6", |
|
46 commandQualifier: 0x00, |
|
47 title: "Basic Icon"}}, |
|
48 {command: "d054810301120082028183850a436f6c6f722049636f6e8a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e5609e020002", |
|
49 func: testSendUSSD, |
|
50 expect: {name: "send_ussd_cmd_7", |
|
51 commandQualifier: 0x00, |
|
52 title: "Color Icon"}}, |
|
53 {command: "d054810301120082028183850a42617369632049636f6e8a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e5609e020101", |
|
54 func: testSendUSSD, |
|
55 expect: {name: "send_ussd_cmd_8", |
|
56 commandQualifier: 0x00, |
|
57 title: "Basic Icon"}}, |
|
58 {command: "d05f8103011200820281838519800417041404200410041204210422041204230419042204158a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560", |
|
59 func: testSendUSSD, |
|
60 expect: {name: "send_ussd_cmd_9", |
|
61 commandQualifier: 0x00, |
|
62 title: "ЗДРАВСТВУЙТЕ"}}, |
|
63 {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4", |
|
64 func: testSendUSSD, |
|
65 expect: {name: "send_ussd_cmd_10", |
|
66 commandQualifier: 0x00, |
|
67 title: "Text Attribute 1"}}, |
|
68 {command: "d0568103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560", |
|
69 func: testSendUSSD, |
|
70 expect: {name: "send_ussd_cmd_11", |
|
71 commandQualifier: 0x00, |
|
72 title: "Text Attribute 2"}}, |
|
73 {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001001b4", |
|
74 func: testSendUSSD, |
|
75 expect: {name: "send_ussd_cmd_12", |
|
76 commandQualifier: 0x00, |
|
77 title: "Text Attribute 1"}}, |
|
78 {command: "d0568103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560", |
|
79 func: testSendUSSD, |
|
80 expect: {name: "send_ussd_cmd_13", |
|
81 commandQualifier: 0x00, |
|
82 title: "Text Attribute 2"}}, |
|
83 {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001002b4", |
|
84 func: testSendUSSD, |
|
85 expect: {name: "send_ussd_cmd_14", |
|
86 commandQualifier: 0x00, |
|
87 title: "Text Attribute 1"}}, |
|
88 {command: "d0568103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560", |
|
89 func: testSendUSSD, |
|
90 expect: {name: "send_ussd_cmd_15", |
|
91 commandQualifier: 0x00, |
|
92 title: "Text Attribute 2"}}, |
|
93 {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001004b4", |
|
94 func: testSendUSSD, |
|
95 expect: {name: "send_ussd_cmd_16", |
|
96 commandQualifier: 0x00, |
|
97 title: "Text Attribute 1"}}, |
|
98 {command: "d05c8103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4", |
|
99 func: testSendUSSD, |
|
100 expect: {name: "send_ussd_cmd_17", |
|
101 commandQualifier: 0x00, |
|
102 title: "Text Attribute 2"}}, |
|
103 {command: "d0568103011200820281838510546578742041747472696275746520338a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560", |
|
104 func: testSendUSSD, |
|
105 expect: {name: "send_ussd_cmd_18", |
|
106 commandQualifier: 0x00, |
|
107 title: "Text Attribute 3"}}, |
|
108 {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001008b4", |
|
109 func: testSendUSSD, |
|
110 expect: {name: "send_ussd_cmd_19", |
|
111 commandQualifier: 0x00, |
|
112 title: "Text Attribute 1"}}, |
|
113 {command: "d05c8103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4", |
|
114 func: testSendUSSD, |
|
115 expect: {name: "send_ussd_cmd_20", |
|
116 commandQualifier: 0x00, |
|
117 title: "Text Attribute 2"}}, |
|
118 {command: "d0568103011200820281838510546578742041747472696275746520338a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560", |
|
119 func: testSendUSSD, |
|
120 expect: {name: "send_ussd_cmd_21", |
|
121 commandQualifier: 0x00, |
|
122 title: "Text Attribute 3"}}, |
|
123 {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001010b4", |
|
124 func: testSendUSSD, |
|
125 expect: {name: "send_ussd_cmd_22", |
|
126 commandQualifier: 0x00, |
|
127 title: "Text Attribute 1"}}, |
|
128 {command: "d05c8103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4", |
|
129 func: testSendUSSD, |
|
130 expect: {name: "send_ussd_cmd_23", |
|
131 commandQualifier: 0x00, |
|
132 title: "Text Attribute 2"}}, |
|
133 {command: "d0568103011200820281838510546578742041747472696275746520338a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560", |
|
134 func: testSendUSSD, |
|
135 expect: {name: "send_ussd_cmd_24", |
|
136 commandQualifier: 0x00, |
|
137 title: "Text Attribute 3"}}, |
|
138 {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001020b4", |
|
139 func: testSendUSSD, |
|
140 expect: {name: "send_ussd_cmd_25", |
|
141 commandQualifier: 0x00, |
|
142 title: "Text Attribute 1"}}, |
|
143 {command: "d05c8103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4", |
|
144 func: testSendUSSD, |
|
145 expect: {name: "send_ussd_cmd_26", |
|
146 commandQualifier: 0x00, |
|
147 title: "Text Attribute 2"}}, |
|
148 {command: "d0568103011200820281838510546578742041747472696275746520338a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560", |
|
149 func: testSendUSSD, |
|
150 expect: {name: "send_ussd_cmd_27", |
|
151 commandQualifier: 0x00, |
|
152 title: "Text Attribute 3"}}, |
|
153 {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001040b4", |
|
154 func: testSendUSSD, |
|
155 expect: {name: "send_ussd_cmd_28", |
|
156 commandQualifier: 0x00, |
|
157 title: "Text Attribute 1"}}, |
|
158 {command: "d05c8103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4", |
|
159 func: testSendUSSD, |
|
160 expect: {name: "send_ussd_cmd_29", |
|
161 commandQualifier: 0x00, |
|
162 title: "Text Attribute 2"}}, |
|
163 {command: "d0568103011200820281838510546578742041747472696275746520338a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560", |
|
164 func: testSendUSSD, |
|
165 expect: {name: "send_ussd_cmd_30", |
|
166 commandQualifier: 0x00, |
|
167 title: "Text Attribute 3"}}, |
|
168 {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001080b4", |
|
169 func: testSendUSSD, |
|
170 expect: {name: "send_ussd_cmd_31", |
|
171 commandQualifier: 0x00, |
|
172 title: "Text Attribute 1"}}, |
|
173 {command: "d05c8103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4", |
|
174 func: testSendUSSD, |
|
175 expect: {name: "send_ussd_cmd_32", |
|
176 commandQualifier: 0x00, |
|
177 title: "Text Attribute 2"}}, |
|
178 {command: "d0568103011200820281838510546578742041747472696275746520338a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560", |
|
179 func: testSendUSSD, |
|
180 expect: {name: "send_ussd_cmd_33", |
|
181 commandQualifier: 0x00, |
|
182 title: "Text Attribute 3"}}, |
|
183 {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4", |
|
184 func: testSendUSSD, |
|
185 expect: {name: "send_ussd_cmd_34", |
|
186 commandQualifier: 0x00, |
|
187 title: "Text Attribute 1"}}, |
|
188 {command: "d0568103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560", |
|
189 func: testSendUSSD, |
|
190 expect: {name: "send_ussd_cmd_35", |
|
191 commandQualifier: 0x00, |
|
192 title: "Text Attribute 2"}}, |
|
193 {command: "d04b8103011200820281838505804f60597d8a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560", |
|
194 func: testSendUSSD, |
|
195 expect: {name: "send_ussd_cmd_36", |
|
196 commandQualifier: 0x00, |
|
197 title: "你好"}}, |
|
198 {command: "d04981030112008202818385038030eb8a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560", |
|
199 func: testSendUSSD, |
|
200 expect: {name: "send_ussd_cmd_37", |
|
201 commandQualifier: 0x00, |
|
202 title: "ル"}} |
|
203 ]; |
|
204 |
|
205 runNextTest(); |