michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: MARIONETTE_HEAD_JS = "stk_helper.js"; michael@0: michael@0: function testGetInKey(command, expect) { michael@0: log("STK CMD " + JSON.stringify(command)); michael@0: is(command.typeOfCommand, iccManager.STK_CMD_GET_INKEY, expect.name); michael@0: is(command.commandQualifier, expect.commandQualifier, expect.name); michael@0: is(command.options.text, expect.text, expect.name); michael@0: is(command.options.isAlphabet, expect.isAlphabet, expect.name); michael@0: is(command.options.isUCS2, expect.isUCS2, expect.name); michael@0: is(command.options.isYesNoRequested, expect.isYesNoRequested, expect.name); michael@0: michael@0: let duration = command.options.duration; michael@0: if (duration) { michael@0: is(duration.timeUnit, expect.duration.timeUnit, expect.name); michael@0: is(duration.timeInterval, expect.duration.timeInterval, expect.name); michael@0: } michael@0: michael@0: runNextTest(); michael@0: } michael@0: michael@0: let tests = [ michael@0: {command: "d0158103012200820281828d0a04456e74657220222b22", michael@0: func: testGetInKey, michael@0: expect: {name: "get_inkey_cmd_1", michael@0: commandQualifier: 0x00, michael@0: text: "Enter \"+\""}}, michael@0: {command: "d0148103012200820281828d09004537bd2c07896022", michael@0: func: testGetInKey, michael@0: expect: {name: "get_inkey_cmd_2", michael@0: commandQualifier: 0x00, michael@0: text: "Enter \"0\""}}, michael@0: {command: "d01a8103012200820281828d0f043c474f2d4241434b57415244533e", michael@0: func: testGetInKey, michael@0: expect: {name: "get_inkey_cmd_3", michael@0: commandQualifier: 0x00, michael@0: text: ""}}, michael@0: {command: "d0138103012200820281828d08043c41424f52543e", michael@0: func: testGetInKey, michael@0: expect: {name: "get_inkey_cmd_4", michael@0: commandQualifier: 0x00, michael@0: text: ""}}, michael@0: {command: "d0158103012201820281828d0a04456e74657220227122", michael@0: func: testGetInKey, michael@0: expect: {name: "get_inkey_cmd_5", michael@0: commandQualifier: 0x01, michael@0: text: "Enter \"q\"", michael@0: isAlphabet: true}}, michael@0: {command: "d081ad8103012201820281828d81a104456e746572202278222e205468697320636f6d6d616e6420696e7374727563747320746865204d4520746f20646973706c617920746578742c20616e6420746f2065787065637420746865207573657220746f20656e74657220612073696e676c65206368617261637465722e20416e7920726573706f6e736520656e7465726564206279207468652075736572207368616c6c206265207061737365642074", michael@0: func: testGetInKey, michael@0: expect: {name: "get_inkey_cmd_6", michael@0: commandQualifier: 0x01, michael@0: text: "Enter \"x\". This command instructs the ME to display text, and to expect the user to enter a single character. Any response entered by the user shall be passed t", michael@0: isAlphabet: true}}, michael@0: {command: "d0168103012200820281828d0b043c54494d452d4f55543e", michael@0: func: testGetInKey, michael@0: expect: {name: "get_inkey_cmd_7", michael@0: commandQualifier: 0x00, michael@0: text: ""}}, michael@0: {command: "d0248103012200820281828d1908041704140420041004120421042204120423041904220415", michael@0: func: testGetInKey, michael@0: expect: {name: "get_inkey_cmd_8", michael@0: commandQualifier: 0x00, michael@0: text: "ЗДРАВСТВУЙТЕ"}}, michael@0: {command: "d081998103012200820281828d818d080417041404200410041204210422041204230419042204150417041404200410041204210422041204230419042204150417041404200410041204210422041204230419042204150417041404200410041204210422041204230419042204150417041404200410041204210422041204230419042204150417041404200410041204210422041204230419", michael@0: func: testGetInKey, michael@0: expect: {name: "get_inkey_cmd_9", michael@0: commandQualifier: 0x00, michael@0: text: "ЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕЗДРАВСТВУЙ"}}, michael@0: {command: "d0118103012203820281828d0604456e746572", michael@0: func: testGetInKey, michael@0: expect: {name: "get_inkey_cmd_10", michael@0: commandQualifier: 0x03, michael@0: text: "Enter", michael@0: isAlphabet: true, michael@0: isUCS2: true}}, michael@0: {command: "d0158103012204820281828d0a04456e74657220594553", michael@0: func: testGetInKey, michael@0: expect: {name: "get_inkey_cmd_11", michael@0: commandQualifier: 0x04, michael@0: text: "Enter YES", michael@0: isYesNoRequested: true}}, michael@0: {command: "d0148103012204820281828d0904456e746572204e4f", michael@0: func: testGetInKey, michael@0: expect: {name: "get_inkey_cmd_12", michael@0: commandQualifier: 0x04, michael@0: text: "Enter NO", michael@0: isYesNoRequested: true}}, michael@0: {command: "d0198103012200820281828d0a043c4e4f2d49434f4e3e1e020001", michael@0: func: testGetInKey, michael@0: expect: {name: "get_inkey_cmd_13", michael@0: commandQualifier: 0x00, michael@0: text: ""}}, michael@0: {command: "D0198103012200820281828D0A04456E74657220222B228402010A", michael@0: func: testGetInKey, michael@0: expect: {name: "get_inkey_cmd_14", michael@0: commandQualifier: 0x00, michael@0: text: "Enter \"+\"", michael@0: duration: {timeUnit: iccManager.STK_TIME_UNIT_SECOND, michael@0: timeInterval: 0x0A}}}, michael@0: ]; michael@0: michael@0: runNextTest();