1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/icc/tests/marionette/test_stk_get_inkey.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,105 @@ 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 testGetInKey(command, expect) { 1.10 + log("STK CMD " + JSON.stringify(command)); 1.11 + is(command.typeOfCommand, iccManager.STK_CMD_GET_INKEY, expect.name); 1.12 + is(command.commandQualifier, expect.commandQualifier, expect.name); 1.13 + is(command.options.text, expect.text, expect.name); 1.14 + is(command.options.isAlphabet, expect.isAlphabet, expect.name); 1.15 + is(command.options.isUCS2, expect.isUCS2, expect.name); 1.16 + is(command.options.isYesNoRequested, expect.isYesNoRequested, expect.name); 1.17 + 1.18 + let duration = command.options.duration; 1.19 + if (duration) { 1.20 + is(duration.timeUnit, expect.duration.timeUnit, expect.name); 1.21 + is(duration.timeInterval, expect.duration.timeInterval, expect.name); 1.22 + } 1.23 + 1.24 + runNextTest(); 1.25 +} 1.26 + 1.27 +let tests = [ 1.28 + {command: "d0158103012200820281828d0a04456e74657220222b22", 1.29 + func: testGetInKey, 1.30 + expect: {name: "get_inkey_cmd_1", 1.31 + commandQualifier: 0x00, 1.32 + text: "Enter \"+\""}}, 1.33 + {command: "d0148103012200820281828d09004537bd2c07896022", 1.34 + func: testGetInKey, 1.35 + expect: {name: "get_inkey_cmd_2", 1.36 + commandQualifier: 0x00, 1.37 + text: "Enter \"0\""}}, 1.38 + {command: "d01a8103012200820281828d0f043c474f2d4241434b57415244533e", 1.39 + func: testGetInKey, 1.40 + expect: {name: "get_inkey_cmd_3", 1.41 + commandQualifier: 0x00, 1.42 + text: "<GO-BACKWARDS>"}}, 1.43 + {command: "d0138103012200820281828d08043c41424f52543e", 1.44 + func: testGetInKey, 1.45 + expect: {name: "get_inkey_cmd_4", 1.46 + commandQualifier: 0x00, 1.47 + text: "<ABORT>"}}, 1.48 + {command: "d0158103012201820281828d0a04456e74657220227122", 1.49 + func: testGetInKey, 1.50 + expect: {name: "get_inkey_cmd_5", 1.51 + commandQualifier: 0x01, 1.52 + text: "Enter \"q\"", 1.53 + isAlphabet: true}}, 1.54 + {command: "d081ad8103012201820281828d81a104456e746572202278222e205468697320636f6d6d616e6420696e7374727563747320746865204d4520746f20646973706c617920746578742c20616e6420746f2065787065637420746865207573657220746f20656e74657220612073696e676c65206368617261637465722e20416e7920726573706f6e736520656e7465726564206279207468652075736572207368616c6c206265207061737365642074", 1.55 + func: testGetInKey, 1.56 + expect: {name: "get_inkey_cmd_6", 1.57 + commandQualifier: 0x01, 1.58 + 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", 1.59 + isAlphabet: true}}, 1.60 + {command: "d0168103012200820281828d0b043c54494d452d4f55543e", 1.61 + func: testGetInKey, 1.62 + expect: {name: "get_inkey_cmd_7", 1.63 + commandQualifier: 0x00, 1.64 + text: "<TIME-OUT>"}}, 1.65 + {command: "d0248103012200820281828d1908041704140420041004120421042204120423041904220415", 1.66 + func: testGetInKey, 1.67 + expect: {name: "get_inkey_cmd_8", 1.68 + commandQualifier: 0x00, 1.69 + text: "ЗДРАВСТВУЙТЕ"}}, 1.70 + {command: "d081998103012200820281828d818d080417041404200410041204210422041204230419042204150417041404200410041204210422041204230419042204150417041404200410041204210422041204230419042204150417041404200410041204210422041204230419042204150417041404200410041204210422041204230419042204150417041404200410041204210422041204230419", 1.71 + func: testGetInKey, 1.72 + expect: {name: "get_inkey_cmd_9", 1.73 + commandQualifier: 0x00, 1.74 + text: "ЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕЗДРАВСТВУЙТЕЗДРАВСТВУЙ"}}, 1.75 + {command: "d0118103012203820281828d0604456e746572", 1.76 + func: testGetInKey, 1.77 + expect: {name: "get_inkey_cmd_10", 1.78 + commandQualifier: 0x03, 1.79 + text: "Enter", 1.80 + isAlphabet: true, 1.81 + isUCS2: true}}, 1.82 + {command: "d0158103012204820281828d0a04456e74657220594553", 1.83 + func: testGetInKey, 1.84 + expect: {name: "get_inkey_cmd_11", 1.85 + commandQualifier: 0x04, 1.86 + text: "Enter YES", 1.87 + isYesNoRequested: true}}, 1.88 + {command: "d0148103012204820281828d0904456e746572204e4f", 1.89 + func: testGetInKey, 1.90 + expect: {name: "get_inkey_cmd_12", 1.91 + commandQualifier: 0x04, 1.92 + text: "Enter NO", 1.93 + isYesNoRequested: true}}, 1.94 + {command: "d0198103012200820281828d0a043c4e4f2d49434f4e3e1e020001", 1.95 + func: testGetInKey, 1.96 + expect: {name: "get_inkey_cmd_13", 1.97 + commandQualifier: 0x00, 1.98 + text: "<NO-ICON>"}}, 1.99 + {command: "D0198103012200820281828D0A04456E74657220222B228402010A", 1.100 + func: testGetInKey, 1.101 + expect: {name: "get_inkey_cmd_14", 1.102 + commandQualifier: 0x00, 1.103 + text: "Enter \"+\"", 1.104 + duration: {timeUnit: iccManager.STK_TIME_UNIT_SECOND, 1.105 + timeInterval: 0x0A}}}, 1.106 +]; 1.107 + 1.108 +runNextTest();