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