diff --git a/gpii/node_modules/matchMakerFramework/test/data/os_win7.json b/gpii/node_modules/matchMakerFramework/test/data/os_win7.json index 80db24962..0eab103d2 100644 --- a/gpii/node_modules/matchMakerFramework/test/data/os_win7.json +++ b/gpii/node_modules/matchMakerFramework/test/data/os_win7.json @@ -106,6 +106,10 @@ "EnableShiftLock": 1, "EnableCompatibilityKeyboard": 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 08ef0afe2..f099ddedd 100644 --- a/gpii/node_modules/matchMakerFramework/test/inverseCapabilities/os_win7_expected.json +++ b/gpii/node_modules/matchMakerFramework/test/inverseCapabilities/os_win7_expected.json @@ -54,6 +54,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/gpii/node_modules/processReporter/src/processesBridge.js b/gpii/node_modules/processReporter/src/processesBridge.js index 7e5fec2e1..8507ff240 100644 --- a/gpii/node_modules/processReporter/src/processesBridge.js +++ b/gpii/node_modules/processReporter/src/processesBridge.js @@ -74,13 +74,20 @@ 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", args: ["{arguments}.0"] // optional string or numeric identifier of the process } - } + }, + // True if process names are matched with differing case. + ignoreCase: false }); /** @@ -122,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. */ @@ -137,12 +144,24 @@ gpii.processes.findProcessByPid = function (that, pid, procArray) { }, null); }; +/** + * Return the path of a running 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) { + var proc = that.findProcessByPid(pid); + return proc && proc.fullPath; +}; + /** * 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 {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. */ @@ -150,8 +169,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 (aProcInfo.command === commandName) { + var match = aProcInfo.command === commandName || + (that.options.ignoreCase && aProcInfo.command.toLowerCase() === commandNameLower); + + if (match) { matchingProcs.push(aProcInfo); } return matchingProcs; diff --git a/gpii/node_modules/processReporter/test/web/js/ProcessesBridgeTests.js b/gpii/node_modules/processReporter/test/web/js/ProcessesBridgeTests.js index acfbc30f1..0e5a96637 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 () { diff --git a/testData/deviceReporter/acceptanceTests/win7_builtIn.json b/testData/deviceReporter/acceptanceTests/win7_builtIn.json index cedaf0f4e..4a79dc2eb 100644 --- a/testData/deviceReporter/acceptanceTests/win7_builtIn.json +++ b/testData/deviceReporter/acceptanceTests/win7_builtIn.json @@ -49,6 +49,10 @@ { "id": "com.microsoft.windows.typingEnhancement" + }, + + { + "id": "com.microsoft.windows.language" } ] diff --git a/testData/deviceReporter/installedSolutions.json b/testData/deviceReporter/installedSolutions.json index 1e6df2d19..d96627b16 100644 --- a/testData/deviceReporter/installedSolutions.json +++ b/testData/deviceReporter/installedSolutions.json @@ -91,6 +91,10 @@ "id": "com.microsoft.windows.typingEnhancement" }, + { + "id": "com.microsoft.windows.language" + }, + { "id": "com.android.activitymanager" }, diff --git a/testData/preferences/catalina.json5 b/testData/preferences/catalina.json5 new file mode 100644 index 000000000..61bdaef3d --- /dev/null +++ b/testData/preferences/catalina.json5 @@ -0,0 +1,19 @@ +//# 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": { + "gpii-default": { + "name": "Default preferences", + "preferences": { + "http://registry.gpii.net/common/language": "es-ES" + } + } + } + } +} diff --git a/testData/preferences/telugu.json5 b/testData/preferences/telugu.json5 new file mode 100644 index 000000000..90e56c38d --- /dev/null +++ b/testData/preferences/telugu.json5 @@ -0,0 +1,19 @@ +//# 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": { + "gpii-default": { + "name": "Default preferences", + "preferences": { + "http://registry.gpii.net/common/language": "te-IN" + } + } + } + } +} diff --git a/testData/preferences/tom.json5 b/testData/preferences/tom.json5 new file mode 100644 index 000000000..6715b2e30 --- /dev/null +++ b/testData/preferences/tom.json5 @@ -0,0 +1,15 @@ +//# tom +// +//This preference set sets the OS language to English (US), en-US. +{ + "flat": { + "contexts": { + "gpii-default": { + "name": "Default preferences", + "preferences": { + "http://registry.gpii.net/common/language": "en-US" + } + } + } + } +} 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..fe9ebdea0 --- /dev/null +++ b/testData/solutions/solutionsDescription/com_microsoft_windows_language.md @@ -0,0 +1,28 @@ +# 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. diff --git a/testData/solutions/win32.json5 b/testData/solutions/win32.json5 index e39c507a2..026353b0f 100644 --- a/testData/solutions/win32.json5 +++ b/testData/solutions/win32.json5 @@ -1007,7 +1007,6 @@ ] }, - "com.microsoft.windows.narrator": { "name": "Windows Built-in Narrator", "contexts": { @@ -1264,6 +1263,89 @@ ] }, + "com.microsoft.windows.language": { + "name": "Windows Display Language", + "contexts": { + "OS": [ + { + "id": "win32", + "version": ">=5.0" + } + ] + }, + "settingsHandlers": { + "configure1": { + "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" + } + } + }, + "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.configure1", + "settings.configure2", + { + "type": "gpii.windows.updateLanguage", + "currentLanguage": "${{registry}.HKEY_CURRENT_USER\\Control Panel\\Desktop\\PreferredUILanguages}" + } + ], + "restore": [ + "settings.configure1", + "settings.configure2", + { + "type": "gpii.windows.updateLanguage", + "currentLanguage": "${{registry}.HKEY_CURRENT_USER\\Control Panel\\Desktop\\PreferredUILanguages}" + } + ], + "isInstalled": [ + { + "type": "gpii.deviceReporter.alwaysInstalled" + } + ] + }, + "org.nvda-project": { "name": "NVDA Screen Reader", "contexts": { diff --git a/tests/data/preferences/os_win7.json5 b/tests/data/preferences/os_win7.json5 index 80db24962..0eab103d2 100644 --- a/tests/data/preferences/os_win7.json5 +++ b/tests/data/preferences/os_win7.json5 @@ -106,6 +106,10 @@ "EnableShiftLock": 1, "EnableCompatibilityKeyboard": 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 b2be0ac65..99d0bff0b 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": [{