From 3ae79dbf643c31f8ba21c9975b8586eb3d6deca2 Mon Sep 17 00:00:00 2001 From: ste Date: Mon, 31 Jul 2017 14:01:12 +0100 Subject: [PATCH 01/18] GPII-2212: Added language support for Windows. --- .../deviceReporter/installedSolutions.json | 4 ++ testData/solutions/win32.json5 | 65 ++++++++++++++++++- 2 files changed, 68 insertions(+), 1 deletion(-) diff --git a/testData/deviceReporter/installedSolutions.json b/testData/deviceReporter/installedSolutions.json index ce25564ec..1473e4f5e 100644 --- a/testData/deviceReporter/installedSolutions.json +++ b/testData/deviceReporter/installedSolutions.json @@ -75,6 +75,10 @@ "id": "com.microsoft.windows.screenResolution" }, + { + "id": "com.microsoft.windows.language" + }, + { "id": "com.android.activitymanager" }, diff --git a/testData/solutions/win32.json5 b/testData/solutions/win32.json5 index d16c3af3b..75112d0cf 100644 --- a/testData/solutions/win32.json5 +++ b/testData/solutions/win32.json5 @@ -840,7 +840,6 @@ ] }, - "com.microsoft.windows.narrator": { "name": "Windows Built-in Narrator", "contexts": { @@ -1112,6 +1111,70 @@ ] }, + "com.microsoft.windows.language": { + "name": "Windows Display Language", + "contexts": { + "OS": [ + { + "id": "win32", + "version": ">=5.0" + } + ] + }, + "settingsHandlers": { + "configure": { + "type": "gpii.windows.registrySettingsHandler", + "options": { + "hKey": "HKEY_CURRENT_USER", + "path": "Control Panel\\Desktop\\MuiCached", + "dataTypes": { + "MachinePreferredUILanguages": "REG_SZ" + } + }, + "capabilities": [ + "http://registry\\.gpii\\.net/common/language" + ], + "capabilitiesTransformations": { + "MachinePreferredUILanguages": { + "transform": { + "type": "fluid.transforms.value", + "inputPath": "http://registry\\.gpii\\.net/common/language" + } + } + } + } + }, + "configure": [ + "settings.configure" + ], + "restore": [ + "settings.configure" + ], + "start": [ + { + "type": "gpii.windows.closeApplications", + "level": "low", + "options": { + "restart": true + } + } + ], + "stop": [ + { + "type": "gpii.windows.closeApplications", + "level": "low", + "options": { + "restart": true + } + } + ], + "isInstalled": [ + { + "type": "gpii.deviceReporter.alwaysInstalled" + } + ] + }, + "org.nvda-project": { "name": "NVDA Screen Reader", "contexts": { From c4ddacd07034e7d2ec92a9277709215dc333d31c Mon Sep 17 00:00:00 2001 From: ste Date: Mon, 31 Jul 2017 14:16:01 +0100 Subject: [PATCH 02/18] GPII-2212: Added "catalina" preference set, for the language preference. --- testData/preferences/catalina.json | 12 ++++++++++++ testData/preferences/catalina.md | 7 +++++++ 2 files changed, 19 insertions(+) create mode 100644 testData/preferences/catalina.json create mode 100644 testData/preferences/catalina.md diff --git a/testData/preferences/catalina.json b/testData/preferences/catalina.json new file mode 100644 index 000000000..c69f1aa13 --- /dev/null +++ b/testData/preferences/catalina.json @@ -0,0 +1,12 @@ +{ + "flat": { + "contexts": { + "gpii-default": { + "name": "Default preferences", + "preferences": { + "http://registry.gpii.net/common/language": "es-ES" + } + } + } + } +} diff --git a/testData/preferences/catalina.md b/testData/preferences/catalina.md new file mode 100644 index 000000000..0464396e7 --- /dev/null +++ b/testData/preferences/catalina.md @@ -0,0 +1,7 @@ +# catalina + +This preference set sets the OS language to Spanish (Spain), es-ES. + +## Testing + +For this to work correctly, the es-ES language pack needs to be installed on Windows. See GPII-2212. From c47e9d0da88a50df94e7cf2415b14f2b35d93f89 Mon Sep 17 00:00:00 2001 From: ste Date: Tue, 16 Jan 2018 21:14:10 +0000 Subject: [PATCH 03/18] GPII-2212: Added "telugu" persona, for the Telugu language. --- testData/preferences/telugu.json | 12 ++++++++++++ testData/preferences/telugu.md | 7 +++++++ 2 files changed, 19 insertions(+) create mode 100644 testData/preferences/telugu.json create mode 100644 testData/preferences/telugu.md diff --git a/testData/preferences/telugu.json b/testData/preferences/telugu.json new file mode 100644 index 000000000..1a4fc4185 --- /dev/null +++ b/testData/preferences/telugu.json @@ -0,0 +1,12 @@ +{ + "flat": { + "contexts": { + "gpii-default": { + "name": "Default preferences", + "preferences": { + "http://registry.gpii.net/common/language": "te-IN" + } + } + } + } +} diff --git a/testData/preferences/telugu.md b/testData/preferences/telugu.md new file mode 100644 index 000000000..2067614b9 --- /dev/null +++ b/testData/preferences/telugu.md @@ -0,0 +1,7 @@ +# telugu + +This preference set sets the OS language to Telugu, te-IN. + +## Testing + +For this to work correctly, the te-IN language pack needs to be installed on Windows. See GPII-2212. From 38576a6fb06c66236a8c4c5a666c5ccae6c131aa Mon Sep 17 00:00:00 2001 From: ste Date: Fri, 26 Jan 2018 12:20:06 +0000 Subject: [PATCH 04/18] GPII-2212: Made language still work after reboot - added another registry location for language change Also, added "tom" who speaks US English --- testData/preferences/tom.json | 12 ++++++++++++ testData/preferences/tom.md | 3 +++ testData/solutions/win32.json5 | 35 +++++++++++++++++++++++++++++++--- 3 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 testData/preferences/tom.json create mode 100644 testData/preferences/tom.md diff --git a/testData/preferences/tom.json b/testData/preferences/tom.json new file mode 100644 index 000000000..0acaa795d --- /dev/null +++ b/testData/preferences/tom.json @@ -0,0 +1,12 @@ +{ + "flat": { + "contexts": { + "gpii-default": { + "name": "Default preferences", + "preferences": { + "http://registry.gpii.net/common/language": "en-US" + } + } + } + } +} diff --git a/testData/preferences/tom.md b/testData/preferences/tom.md new file mode 100644 index 000000000..74c5152f5 --- /dev/null +++ b/testData/preferences/tom.md @@ -0,0 +1,3 @@ +# tom + +This preference set sets the OS language to English (US), en-US. diff --git a/testData/solutions/win32.json5 b/testData/solutions/win32.json5 index 6fb41cb8f..0c31593d6 100644 --- a/testData/solutions/win32.json5 +++ b/testData/solutions/win32.json5 @@ -1308,7 +1308,7 @@ ] }, "settingsHandlers": { - "configure": { + "configure1": { "type": "gpii.windows.registrySettingsHandler", "options": { "hKey": "HKEY_CURRENT_USER", @@ -1327,14 +1327,43 @@ "inputPath": "http://registry\\.gpii\\.net/common/language" } } + }, + "supportedSettings": { + "MachinePreferredUILanguages": {} + } + }, + "configure2": { + "type": "gpii.windows.registrySettingsHandler", + "options": { + "hKey": "HKEY_CURRENT_USER", + "path": "Control Panel\\Desktop", + "dataTypes": { + "PreferredUILanguages": "REG_SZ" + } + }, + "capabilities": [ + "http://registry\\.gpii\\.net/common/language" + ], + "capabilitiesTransformations": { + "PreferredUILanguages": { + "transform": { + "type": "fluid.transforms.value", + "inputPath": "http://registry\\.gpii\\.net/common/language" + } + } + }, + "supportedSettings": { + "PreferredUILanguages": {} } } }, "configure": [ - "settings.configure" + "settings.configure1", + "settings.configure2" ], "restore": [ - "settings.configure" + "settings.configure1", + "settings.configure2" ], "start": [ { From 9d7801bb26673d733366c70670888e61f614a31b Mon Sep 17 00:00:00 2001 From: ste Date: Thu, 15 Mar 2018 13:25:47 +0000 Subject: [PATCH 05/18] GPII-2578: Made findProcessesByCommand case-insensitive for Windows. --- .../processReporter/src/processesBridge.js | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/gpii/node_modules/processReporter/src/processesBridge.js b/gpii/node_modules/processReporter/src/processesBridge.js index b4d617994..04511fc4c 100644 --- a/gpii/node_modules/processReporter/src/processesBridge.js +++ b/gpii/node_modules/processReporter/src/processesBridge.js @@ -16,6 +16,7 @@ https://github.com/gpii/universal/LICENSE.txt var fluid = fluid || require("infusion"); var gpii = fluid.registerNamespace("gpii"); +var os = require("os"); fluid.defaults("gpii.processes", { gradeNames: ["fluid.component", "fluid.contextAware"], @@ -145,7 +146,7 @@ gpii.processes.findProcessByPid = function (that, pid, procArray) { /** * Return a list of process information objects that match the given - * command name. Return san empty array if not matching name is found. + * command name. Returns an empty array if not matching name is found. * * @param that {Component} - an instance of a processes component. * @param commandName {String} - the name of the processe to inspect. @@ -159,7 +160,7 @@ gpii.processes.findProcessesByCommand = function (that, commandName, procArray) procArray = that.getProcessList(commandName); } return fluid.accumulate(procArray, function (aProcInfo, matchingProcs) { - if (aProcInfo.command === commandName) { + if (gpii.processes.compareProcessNames(aProcInfo.command, commandName)) { matchingProcs.push(aProcInfo); } return matchingProcs; @@ -265,3 +266,18 @@ gpii.processes.initProcInfoNotRunning = function (that, command) { gpii.processes.getProcessList = function (/* identifier */) { return []; }; + +var compare = (os.platform() === "win32") + ? (new Intl.Collator(undefined, {sensitivity:"base"})).compare + : Object.is; + +/** + * Compares the names of two processes, returning a boolean indicating whether or not they are equal according to + * the case-sensitivity rules of the OS. + * + * @param processA {String} Name of a process. + * @param processB {String} Name of another process. + */ +gpii.processes.compareProcessNames = function (processA, processB) { + return !compare(processA, processB); +}; From 483167796eb4fee8f242ac63fdbbd50aa28f1729 Mon Sep 17 00:00:00 2001 From: ste Date: Tue, 20 Mar 2018 11:38:57 +0000 Subject: [PATCH 06/18] GPII-2578: Implemented the os detection the right way --- .../processReporter/src/processesBridge.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/gpii/node_modules/processReporter/src/processesBridge.js b/gpii/node_modules/processReporter/src/processesBridge.js index 04511fc4c..0d395c071 100644 --- a/gpii/node_modules/processReporter/src/processesBridge.js +++ b/gpii/node_modules/processReporter/src/processesBridge.js @@ -16,7 +16,6 @@ https://github.com/gpii/universal/LICENSE.txt var fluid = fluid || require("infusion"); var gpii = fluid.registerNamespace("gpii"); -var os = require("os"); fluid.defaults("gpii.processes", { gradeNames: ["fluid.component", "fluid.contextAware"], @@ -80,6 +79,11 @@ fluid.defaults("gpii.processes", { funcName: "gpii.processes.getProcessList", args: ["{arguments}.0"] // optional string or numeric identifier of the process + }, + compareProcessNames: { + funcName: "gpii.processes.compareProcessNames", + args: ["{arguments}.0", "{arguments}.1"] + // process name A, process name B } } }); @@ -160,7 +164,7 @@ gpii.processes.findProcessesByCommand = function (that, commandName, procArray) procArray = that.getProcessList(commandName); } return fluid.accumulate(procArray, function (aProcInfo, matchingProcs) { - if (gpii.processes.compareProcessNames(aProcInfo.command, commandName)) { + if (that.compareProcessNames(aProcInfo.command, commandName)) { matchingProcs.push(aProcInfo); } return matchingProcs; @@ -267,17 +271,12 @@ gpii.processes.getProcessList = function (/* identifier */) { return []; }; -var compare = (os.platform() === "win32") - ? (new Intl.Collator(undefined, {sensitivity:"base"})).compare - : Object.is; - /** - * Compares the names of two processes, returning a boolean indicating whether or not they are equal according to - * the case-sensitivity rules of the OS. + * Compares the names of two processes, returning a boolean indicating whether or not they are equal. * * @param processA {String} Name of a process. * @param processB {String} Name of another process. */ gpii.processes.compareProcessNames = function (processA, processB) { - return !compare(processA, processB); + return processA === processB; }; From 65a563e0e94995757f72c1e31be5250434b7a47a Mon Sep 17 00:00:00 2001 From: ste Date: Mon, 26 Mar 2018 16:36:36 +0100 Subject: [PATCH 07/18] GPII-2578: Moved case-insensitive process match into universal --- .../processReporter/src/processesBridge.js | 25 ++++++------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/gpii/node_modules/processReporter/src/processesBridge.js b/gpii/node_modules/processReporter/src/processesBridge.js index 0d395c071..727087d5e 100644 --- a/gpii/node_modules/processReporter/src/processesBridge.js +++ b/gpii/node_modules/processReporter/src/processesBridge.js @@ -79,13 +79,10 @@ fluid.defaults("gpii.processes", { funcName: "gpii.processes.getProcessList", args: ["{arguments}.0"] // optional string or numeric identifier of the process - }, - compareProcessNames: { - funcName: "gpii.processes.compareProcessNames", - args: ["{arguments}.0", "{arguments}.1"] - // process name A, process name B } - } + }, + // True if process names are matched with differing case. + ignoreCase: false }); /** @@ -163,8 +160,12 @@ gpii.processes.findProcessesByCommand = function (that, commandName, procArray) if (!procArray) { procArray = that.getProcessList(commandName); } + var commandNameLower = that.options.ignoreCase && commandName.toLowerCase(); return fluid.accumulate(procArray, function (aProcInfo, matchingProcs) { - if (that.compareProcessNames(aProcInfo.command, commandName)) { + var match = aProcInfo.command === commandName || + (that.options.ignoreCase && aProcInfo.command.toLowerCase() === commandNameLower); + + if (match) { matchingProcs.push(aProcInfo); } return matchingProcs; @@ -270,13 +271,3 @@ gpii.processes.initProcInfoNotRunning = function (that, command) { gpii.processes.getProcessList = function (/* identifier */) { return []; }; - -/** - * Compares the names of two processes, returning a boolean indicating whether or not they are equal. - * - * @param processA {String} Name of a process. - * @param processB {String} Name of another process. - */ -gpii.processes.compareProcessNames = function (processA, processB) { - return processA === processB; -}; From 4fc0d71e84e483324d4c1a36330e6518a2a9024e Mon Sep 17 00:00:00 2001 From: ste Date: Mon, 26 Mar 2018 16:41:19 +0100 Subject: [PATCH 08/18] GPII-2578: Implemented getProcessPath() --- .../processReporter/src/processesBridge.js | 17 +++++++++++++++++ .../test/web/js/ProcessesBridgeTests.js | 19 +++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/gpii/node_modules/processReporter/src/processesBridge.js b/gpii/node_modules/processReporter/src/processesBridge.js index 727087d5e..559e49895 100644 --- a/gpii/node_modules/processReporter/src/processesBridge.js +++ b/gpii/node_modules/processReporter/src/processesBridge.js @@ -74,6 +74,11 @@ fluid.defaults("gpii.processes", { args: ["{that}", "{arguments}.0"] // command name (string) }, + getProcessPath: { + funcName: "gpii.processes.getProcessPath", + args: ["{that}", "{arguments}.0"] + // command name (string) + }, // Context aware invokers. getProcessList : { funcName: "gpii.processes.getProcessList", @@ -145,6 +150,18 @@ gpii.processes.findProcessByPid = function (that, pid, procArray) { }, null); }; +/** + * Return the path of a running process. + * + * @param that {Component} - an instance of a processes component. + * @param pid {Number} - the process id of the process. + * @return {String} - The full path of the process, or null if there's no matching process. + */ +gpii.processes.getProcessPath = function (that, pid) { + var proc = that.findProcessByPid(pid); + return proc && proc.fullPath; +}; + /** * Return a list of process information objects that match the given * command name. Returns an empty array if not matching name is found. diff --git a/gpii/node_modules/processReporter/test/web/js/ProcessesBridgeTests.js b/gpii/node_modules/processReporter/test/web/js/ProcessesBridgeTests.js index 5ed148dd2..8dd0b95d4 100644 --- a/gpii/node_modules/processReporter/test/web/js/ProcessesBridgeTests.js +++ b/gpii/node_modules/processReporter/test/web/js/ProcessesBridgeTests.js @@ -187,6 +187,25 @@ gpii.tests.processes.runTests = function () { } ); + jqUnit.test( + "Test getProcessPath() with non-running process id", + function () { + jqUnit.assertNull( + "Path of negative process id value", processesBridge.getProcessPath(-1) + ); + } + ); + + jqUnit.test( + "Test getProcessPath() against mock node process object.", + function () { + var fullPath = processesBridge.getProcessPath(processesBridge.mockNode.pid); + + jqUnit.assertEquals("Node process fullPath", + processesBridge.mockNode.fullPath, fullPath); + } + ); + jqUnit.test( "Test findProcessesByCmd()/findFirstProcessByCmd()", function () { From 176bb6f3707c88fac9c4da7f904feba1c3692ce2 Mon Sep 17 00:00:00 2001 From: ste Date: Wed, 28 Mar 2018 14:05:51 +0100 Subject: [PATCH 09/18] TESTING --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8232f24e9..503c9037f 100644 --- a/README.md +++ b/README.md @@ -231,3 +231,4 @@ Universal image you can use this command: Or use the following command to download a particular image identified using a Git commit hash: `docker pull gpii/universal:` + From b337e72afa53d9e92371fb314ddaa7fbd2928086 Mon Sep 17 00:00:00 2001 From: ste Date: Mon, 2 Apr 2018 14:38:45 +0100 Subject: [PATCH 10/18] GPII-2212: Updated start/stop instructions to invoke new function for restarting explorer --- testData/solutions/win32.json5 | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/testData/solutions/win32.json5 b/testData/solutions/win32.json5 index 271ee7dd4..095f0cf6c 100644 --- a/testData/solutions/win32.json5 +++ b/testData/solutions/win32.json5 @@ -1373,20 +1373,12 @@ ], "start": [ { - "type": "gpii.windows.closeApplications", - "level": "low", - "options": { - "restart": true - } + "type": "gpii.windows.restartExplorer" } ], "stop": [ { - "type": "gpii.windows.closeApplications", - "level": "low", - "options": { - "restart": true - } + "type": "gpii.windows.restartExplorer" } ], "isInstalled": [ From dc38c567e456788c60919eb140d007494af51415 Mon Sep 17 00:00:00 2001 From: ste Date: Sun, 24 Jun 2018 20:59:50 +0100 Subject: [PATCH 11/18] GPII-2212: JSON5 preference files. --- testData/preferences/{catalina.json => catalina.json5} | 7 +++++++ testData/preferences/catalina.md | 7 ------- testData/preferences/{telugu.json => telugu.json5} | 7 +++++++ testData/preferences/telugu.md | 7 ------- testData/preferences/{tom.json => tom.json5} | 3 +++ testData/preferences/tom.md | 3 --- 6 files changed, 17 insertions(+), 17 deletions(-) rename testData/preferences/{catalina.json => catalina.json5} (56%) delete mode 100644 testData/preferences/catalina.md rename testData/preferences/{telugu.json => telugu.json5} (57%) delete mode 100644 testData/preferences/telugu.md rename testData/preferences/{tom.json => tom.json5} (77%) delete mode 100644 testData/preferences/tom.md diff --git a/testData/preferences/catalina.json b/testData/preferences/catalina.json5 similarity index 56% rename from testData/preferences/catalina.json rename to testData/preferences/catalina.json5 index c69f1aa13..61bdaef3d 100644 --- a/testData/preferences/catalina.json +++ b/testData/preferences/catalina.json5 @@ -1,3 +1,10 @@ +//# catalina +// +//This preference set sets the OS language to Spanish (Spain), es-ES. +// +//## Testing +// +//For this to work correctly, the es-ES language pack needs to be installed on Windows. See GPII-2212. { "flat": { "contexts": { diff --git a/testData/preferences/catalina.md b/testData/preferences/catalina.md deleted file mode 100644 index 0464396e7..000000000 --- a/testData/preferences/catalina.md +++ /dev/null @@ -1,7 +0,0 @@ -# catalina - -This preference set sets the OS language to Spanish (Spain), es-ES. - -## Testing - -For this to work correctly, the es-ES language pack needs to be installed on Windows. See GPII-2212. diff --git a/testData/preferences/telugu.json b/testData/preferences/telugu.json5 similarity index 57% rename from testData/preferences/telugu.json rename to testData/preferences/telugu.json5 index 1a4fc4185..90e56c38d 100644 --- a/testData/preferences/telugu.json +++ b/testData/preferences/telugu.json5 @@ -1,3 +1,10 @@ +//# telugu +// +//This preference set sets the OS language to Telugu, te-IN. +// +//## Testing +// +//For this to work correctly, the te-IN language pack needs to be installed on Windows. See GPII-2212. { "flat": { "contexts": { diff --git a/testData/preferences/telugu.md b/testData/preferences/telugu.md deleted file mode 100644 index 2067614b9..000000000 --- a/testData/preferences/telugu.md +++ /dev/null @@ -1,7 +0,0 @@ -# telugu - -This preference set sets the OS language to Telugu, te-IN. - -## Testing - -For this to work correctly, the te-IN language pack needs to be installed on Windows. See GPII-2212. diff --git a/testData/preferences/tom.json b/testData/preferences/tom.json5 similarity index 77% rename from testData/preferences/tom.json rename to testData/preferences/tom.json5 index 0acaa795d..6715b2e30 100644 --- a/testData/preferences/tom.json +++ b/testData/preferences/tom.json5 @@ -1,3 +1,6 @@ +//# tom +// +//This preference set sets the OS language to English (US), en-US. { "flat": { "contexts": { diff --git a/testData/preferences/tom.md b/testData/preferences/tom.md deleted file mode 100644 index 74c5152f5..000000000 --- a/testData/preferences/tom.md +++ /dev/null @@ -1,3 +0,0 @@ -# tom - -This preference set sets the OS language to English (US), en-US. From a122400e7c49b1802dffce1026ad609b92aaec3a Mon Sep 17 00:00:00 2001 From: ste Date: Mon, 25 Jun 2018 10:59:06 +0100 Subject: [PATCH 12/18] GPII-2212: Restart explorer after language setting. --- testData/solutions/win32.json5 | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/testData/solutions/win32.json5 b/testData/solutions/win32.json5 index af887b56e..a71a86a28 100644 --- a/testData/solutions/win32.json5 +++ b/testData/solutions/win32.json5 @@ -1325,18 +1325,14 @@ }, "configure": [ "settings.configure1", - "settings.configure2" - ], - "restore": [ - "settings.configure1", - "settings.configure2" - ], - "start": [ + "settings.configure2", { "type": "gpii.windows.restartExplorer" } ], - "stop": [ + "restore": [ + "settings.configure1", + "settings.configure2", { "type": "gpii.windows.restartExplorer" } @@ -3406,7 +3402,7 @@ } ] }, - "net.gpii.test.speechControl": { + "net.gpii.test.speechControl": { // This solution does not exist in real life and has been added strictly for user testing/demoing of a solution // which requires the OS to be restarted in order to respond to changed settings (e.g. DPI on Windows 7) "name": "GPII Test solution for speech control of the computer", @@ -3441,11 +3437,11 @@ ], "isRunning": [] }, - - "net.gpii.explode": { - // This solution exists only to support manual and automated testing of GPII's error support. It references the + + "net.gpii.explode": { + // This solution exists only to support manual and automated testing of GPII's error support. It references the // "exploding settings handler" which will trigger a failure using a configurable strategy during either the - // get, set or launch settingsHandler action + // get, set or launch settingsHandler action "name": "GPII Test solution for triggering settingsHandler errors", "contexts": { "OS": [ From def27ced119901e973685bbca737c683bea15bf1 Mon Sep 17 00:00:00 2001 From: ste Date: Mon, 25 Jun 2018 15:36:23 +0100 Subject: [PATCH 13/18] GPII-2212: Language acceptance tests. --- .../test/data/os_win7.json | 6 +++- .../inverseCapabilities/os_win7_expected.json | 3 ++ .../acceptanceTests/win7_builtIn.json | 4 +++ .../com_microsoft_windows_language.md | 29 +++++++++++++++++++ tests/data/preferences/os_win7.json5 | 6 +++- .../windows/windows-builtIn-testSpec.js | 25 +++++++++++++++- 6 files changed, 70 insertions(+), 3 deletions(-) create mode 100644 testData/solutions/solutionsDescription/com_microsoft_windows_language.md diff --git a/gpii/node_modules/matchMakerFramework/test/data/os_win7.json b/gpii/node_modules/matchMakerFramework/test/data/os_win7.json index 99ed5c822..34da01ac4 100644 --- a/gpii/node_modules/matchMakerFramework/test/data/os_win7.json +++ b/gpii/node_modules/matchMakerFramework/test/data/os_win7.json @@ -100,7 +100,11 @@ "EnableAutoShiftEngage": 1, "EnableShiftLock": 1, "EnableCompatibilityKeyboard": 1, - "EnableDesktopModeAutoInvoke": 1 + "EnableDesktopModeAutoInvoke": 1 + }, + "http://registry.gpii.net/applications/com.microsoft.windows.language": { + "MachinePreferredUILanguages": "en-US", + "PreferredUILanguages": "en-US" } } } diff --git a/gpii/node_modules/matchMakerFramework/test/inverseCapabilities/os_win7_expected.json b/gpii/node_modules/matchMakerFramework/test/inverseCapabilities/os_win7_expected.json index 55984b001..0b8ed9798 100644 --- a/gpii/node_modules/matchMakerFramework/test/inverseCapabilities/os_win7_expected.json +++ b/gpii/node_modules/matchMakerFramework/test/inverseCapabilities/os_win7_expected.json @@ -51,6 +51,9 @@ "http://registry.gpii.net/common/shiftLockEnabled": true, "http://registry.gpii.net/common/compatibilityKeyboardEnabled": true, "http://registry.gpii.net/common/desktopModeAutoInvokeEnabled": true + }, + "com.microsoft.windows.language": { + "http://registry.gpii.net/common/language": "en-US" } } } diff --git a/testData/deviceReporter/acceptanceTests/win7_builtIn.json b/testData/deviceReporter/acceptanceTests/win7_builtIn.json index 2c08eb78d..865e9cc7a 100644 --- a/testData/deviceReporter/acceptanceTests/win7_builtIn.json +++ b/testData/deviceReporter/acceptanceTests/win7_builtIn.json @@ -45,6 +45,10 @@ { "id": "com.microsoft.windows.typingEnhancement" + }, + + { + "id": "com.microsoft.windows.language" } ] diff --git a/testData/solutions/solutionsDescription/com_microsoft_windows_language.md b/testData/solutions/solutionsDescription/com_microsoft_windows_language.md new file mode 100644 index 000000000..884e7a7ac --- /dev/null +++ b/testData/solutions/solutionsDescription/com_microsoft_windows_language.md @@ -0,0 +1,29 @@ +# Windows Display Language + +## Details + +* __Name__: Windows Display Language +* __Id__: com.microsoft.windows.language +* __Platform__: Windows +* __Contact__: Steve Grundell + +## Description + +Sets the display language of the operating system, by changing some values in the Windows Registry. The new setting +is only applied to new processes; only Windows Explorer is restarted by this solution. + +The language identifier is specified in `http://registry.gpii.net/common/language`. + + +## Testing + +The following test users make use of the language setting: + +* Tom: English (US), en-US +* Catalina: Spanish (Spain), es-ES +* Telegu: Telegu (India), te-IN. + +## Limitations + +* The appropriate language pack must already be installed. +* If the language "changes" to the same value as the current, explorer is still restarted. diff --git a/tests/data/preferences/os_win7.json5 b/tests/data/preferences/os_win7.json5 index 99ed5c822..34da01ac4 100644 --- a/tests/data/preferences/os_win7.json5 +++ b/tests/data/preferences/os_win7.json5 @@ -100,7 +100,11 @@ "EnableAutoShiftEngage": 1, "EnableShiftLock": 1, "EnableCompatibilityKeyboard": 1, - "EnableDesktopModeAutoInvoke": 1 + "EnableDesktopModeAutoInvoke": 1 + }, + "http://registry.gpii.net/applications/com.microsoft.windows.language": { + "MachinePreferredUILanguages": "en-US", + "PreferredUILanguages": "en-US" } } } diff --git a/tests/platform/windows/windows-builtIn-testSpec.js b/tests/platform/windows/windows-builtIn-testSpec.js index 4db1c6149..50b9782e1 100644 --- a/tests/platform/windows/windows-builtIn-testSpec.js +++ b/tests/platform/windows/windows-builtIn-testSpec.js @@ -289,7 +289,30 @@ gpii.tests.windows.builtIn = [ } } } - ] + ], + "com.microsoft.windows.language": [{ + "settings": { + "PreferredUILanguages": "en-US" + }, + "options": { + "hKey": "HKEY_CURRENT_USER", + "path": "Control Panel\\Desktop", + "dataTypes": { + "PreferredUILanguages": "REG_SZ" + } + } + }, { + "settings": { + "MachinePreferredUILanguages": "en-US" + }, + "options": { + "hKey": "HKEY_CURRENT_USER", + "path": "Control Panel\\Desktop\\MuiCached", + "dataTypes": { + "MachinePreferredUILanguages": "REG_SZ" + } + } + }] }, "gpii.windows.displaySettingsHandler": { "com.microsoft.windows.screenResolution": [{ From dbf6805d19535c13678699350f4de5e5102f7d48 Mon Sep 17 00:00:00 2001 From: ste Date: Tue, 26 Jun 2018 11:25:44 +0100 Subject: [PATCH 14/18] GPII-2212: JSDoc fixed. --- gpii/node_modules/processReporter/src/processesBridge.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gpii/node_modules/processReporter/src/processesBridge.js b/gpii/node_modules/processReporter/src/processesBridge.js index d8840a546..4700c36bb 100644 --- a/gpii/node_modules/processReporter/src/processesBridge.js +++ b/gpii/node_modules/processReporter/src/processesBridge.js @@ -129,7 +129,7 @@ gpii.processes.findSolutionsByPids = function (that, pids) { * id (process id number). Returns null if there is no such process. * * @param {Component} that - An instance of a processes component. - * @param {Number} pid - The process id of the processe to inspect. + * @param {Number} pid - The process id of the process to inspect. * @param {Array} [procArray] - [optional] An array of process information objects to search. * @return {ProcInfo} A process information object for the process with the given id. Returns null if there is no such process. */ @@ -147,8 +147,8 @@ gpii.processes.findProcessByPid = function (that, pid, procArray) { /** * Return the path of a running process. * - * @param that {Component} - an instance of a processes component. - * @param pid {Number} - the process id of the process. + * @param {Component} that - an instance of a processes component. + * @param {Number} pid - the process id of the process. * @return {String} - The full path of the process, or null if there's no matching process. */ gpii.processes.getProcessPath = function (that, pid) { @@ -161,7 +161,7 @@ gpii.processes.getProcessPath = function (that, pid) { * command name. Returns an empty array if not matching name is found. * * @param {Component} that - An instance of a processes component. - * @param {String} commandName - The name of the processe to inspect. + * @param {String} commandName - The name of the process to inspect. * @param {Array} [procArray] - [optional] an array of process information objects to search. * @return {Array} Array of procInfo objects matching the command name. Empty if no corresponding processes are found. */ From 471404ac6903d4ae30d3eb157b87addce8da4144 Mon Sep 17 00:00:00 2001 From: ste Date: Tue, 26 Jun 2018 12:41:16 +0100 Subject: [PATCH 15/18] GPII-2212: Making markdown linter happy. --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 091de1ae4..68ddc7dff 100644 --- a/README.md +++ b/README.md @@ -288,4 +288,3 @@ Universal image you can use this command: Or use the following command to download a particular image identified using a Git commit hash: `docker pull gpii/universal:` - From 33d1f88c06be46ef3bce0df66a7af01d769ca5d6 Mon Sep 17 00:00:00 2001 From: ste Date: Tue, 10 Jul 2018 13:26:34 +0100 Subject: [PATCH 16/18] GPII-2212: Nice hack to only restart explorer if the language has changed. --- testData/solutions/win32.json5 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/testData/solutions/win32.json5 b/testData/solutions/win32.json5 index 5fdadf905..73871e378 100644 --- a/testData/solutions/win32.json5 +++ b/testData/solutions/win32.json5 @@ -1327,14 +1327,16 @@ "settings.configure1", "settings.configure2", { - "type": "gpii.windows.restartExplorer" + "type": "gpii.windows.updateLanguage", + "currentLanguage": "${{registry}.HKEY_CURRENT_USER\\Control Panel\\Desktop\\PreferredUILanguages}", } ], "restore": [ "settings.configure1", "settings.configure2", { - "type": "gpii.windows.restartExplorer" + "type": "gpii.windows.updateLanguage", + "currentLanguage": "${{registry}.HKEY_CURRENT_USER\\Control Panel\\Desktop\\PreferredUILanguages}", } ], "isInstalled": [ From 7f2521b2fb2a5c388b47a3d574aa6860e71fa7e4 Mon Sep 17 00:00:00 2001 From: ste Date: Tue, 10 Jul 2018 13:37:19 +0100 Subject: [PATCH 17/18] GPII-2212: Removed documented limitation. --- .../solutionsDescription/com_microsoft_windows_language.md | 1 - 1 file changed, 1 deletion(-) diff --git a/testData/solutions/solutionsDescription/com_microsoft_windows_language.md b/testData/solutions/solutionsDescription/com_microsoft_windows_language.md index 884e7a7ac..fe9ebdea0 100644 --- a/testData/solutions/solutionsDescription/com_microsoft_windows_language.md +++ b/testData/solutions/solutionsDescription/com_microsoft_windows_language.md @@ -26,4 +26,3 @@ The following test users make use of the language setting: ## Limitations * The appropriate language pack must already be installed. -* If the language "changes" to the same value as the current, explorer is still restarted. From 7d38d98b346e67f1ed6bf182228d15a386e29de2 Mon Sep 17 00:00:00 2001 From: ste Date: Tue, 10 Jul 2018 14:27:20 +0100 Subject: [PATCH 18/18] GPII-2212: Trailing commas --- testData/solutions/win32.json5 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testData/solutions/win32.json5 b/testData/solutions/win32.json5 index af6ba087a..bafa0bcf1 100644 --- a/testData/solutions/win32.json5 +++ b/testData/solutions/win32.json5 @@ -1328,7 +1328,7 @@ "settings.configure2", { "type": "gpii.windows.updateLanguage", - "currentLanguage": "${{registry}.HKEY_CURRENT_USER\\Control Panel\\Desktop\\PreferredUILanguages}", + "currentLanguage": "${{registry}.HKEY_CURRENT_USER\\Control Panel\\Desktop\\PreferredUILanguages}" } ], "restore": [ @@ -1336,7 +1336,7 @@ "settings.configure2", { "type": "gpii.windows.updateLanguage", - "currentLanguage": "${{registry}.HKEY_CURRENT_USER\\Control Panel\\Desktop\\PreferredUILanguages}", + "currentLanguage": "${{registry}.HKEY_CURRENT_USER\\Control Panel\\Desktop\\PreferredUILanguages}" } ], "isInstalled": [