dom/icc/tests/marionette/test_stk_bip_command.js

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:3e9e06e912cb
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 testBipCommand(command, expect) {
7 log("STK CMD " + JSON.stringify(command));
8
9 is(command.typeOfCommand, expect.typeOfCommand, expect.name);
10 is(command.options.text, expect.text, expect.name);
11
12 runNextTest();
13 }
14
15 let tests = [
16 {command: "d04b81030140018202818205074f70656e204944350702030403041f0239020578470a065465737447700272730d08f4557365724c6f670d08f4557365725077643c0301ad9c3e052101010101",
17 func: testBipCommand,
18 expect: {name: "open_channel_1",
19 typeOfCommand: iccManager.STK_CMD_OPEN_CHANNEL,
20 text: "Open ID"}},
21 {command: "d0448103014001820281820500350702030403041f0239020578470a065465737447700272730d08f4557365724c6f670d08f4557365725077643c0301ad9c3e052101010101",
22 func: testBipCommand,
23 expect: {name: "open_channel_2",
24 typeOfCommand: iccManager.STK_CMD_OPEN_CHANNEL,
25 text: ""}},
26 {command: "d05381030140018202818205094f70656e2049442031350702030403041f0239020578470a065465737447700272730d08f4557365724c6f670d08f4557365725077643c0301ad9c3e052101010101d004000900b4",
27 func: testBipCommand,
28 expect: {name: "open_channel_3",
29 typeOfCommand: iccManager.STK_CMD_OPEN_CHANNEL,
30 text: "Open ID 1"}},
31 {command: "d01b810301410082028121850a436c6f73652049442031d004000a00b4",
32 func: testBipCommand,
33 expect: {name: "close_channel_1",
34 typeOfCommand: iccManager.STK_CMD_CLOSE_CHANNEL,
35 text: "Close ID 1"}},
36 {command: "d022810301420082028121850e5265636569766520446174612031b701c8d004000e00b4",
37 func: testBipCommand,
38 expect: {name: "receive_data_1",
39 typeOfCommand: iccManager.STK_CMD_RECEIVE_DATA,
40 text: "Receive Data 1"}},
41 {command: "d026810301430182028121850b53656e6420446174612031b6080001020304050607d004000b00b4",
42 func: testBipCommand,
43 expect: {name: "send_data_1",
44 typeOfCommand: iccManager.STK_CMD_SEND_DATA,
45 text: "Send Data 1"}},
46 ];
47
48 runNextTest();

mercurial