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

mercurial