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 testDisplayText(command, expect) { michael@0: log("STK CMD " + JSON.stringify(command)); michael@0: is(command.typeOfCommand, iccManager.STK_CMD_DISPLAY_TEXT, expect.name); michael@0: is(command.options.text, expect.text, expect.name); michael@0: is(command.commandQualifier, expect.commandQualifier, expect.name); michael@0: is(command.options.userClear, expect.userClear, expect.name); michael@0: is(command.options.isHighPriority, expect.isHighPriority, 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: "d01a8103012180820281028d0f04546f6f6c6b697420546573742031", michael@0: func: testDisplayText, michael@0: expect: {name: "display_text_cmd_1", michael@0: commandQualifier: 0x80, michael@0: text: "Toolkit Test 1", michael@0: userClear: true}}, michael@0: {command: "d01a8103012181820281028d0f04546f6f6c6b697420546573742032", michael@0: func: testDisplayText, michael@0: expect: {name: "display_text_cmd_2", michael@0: commandQualifier: 0x81, michael@0: text: "Toolkit Test 2", michael@0: isHighPriority: true, michael@0: userClear: true}}, michael@0: {command: "d0198103012180820281028d0e00d4f79bbd4ed341d4f29c0e9a01", michael@0: func: testDisplayText, michael@0: expect: {name: "display_text_cmd_3", michael@0: commandQualifier: 0x80, michael@0: text: "Toolkit Test 3", michael@0: userClear: true}}, michael@0: {command: "d01a8103012100820281028d0f04546f6f6c6b697420546573742034", michael@0: func: testDisplayText, michael@0: expect: {name: "display_text_cmd_4", michael@0: commandQualifier: 0x00, michael@0: text: "Toolkit Test 4"}}, michael@0: {command: "d081ad8103012180820281028d81a1045468697320636f6d6d616e6420696e7374727563747320746865204d4520746f20646973706c617920612074657874206d6573736167652e20497420616c6c6f7773207468652053494d20746f20646566696e6520746865207072696f72697479206f662074686174206d6573736167652c20616e6420746865207465787420737472696e6720666f726d61742e2054776f207479706573206f66207072696f", michael@0: func: testDisplayText, michael@0: expect: {name: "display_text_cmd_5", michael@0: commandQualifier: 0x80, michael@0: text: "This command instructs the ME to display a text message. It allows the SIM to define the priority of that message, and the text string format. Two types of prio", michael@0: userClear: true}}, michael@0: {command: "d01a8103012180820281028d0f043c474f2d4241434b57415244533e", michael@0: func: testDisplayText, michael@0: expect: {name: "display_text_cmd_6", michael@0: commandQualifier: 0x80, michael@0: text: "", michael@0: userClear: true}}, michael@0: {command: "d0248103012180820281028d1908041704140420041004120421042204120423041904220415", michael@0: func: testDisplayText, michael@0: expect: {name: "display_text_cmd_7", michael@0: commandQualifier: 0x80, michael@0: text: "ЗДРАВСТВУЙТЕ", michael@0: userClear: true}}, michael@0: {command: "d0108103012180820281028d05084f60597d", michael@0: func: testDisplayText, michael@0: expect: {name: "display_text_cmd_8", michael@0: commandQualifier: 0x80, michael@0: text: "你好", michael@0: userClear: true}}, michael@0: {command: "d0128103012180820281028d07080038003030eb", michael@0: func: testDisplayText, michael@0: expect: {name: "display_text_cmd_9", michael@0: commandQualifier: 0x80, michael@0: text: "80ル", michael@0: userClear: true}}, michael@0: {command: "d0288103012180820281020d1d00d3309bfc06c95c301aa8e80259c3ec34b9ac07c9602f58ed159bb940", michael@0: func: testDisplayText, michael@0: expect: {name: "display_text_cmd_10", michael@0: commandQualifier: 0x80, michael@0: text: "Saldo 2.04 E. Validez 20/05/13. ", michael@0: userClear: true}}, michael@0: {command: "d0198103012180820281028D0A043130205365636F6E648402010A", michael@0: func: testDisplayText, michael@0: expect: {name: "display_text_cmd_11", michael@0: commandQualifier: 0x80, michael@0: text: "10 Second", michael@0: userClear: true, michael@0: duration: {timeUnit: iccManager.STK_TIME_UNIT_SECOND, michael@0: timeInterval: 0x0A}}}, michael@0: ]; michael@0: michael@0: runNextTest();