1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/icc/tests/marionette/test_stk_bip_command.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,48 @@ 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 testBipCommand(command, expect) { 1.10 + log("STK CMD " + JSON.stringify(command)); 1.11 + 1.12 + is(command.typeOfCommand, expect.typeOfCommand, expect.name); 1.13 + is(command.options.text, expect.text, expect.name); 1.14 + 1.15 + runNextTest(); 1.16 +} 1.17 + 1.18 +let tests = [ 1.19 + {command: "d04b81030140018202818205074f70656e204944350702030403041f0239020578470a065465737447700272730d08f4557365724c6f670d08f4557365725077643c0301ad9c3e052101010101", 1.20 + func: testBipCommand, 1.21 + expect: {name: "open_channel_1", 1.22 + typeOfCommand: iccManager.STK_CMD_OPEN_CHANNEL, 1.23 + text: "Open ID"}}, 1.24 + {command: "d0448103014001820281820500350702030403041f0239020578470a065465737447700272730d08f4557365724c6f670d08f4557365725077643c0301ad9c3e052101010101", 1.25 + func: testBipCommand, 1.26 + expect: {name: "open_channel_2", 1.27 + typeOfCommand: iccManager.STK_CMD_OPEN_CHANNEL, 1.28 + text: ""}}, 1.29 + {command: "d05381030140018202818205094f70656e2049442031350702030403041f0239020578470a065465737447700272730d08f4557365724c6f670d08f4557365725077643c0301ad9c3e052101010101d004000900b4", 1.30 + func: testBipCommand, 1.31 + expect: {name: "open_channel_3", 1.32 + typeOfCommand: iccManager.STK_CMD_OPEN_CHANNEL, 1.33 + text: "Open ID 1"}}, 1.34 + {command: "d01b810301410082028121850a436c6f73652049442031d004000a00b4", 1.35 + func: testBipCommand, 1.36 + expect: {name: "close_channel_1", 1.37 + typeOfCommand: iccManager.STK_CMD_CLOSE_CHANNEL, 1.38 + text: "Close ID 1"}}, 1.39 + {command: "d022810301420082028121850e5265636569766520446174612031b701c8d004000e00b4", 1.40 + func: testBipCommand, 1.41 + expect: {name: "receive_data_1", 1.42 + typeOfCommand: iccManager.STK_CMD_RECEIVE_DATA, 1.43 + text: "Receive Data 1"}}, 1.44 + {command: "d026810301430182028121850b53656e6420446174612031b6080001020304050607d004000b00b4", 1.45 + func: testBipCommand, 1.46 + expect: {name: "send_data_1", 1.47 + typeOfCommand: iccManager.STK_CMD_SEND_DATA, 1.48 + text: "Send Data 1"}}, 1.49 +]; 1.50 + 1.51 +runNextTest();