Wed, 31 Dec 2014 06:09:35 +0100
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 testGetInKey(command, expect) {
7 log("STK CMD " + JSON.stringify(command));
8 is(command.typeOfCommand, iccManager.STK_CMD_GET_INKEY, expect.name);
9 is(command.commandQualifier, expect.commandQualifier, expect.name);
10 is(command.options.text, expect.text, expect.name);
11 is(command.options.isAlphabet, expect.isAlphabet, expect.name);
12 is(command.options.isUCS2, expect.isUCS2, expect.name);
13 is(command.options.isYesNoRequested, expect.isYesNoRequested, expect.name);
15 let duration = command.options.duration;
16 if (duration) {
17 is(duration.timeUnit, expect.duration.timeUnit, expect.name);
18 is(duration.timeInterval, expect.duration.timeInterval, expect.name);
19 }
21 runNextTest();
22 }
24 let tests = [
25 {command: "d0158103012200820281828d0a04456e74657220222b22",
26 func: testGetInKey,
27 expect: {name: "get_inkey_cmd_1",
28 commandQualifier: 0x00,
29 text: "Enter \"+\""}},
30 {command: "d0148103012200820281828d09004537bd2c07896022",
31 func: testGetInKey,
32 expect: {name: "get_inkey_cmd_2",
33 commandQualifier: 0x00,
34 text: "Enter \"0\""}},
35 {command: "d01a8103012200820281828d0f043c474f2d4241434b57415244533e",
36 func: testGetInKey,
37 expect: {name: "get_inkey_cmd_3",
38 commandQualifier: 0x00,
39 text: "<GO-BACKWARDS>"}},
40 {command: "d0138103012200820281828d08043c41424f52543e",
41 func: testGetInKey,
42 expect: {name: "get_inkey_cmd_4",
43 commandQualifier: 0x00,
44 text: "<ABORT>"}},
45 {command: "d0158103012201820281828d0a04456e74657220227122",
46 func: testGetInKey,
47 expect: {name: "get_inkey_cmd_5",
48 commandQualifier: 0x01,
49 text: "Enter \"q\"",
50 isAlphabet: true}},
51 {command: "d081ad8103012201820281828d81a104456e746572202278222e205468697320636f6d6d616e6420696e7374727563747320746865204d4520746f20646973706c617920746578742c20616e6420746f2065787065637420746865207573657220746f20656e74657220612073696e676c65206368617261637465722e20416e7920726573706f6e736520656e7465726564206279207468652075736572207368616c6c206265207061737365642074",
52 func: testGetInKey,
53 expect: {name: "get_inkey_cmd_6",
54 commandQualifier: 0x01,
55 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",
56 isAlphabet: true}},
57 {command: "d0168103012200820281828d0b043c54494d452d4f55543e",
58 func: testGetInKey,
59 expect: {name: "get_inkey_cmd_7",
60 commandQualifier: 0x00,
61 text: "<TIME-OUT>"}},
62 {command: "d0248103012200820281828d1908041704140420041004120421042204120423041904220415",
63 func: testGetInKey,
64 expect: {name: "get_inkey_cmd_8",
65 commandQualifier: 0x00,
66 text: "ЗДРАВСТВУЙТЕ"}},
67 {command: "d081998103012200820281828d818d080417041404200410041204210422041204230419042204150417041404200410041204210422041204230419042204150417041404200410041204210422041204230419042204150417041404200410041204210422041204230419042204150417041404200410041204210422041204230419042204150417041404200410041204210422041204230419",
68 func: testGetInKey,
69 expect: {name: "get_inkey_cmd_9",
70 commandQualifier: 0x00,
71 text: "ЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕЗДРАВСТВУЙ"}},
72 {command: "d0118103012203820281828d0604456e746572",
73 func: testGetInKey,
74 expect: {name: "get_inkey_cmd_10",
75 commandQualifier: 0x03,
76 text: "Enter",
77 isAlphabet: true,
78 isUCS2: true}},
79 {command: "d0158103012204820281828d0a04456e74657220594553",
80 func: testGetInKey,
81 expect: {name: "get_inkey_cmd_11",
82 commandQualifier: 0x04,
83 text: "Enter YES",
84 isYesNoRequested: true}},
85 {command: "d0148103012204820281828d0904456e746572204e4f",
86 func: testGetInKey,
87 expect: {name: "get_inkey_cmd_12",
88 commandQualifier: 0x04,
89 text: "Enter NO",
90 isYesNoRequested: true}},
91 {command: "d0198103012200820281828d0a043c4e4f2d49434f4e3e1e020001",
92 func: testGetInKey,
93 expect: {name: "get_inkey_cmd_13",
94 commandQualifier: 0x00,
95 text: "<NO-ICON>"}},
96 {command: "D0198103012200820281828D0A04456E74657220222B228402010A",
97 func: testGetInKey,
98 expect: {name: "get_inkey_cmd_14",
99 commandQualifier: 0x00,
100 text: "Enter \"+\"",
101 duration: {timeUnit: iccManager.STK_TIME_UNIT_SECOND,
102 timeInterval: 0x0A}}},
103 ];
105 runNextTest();