dom/icc/tests/marionette/test_stk_send_dtmf.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_dtmf.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,190 @@
     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 testSendDTMF(command, expect) {
    1.10 +  log("STK CMD " + JSON.stringify(command));
    1.11 +  is(command.typeOfCommand, iccManager.STK_CMD_SEND_DTMF, expect.name);
    1.12 +  is(command.commandQualifier, expect.commandQualifier, expect.name);
    1.13 +  if (command.options.text) {
    1.14 +    is(command.options.text, expect.text, expect.name);
    1.15 +  }
    1.16 +
    1.17 +  runNextTest();
    1.18 +}
    1.19 +
    1.20 +let tests = [
    1.21 +  {command: "d01b810301140082028183850953656e642044544d46ac052143658709",
    1.22 +   func: testSendDTMF,
    1.23 +   expect: {name: "send_dtmf_cmd_1",
    1.24 +            commandQualifier: 0x00,
    1.25 +            text: "Send DTMF"}},
    1.26 +  {command: "d0138103011400820281838500ac06c1cccccccc2c",
    1.27 +   func: testSendDTMF,
    1.28 +   expect: {name: "send_dtmf_cmd_2",
    1.29 +            commandQualifier: 0x00,
    1.30 +            text: ""}},
    1.31 +  {command: "d01d810301140082028183850a42617369632049636f6eac02c1f29e020001",
    1.32 +   func: testSendDTMF,
    1.33 +   expect: {name: "send_dtmf_cmd_3",
    1.34 +            commandQualifier: 0x00,
    1.35 +            text: "Basic Icon"}},
    1.36 +  {command: "d01b810301140082028183850953656e642044544d46ac052143658709",
    1.37 +   func: testSendDTMF,
    1.38 +   expect: {name: "send_dtmf_cmd_4",
    1.39 +            commandQualifier: 0x00,
    1.40 +            text: "Send DTMF"}},
    1.41 +  {command: "d01c810301140082028183850953656e642044544d46ac02c1f29e020101",
    1.42 +   func: testSendDTMF,
    1.43 +   expect: {name: "send_dtmf_cmd_5",
    1.44 +            commandQualifier: 0x00,
    1.45 +            text: "Send DTMF"}},
    1.46 +  {command: "d028810301140082028183851980041704140420041004120421042204120423041904220415ac02c1f2",
    1.47 +   func: testSendDTMF,
    1.48 +   expect: {name: "send_dtmf_cmd_6",
    1.49 +            commandQualifier: 0x00,
    1.50 +            text: "ЗДРАВСТВУЙТЕ"}},
    1.51 +  {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b00b4",
    1.52 +   func: testSendDTMF,
    1.53 +   expect: {name: "send_dtmf_cmd_7",
    1.54 +            commandQualifier: 0x00,
    1.55 +            text: "Send DTMF 1"}},
    1.56 +  {command: "d01d810301140082028183850b53656e642044544d462032ac052143658709",
    1.57 +   func: testSendDTMF,
    1.58 +   expect: {name: "send_dtmf_cmd_8",
    1.59 +            commandQualifier: 0x00,
    1.60 +            text: "Send DTMF 2"}},
    1.61 +  {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b01b4",
    1.62 +   func: testSendDTMF,
    1.63 +   expect: {name: "send_dtmf_cmd_9",
    1.64 +            commandQualifier: 0x00,
    1.65 +            text: "Send DTMF 1"}},
    1.66 +  {command: "d01d810301140082028183850b53656e642044544d462032ac052143658709",
    1.67 +   func: testSendDTMF,
    1.68 +   expect: {name: "send_dtmf_cmd_10",
    1.69 +            commandQualifier: 0x00,
    1.70 +            text: "Send DTMF 2"}},
    1.71 +  {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d00400b002b4",
    1.72 +   func: testSendDTMF,
    1.73 +   expect: {name: "send_dtmf_cmd_11",
    1.74 +            commandQualifier: 0x00,
    1.75 +            text: "Send DTMF 1"}},
    1.76 +  {command: "d01d810301140082028183850b53656e642044544d462032ac052143658709",
    1.77 +   func: testSendDTMF,
    1.78 +   expect: {name: "send_dtmf_cmd_12",
    1.79 +            commandQualifier: 0x00,
    1.80 +            text: "Send DTMF 2"}},
    1.81 +  {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b04b4",
    1.82 +   func: testSendDTMF,
    1.83 +   expect: {name: "send_dtmf_cmd_13",
    1.84 +            commandQualifier: 0x00,
    1.85 +            text: "Send DTMF 1"}},
    1.86 +  {command: "d023810301140082028183850b53656e642044544d462032ac052143658709d004000b00b4",
    1.87 +   func: testSendDTMF,
    1.88 +   expect: {name: "send_dtmf_cmd_14",
    1.89 +            commandQualifier: 0x00,
    1.90 +            text: "Send DTMF 2"}},
    1.91 +  {command: "d01d810301140082028183850b53656e642044544d462033ac052143658709",
    1.92 +   func: testSendDTMF,
    1.93 +   expect: {name: "send_dtmf_cmd_15",
    1.94 +            commandQualifier: 0x00,
    1.95 +            text: "Send DTMF 3"}},
    1.96 +  {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b08b4",
    1.97 +   func: testSendDTMF,
    1.98 +   expect: {name: "send_dtmf_cmd_16",
    1.99 +            commandQualifier: 0x00,
   1.100 +            text: "Send DTMF 1"}},
   1.101 +  {command: "d023810301140082028183850b53656e642044544d462032ac052143658709d004000b00b4",
   1.102 +   func: testSendDTMF,
   1.103 +   expect: {name: "send_dtmf_cmd_17",
   1.104 +            commandQualifier: 0x00,
   1.105 +            text: "Send DTMF 2"}},
   1.106 +  {command: "d01d810301140082028183850b53656e642044544d462033ac052143658709",
   1.107 +   func: testSendDTMF,
   1.108 +   expect: {name: "send_dtmf_cmd_18",
   1.109 +            commandQualifier: 0x00,
   1.110 +            text: "Send DTMF 3"}},
   1.111 +  {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b10b4",
   1.112 +   func: testSendDTMF,
   1.113 +   expect: {name: "send_dtmf_cmd_19",
   1.114 +            commandQualifier: 0x00,
   1.115 +            text: "Send DTMF 1"}},
   1.116 +  {command: "d023810301140082028183850b53656e642044544d462032ac052143658709d004000b00b4",
   1.117 +   func: testSendDTMF,
   1.118 +   expect: {name: "send_dtmf_cmd_20",
   1.119 +            commandQualifier: 0x00,
   1.120 +            text: "Send DTMF 2"}},
   1.121 +  {command: "d01d810301140082028183850b53656e642044544d462033ac052143658709",
   1.122 +   func: testSendDTMF,
   1.123 +   expect: {name: "send_dtmf_cmd_21",
   1.124 +            commandQualifier: 0x00,
   1.125 +            text: "Send DTMF 3"}},
   1.126 +  {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b20b4",
   1.127 +   func: testSendDTMF,
   1.128 +   expect: {name: "send_dtmf_cmd_22",
   1.129 +            commandQualifier: 0x00,
   1.130 +            text: "Send DTMF 1"}},
   1.131 +  {command: "d023810301140082028183850b53656e642044544d462032ac052143658709d004000b00b4",
   1.132 +   func: testSendDTMF,
   1.133 +   expect: {name: "send_dtmf_cmd_23",
   1.134 +            commandQualifier: 0x00,
   1.135 +            text: "Send DTMF 2"}},
   1.136 +  {command: "d01d810301140082028183850b53656e642044544d462033ac052143658709",
   1.137 +   func: testSendDTMF,
   1.138 +   expect: {name: "send_dtmf_cmd_24",
   1.139 +            commandQualifier: 0x00,
   1.140 +            text: "Send DTMF 3"}},
   1.141 +  {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b40b4",
   1.142 +   func: testSendDTMF,
   1.143 +   expect: {name: "send_dtmf_cmd_25",
   1.144 +            commandQualifier: 0x00,
   1.145 +            text: "Send DTMF 1"}},
   1.146 +  {command: "d023810301140082028183850b53656e642044544d462032ac052143658709d004000b00b4",
   1.147 +   func: testSendDTMF,
   1.148 +   expect: {name: "send_dtmf_cmd_26",
   1.149 +            commandQualifier: 0x00,
   1.150 +            text: "Send DTMF 2"}},
   1.151 +  {command: "d01d810301140082028183850b53656e642044544d462033ac052143658709",
   1.152 +   func: testSendDTMF,
   1.153 +   expect: {name: "send_dtmf_cmd_27",
   1.154 +            commandQualifier: 0x00,
   1.155 +            text: "Send DTMF 3"}},
   1.156 +  {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b80b4",
   1.157 +   func: testSendDTMF,
   1.158 +   expect: {name: "send_dtmf_cmd_28",
   1.159 +            commandQualifier: 0x00,
   1.160 +            text: "Send DTMF 1"}},
   1.161 +  {command: "d023810301140082028183850b53656e642044544d462032ac052143658709d004000b00b4",
   1.162 +   func: testSendDTMF,
   1.163 +   expect: {name: "send_dtmf_cmd_29",
   1.164 +            commandQualifier: 0x00,
   1.165 +            text: "Send DTMF 2"}},
   1.166 +  {command: "d01d810301140082028183850b53656e642044544d462033ac052143658709",
   1.167 +   func: testSendDTMF,
   1.168 +   expect: {name: "send_dtmf_cmd_30",
   1.169 +            commandQualifier: 0x00,
   1.170 +            text: "Send DTMF 3"}},
   1.171 +  {command: "d023810301140082028183850b53656e642044544d462031ac052143658709d004000b00b4",
   1.172 +   func: testSendDTMF,
   1.173 +   expect: {name: "send_dtmf_cmd_31",
   1.174 +            commandQualifier: 0x00,
   1.175 +            text: "Send DTMF 1"}},
   1.176 +  {command: "d01d810301140082028183850b53656e642044544d462032ac052143658709",
   1.177 +   func: testSendDTMF,
   1.178 +   expect: {name: "send_dtmf_cmd_32",
   1.179 +            commandQualifier: 0x00,
   1.180 +            text: "Send DTMF 2"}},
   1.181 +  {command: "d0148103011400820281838505804f60597dac02c1f2",
   1.182 +   func: testSendDTMF,
   1.183 +   expect: {name: "send_dtmf_cmd_33",
   1.184 +            commandQualifier: 0x00,
   1.185 +            text: "你好"}},
   1.186 +  {command: "d01281030114008202818385038030ebac02c1f2",
   1.187 +   func: testSendDTMF,
   1.188 +   expect: {name: "send_dtmf_cmd_34",
   1.189 +            commandQualifier: 0x00,
   1.190 +            text: "ル"}}
   1.191 +];
   1.192 +
   1.193 +runNextTest();

mercurial