dom/icc/tests/marionette/test_stk_display_text.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 testDisplayText(command, expect) {
michael@0 7 log("STK CMD " + JSON.stringify(command));
michael@0 8 is(command.typeOfCommand, iccManager.STK_CMD_DISPLAY_TEXT, expect.name);
michael@0 9 is(command.options.text, expect.text, expect.name);
michael@0 10 is(command.commandQualifier, expect.commandQualifier, expect.name);
michael@0 11 is(command.options.userClear, expect.userClear, expect.name);
michael@0 12 is(command.options.isHighPriority, expect.isHighPriority, expect.name);
michael@0 13
michael@0 14 let duration = command.options.duration;
michael@0 15 if (duration) {
michael@0 16 is(duration.timeUnit, expect.duration.timeUnit, expect.name);
michael@0 17 is(duration.timeInterval, expect.duration.timeInterval, expect.name);
michael@0 18 }
michael@0 19
michael@0 20 runNextTest();
michael@0 21 }
michael@0 22
michael@0 23 let tests = [
michael@0 24 {command: "d01a8103012180820281028d0f04546f6f6c6b697420546573742031",
michael@0 25 func: testDisplayText,
michael@0 26 expect: {name: "display_text_cmd_1",
michael@0 27 commandQualifier: 0x80,
michael@0 28 text: "Toolkit Test 1",
michael@0 29 userClear: true}},
michael@0 30 {command: "d01a8103012181820281028d0f04546f6f6c6b697420546573742032",
michael@0 31 func: testDisplayText,
michael@0 32 expect: {name: "display_text_cmd_2",
michael@0 33 commandQualifier: 0x81,
michael@0 34 text: "Toolkit Test 2",
michael@0 35 isHighPriority: true,
michael@0 36 userClear: true}},
michael@0 37 {command: "d0198103012180820281028d0e00d4f79bbd4ed341d4f29c0e9a01",
michael@0 38 func: testDisplayText,
michael@0 39 expect: {name: "display_text_cmd_3",
michael@0 40 commandQualifier: 0x80,
michael@0 41 text: "Toolkit Test 3",
michael@0 42 userClear: true}},
michael@0 43 {command: "d01a8103012100820281028d0f04546f6f6c6b697420546573742034",
michael@0 44 func: testDisplayText,
michael@0 45 expect: {name: "display_text_cmd_4",
michael@0 46 commandQualifier: 0x00,
michael@0 47 text: "Toolkit Test 4"}},
michael@0 48 {command: "d081ad8103012180820281028d81a1045468697320636f6d6d616e6420696e7374727563747320746865204d4520746f20646973706c617920612074657874206d6573736167652e20497420616c6c6f7773207468652053494d20746f20646566696e6520746865207072696f72697479206f662074686174206d6573736167652c20616e6420746865207465787420737472696e6720666f726d61742e2054776f207479706573206f66207072696f",
michael@0 49 func: testDisplayText,
michael@0 50 expect: {name: "display_text_cmd_5",
michael@0 51 commandQualifier: 0x80,
michael@0 52 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 53 userClear: true}},
michael@0 54 {command: "d01a8103012180820281028d0f043c474f2d4241434b57415244533e",
michael@0 55 func: testDisplayText,
michael@0 56 expect: {name: "display_text_cmd_6",
michael@0 57 commandQualifier: 0x80,
michael@0 58 text: "<GO-BACKWARDS>",
michael@0 59 userClear: true}},
michael@0 60 {command: "d0248103012180820281028d1908041704140420041004120421042204120423041904220415",
michael@0 61 func: testDisplayText,
michael@0 62 expect: {name: "display_text_cmd_7",
michael@0 63 commandQualifier: 0x80,
michael@0 64 text: "ЗДРАВСТВУЙТЕ",
michael@0 65 userClear: true}},
michael@0 66 {command: "d0108103012180820281028d05084f60597d",
michael@0 67 func: testDisplayText,
michael@0 68 expect: {name: "display_text_cmd_8",
michael@0 69 commandQualifier: 0x80,
michael@0 70 text: "你好",
michael@0 71 userClear: true}},
michael@0 72 {command: "d0128103012180820281028d07080038003030eb",
michael@0 73 func: testDisplayText,
michael@0 74 expect: {name: "display_text_cmd_9",
michael@0 75 commandQualifier: 0x80,
michael@0 76 text: "80ル",
michael@0 77 userClear: true}},
michael@0 78 {command: "d0288103012180820281020d1d00d3309bfc06c95c301aa8e80259c3ec34b9ac07c9602f58ed159bb940",
michael@0 79 func: testDisplayText,
michael@0 80 expect: {name: "display_text_cmd_10",
michael@0 81 commandQualifier: 0x80,
michael@0 82 text: "Saldo 2.04 E. Validez 20/05/13. ",
michael@0 83 userClear: true}},
michael@0 84 {command: "d0198103012180820281028D0A043130205365636F6E648402010A",
michael@0 85 func: testDisplayText,
michael@0 86 expect: {name: "display_text_cmd_11",
michael@0 87 commandQualifier: 0x80,
michael@0 88 text: "10 Second",
michael@0 89 userClear: true,
michael@0 90 duration: {timeUnit: iccManager.STK_TIME_UNIT_SECOND,
michael@0 91 timeInterval: 0x0A}}},
michael@0 92 ];
michael@0 93
michael@0 94 runNextTest();

mercurial