dom/icc/tests/marionette/test_stk_display_text.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial