dom/icc/tests/marionette/test_stk_display_text.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/icc/tests/marionette/test_stk_display_text.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,94 @@
     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 testDisplayText(command, expect) {
    1.10 +  log("STK CMD " + JSON.stringify(command));
    1.11 +  is(command.typeOfCommand, iccManager.STK_CMD_DISPLAY_TEXT, expect.name);
    1.12 +  is(command.options.text, expect.text, expect.name);
    1.13 +  is(command.commandQualifier, expect.commandQualifier, expect.name);
    1.14 +  is(command.options.userClear, expect.userClear, expect.name);
    1.15 +  is(command.options.isHighPriority, expect.isHighPriority, expect.name);
    1.16 +
    1.17 +  let duration = command.options.duration;
    1.18 +  if (duration) {
    1.19 +    is(duration.timeUnit, expect.duration.timeUnit, expect.name);
    1.20 +    is(duration.timeInterval, expect.duration.timeInterval, expect.name);
    1.21 +  }
    1.22 +
    1.23 +  runNextTest();
    1.24 +}
    1.25 +
    1.26 +let tests = [
    1.27 +  {command: "d01a8103012180820281028d0f04546f6f6c6b697420546573742031",
    1.28 +   func: testDisplayText,
    1.29 +   expect: {name: "display_text_cmd_1",
    1.30 +            commandQualifier: 0x80,
    1.31 +            text: "Toolkit Test 1",
    1.32 +            userClear: true}},
    1.33 +  {command: "d01a8103012181820281028d0f04546f6f6c6b697420546573742032",
    1.34 +   func: testDisplayText,
    1.35 +   expect: {name: "display_text_cmd_2",
    1.36 +            commandQualifier: 0x81,
    1.37 +            text: "Toolkit Test 2",
    1.38 +            isHighPriority: true,
    1.39 +            userClear: true}},
    1.40 +  {command: "d0198103012180820281028d0e00d4f79bbd4ed341d4f29c0e9a01",
    1.41 +   func: testDisplayText,
    1.42 +   expect: {name: "display_text_cmd_3",
    1.43 +            commandQualifier: 0x80,
    1.44 +            text: "Toolkit Test 3",
    1.45 +            userClear: true}},
    1.46 +  {command: "d01a8103012100820281028d0f04546f6f6c6b697420546573742034",
    1.47 +   func: testDisplayText,
    1.48 +   expect: {name: "display_text_cmd_4",
    1.49 +            commandQualifier: 0x00,
    1.50 +            text: "Toolkit Test 4"}},
    1.51 +  {command: "d081ad8103012180820281028d81a1045468697320636f6d6d616e6420696e7374727563747320746865204d4520746f20646973706c617920612074657874206d6573736167652e20497420616c6c6f7773207468652053494d20746f20646566696e6520746865207072696f72697479206f662074686174206d6573736167652c20616e6420746865207465787420737472696e6720666f726d61742e2054776f207479706573206f66207072696f",
    1.52 +   func: testDisplayText,
    1.53 +   expect: {name: "display_text_cmd_5",
    1.54 +            commandQualifier: 0x80,
    1.55 +            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",
    1.56 +            userClear: true}},
    1.57 +  {command: "d01a8103012180820281028d0f043c474f2d4241434b57415244533e",
    1.58 +   func: testDisplayText,
    1.59 +   expect: {name: "display_text_cmd_6",
    1.60 +            commandQualifier: 0x80,
    1.61 +            text: "<GO-BACKWARDS>",
    1.62 +            userClear: true}},
    1.63 +   {command: "d0248103012180820281028d1908041704140420041004120421042204120423041904220415",
    1.64 +    func: testDisplayText,
    1.65 +    expect: {name: "display_text_cmd_7",
    1.66 +             commandQualifier: 0x80,
    1.67 +             text: "ЗДРАВСТВУЙТЕ",
    1.68 +             userClear: true}},
    1.69 +   {command: "d0108103012180820281028d05084f60597d",
    1.70 +    func: testDisplayText,
    1.71 +    expect: {name: "display_text_cmd_8",
    1.72 +             commandQualifier: 0x80,
    1.73 +             text: "你好",
    1.74 +             userClear: true}},
    1.75 +   {command: "d0128103012180820281028d07080038003030eb",
    1.76 +    func: testDisplayText,
    1.77 +    expect: {name: "display_text_cmd_9",
    1.78 +             commandQualifier: 0x80,
    1.79 +             text: "80ル",
    1.80 +             userClear: true}},
    1.81 +   {command: "d0288103012180820281020d1d00d3309bfc06c95c301aa8e80259c3ec34b9ac07c9602f58ed159bb940",
    1.82 +    func: testDisplayText,
    1.83 +    expect: {name: "display_text_cmd_10",
    1.84 +             commandQualifier: 0x80,
    1.85 +             text: "Saldo 2.04 E. Validez 20/05/13. ",
    1.86 +             userClear: true}},
    1.87 +  {command: "d0198103012180820281028D0A043130205365636F6E648402010A",
    1.88 +   func: testDisplayText,
    1.89 +   expect: {name: "display_text_cmd_11",
    1.90 +            commandQualifier: 0x80,
    1.91 +            text: "10 Second",
    1.92 +            userClear: true,
    1.93 +            duration: {timeUnit: iccManager.STK_TIME_UNIT_SECOND,
    1.94 +                       timeInterval: 0x0A}}},
    1.95 +];
    1.96 +
    1.97 +runNextTest();

mercurial