dom/icc/tests/marionette/test_stk_setup_call.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 testSetupCall(command, expect) {
michael@0 7 log("STK CMD " + JSON.stringify(command));
michael@0 8 is(command.typeOfCommand, iccManager.STK_CMD_SET_UP_CALL, expect.name);
michael@0 9 is(command.commandQualifier, expect.commandQualifier, expect.name);
michael@0 10 is(command.options.confirmMessage, expect.confirmMessage, expect.name);
michael@0 11 is(command.options.address, expect.address, expect.name);
michael@0 12 is(command.options.callMessage, expect.callMessage, expect.name);
michael@0 13
michael@0 14 let duration = command.options.duration;
michael@0 15 if (duration) {
michael@0 16 is(duration.timeUnit, expect.duration.timeUnit, expect.name);
michael@0 17 is(duration.timeInterval, expect.duration.timeInterval, expect.name);
michael@0 18 }
michael@0 19
michael@0 20 runNextTest();
michael@0 21 }
michael@0 22
michael@0 23 let tests = [
michael@0 24 {command: "d01e81030110008202818385084e6f7420627573798609911032042143651c2c",
michael@0 25 func: testSetupCall,
michael@0 26 expect: {name: "setup_call_cmd_1",
michael@0 27 commandQualifier: 0x00,
michael@0 28 confirmMessage: "Not busy",
michael@0 29 address: "+012340123456,1,2"}},
michael@0 30 {command: "d01d81030110028202818385074f6e20686f6c648609911032042143651c2c",
michael@0 31 func: testSetupCall,
michael@0 32 expect: {name: "setup_call_cmd_2",
michael@0 33 commandQualifier: 0x02,
michael@0 34 confirmMessage: "On hold",
michael@0 35 address: "+012340123456,1,2"}},
michael@0 36 {command: "d020810301100482028183850a446973636f6e6e6563748609911032042143651c2c",
michael@0 37 func: testSetupCall,
michael@0 38 expect: {name: "setup_call_cmd_3",
michael@0 39 commandQualifier: 0x04,
michael@0 40 confirmMessage: "Disconnect",
michael@0 41 address: "+012340123456,1,2"}},
michael@0 42 {command: "d02b81030110008202818385114361706162696c69747920636f6e6669678609911032042143651c2c870201a0",
michael@0 43 func: testSetupCall,
michael@0 44 expect: {name: "setup_call_cmd_4",
michael@0 45 commandQualifier: 0x00,
michael@0 46 confirmMessage: "Capability config",
michael@0 47 address: "+012340123456,1,2"}},
michael@0 48 {command: "d01c81030110018202818386119110325476981032547698103254769810",
michael@0 49 func: testSetupCall,
michael@0 50 expect: {name: "setup_call_cmd_5",
michael@0 51 commandQualifier: 0x01,
michael@0 52 address: "+01234567890123456789012345678901"}},
michael@0 53 {command: "d081fd8103011001820281838581ed54687265652074797065732061726520646566696e65643a202d2073657420757020612063616c6c2c20627574206f6e6c79206966206e6f742063757272656e746c792062757379206f6e20616e6f746865722063616c6c3b202d2073657420757020612063616c6c2c2070757474696e6720616c6c206f746865722063616c6c732028696620616e7929206f6e20686f6c643b202d2073657420757020612063616c6c2c20646973636f6e6e656374696e6720616c6c206f746865722063616c6c732028696620616e79292066697273742e20466f722065616368206f662074686573652074797065732c2086029110",
michael@0 54 func: testSetupCall,
michael@0 55 expect: {name: "setup_call_cmd_6",
michael@0 56 commandQualifier: 0x01,
michael@0 57 confirmMessage: "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, ",
michael@0 58 address: "+01"}},
michael@0 59 {command: "d02b810301100082028183850c43616c6c65642070617274798609911032042143651c2c880780509595959595",
michael@0 60 func: testSetupCall,
michael@0 61 expect: {name: "setup_call_cmd_7",
michael@0 62 commandQualifier: 0x00,
michael@0 63 confirmMessage: "Called party",
michael@0 64 address: "+012340123456,1,2"}},
michael@0 65 {command: "d02281030110018202818385084475726174696f6e8609911032042143651c2c8402010a",
michael@0 66 func: testSetupCall,
michael@0 67 expect: {name: "setup_call_cmd_8",
michael@0 68 commandQualifier: 0x01,
michael@0 69 confirmMessage: "Duration",
michael@0 70 address: "+012340123456,1,2",
michael@0 71 duration: {timeUnit: iccManager.STK_TIME_UNIT_SECOND,
michael@0 72 timeInterval: 0x0A}}},
michael@0 73 {command: "d028810301100082028183850c434f4e4649524d4154494f4e8609911032042143651c2c850443414c4c",
michael@0 74 func: testSetupCall,
michael@0 75 expect: {name: "setup_call_cmd_9",
michael@0 76 commandQualifier: 0x00,
michael@0 77 confirmMessage: "CONFIRMATION",
michael@0 78 callMessage: "CALL",
michael@0 79 address: "+012340123456,1,2"}},
michael@0 80 {command: "d03081030110008202818385165365742075702063616c6c2049636f6e20332e312e318609911032042143651c2c9e020101",
michael@0 81 func: testSetupCall,
michael@0 82 expect: {name: "setup_call_cmd_10",
michael@0 83 commandQualifier: 0x00,
michael@0 84 confirmMessage: "Set up call Icon 3.1.1",
michael@0 85 address: "+012340123456,1,2"}},
michael@0 86 {command: "d03081030110008202818385165365742075702063616c6c2049636f6e20332e322e318609911032042143651c2c9e020001",
michael@0 87 func: testSetupCall,
michael@0 88 expect: {name: "setup_call_cmd_11",
michael@0 89 commandQualifier: 0x00,
michael@0 90 confirmMessage: "Set up call Icon 3.2.1",
michael@0 91 address: "+012340123456,1,2"}},
michael@0 92 {command: "d03081030110008202818385165365742075702063616c6c2049636f6e20332e332e318609911032042143651c2c9e020102",
michael@0 93 func: testSetupCall,
michael@0 94 expect: {name: "setup_call_cmd_12",
michael@0 95 commandQualifier: 0x00,
michael@0 96 confirmMessage: "Set up call Icon 3.3.1",
michael@0 97 address: "+012340123456,1,2"}},
michael@0 98 {command: "d04c81030110008202818385165365742075702063616c6c2049636f6e20332e342e318609911032042143651c2c9e02000185165365742075702063616c6c2049636f6e20332e342e329e020001",
michael@0 99 func: testSetupCall,
michael@0 100 expect: {name: "setup_call_cmd_13",
michael@0 101 commandQualifier: 0x00,
michael@0 102 confirmMessage: "Set up call Icon 3.4.1",
michael@0 103 callMessage: "Set up call Icon 3.4.2",
michael@0 104 address: "+012340123456,1,2"}},
michael@0 105 {command: "d038810301100082028183850e434f4e4649524d4154494f4e20318609911032042143651c2c850643414c4c2031d004000e00b4d004000600b4",
michael@0 106 func: testSetupCall,
michael@0 107 expect: {name: "setup_call_cmd_14",
michael@0 108 commandQualifier: 0x00,
michael@0 109 confirmMessage: "CONFIRMATION 1",
michael@0 110 callMessage: "CALL 1",
michael@0 111 address: "+012340123456,1,2"}},
michael@0 112 {command: "d02c810301100082028183850e434f4e4649524d4154494f4e20328609911032042143651c2c850643414c4c2032",
michael@0 113 func: testSetupCall,
michael@0 114 expect: {name: "setup_call_cmd_15",
michael@0 115 commandQualifier: 0x00,
michael@0 116 confirmMessage: "CONFIRMATION 2",
michael@0 117 callMessage: "CALL 2",
michael@0 118 address: "+012340123456,1,2"}},
michael@0 119 {command: "d038810301100082028183850e434f4e4649524d4154494f4e20318609911032042143651c2c850643414c4c2031d004000e01b4d004000601b4",
michael@0 120 func: testSetupCall,
michael@0 121 expect: {name: "setup_call_cmd_16",
michael@0 122 commandQualifier: 0x00,
michael@0 123 confirmMessage: "CONFIRMATION 1",
michael@0 124 callMessage: "CALL 1",
michael@0 125 address: "+012340123456,1,2"}},
michael@0 126 {command: "d02c810301100082028183850e434f4e4649524d4154494f4e20328609911032042143651c2c850643414c4c2032",
michael@0 127 func: testSetupCall,
michael@0 128 expect: {name: "setup_call_cmd_17",
michael@0 129 commandQualifier: 0x00,
michael@0 130 confirmMessage: "CONFIRMATION 2",
michael@0 131 callMessage: "CALL 2",
michael@0 132 address: "+012340123456,1,2"}},
michael@0 133 {command: "d038810301100082028183850e434f4e4649524d4154494f4e20318609911032042143651c2c850643414c4c2031d004000e02b4d004000602b4",
michael@0 134 func: testSetupCall,
michael@0 135 expect: {name: "setup_call_cmd_18",
michael@0 136 commandQualifier: 0x00,
michael@0 137 confirmMessage: "CONFIRMATION 1",
michael@0 138 callMessage: "CALL 1",
michael@0 139 address: "+012340123456,1,2"}},
michael@0 140 {command: "d02c810301100082028183850e434f4e4649524d4154494f4e20328609911032042143651c2c850643414c4c2032",
michael@0 141 func: testSetupCall,
michael@0 142 expect: {name: "setup_call_cmd_19",
michael@0 143 commandQualifier: 0x00,
michael@0 144 confirmMessage: "CONFIRMATION 2",
michael@0 145 callMessage: "CALL 2",
michael@0 146 address: "+012340123456,1,2"}},
michael@0 147 {command: "d038810301100082028183850e434f4e4649524d4154494f4e20318609911032042143651c2c850643414c4c2031d004000e04b4d004000604b4",
michael@0 148 func: testSetupCall,
michael@0 149 expect: {name: "setup_call_cmd_20",
michael@0 150 commandQualifier: 0x00,
michael@0 151 confirmMessage: "CONFIRMATION 1",
michael@0 152 callMessage: "CALL 1",
michael@0 153 address: "+012340123456,1,2"}},
michael@0 154 {command: "d038810301100082028183850e434f4e4649524d4154494f4e20328609911032042143651c2c850643414c4c2032d004000e00b4d004000600b4",
michael@0 155 func: testSetupCall,
michael@0 156 expect: {name: "setup_call_cmd_21",
michael@0 157 commandQualifier: 0x00,
michael@0 158 confirmMessage: "CONFIRMATION 2",
michael@0 159 callMessage: "CALL 2",
michael@0 160 address: "+012340123456,1,2"}},
michael@0 161 {command: "d02c810301100082028183850e434f4e4649524d4154494f4e20338609911032042143651c2c850643414c4c2033",
michael@0 162 func: testSetupCall,
michael@0 163 expect: {name: "setup_call_cmd_22",
michael@0 164 commandQualifier: 0x00,
michael@0 165 confirmMessage: "CONFIRMATION 3",
michael@0 166 callMessage: "CALL 3",
michael@0 167 address: "+012340123456,1,2"}},
michael@0 168 {command: "d038810301100082028183850e434f4e4649524d4154494f4e20318609911032042143651c2c850643414c4c2031d004000e08b4d004000608b4",
michael@0 169 func: testSetupCall,
michael@0 170 expect: {name: "setup_call_cmd_23",
michael@0 171 commandQualifier: 0x00,
michael@0 172 confirmMessage: "CONFIRMATION 1",
michael@0 173 callMessage: "CALL 1",
michael@0 174 address: "+012340123456,1,2"}},
michael@0 175 {command: "d038810301100082028183850e434f4e4649524d4154494f4e20328609911032042143651c2c850643414c4c2032d004000e00b4d004000600b4",
michael@0 176 func: testSetupCall,
michael@0 177 expect: {name: "setup_call_cmd_24",
michael@0 178 commandQualifier: 0x00,
michael@0 179 confirmMessage: "CONFIRMATION 2",
michael@0 180 callMessage: "CALL 2",
michael@0 181 address: "+012340123456,1,2"}},
michael@0 182 {command: "d02c810301100082028183850e434f4e4649524d4154494f4e20338609911032042143651c2c850643414c4c2033",
michael@0 183 func: testSetupCall,
michael@0 184 expect: {name: "setup_call_cmd_25",
michael@0 185 commandQualifier: 0x00,
michael@0 186 confirmMessage: "CONFIRMATION 3",
michael@0 187 callMessage: "CALL 3",
michael@0 188 address: "+012340123456,1,2"}},
michael@0 189 {command: "d038810301100082028183850e434f4e4649524d4154494f4e20318609911032042143651c2c850643414c4c2031d004000e10b4d004000610b4",
michael@0 190 func: testSetupCall,
michael@0 191 expect: {name: "setup_call_cmd_26",
michael@0 192 commandQualifier: 0x00,
michael@0 193 confirmMessage: "CONFIRMATION 1",
michael@0 194 callMessage: "CALL 1",
michael@0 195 address: "+012340123456,1,2"}},
michael@0 196 {command: "d038810301100082028183850e434f4e4649524d4154494f4e20328609911032042143651c2c850643414c4c2032d004000e00b4d004000600b4",
michael@0 197 func: testSetupCall,
michael@0 198 expect: {name: "setup_call_cmd_27",
michael@0 199 commandQualifier: 0x00,
michael@0 200 confirmMessage: "CONFIRMATION 2",
michael@0 201 callMessage: "CALL 2",
michael@0 202 address: "+012340123456,1,2"}},
michael@0 203 {command: "d02c810301100082028183850e434f4e4649524d4154494f4e20338609911032042143651c2c850643414c4c2033",
michael@0 204 func: testSetupCall,
michael@0 205 expect: {name: "setup_call_cmd_28",
michael@0 206 commandQualifier: 0x00,
michael@0 207 confirmMessage: "CONFIRMATION 3",
michael@0 208 callMessage: "CALL 3",
michael@0 209 address: "+012340123456,1,2"}},
michael@0 210 {command: "d038810301100082028183850e434f4e4649524d4154494f4e20318609911032042143651c2c850643414c4c2031d004000e20b4d004000620b4",
michael@0 211 func: testSetupCall,
michael@0 212 expect: {name: "setup_call_cmd_29",
michael@0 213 commandQualifier: 0x00,
michael@0 214 confirmMessage: "CONFIRMATION 1",
michael@0 215 callMessage: "CALL 1",
michael@0 216 address: "+012340123456,1,2"}},
michael@0 217 {command: "d038810301100082028183850e434f4e4649524d4154494f4e20328609911032042143651c2c850643414c4c2032d004000e00b4d004000600b4",
michael@0 218 func: testSetupCall,
michael@0 219 expect: {name: "setup_call_cmd_30",
michael@0 220 commandQualifier: 0x00,
michael@0 221 confirmMessage: "CONFIRMATION 2",
michael@0 222 callMessage: "CALL 2",
michael@0 223 address: "+012340123456,1,2"}},
michael@0 224 {command: "d02c810301100082028183850e434f4e4649524d4154494f4e20338609911032042143651c2c850643414c4c2033",
michael@0 225 func: testSetupCall,
michael@0 226 expect: {name: "setup_call_cmd_31",
michael@0 227 commandQualifier: 0x00,
michael@0 228 confirmMessage: "CONFIRMATION 3",
michael@0 229 callMessage: "CALL 3",
michael@0 230 address: "+012340123456,1,2"}},
michael@0 231 {command: "d038810301100082028183850e434f4e4649524d4154494f4e20318609911032042143651c2c850643414c4c2031d004000e40b4d004000640b4",
michael@0 232 func: testSetupCall,
michael@0 233 expect: {name: "setup_call_cmd_32",
michael@0 234 commandQualifier: 0x00,
michael@0 235 confirmMessage: "CONFIRMATION 1",
michael@0 236 callMessage: "CALL 1",
michael@0 237 address: "+012340123456,1,2"}},
michael@0 238 {command: "d038810301100082028183850e434f4e4649524d4154494f4e20328609911032042143651c2c850643414c4c2032d004000e00b4d004000600b4",
michael@0 239 func: testSetupCall,
michael@0 240 expect: {name: "setup_call_cmd_33",
michael@0 241 commandQualifier: 0x00,
michael@0 242 confirmMessage: "CONFIRMATION 2",
michael@0 243 callMessage: "CALL 2",
michael@0 244 address: "+012340123456,1,2"}},
michael@0 245 {command: "d02c810301100082028183850e434f4e4649524d4154494f4e20338609911032042143651c2c850643414c4c2033",
michael@0 246 func: testSetupCall,
michael@0 247 expect: {name: "setup_call_cmd_34",
michael@0 248 commandQualifier: 0x00,
michael@0 249 confirmMessage: "CONFIRMATION 3",
michael@0 250 callMessage: "CALL 3",
michael@0 251 address: "+012340123456,1,2"}},
michael@0 252 {command: "d038810301100082028183850e434f4e4649524d4154494f4e20318609911032042143651c2c850643414c4c2031d004000e80b4d004000680b4",
michael@0 253 func: testSetupCall,
michael@0 254 expect: {name: "setup_call_cmd_35",
michael@0 255 commandQualifier: 0x00,
michael@0 256 confirmMessage: "CONFIRMATION 1",
michael@0 257 callMessage: "CALL 1",
michael@0 258 address: "+012340123456,1,2"}},
michael@0 259 {command: "d038810301100082028183850e434f4e4649524d4154494f4e20328609911032042143651c2c850643414c4c2032d004000e00b4d004000600b4",
michael@0 260 func: testSetupCall,
michael@0 261 expect: {name: "setup_call_cmd_36",
michael@0 262 commandQualifier: 0x00,
michael@0 263 confirmMessage: "CONFIRMATION 2",
michael@0 264 callMessage: "CALL 2",
michael@0 265 address: "+012340123456,1,2"}},
michael@0 266 {command: "d02c810301100082028183850e434f4e4649524d4154494f4e20338609911032042143651c2c850643414c4c2033",
michael@0 267 func: testSetupCall,
michael@0 268 expect: {name: "setup_call_cmd_37",
michael@0 269 commandQualifier: 0x00,
michael@0 270 confirmMessage: "CONFIRMATION 3",
michael@0 271 callMessage: "CALL 3",
michael@0 272 address: "+012340123456,1,2"}},
michael@0 273 {command: "d038810301100082028183850e434f4e4649524d4154494f4e20318609911032042143651c2c850643414c4c2031d004000e00b4d0040006004b",
michael@0 274 func: testSetupCall,
michael@0 275 expect: {name: "setup_call_cmd_38",
michael@0 276 commandQualifier: 0x00,
michael@0 277 confirmMessage: "CONFIRMATION 1",
michael@0 278 callMessage: "CALL 1",
michael@0 279 address: "+012340123456,1,2"}},
michael@0 280 {command: "d02c810301100082028183850e434f4e4649524d4154494f4e20328609911032042143651c2c850643414c4c2032",
michael@0 281 func: testSetupCall,
michael@0 282 expect: {name: "setup_call_cmd_39",
michael@0 283 commandQualifier: 0x00,
michael@0 284 confirmMessage: "CONFIRMATION 2",
michael@0 285 callMessage: "CALL 2",
michael@0 286 address: "+012340123456,1,2"}},
michael@0 287 {command: "d02d810301100082028183851980041704140420041004120421042204120423041904220415860791103204214365",
michael@0 288 func: testSetupCall,
michael@0 289 expect: {name: "setup_call_cmd_40",
michael@0 290 commandQualifier: 0x00,
michael@0 291 confirmMessage: "ЗДРАВСТВУЙТЕ",
michael@0 292 address: "+012340123456"}},
michael@0 293 {command: "d04c810301100082028183851b800417041404200410041204210422041204230419042204150031860791103204214365851b800417041404200410041204210422041204230419042204150032",
michael@0 294 func: testSetupCall,
michael@0 295 expect: {name: "setup_call_cmd_41",
michael@0 296 commandQualifier: 0x00,
michael@0 297 confirmMessage: "ЗДРАВСТВУЙТЕ1",
michael@0 298 callMessage: "ЗДРАВСТВУЙТЕ2",
michael@0 299 address: "+012340123456"}},
michael@0 300 {command: "d0198103011000820281838505804e0d5fd9860791103204214365",
michael@0 301 func: testSetupCall,
michael@0 302 expect: {name: "setup_call_cmd_42",
michael@0 303 commandQualifier: 0x00,
michael@0 304 confirmMessage: "不忙",
michael@0 305 address: "+012340123456"}},
michael@0 306 {command: "d022810301100082028183850580786e5b9a860791103204214365850780625375358bdd",
michael@0 307 func: testSetupCall,
michael@0 308 expect: {name: "setup_call_cmd_43",
michael@0 309 commandQualifier: 0x00,
michael@0 310 confirmMessage: "确定",
michael@0 311 callMessage: "打电话",
michael@0 312 address: "+012340123456"}},
michael@0 313 {command: "d01781030110008202818385038030eb860791103204214365",
michael@0 314 func: testSetupCall,
michael@0 315 expect: {name: "setup_call_cmd_44",
michael@0 316 commandQualifier: 0x00,
michael@0 317 confirmMessage: "ル",
michael@0 318 address: "+012340123456"}},
michael@0 319 {command: "d02081030110008202818385058030eb003186079110320421436585058030eb0032",
michael@0 320 func: testSetupCall,
michael@0 321 expect: {name: "setup_call_cmd_45",
michael@0 322 commandQualifier: 0x00,
michael@0 323 confirmMessage: "ル1",
michael@0 324 callMessage:"ル2",
michael@0 325 address: "+012340123456"}},
michael@0 326 {command: "d029810301100482028182050a446973636f6e6e6563748609811032042143651c2c05074d657373616765",
michael@0 327 func: testSetupCall,
michael@0 328 expect: {name: "setup_call_cmd_46",
michael@0 329 commandQualifier: 0x04,
michael@0 330 confirmMessage: "Disconnect",
michael@0 331 address: "012340123456,1,2",
michael@0 332 callMessage: "Message"}},
michael@0 333 {command: "d02281030110008202818385084E6F7420627573798609911032042143651C2C8402010A",
michael@0 334 func: testSetupCall,
michael@0 335 expect: {name: "setup_call_cmd_47",
michael@0 336 commandQualifier: 0x00,
michael@0 337 confirmMessage: "Not busy",
michael@0 338 address: "+012340123456,1,2",
michael@0 339 duration: {timeUnit: iccManager.STK_TIME_UNIT_SECOND,
michael@0 340 timeInterval: 0x0A}}},
michael@0 341
michael@0 342 ];
michael@0 343
michael@0 344 runNextTest();

mercurial