dom/icc/tests/marionette/test_stk_send_ussd.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_ussd.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,205 @@
     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 testSendUSSD(command, expect) {
    1.10 +  log("STK CMD " + JSON.stringify(command));
    1.11 +  is(command.typeOfCommand, iccManager.STK_CMD_SEND_USSD, expect.name);
    1.12 +  is(command.commandQualifier, expect.commandQualifier, expect.name);
    1.13 +  if (command.options.text) {
    1.14 +    is(command.options.text, expect.title, expect.name);
    1.15 +  }
    1.16 +
    1.17 +  runNextTest();
    1.18 +}
    1.19 +
    1.20 +let tests = [
    1.21 +  {command: "d050810301120082028183850a372d62697420555353448a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
    1.22 +   func: testSendUSSD,
    1.23 +   expect: {name: "send_ussd_cmd_1",
    1.24 +            commandQualifier: 0x00,
    1.25 +            title: "7-bit USSD"}},
    1.26 +  {command: "d058810301120082028183850a382d62697420555353448a41444142434445464748494a4b4c4d4e4f505152535455565758595a2d6162636465666768696a6b6c6d6e6f707172737475767778797a2d31323334353637383930",
    1.27 +   func: testSendUSSD,
    1.28 +   expect: {name: "send_ussd_cmd_2",
    1.29 +            commandQualifier: 0x00,
    1.30 +            title: "8-bit USSD"}},
    1.31 +  {command: "d02f81030112008202818385095543533220555353448a1948041704140420041004120421042204120423041904220415",
    1.32 +   func: testSendUSSD,
    1.33 +   expect: {name: "send_ussd_cmd_3",
    1.34 +            commandQualifier: 0x00,
    1.35 +            title: "UCS2 USSD"}},
    1.36 +  {command: "d081fd8103011200820281838581b66f6e636520612052454c4541534520434f4d504c455445206d65737361676520636f6e7461696e696e672074686520555353442052657475726e20526573756c74206d657373616765206e6f7420636f6e7461696e696e6720616e206572726f7220686173206265656e2072656365697665642066726f6d20746865206e6574776f726b2c20746865204d45207368616c6c20696e666f726d207468652053494d20746861742074686520636f6d6d616e64206861738a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
    1.37 +   func: testSendUSSD,
    1.38 +   expect: {name: "send_ussd_cmd_4",
    1.39 +            commandQualifier: 0x00,
    1.40 +            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"}},
    1.41 +  {command: "d04681030112008202818385008a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
    1.42 +   func: testSendUSSD,
    1.43 +   expect: {name: "send_ussd_cmd_5",
    1.44 +         commandQualifier: 0x00,
    1.45 +         title: ""}},
    1.46 +  {command: "d054810301120082028183850a42617369632049636f6e8a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e5609e020001",
    1.47 +   func: testSendUSSD,
    1.48 +   expect: {name: "send_ussd_cmd_6",
    1.49 +            commandQualifier: 0x00,
    1.50 +            title: "Basic Icon"}},
    1.51 +  {command: "d054810301120082028183850a436f6c6f722049636f6e8a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e5609e020002",
    1.52 +   func: testSendUSSD,
    1.53 +   expect: {name: "send_ussd_cmd_7",
    1.54 +            commandQualifier: 0x00,
    1.55 +            title: "Color Icon"}},
    1.56 +  {command: "d054810301120082028183850a42617369632049636f6e8a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e5609e020101",
    1.57 +   func: testSendUSSD,
    1.58 +   expect: {name: "send_ussd_cmd_8",
    1.59 +            commandQualifier: 0x00,
    1.60 +            title: "Basic Icon"}},
    1.61 +  {command: "d05f8103011200820281838519800417041404200410041204210422041204230419042204158a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
    1.62 +   func: testSendUSSD,
    1.63 +   expect: {name: "send_ussd_cmd_9",
    1.64 +            commandQualifier: 0x00,
    1.65 +            title: "ЗДРАВСТВУЙТЕ"}},
    1.66 +  {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4",
    1.67 +   func: testSendUSSD,
    1.68 +   expect: {name: "send_ussd_cmd_10",
    1.69 +            commandQualifier: 0x00,
    1.70 +            title: "Text Attribute 1"}},
    1.71 +  {command: "d0568103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
    1.72 +   func: testSendUSSD,
    1.73 +   expect: {name: "send_ussd_cmd_11",
    1.74 +            commandQualifier: 0x00,
    1.75 +            title: "Text Attribute 2"}},
    1.76 +  {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001001b4",
    1.77 +   func: testSendUSSD,
    1.78 +   expect: {name: "send_ussd_cmd_12",
    1.79 +            commandQualifier: 0x00,
    1.80 +            title: "Text Attribute 1"}},
    1.81 +  {command: "d0568103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
    1.82 +   func: testSendUSSD,
    1.83 +   expect: {name: "send_ussd_cmd_13",
    1.84 +            commandQualifier: 0x00,
    1.85 +            title: "Text Attribute 2"}},
    1.86 +  {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001002b4",
    1.87 +   func: testSendUSSD,
    1.88 +   expect: {name: "send_ussd_cmd_14",
    1.89 +            commandQualifier: 0x00,
    1.90 +            title: "Text Attribute 1"}},
    1.91 +  {command: "d0568103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
    1.92 +   func: testSendUSSD,
    1.93 +   expect: {name: "send_ussd_cmd_15",
    1.94 +            commandQualifier: 0x00,
    1.95 +            title: "Text Attribute 2"}},
    1.96 +  {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001004b4",
    1.97 +   func: testSendUSSD,
    1.98 +   expect: {name: "send_ussd_cmd_16",
    1.99 +            commandQualifier: 0x00,
   1.100 +            title: "Text Attribute 1"}},
   1.101 +  {command: "d05c8103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4",
   1.102 +   func: testSendUSSD,
   1.103 +   expect: {name: "send_ussd_cmd_17",
   1.104 +            commandQualifier: 0x00,
   1.105 +            title: "Text Attribute 2"}},
   1.106 +  {command: "d0568103011200820281838510546578742041747472696275746520338a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
   1.107 +   func: testSendUSSD,
   1.108 +   expect: {name: "send_ussd_cmd_18",
   1.109 +            commandQualifier: 0x00,
   1.110 +            title: "Text Attribute 3"}},
   1.111 +  {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001008b4",
   1.112 +   func: testSendUSSD,
   1.113 +   expect: {name: "send_ussd_cmd_19",
   1.114 +            commandQualifier: 0x00,
   1.115 +            title: "Text Attribute 1"}},
   1.116 +  {command: "d05c8103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4",
   1.117 +   func: testSendUSSD,
   1.118 +   expect: {name: "send_ussd_cmd_20",
   1.119 +            commandQualifier: 0x00,
   1.120 +            title: "Text Attribute 2"}},
   1.121 +  {command: "d0568103011200820281838510546578742041747472696275746520338a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
   1.122 +   func: testSendUSSD,
   1.123 +   expect: {name: "send_ussd_cmd_21",
   1.124 +            commandQualifier: 0x00,
   1.125 +            title: "Text Attribute 3"}},
   1.126 +  {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001010b4",
   1.127 +   func: testSendUSSD,
   1.128 +   expect: {name: "send_ussd_cmd_22",
   1.129 +            commandQualifier: 0x00,
   1.130 +            title: "Text Attribute 1"}},
   1.131 +  {command: "d05c8103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4",
   1.132 +   func: testSendUSSD,
   1.133 +   expect: {name: "send_ussd_cmd_23",
   1.134 +            commandQualifier: 0x00,
   1.135 +            title: "Text Attribute 2"}},
   1.136 +  {command: "d0568103011200820281838510546578742041747472696275746520338a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
   1.137 +   func: testSendUSSD,
   1.138 +   expect: {name: "send_ussd_cmd_24",
   1.139 +            commandQualifier: 0x00,
   1.140 +            title: "Text Attribute 3"}},
   1.141 +  {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001020b4",
   1.142 +   func: testSendUSSD,
   1.143 +   expect: {name: "send_ussd_cmd_25",
   1.144 +            commandQualifier: 0x00,
   1.145 +            title: "Text Attribute 1"}},
   1.146 +  {command: "d05c8103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4",
   1.147 +   func: testSendUSSD,
   1.148 +   expect: {name: "send_ussd_cmd_26",
   1.149 +            commandQualifier: 0x00,
   1.150 +            title: "Text Attribute 2"}},
   1.151 +  {command: "d0568103011200820281838510546578742041747472696275746520338a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
   1.152 +   func: testSendUSSD,
   1.153 +   expect: {name: "send_ussd_cmd_27",
   1.154 +            commandQualifier: 0x00,
   1.155 +            title: "Text Attribute 3"}},
   1.156 +  {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001040b4",
   1.157 +   func: testSendUSSD,
   1.158 +   expect: {name: "send_ussd_cmd_28",
   1.159 +            commandQualifier: 0x00,
   1.160 +            title: "Text Attribute 1"}},
   1.161 +  {command: "d05c8103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4",
   1.162 +   func: testSendUSSD,
   1.163 +   expect: {name: "send_ussd_cmd_29",
   1.164 +            commandQualifier: 0x00,
   1.165 +            title: "Text Attribute 2"}},
   1.166 +  {command: "d0568103011200820281838510546578742041747472696275746520338a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
   1.167 +   func: testSendUSSD,
   1.168 +   expect: {name: "send_ussd_cmd_30",
   1.169 +            commandQualifier: 0x00,
   1.170 +            title: "Text Attribute 3"}},
   1.171 +  {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001080b4",
   1.172 +   func: testSendUSSD,
   1.173 +   expect: {name: "send_ussd_cmd_31",
   1.174 +            commandQualifier: 0x00,
   1.175 +            title: "Text Attribute 1"}},
   1.176 +  {command: "d05c8103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4",
   1.177 +   func: testSendUSSD,
   1.178 +   expect: {name: "send_ussd_cmd_32",
   1.179 +            commandQualifier: 0x00,
   1.180 +            title: "Text Attribute 2"}},
   1.181 +  {command: "d0568103011200820281838510546578742041747472696275746520338a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
   1.182 +   func: testSendUSSD,
   1.183 +   expect: {name: "send_ussd_cmd_33",
   1.184 +            commandQualifier: 0x00,
   1.185 +            title: "Text Attribute 3"}},
   1.186 +  {command: "d05c8103011200820281838510546578742041747472696275746520318a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560d004001000b4",
   1.187 +   func: testSendUSSD,
   1.188 +   expect: {name: "send_ussd_cmd_34",
   1.189 +            commandQualifier: 0x00,
   1.190 +            title: "Text Attribute 1"}},
   1.191 +  {command: "d0568103011200820281838510546578742041747472696275746520328a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
   1.192 +   func: testSendUSSD,
   1.193 +   expect: {name: "send_ussd_cmd_35",
   1.194 +            commandQualifier: 0x00,
   1.195 +            title: "Text Attribute 2"}},
   1.196 +  {command: "d04b8103011200820281838505804f60597d8a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
   1.197 +   func: testSendUSSD,
   1.198 +   expect: {name: "send_ussd_cmd_36",
   1.199 +            commandQualifier: 0x00,
   1.200 +            title: "你好"}},
   1.201 +  {command: "d04981030112008202818385038030eb8a39f041e19058341e9149e592d9743ea151e9945ab55eb1596d2b2c1e93cbe6333aad5eb3dbee373c2e9fd3ebf63b3eaf6fc564335acd76c3e560",
   1.202 +   func: testSendUSSD,
   1.203 +   expect: {name: "send_ussd_cmd_37",
   1.204 +            commandQualifier: 0x00,
   1.205 +            title: "ル"}}
   1.206 +];
   1.207 +
   1.208 +runNextTest();

mercurial