diff --git a/documentation/BrowserChannel.md b/documentation/BrowserChannel.md index 035678ba9..86744a205 100644 --- a/documentation/BrowserChannel.md +++ b/documentation/BrowserChannel.md @@ -65,8 +65,8 @@ The workflow between the client and server can be summarised as follows: * When the flow manager emits either the _connectionSucceeded_ (after being registered) or the _onSettingsChanged_ (after a user login/logout) signal to the client, it is delivering the current available settings for the client in the following way: ``` { - "screenReaderTTSEnabled":false, - "highContrastEnabled":true, + "screenReaderTTS/enabled":false, + "highContrast/enabled":true, "invertColours":false, "magnifierEnabled":true, "magnification":2, diff --git a/documentation/CanopyMatchMaker.md b/documentation/CanopyMatchMaker.md index 51df9a45f..d9dab8afd 100644 --- a/documentation/CanopyMatchMaker.md +++ b/documentation/CanopyMatchMaker.md @@ -21,17 +21,13 @@ Broadly, the match making algorithm used by the canopy match maker is as follows More details are given below on solution types, as well as the two disposition methods used (priority and canopy). ## Solution Types: -To ensure that several conflicting solutions (e.g. two screenreaders) are not launched, "Types" are calculated for each solution, based on the capabilities they have (and in the future, on their explicitly stated types). The inference of solution type based on capabilities is based on the "apptology" tranformation, from the "flat" format into a solution type ontology. In the matchmaking process, each time a solution is 'accepted', any other conflicting solutions (i.e. of the same type) will be rejected. +To avoid that two conflicting solutions of the same time are run, the canopy matchmaker uses Solution Types, as described in [Match Maker Framework](MatchMakerFramework.md) under the section on utilities and concepts. -The apptology is described in more details here: [Apptology.md](Apptology.md). - -## Disposing from prioriy: -Explicit priorities are declared in the NP sets metadata section and will always be a floating point value of 1024 or more. Implicit priorities are deduced from application specific settings. When a user has application specific settings for a solution a priority of 512 is set for that solution. - -Goes through all solutions from high priority to low. If a solution already has a disposition, it is ignored. Else it will be selected (accepted). Any solution with the same type, but a lower priority (or no priority) will be rejected. If there are two or more solutions of the same priority _and_ the same type (even partly), these will be considered a "tie". All lower-priority solutions of this type will still be rejected. The tied solutions will have their current disposition and priority removed and left to be disposed by some other disposal algorithm. +## Disposing from priority: +If the user explicitly or implicitly has specified priorities in terms of applications, this will be used to select the relevant solutions. Priorities can be inferred from application specific settings, or they can be explicitly stated by the user. More information on disposition from priority can be found in [Match Maker Framework](MatchMakerFramework.md) under the utilities and concepts section. ## Disposing from Canopy -The Canopy matching strategy is used for deciding how to dispose solutions in case no priorities are available or there is a priority-tie between two applications of the same type. +The Canopy matching strategy is used for deciding how to dispose solutions in case no priorities are available or there is a priority-tie between two applications of the same type. * The canopy approach is based on a vectorial "fitness measure" of a solution plus a lexicographical ordering * It is similar to the strategy used in resolving CSS rules. @@ -45,7 +41,7 @@ The Canopy matching strategy is used for deciding how to dispose solutions in ca * Compute capabilities of solution * Compute vector of prefix depths for each leaf el path from NP set * Sort vector in descending order of fitness ("fitness vector") -* Rank solutions by fitness using lexicographic ordering +* Rank solutions by fitness using lexicographic ordering *The canopy matching* * Compute fitness vectors for each solution and sort in rank order @@ -53,5 +49,3 @@ The Canopy matching strategy is used for deciding how to dispose solutions in ca * For each solution, “raise the canopy” by setting the canopy value to the maximum of its old value and solution value * For each solution which “raised the canopy” at any leaf, accept it. Reject any solution of the same type. * For each solution which did not raise the canopy, reject it - - diff --git a/documentation/FlowManager.md b/documentation/FlowManager.md index 5be1ee654..0d185e672 100644 --- a/documentation/FlowManager.md +++ b/documentation/FlowManager.md @@ -201,7 +201,7 @@ OR if the last login/logout process for finished less than 5 seconds a "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/onScreenKeyboardEnabled": true, + "http://registry.gpii.net/common/onScreenKeyboard/enabled": true, "http://registry.gpii.net/common/initDelay": 0.120, "http://registry.gpii.net/common/cursorSpeed": 0.850 } diff --git a/documentation/LifecycleManager.md b/documentation/LifecycleManager.md index 908b3d283..794bd972e 100644 --- a/documentation/LifecycleManager.md +++ b/documentation/LifecycleManager.md @@ -12,10 +12,10 @@ The queue is run sequentially, and an item is considered "done" once the promise #### Main functions of lifecycle manager: -The lifecycle manager have three invokers that are generally the ones that will be called from the general system, namely "start", "stop" and "update". These invokers are manually created, so are not obvious to spot on the component defaults block, but the are the ones to be used (instead of the processStart, processStop and processUpdate). They will add the relevant task to the Lifecycle Managers queue: +The lifecycle manager have three invokers that are generally the ones that will be called from the general system, namely "start", "stop" and "update". These invokers are manually created, so are not obvious to spot on the component defaults block, but they are the ones to be used (instead of the processStart, processStop and processUpdate). They will add the relevant task to the Lifecycle Managers queue: `start`: Should be called when keying in (configuring the system) `stop`: Should be called when keying out (restoring the system) `update`: Should be called when changing the settings of an already configured system (updating the applied settings) - +Note that these are unrelated to, and should not be confused with the "start", "stop" and "update" directives from solutions registry entries. diff --git a/documentation/MatchMakerFramework.md b/documentation/MatchMakerFramework.md index d966c5751..42cac5693 100644 --- a/documentation/MatchMakerFramework.md +++ b/documentation/MatchMakerFramework.md @@ -1,49 +1,94 @@ -## Matchmaker Framework +# Matchmaker Framework + +The matchmaker framework is a component and a set of utitilities that can run either locally or remotely depending on the configuration. Together with the actual matchmaker, it is respnosible for deciding how the users device should be configured based on their preferences, current context and the solution registry data. More specifically, the matchmaker framework has the following responsibility: + +* Doing the preprocessing - that is, preparing and augmenting the input payload for the specific matchmaker +* Making the decision of which matchmaker to call, and then call that matchmaker (for example the [Canopy MatchMaker](CanopyMatchMaker.md)) +* Doing the post-processing - that is, taking the return payload from the matchmakers, parse it and pass it on in the login (or other) flow. +* Generally providing utilities that can be used by matchmaker implementations. -A locally running component, with the following responsiblities: -* Doing the preprocessing - that is, preparing the input payload for the matchmakers -* Making the decision of which MM to call (i.e. hybrid matchmaking), and then call that MM -* Doing the post-processing - that is, taking the return payload from the matchmakers and transformat ## Configuration -Like all other Kettle apps, the Matchmaker Framework is defined by a config file. Generally, the Matchmaker Framework configs are located in the `configs` folder of the matchMakerFramework component. The declaration of what matchmakers are available to the Matchmaker Framework, and where to find them should be set under the `matchMakers` option of the `gpii.matchMakerFramework`. Each entry should have the name of the matchmaker as key, and then the value of an object which at least contains a `url`. For example, in the following config file, two matchmakers are listed to be available. The "default" matchmaker, located at the url http://localhost:8081 and the "RuleBased" one at the url http://localhost:8078. +The matchmaker framework itself is not a Kettle app, but it expect at least matchmaker implementation to be available on a URL. The available matchmaker implementation should be provided in the options block under a `matchMakers` directive. Here, matchmaker implementation can be listed by some identifier (key) and an object with a `{ url: "SOME URL" }` object each. For example the options of having two matchmakers available, where the default one will be on port 8081 will be done like: ``` { - "type": "matchMakerFramework.development.all.local", + "type": "my.matchmakerframework.config", "options": { - "gradeNames": ["fluid.component"], - "components": { - "server": { - "type": "kettle.server", - "options": { - "logging": true, - "components": { - "matchMakerFramework": { - "type": "gpii.matchMakerFramework", - "options": { - "matchMakers": { - "default": { - "url": "http://localhost:8081" - }, - "RuleBased": { - "url": "http://localhost:8078" - } - } - } - } + "distributeOptions": { + "untrusted.development.matchMakers": { + "record": { + "default": { + "url": "http://localhost:8081" + }, + "otherMM": { + "url": "http://localhost:8084" } - } + }, + "target": "{that flowManager}.options.matchMakers" } } - }, - "mergeConfigs": [ - "./base.json" - ] + } } + ``` +## Detailed Description: + + +### Main steps of the match maker frameworks matching process + +1. The matchmaking process is triggered by the `processMatch` event of the FlowManager. The actual matchmaking flow is dictated by a combination of the priorities in `gpii.flowmanager.processmatch.priorities`, and the `processMatch` listeners (which are different depending on whether the system runs in trusted or untrusted mode) +* Preprocess: + * Triggered when the initial data has been collected (preferences, context, solution registry entries, etc) + * Augments the match maker input with inferred common terms (see under important utilities/functions in this document) + * TODO: _Full solutions registry is currently being used when inferring common terms. This is because the users NP set might contain e.g. Linux app preferences, even if the user is logging into a windows box. We then need the linux solutions registry entries to get information (if available) about how to transform the linux app preferences into common terms (that in turn can be translated into app settings for windows)._ +* matchMakerDispatcher: + * Sends the matchmaker input data to the actual matchmaker. _While there is functionality in place for allowing multiple matchmakers, the system is currently hardcoded to use the “default” one, which is the Canopy matchmaker in all the default configs_. + * A promise is returned, which will contain the original matchmaker input along with the response from the matchmaker in a block keyed by `matchMakerOutput`. + * The return payload is built in: `gpii.matchMakerFramework.utils.buildReturnPayload` + + +### Important utilities and concepts in the Match Maker Framework + +**The Canopy Matchmaker**: While this is not part of the matchmaker framework, it is important to mention the Canopy Match Maker, which is an (the only) implementation of a matchmaker, which uses most of the utilities described in this document as well as a canopy matching algorithm. It is described in details here: https://github.com/GPII/universal/blob/master/documentation/CanopyMatchMaker.md + + +**Solution Types**: To ensure that several conflicting solutions (e.g. two screenreaders) are not launched, "Types" can be calculated for each solution, based on the capabilities they have (and in the future, on their explicitly stated types). The inference of solution type based on capabilities is based on the "apptology" tranformation, from the "flat" format into a solution type ontology. In the matchmaking process, each time a solution is 'accepted', any other conflicting solutions (i.e. of the same type) will be rejected. Adding solution type information can be done via the `gpii.matchMakerFramework.utils.addSolutionTypeInformation` function. + +The apptology is described in more details here: [Apptology.md](Apptology.md). + +**Common Term Inference**: If the solution registry entry for a solution has an `inverseCapabilitiesTransformations` block specified, or does not have a `capabilitiesTransformations` (in which case, the system attempts to automatically calculate the inverses), the matchmaker framework can infer common terms from application specific settings. This means, that if the user has application specific settings for e.g. windows magnifier, the equivalent common term preferences can be inferred and used in the matchmaking process (e.g. finding the relevant settings for the linux magnifier). The inference happens via the `gpii.matchMakerFramework.utils.inferCommonTerms` function, and if these should be merged with an NP set, this can be done via the `gpii.matchMakerFramework.utils.addInferredCommonTerms` function. It is worth stressing two things: The use of inferred common terms is not mandatory in a matchmaking flow, but available via the above functions, and something which _is_ being used in the canopy matchmaker. Secondly, there is no metadata generated saying that the common terms are inferred, meaning that once added to an NP set, the matchmaker has no way of knowing whether the term was originally in the NP set or was inferred. + +Also, hte full solutions registry is currently being used when inferring common terms. This is because the users NP set might contain e.g. Linux app preferences, even if the user is logging into a windows box. We then need the linux solutions registry entries to get information (if available) about how to transform the linux app preferences into common terms (that in turn can be translated into app settings for windows). This should be changed into a more dynamically loaded solution registry fetching based on the users application settings, once the solutions registry has been turned into a queriable service. + + +**gpii.matchMakerFramework.utils.disposeFromPriority**: Explicit priorities are declared in the NP sets metadata section and will always be a floating point value of 1024 or more. Implicit priorities are deduced from application specific settings. When a user has application specific settings for a solution a priority of 512 is set for that solution. + +This function goes through all solutions from high priority to low. If a solution already has a disposition, it is ignored. Else it will be selected (accepted). Any solution with the same type, but a lower priority (or no priority) will be rejected. If there are two or more solutions of the same priority _and_ the same type (even partly), these will be considered a "tie". All lower-priority solutions of this type will still be rejected. The tied solutions will have their current disposition and priority removed and left to be disposed by some other disposal algorithm. + + +**gpii.matchmakerframework.utils.disposeSolution:** In many ways the “Heart” of the matchmaking process. It is responsible for adding priorities, augmenting the solution and preference data and finally passing it to some disposition (matchmaker) strategy that is passed as a parameter. In more details the following happens: +1. The solutions are run through `gpii.matchMakerFramework.utils.expandSolutions` augmenting them to, besides the original solution registry data, a skeleton of the solutions capabilities is built is built - i.e. a hierarchical object matching the solutions capabilities. +1. Next solution priorities are added to each solution according to application settings via `gpii.matchMakerFramework.utils.expandSolutions`. That is, if a user has any application settings the solution is considered to have a priority of 512. +1. Following this, explicit priorities of the users NP set is added to each solution. That is, if a user has application priorities in their metadata, this is added. These values will always be above 1024, and hence take priority (overwrite) the implicit priorities from the step above. +1. A leaves structure of the preferences is calculated in the `gpii.matchMakerFramework.utils.computeLeaves` function. This is a structure with a key for each preference in an EL-path format and a value of true. This, in conjunction with the solutions skeleton is useful for looking up matches via fluids' getPath functionality. +1. Once all this data has been prepared, the information is sent to the strategy (e.g. canopy match makers algorithm) +1. Finally a disposition is assigned to each solution based on the output of the strategy. + + +**Preference filtering:** When using a the untrusted flowmanager, security dictates that no "irrelevant" or unnused preferences of settings should be sent to the local device. Since the users NP set does need to be sent to the local device for use in the PSP, a filtering needs to happen, to ensure that the only settings reaching the local device are those that have been used to configure the device. This filtering can be done using the `gpii.matchMakerFramework.utils.filterPreferencesForSolution` function. + + +**matchMakerDispatcher:** Sends the matchmaker input data to the actual matchmaker. While there is functionality in place for allowing multiple matchmakers, the system is currently hardcoded to use the “default” one, which is the Canopy matchmaker. + +A promise is returned, which will contain the original matchmaker input along with the matchmaker response in a block keyed by matchMakerOutput + +The dispatching happens in the function `gpii.matchMakerFramework.matchMakerDispatcher`. + + + ## API: The matchmakers that can be called from the Matchmaker Framework need to adhere to the following API. @@ -58,176 +103,97 @@ The input for these POST requests will be in the following format. Note that it ``` { - preferences: { - "contexts": { - "gpii-default": { - "name": "Default preferences", - "preferences": { - "http://registry.gpii.net/common/fontSize": 15, - "http://registry.gpii.net/common/speechRate": 15 - } + "activeContexts": [], + "environmentReporter": {}, + "inferredCommonTerms": { + "gpii-default": { + "com.microsoft.windows.highContrast": { + "http://registry.gpii.net/common/highContrast/enabled": true, + "http://registry.gpii.net/common/highContrastTheme": "white-black" }, - "nighttime-at-home": { - "name": "Nighttime at home", - "preferences": { - "http://registry.gpii.net/common/fontSize": 18 - }, - "metadata": [ - { - "type": "required", - "scope": ["http://registry.gpii.net/common/fontSize"], - "value": 100 - } - ], - "conditions": [ - { - "type": "http://gpii.net/common/operators/inRange", - "max": 1800, - "min": 600, - "inputPath": "http://registry.gpii.net/conditions/timeOfDay" - } - ] - } + (...), + "org.gnome.desktop.a11y.magnifier": { ... }, } }, - deviceReporter: { + "specialPreferences": { + "gpii-default": {} + }, + "userToken": "carla", + "preferences": { ... } // unmodified preferences set + "deviceContext": { + "solutions": [ + { "id": "com.texthelp.readWriteGold" }, + (...), + { "id": "org.gnome.desktop.a11y.magnifier" } + ], "OS": { "id": "win32", - "version": "5.0.0" - }, - "solutions": [ - { - "id": "com.microsoft.windows.onscreenKeyboard" - }, { - "id": "com.microsoft.windows.desktop" - }, - (...) - { - "id": "org.nvda-project" - }, { - "id": "com.freedomScientific.jaws" - } - ] - }, - environmentReporter: { - "http://registry.gpii.net/terms/environment/brightness": 60, - "http://registry.gpii.net/terms/environment/sound": -6 - "http://registry.gpii.net/terms/environment/timeOfDay": "18:29:00" + "version": "6.1.7601" + } }, - solutionsRegistry: { - //stuff from: https://github.com/GPII/universal/blob/master/testData/solutions/win32.json5 + "solutionsRegistryEntries": { + "com.texthelp.readWriteGold": { ... }, + (..) + "org.gnome.desktop.a11y.magnifier": { ... } }, - activeContexts: [ - "gpii-default", - "nighttime-at-home" - ], - inverseCapabilities: { - "com.microsoft.windows.cursors": { - "http://registry.gpii.net/common/mouseTrailing": 0.8, - (...), - "http://registry.gpii.net/common/cursorSize": 0.60 - }, + "solutionCapabilities": { + "com.texthelp.readWriteGold": [ ... ], (...), - "org.nvda-project": { - (...) - } + "org.gnome.desktop.a11y.magnifier": [ ... ] }, - rematch: { //out of scope for review - it would be useful to allow a MM specific block in the MM output, - //which can then be sent back in the rematch section to make the MM more informed - // [ ? - userFeedback: { - dislike: true - }, - previousOutput: { - // vast document previously output by matchmaker in this session - } - // ]? + "specialCapabilities": { + "com.microsoft.windows.filterKeys": [ + "http://registry\\.gpii\\.net/common/debounce/enabled", + "http://registry\\.gpii\\.net/common/slowKeys/enabled", + "http://registry\\.gpii\\.net/common/slowKeys/enabled", + "http://registry\\.gpii\\.net/common/debounce/enabled", + "http://registry\\.gpii\\.net/common/slowKeys/enabled" + ], + (...), + "com.microsoft.windows.mouseKeys": [ ... ] } } + ``` + + ### Return payload -The return payload from at call to `/match` should be in the following format: +The return payload from at call to `/match` should be in the following format. The "active" key expresses whether the application should be set to running. A `true` value means that it should be running, `undefined` means we leave it in its current run state and `false` mean we should actively ensure that it is not running. ``` { "inferredConfiguration": { "gpii-default": { "applications": { - "com.microsoft.windows.desktop": { + "com.microsoft.windows.magnifier": { "active": true, "settings": { - "http://registry.gpii.net/common/fontSize": 200, - "http://registry.gpii.net/applications/com.microsoft.windows.desktop/otherSetting": "reallyBig" + "http://registry.gpii.net/common/tracking": ["mouse", "mouse", "caret"], + "http://registry.gpii.net/common/magnification": 2, + "http://registry.gpii.net/common/invertColours": true, + "http://registry.gpii.net/common/magnifierPosition": "RightHalf", + "http://registry.gpii.net/applications/com.microsoft.windows.magnifier": { + "Magnification": 200, + "ZoomIncrement": 50, + "Invert": 0, + "FollowMouse": 1, + "FollowFocus": 1, + "FollowCaret": 1, + "MagnificationMode": 1 + } } }, - "org.cats": {} - } - }, - "nighttime-at-home":{ - "applications": { - "com.microsoft.windows.desktop": { - "active": true, - "settings": { - "http://registry.gpii.net/common/fontSize": 800 /// <-- really? fontsize 800!? - } - } - }, - "conditions": [ - { - "type": "http://gpii.net/common/operators/(time?)inRange", - "max": 1800, - "min": 600, - "inputPath": "http://registry.gpii.net/conditions/timeOfDay" - } - ] - }, - "gpii-xyz-autogenerated12365478": { - "applications": { - "com.freedomScientic.jaws": { + "net.gpii.uioPlus": { "active": true, "settings": { - "active": false, - "http://registry.gpii.net/common/speechRate": 800 + "http://registry.gpii.net/common/fontSize": 24, + "http://registry.gpii.net/common/tableOfContents": false } } - }, - "conditions": [ - { - "type": "http://gpii.net/common/operators/inRange", - "max": 10, - "min": 6, - "inputPath": "http://registry.gpii.net/conditions/sound" - } - ], - "metadata": [ - { - "scope": [ - "org.nvda-project" - ], - "type": "infoMessage", - "help": "....TBDwithalex...." - }, - { - "type": "PCPPopulation", - "scope": [], - "settings": { - "http: //registry.gpii.net/applications/com.microsoft.windows.desktop": [ - "fontSize" - ], - "com.microsoft.windows.desktop": [ - "http: //registry.gpii.net/common/fontSize" - ] - } - } - ] + } } - }, - "status": { - "type": "success", - "code": 200, - "message": "Catsare(inconsistently)decent" } } ``` diff --git a/documentation/PreferencesServer.md b/documentation/PreferencesServer.md index 049508458..2700ba28b 100644 --- a/documentation/PreferencesServer.md +++ b/documentation/PreferencesServer.md @@ -33,11 +33,11 @@ Return payload: "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/onScreenKeyboardEnabled": true, + "http://registry.gpii.net/common/onScreenKeyboard/enabled": true, "http://registry.gpii.net/common/initDelay": 0.120, "http://registry.gpii.net/common/cursorSpeed": 0.850, "http://registry.gpii.net/common/cursorAcceleration": 0.800, - "http://registry.gpii.net/common/mouseEmulationEnabled": true, + "http://registry.gpii.net/common/mouseEmulation/enabled": true, "http://registry.gpii.net/common/unknown": true, "http://registry.gpii.net/applications/org.alsa-project": { "volume": 14, @@ -70,7 +70,7 @@ Return payload: "cursorSpeed": 0.85, "cursorAcceleration": 0.8, "-provisional-initDelay": 0.12, - "-provisional-mouseEmulationEnabled": true + "-provisional-mouseEmulation/enabled": true } }, "applications": { @@ -110,11 +110,11 @@ Example POST body: "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/onScreenKeyboardEnabled": true, + "http://registry.gpii.net/common/onScreenKeyboard/enabled": true, "http://registry.gpii.net/common/initDelay": 0.120, "http://registry.gpii.net/common/cursorSpeed": 0.850, "http://registry.gpii.net/common/cursorAcceleration": 0.800, - "http://registry.gpii.net/common/mouseEmulationEnabled": true, + "http://registry.gpii.net/common/mouseEmulation/enabled": true, "http://registry.gpii.net/common/unknown": true, "http://registry.gpii.net/applications/org.alsa-project": { "volume": 14, @@ -138,11 +138,11 @@ Given that the above payload was stored with the token `123e4567-e89b-12d3-a456- "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/onScreenKeyboardEnabled": true, + "http://registry.gpii.net/common/onScreenKeyboard/enabled": true, "http://registry.gpii.net/common/initDelay": 0.120, "http://registry.gpii.net/common/cursorSpeed": 0.850, "http://registry.gpii.net/common/cursorAcceleration": 0.800, - "http://registry.gpii.net/common/mouseEmulationEnabled": true, + "http://registry.gpii.net/common/mouseEmulation/enabled": true, "http://registry.gpii.net/common/unknown": true, "http://registry.gpii.net/applications/org.alsa-project": { "volume": 14, diff --git a/documentation/SolutionsRegistryFormat.md b/documentation/SolutionsRegistryFormat.md index 786f9327b..f9d6bde9a 100644 --- a/documentation/SolutionsRegistryFormat.md +++ b/documentation/SolutionsRegistryFormat.md @@ -1,6 +1,6 @@ -## Solutions Registry format +# Solutions Registry format -### Overall format: +## Overall format: Each entry in the solution registry should have a unique ID (`Solution.id` in the below example), as well as a name (`name`), and a description of which context it requires to run (`context`). Besides these, information can be provided describing different potential aspects of its lifecycle. This can for example be information about how to start and stop the solution, detect whether it is running, set its settings, etc. These will all be described in the below. The overall structure and allowed keys in a solution description can be seen here. ``` @@ -8,23 +8,25 @@ Each entry in the solution registry should have a unique ID (`Solution.id` in th "name": "My Solution" "contexts": { ... }, "settingsHandlers": { ... }, + "launchHandlers": { ... }, + "capabilities": [ .. ], "configure": [ .. ], "restore": [ .. ], "update": [ .. ], "start": [ .. ], "stop": [ .. ], + "isRunning": [ ..], "isInstalled": [ .. ], - // Not yet supported. Post-Cloud4All features. + // Not yet supported. "install": [ ... ], "uninstall": [ ... ], "makeConfigurable": [ ... ], - "isRunning": [ ... ], "isConfigurable": [ ... ] } ``` -### contexts +## contexts The `contexts` block describes what the required context is for the solution to run. Currently only one type of context is supported, namely `OS`. The context block is **mandatory**. **Example Context**: @@ -38,8 +40,8 @@ The `contexts` block describes what the required context is for the solution to } ``` -### settingsHandlers -The `settingsHandlers` block is unique and one of the most important blocks in the solutions registry entry. It consists of zero or more settingsHandler entries, each keyed by an arbitrary name (that is unique within this solutions settingsHandlers block). Inside each settingsHandler entry, the properties for that settingsHandler is provided. The entries in the settingsHandlers block can be referred to from the other lifecycle blocks of the solutions registry entry. The settingsHandlers block is mandatory. +## settingsHandlers +The `settingsHandlers` block is unique and one of the most important blocks in the solutions registry entry. It consists of zero or more settingsHandler entries, each keyed by an arbitrary name (that is unique within this solutions settingsHandlers block). Inside each settingsHandler entry, the properties for that settingsHandler is provided. The entries in the settingsHandlers block can be referred to from the lifecycle blocks of the solutions registry entry. The settingsHandlers block is mandatory, but can be empty. **Example settingsHandlers block**: ``` @@ -57,7 +59,6 @@ The `settingsHandlers` block is unique and one of the most important blocks in t "presentation.reportHelpBalloons": { ... metadata for setting ... }, "speech.nonTransformableSetting": { ... metadata for setting ... } }, - "capabilities": [], "capabilitiesTransformations": { "speech.espeak.pitch": { "transform": { @@ -82,6 +83,7 @@ The `settingsHandlers` block is unique and one of the most important blocks in t }, "otherconf": { "type": "gpii.settingsHandlers.XMLHandler", + "liveness:: "liveRestart", "options": { "filename": "${{environment}.HOME}\\mySettings.ini" }, @@ -95,13 +97,12 @@ The `settingsHandlers` block is unique and one of the most important blocks in t } ``` -An important thing to notice here is that this solution example has two references to settingsHandler - one XMLHandler which has been given a reference `myconf` and an INIHandler referred to as `otherconf`. +An important thing to notice here is that this solution example has two settingsHandlers - one XMLHandler which has been given a reference `myconf` and an INIHandler referred to as `otherconf`. Each settingsHandler block can contain the following information: * **type (mandatory):** the type of settingshandler -* **liveness (mandatory):** Describes the update behavior of this solution: `"live"` means that the settings can be applied live without needing to restart the solution. `"liveRestart"` means that the a restart is required but considered low-impact enough for e.g. the PCP to trigger this automatically but not on a framerate of e.g. dragging a slider. `"manualRestart"` means that a change in settings requires a restart and that the restart of the solution is considered high-impact and slow. `"OSRestart"` means that a restart of the OS required. +* **liveness (mandatory):** Describes the update behavior of this solution: `"live"` means that the settings can be applied live without needing to restart the solution. `"liveRestart"` means that the a restart is required but considered low-impact enough for e.g. the PCP to trigger this automatically but not on a framerate of e.g. dragging a slider. `"manualRestart"` means that a change in settings requires a restart and that the restart of the solution is considered high-impact and slow. `"OSRestart"` means that a restart of the operating system required. * **options:** Any options that should be passed to the settingsHandler. This is specific to the type of settingshandler specified in the "type" block. -* **capabilities:** Is used to specify the capabilities of the solution (i.e. the settings/terms that the solution is capable of handling). Note that the framework can automatically deduce capabilities from the `capabilitiesTransformations` block, so if a setting is specified here, the system will automatically consider it a capability which means it does not need to specified in the `capabilities` block. * **capabilitiesTransformations**: Transformations from common terms to application specific settings can be defined here. These will enable the framework to automatically translate common terms from a user's NP set into application settings. Any common terms listed here, will automatically be added to the `capabilities` of the solution. * **inverseCapabilitiesTransformations**: This block describes transformations from application settings to common terms. If this block is present, the transformations specified will be used by the framework to deduce common terms based on any application specific settings in the users NP set. If this key is not present, the framework will attempt to do the inversion itself, based on the `capabilitiesTransformations`. If this block is present, but empty, the system will make no attempt to automatically invert the `capabilitiesTransformations`. * **supportedSettings (mandatory when multiple settingsHandlers)**: This block is used to determine which application specific settings are relevant to the settingshandler, and also serves as location for providing metadata (such as default values, data type, validation information, etc) about the setting. Currently no relevant metadata is supported, so the empty object (`{}`) should be used as value. If a solution only has a single settingsHandler block, all the settings will be passed to that handler by default. But in case there are multiple settingsHandlers, the system needs some way of determining which settings to apply to which handler. The `supportedSettings` directive is used for this: @@ -110,15 +111,75 @@ Each settingsHandler block can contain the following information: -### configure, restore, start and stop -These four lifecycle blocks have different meanings to the system but has the same format. Their meanings are the following: +## launchHandlers: + +The `launchHandlers` are very similar to the `settingsHandlers` block in both form, functionality and implementation, but have a different area of responsibility. As the name suggests, rather than being responsible for modifying settings, they are responsible for the 'launch' state of the application. That is, they are responsible for any actions related to stopping or starting the application, and detecting whether it is running. + +There are two main difference from settingshandlers: (1) internally, launch handlers only have one setting (`running`) which can be true or false depending on the (desired) state of solution and (2) launch handlers do not get their settings from the users NP directly, rather they get the value for `running` from the matchmaker. This is because the decision of which applications to run/stop/update on login depends on what is available on the system and what the matchmaker decides best works for the user. + +On a technical level, launch handlers work exactly as settings handlers, in that they have two methods `get` and `set` for getting and setting the current run-state of and application, respectively. They ignore all "settings" passed in the payload, except for the `running` setting, which should be a boolean value. An implementation of a launch handler should support 3 actions: reading the current run-state of an application (i.e. the `get` call), starting an application (i.e. when `set` is called with a `true` value) and stopping an application (i.e. when `set` is called with a `false` value). + +**Example launchHandlers block**: +``` +"launchHandlers:" { + "launcher": { + "type": "gpii.launchHandlers.flexibleHandler", + "options": { + "setTrue": [ + { + "type": "gpii.launch.exec", + "command": "\"${{registry}.HKEY_CURRENT_USER\\Software\\Texthelp\\Read&Write11\\InstallPath}\\ReadAndWrite.exe\"" + } + ], + "setFalse": [ + { + "type": "gpii.windows.closeProcessByName", + "filename": "ReadAndWrite.exe" + } + ], + "getState": [ + { + "type": "gpii.processReporter.find", + "command": "ReadAndWrite" + } + ] + } + } +} +``` + +As can be seen, the structure of the `launchHandlers` block is very similar to the `settingsHandlers` block. It supports any number of launchHandler entries, keyed by some reference string (in this case "launcher", but it could be anything) that can be used in the lifecycle blocks to reference it. + +Each launch handler will have a `type` entry, describing its type, as well as an `options` block. The content of the `options` block will depend on the launch handler. + +## Capabilities +While most of the users preferences for a certain application or group of applications are handled in the various `settingsHandlers` entries, there are some preferences that can affect the application in other ways than in its configuration. These are `enabled` terms, such as `http://registry.gpii.net/common/magnification/enabled`, which can have a special meaning. If a setting like this should affect whether the solution should be started at all, it should be listed in the solutions capabilities block. If a preference like this should just affect a certain feature/setting of the application, it should _not_ be listed in the capabilities. + +For clarity, lets take two different solutions: +1. `Solution A` is a combined screen reader and magnifier. It supports a `magOff` setting which will turn the magnification feature off, but still read what is on the screen. In this case, it would have `http://registry.gpii.net/common/magnification/enabled` in one of its settingsHandlers' capabilitiesTransformation block, where it would be transformed into an appropriate `magOff` value. This will affect whether the magnification feature is enabled, but otherwise allow the application to run normally. It should _not_ have the `http://registry\\.gpii\\.net/common/magnification/enabled` listed in its capabilities, since a value of `false` would mean that the application would not be started at all - meaning that the screenreader features would not be usable either. +2. `Solution B` is a magnifier application. If the user does not want magnification enabled, there is no sense in having this application running. In this case, it _should_ have the `http://registry\\.gpii\\.net/common/magnification/enabled` listed in its capabilities. This effect is that if the user have a preference for this term, it would affect whether the `Solution B` is launched or not. Note that `Solution B` would still be configured according to the users preferences (just not launched) on user login, in case the user manually starts it later. + +**Example capabilities block**: +``` +"capabilities": [ + "http://registry\\.gpii\\.net/common/magnification/enabled" +] +``` + +## Lifecycle Blocks: configure, restore, start, stop, update and isRunning + +Lifecycle blocks describe what should happen when the system needs to configure, start, update, etc., an application. Neither of these blocks are mandatory as the system will infer their content in case they are not specified. + +### configure and restore + +These blocks describe how to configure and restore a solution, that is: * `configure`: Configure the solution with the users setting (e.g. on login) * `restore`: Restore the settings of the system from before the user logged in -* `start`: Launch/start the solution -* `stop`: Stop/kill the solution -Each of these lifecycle blocks allow the same content - which is an array with entries that are either references to settingsHandlers blocks or customized lifecycle blocks. To reference a settingsHandler block, the keyword `settings.` is used, where `` should be replaced with the name of a settingsHandler block. In the case of `configure` and `start`, a consequence of referencing a settingsHandler is that the settings given in the settingsHandler and users preferences set will be applied to that solution (and their original values will be saved to the system - if the user just logged in). In the case of `restore` and `stop`, the settings that have previously been written using the settingshandler(s) in question will be restored. Alternative to referencings setting and restoring settings, arbitrary lifecycle actions are allowed - the syntax for this is an object that contains at least a `type` key for the function to call. None of these blocks are mandatory. +Each of these lifecycle blocks allow the same content - which is an array with entries that are either references to settingsHandlers blocks or customized lifecycle blocks. To reference a settingsHandler block, the keyword `settings.` is used, where `` should be replaced with the name of a settingsHandler block. The meaning of referencing a settingsHandler is telling the system that the users preferences set will be applied to that solution via the referenced settingshandler. Alternative to referencings setting and restoring settings, arbitrary lifecycle actions are allowed - the syntax for this is an object that contains at least a `type` key for the function to call and any further key/value pairs that are needed by the type. + +If the `configure` and/or `restore` blocks are omitted from a solution entry, they will be inferred as containing references to all the solutions settingshandlers (if any). **Example blocks**: ``` @@ -127,26 +188,43 @@ Each of these lifecycle blocks allow the same content - which is an array with e ], "restore": [ "settings.myconf" -], +] +``` + +### start, stop and isRunning + +These blocks all have to do with the run-state of a solution. Their meanings are the following: + +* `start`: Launch/start the solution +* `stop`: Stop/kill the solution +* `isRunning`: Detect whether the application is currently running + +Similar to the configuration related blocks, each of these lifecycle blocks allow the same content - which is an array with entries that are either references to launcHandler blocks or customized lifecycle blocks. To reference a launchHandler block, the keyword `launchers.` is used, where `` should be replaced with the name of a `launchHandler` block. Internally, when referencing a launchHandler, different things will happen depending on which lifecycle block the reference is from. A reference from `start` or `stop` will call the launch handlers `.set` method with a `running` value of `true` or `false`, respectively. This should have the effect of starting or stopping the process. In case of a reference from `isRunning`, a call will be made to the launch handlers `.set` method. Alternative to referencing launch handler blocks, arbitrary lifecycle actions are allowed - the syntax for this is an object that contains at least a `type` key for the function to call. + +None of these blocks are mandatory. If one is omitted from the solution registry entry, it will be inferred as containing references to all launchHandlers specified for that solution (if any). + +**Example blocks**: +``` "start": [ - { - "type": "gpii.launch.exec", - "command": "\"${{registry}.HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\nvda.exe\\}\"" - } + "launchers.myLauncher" ], "stop": [ + "launchers.myLauncher" +], +"isRunning": [ + "launchers.myLauncher", { - "type": "gpii.windows.killProcessByName", - "filename": "nvda.exe" + "type": "gpii.runCheckers.myCustomChecker", + "command": "applicationChecker.exe /n myApplication" } ] ``` ### update -The `update` block works very similarly to the configure, restore, start and stop blocks. It describes what should happen when the configuration needs to be updated (e.g. due to context changes, PCP adjustments, etc). +The `update` block works very similarly to the lifecycle blocks. It describes what should happen when the configuration needs to be updated (e.g. due to context changes, PCP adjustments, etc). -The format of the `update` block allows for the same entries as the configure, restore, start and stop blocks - that is: arbitrary lifecycle action blocks and `settings.`. Unlike for the other lifecycle blocks, the `update` block furthermore allows references to the `start`, `stop` and `configure` blocks. This is one by putting a string with the name of that block. When the system encounters one of these references, the entries of that block will be run. +The format of the `update` block allows for the same entries as the other lifecycle blocks - that is: arbitrary lifecycle action blocks and references to `settings.` and `launchers.`. Unlike for the other lifecycle blocks, the `update` block furthermore allows references to the `start`, `stop` and `configure` blocks. This is done by putting a string with the name of that block. When the system encounters one of these references, the entries of that block will be run. **Example block**: ``` @@ -164,6 +242,7 @@ The format of the `update` block allows for the same entries as the configure, r In the above example, the process of updating the application settings would consists of running the contents of the `configure` block (that is `"settings.myconf"`), followed by a custom lifecycle actions. +If the `update` block is omitted, it will be inferred by the system. What the inferred content will be depends on the solutions' liveness. If any of the settingsHandlers have a `liveness` value of less than "live", the inferred content will be `[ "stop", "configure", "start" ]`, i.e. a cycle of stopping, configuring and starting the application. If all settingsHandlers are "live", that means that it supports settings being updated live and a value of `[ "configure" ]` is inferred. ### isInstalled: @@ -188,19 +267,6 @@ This directive is used to detect whether a solution is installed. If any of thes ### UNIMPLEMENTED BLOCKS There are several advanced options that we're not planning to implement in the short term, but which will make the implementation of things like the ORCA settings handler much less horrible. -#### isRunning: -To detect whether a solution is running - this is planned to be integrated in the relatively short run. If any of these blocks evaluate to `true` (implicit OR), the application is considered to be running. - -**Example Entry**: -``` -"isRunning": [ - { - "type": "gpii.processReporter.find", - "command": "orca" - } -] -``` - #### isConfigurable This is run before configuration to ensure that the application is actually ready to be configured. This is relevant for applications where e.g. a configuration file needs to be present, a tutorial needs to be run on the first launch, etc. diff --git a/gpii/node_modules/canopyMatchMaker/src/CanopyMatchMaker.js b/gpii/node_modules/canopyMatchMaker/src/CanopyMatchMaker.js index b75b0e4ee..94c808cfd 100644 --- a/gpii/node_modules/canopyMatchMaker/src/CanopyMatchMaker.js +++ b/gpii/node_modules/canopyMatchMaker/src/CanopyMatchMaker.js @@ -78,7 +78,7 @@ gpii.canopyMatchMaker.matchPost.handleRequest = function (canopyMatchMaker, requ */ gpii.canopyMatchMaker.match = function (ontologyHandler, payload, disposeStrategy) { // augment payload with inferred common terms - payload.preferences = gpii.matchMakerFramework.utils.addInferredCommonTerms(payload.preferences, payload.inferredCommonTerms); + payload.preferences = gpii.matchMakerFramework.utils.addInferredCommonTermsToPreferences(payload.preferences, payload.inferredCommonTerms); // augment payload with information about the solution types var appTransformSpec = gpii.ontologyHandler.getTransformSpec(ontologyHandler.ontologyTransformSpecs, "flat", "apptology"); diff --git a/gpii/node_modules/canopyMatchMaker/src/CanopyMatchMakerUtilities.js b/gpii/node_modules/canopyMatchMaker/src/CanopyMatchMakerUtilities.js index e773b3468..5af199b0c 100644 --- a/gpii/node_modules/canopyMatchMaker/src/CanopyMatchMakerUtilities.js +++ b/gpii/node_modules/canopyMatchMaker/src/CanopyMatchMakerUtilities.js @@ -75,16 +75,16 @@ gpii.canopyMatchMaker.utils.rankSolutions = function (leaves, solrecs, ontologic * @leaves {object} * @solrecs {object} map of solutions keyed by solution id. */ -gpii.canopyMatchMaker.utils.disposeStrategy = function (leaves, solrecs, data, ontologyMetadata) { +gpii.canopyMatchMaker.utils.disposeStrategy = function (leaves, solrecs, data, contextId, ontologyMetadata) { var ontologicalMetricName = fluid.get(ontologyMetadata, "ontologicalMetricFunction") || "gpii.canopyMatchMaker.utils.prefixLength"; var ontologicalMetricFunction = fluid.getGlobalValue(ontologicalMetricName); // if we already have priority for some solutions, accept these and reject any applications // of same type. - gpii.matchMakerFramework.utils.disposeFromPriority(solrecs, data); + gpii.matchMakerFramework.utils.disposeFromPriority(solrecs, data, contextId); // rank remaining solutions based on fit to preferences var ranked = gpii.canopyMatchMaker.utils.rankSolutions(leaves, solrecs, ontologicalMetricFunction); // dispose based on canopy - var disposed = gpii.canopyMatchMaker.utils.disposeFromCanopy(leaves, ranked, solrecs, data, ontologicalMetricFunction); + var disposed = gpii.canopyMatchMaker.utils.disposeFromCanopy(leaves, ranked, solrecs, data, contextId, ontologicalMetricFunction); // re-key by solution id: var togo = {}; fluid.each(disposed, function (val) { @@ -93,7 +93,7 @@ gpii.canopyMatchMaker.utils.disposeStrategy = function (leaves, solrecs, data, o return togo; }; -gpii.canopyMatchMaker.utils.disposeFromCanopy = function (leaves, ranked, solrecs, data, ontologicalMetricFunction) { +gpii.canopyMatchMaker.utils.disposeFromCanopy = function (leaves, ranked, solrecs, data, contextId, ontologicalMetricFunction) { // Set default canopy to negative leaf depth. To raise the canopy, a preference needs to // match at least one level into the leaf. var canopy = fluid.transform(leaves, function (leaf) { @@ -116,12 +116,22 @@ gpii.canopyMatchMaker.utils.disposeFromCanopy = function (leaves, ranked, solrec } } if (inCanopy) { + // if solution is already disposed, don't redo it. Previous steps make sure canopy is raised accordingly + if (sol.disposition !== undefined) { + continue; + } + var prefActive = gpii.matchMakerFramework.utils.getActiveValueFromEnabledTerms(data.specialPreferences[contextId] || {}, data.specialCapabilities[sol.index], data.solutionsRegistryEntries[sol.index], sol.index); sol.disposition = "accept"; + sol.active = (prefActive !== undefined) ? prefActive : true; sol.dispositionReason = "Was the solution of this type that best fit user preferences"; gpii.matchMakerFramework.utils.rejectFromTypes(data.solutionTypes[sol.index], data.solutionTypeMapping, solrecs, "Another solution (" + sol.index + ") covering more preferences was found found."); } else { + // if solution is already disposed, don't redo it. Previous steps make sure canopy is raised accordingly + if (sol.disposition !== undefined) { + continue; + } sol.disposition = "reject"; sol.dispositionReason = "Was not in canopy."; } diff --git a/gpii/node_modules/canopyMatchMaker/test/CanopyMatchMakerTests.js b/gpii/node_modules/canopyMatchMaker/test/CanopyMatchMakerTests.js index f2651f678..b52ec78d0 100644 --- a/gpii/node_modules/canopyMatchMaker/test/CanopyMatchMakerTests.js +++ b/gpii/node_modules/canopyMatchMaker/test/CanopyMatchMakerTests.js @@ -45,12 +45,12 @@ fluid.defaults("gpii.canopyMatchMaker.tests", { var matchFixtures = [ { description: "Screenreader preference -> screenreader should be launched and configured", - input: require("./data/full_mm_payload2.json"), + input: require("./data/pre_mm_payload2.json"), preferences: { "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/screenReaderTTSEnabled": true + "http://registry.gpii.net/common/screenReaderTTS/enabled": true } } }, @@ -61,7 +61,7 @@ var matchFixtures = [ "fakescreenreader1": { "active": true, "settings": { - "http://registry.gpii.net/common/screenReaderTTSEnabled": true + "http://registry.gpii.net/common/screenReaderTTS/enabled": true } } } @@ -70,7 +70,7 @@ var matchFixtures = [ } }, { description: "Screenreader preference (not matching apptology) -> screenreader should be launched and configured", - input: require("./data/full_mm_payload2.json"), + input: require("./data/pre_mm_payload2.json"), preferences: { "gpii-default": { "name": "Default preferences", @@ -94,8 +94,8 @@ var matchFixtures = [ } } }, { - description: "Two magnifier preferences->best fit is launched", - input: require("./data/full_mm_payload2.json"), + description: "Two magnifier preferences->best fit is launched, the other one should not run", + input: require("./data/pre_mm_payload2.json"), preferences: { "gpii-default": { "name": "Default preferences", @@ -115,6 +115,12 @@ var matchFixtures = [ "http://registry.gpii.net/common/magnification": 150, "http://registry.gpii.net/common/invertColours": true } + }, + "fakemag1": { + "active": false, + "settings": { + "http://registry.gpii.net/common/magnification": 150 + } } } } @@ -122,7 +128,7 @@ var matchFixtures = [ } }, { description: "Equally good magnifier fit->first hit is launched", - input: require("./data/full_mm_payload2.json"), + input: require("./data/pre_mm_payload2.json"), preferences: { "gpii-default": { "name": "Default preferences", @@ -140,6 +146,12 @@ var matchFixtures = [ "settings": { "http://registry.gpii.net/common/magnification": 150 } + }, + "fakemag2": { + "active": false, + "settings": { + "http://registry.gpii.net/common/magnification": 150 + } } } } @@ -147,7 +159,7 @@ var matchFixtures = [ } }, { description: "magnifier and screen reader pref->both are launched", - input: require("./data/full_mm_payload2.json"), + input: require("./data/pre_mm_payload2.json"), preferences: { "gpii-default": { "name": "Default preferences", @@ -172,6 +184,12 @@ var matchFixtures = [ "settings": { "http://registry.gpii.net/common/pitch": 0.8 } + }, + "fakemag2": { + "active": false, + "settings": { + "http://registry.gpii.net/common/magnification": 150 + } } } } @@ -180,7 +198,7 @@ var matchFixtures = [ }, { description: "APPLICATION PRIORITIES: prioritized magnifier is launched despite " + "the other one being first hit", - input: require("./data/full_mm_payload2.json"), + input: require("./data/pre_mm_payload2.json"), preferences: { "gpii-default": { "name": "Default preferences", @@ -205,6 +223,12 @@ var matchFixtures = [ "settings": { "http://registry.gpii.net/common/magnification": 150 } + }, + "fakemag1": { + "active": false, + "settings": { + "http://registry.gpii.net/common/magnification": 150 + } } } } @@ -212,7 +236,7 @@ var matchFixtures = [ } }, { description: "APPLICATION PRIORITIES: Different priority levels for magnifiers", - input: require("./data/full_mm_payload2.json"), + input: require("./data/pre_mm_payload2.json"), preferences: { "gpii-default": { "name": "Default preferences", @@ -243,6 +267,12 @@ var matchFixtures = [ "settings": { "http://registry.gpii.net/common/magnification": 150 } + }, + "fakemag1": { + "active": false, + "settings": { + "http://registry.gpii.net/common/magnification": 150 + } } } } @@ -251,7 +281,7 @@ var matchFixtures = [ }, { description: "APPLICATION PRIORITIES: Same priority levels for magnifiers," + " - where canopy uses first hit match", - input: require("./data/full_mm_payload2.json"), + input: require("./data/pre_mm_payload2.json"), preferences: { "gpii-default": { "name": "Default preferences", @@ -282,6 +312,12 @@ var matchFixtures = [ "settings": { "http://registry.gpii.net/common/magnification": 150 } + }, + "fakemag2": { + "active": false, + "settings": { + "http://registry.gpii.net/common/magnification": 150 + } } } } @@ -290,7 +326,7 @@ var matchFixtures = [ }, { description: "APPLICATION PRIORITIES: Same priority levels for magnifiers" + " - best canopy fit selected", - input: require("./data/full_mm_payload2.json"), + input: require("./data/pre_mm_payload2.json"), preferences: { "gpii-default": { "name": "Default preferences", @@ -323,6 +359,12 @@ var matchFixtures = [ "http://registry.gpii.net/common/magnification": 150, "http://registry.gpii.net/common/invertColours": true } + }, + "fakemag1": { + "active": false, + "settings": { + "http://registry.gpii.net/common/magnification": 150 + } } } } @@ -330,7 +372,7 @@ var matchFixtures = [ } }, { description: "Application specific preference for magnifier - overrides canopy best fit", - input: require("./data/full_mm_payload2.json"), + input: require("./data/pre_mm_payload2.json"), preferences: { "gpii-default": { "name": "Default preferences", @@ -348,6 +390,10 @@ var matchFixtures = [ "settings": { "http://registry.gpii.net/applications/fakemag2": {} } + }, + "fakemag1": { + "active": false, + "settings": {} } } } @@ -355,7 +401,7 @@ var matchFixtures = [ } }, { description: "Application settings for multiple magnifiers - canopy best fit used", - input: require("./data/full_mm_payload2.json"), + input: require("./data/pre_mm_payload2.json"), preferences: { "gpii-default": { "name": "Default preferences", @@ -374,6 +420,12 @@ var matchFixtures = [ "settings": { "http://registry.gpii.net/applications/fakemag1": {} } + }, + "fakemag2": { + "active": false, + "settings": { + "http://registry.gpii.net/applications/fakemag2": {} + } } } } @@ -381,7 +433,7 @@ var matchFixtures = [ } }, { description: "Application settings for app with no specific type", - input: require("./data/full_mm_payload2.json"), + input: require("./data/pre_mm_payload2.json"), preferences: { "gpii-default": { "name": "Default preferences", @@ -406,7 +458,7 @@ var matchFixtures = [ } }, { description: "Expl. user priorities overrides application settings implicit priority", - input: require("./data/full_mm_payload2.json"), + input: require("./data/pre_mm_payload2.json"), preferences: { "gpii-default": { "name": "Default preferences", @@ -432,6 +484,177 @@ var matchFixtures = [ "settings": { "http://registry.gpii.net/common/magnification": 150 } + }, + "fakemag2": { + "active": false, + "settings": { + "http://registry.gpii.net/applications/fakemag2": {}, + "http://registry.gpii.net/common/magnification": 150 + } + } + } + } + } + } + }, { + description: "/enabled support - when 'magnification/enabled: false' preference comes from transformation, we still have 'active: true'", + input: require("./data/pre_mm_payload2.json"), + preferences: { + "gpii-default": { + "name": "Default preferences", + "preferences": { + "http://registry.gpii.net/common/magnification": 150, + "http://registry.gpii.net/common/magnification/enabled": false + }, + "metadata": [{ // We select fakemag2 + "type": "priority", + "scope": [ + "http://registry.gpii.net/applications/fakemag2" + ], + "value": 1024 + }] + } + }, + expect: { + "inferredConfiguration": { + "gpii-default": { + "applications": { + "fakemag1": { + "active": false, + "settings": { + "http://registry.gpii.net/common/magnification": 150, + "http://registry.gpii.net/common/magnification/enabled": false + } + }, + "fakemag2": { + "active": true, + "settings": { + "http://registry.gpii.net/common/magnification": 150, + "http://registry.gpii.net/common/magnification/enabled": false + } + } + } + } + } + } + }, { + description: "/enabled support - when 'magnification/enabled: true' preference comes from transformation, we still have 'active: true' only on relevant solution", + input: require("./data/pre_mm_payload2.json"), + preferences: { + "gpii-default": { + "name": "Default preferences", + "preferences": { + "http://registry.gpii.net/common/magnification": 150, + "http://registry.gpii.net/common/magnification/enabled": true + }, + "metadata": [{ // We select fakemag2 + "type": "priority", + "scope": [ + "http://registry.gpii.net/applications/fakemag2" + ], + "value": 1024 + }] + } + }, + expect: { + "inferredConfiguration": { + "gpii-default": { + "applications": { + "fakemag1": { + "active": false, + "settings": { + "http://registry.gpii.net/common/magnification": 150, + "http://registry.gpii.net/common/magnification/enabled": true + } + }, + "fakemag2": { + "active": true, + "settings": { + "http://registry.gpii.net/common/magnification": 150, + "http://registry.gpii.net/common/magnification/enabled": true + } + } + } + } + } + } + }, { + description: "/enabled support - when 'magnification/enabled: false' preference comes from capabilities block, we have 'active: false'", + input: require("./data/pre_mm_payload2.json"), + preferences: { + "gpii-default": { + "name": "Default preferences", + "preferences": { + "http://registry.gpii.net/common/magnification": 150, + "http://registry.gpii.net/common/magnification/enabled": false + }, + "metadata": [{ // We select fakemag1 + "type": "priority", + "scope": [ + "http://registry.gpii.net/applications/fakemag1" + ], + "value": 1024 + }] + } + }, + expect: { + "inferredConfiguration": { + "gpii-default": { + "applications": { + "fakemag1": { + "active": false, + "settings": { + "http://registry.gpii.net/common/magnification": 150, + "http://registry.gpii.net/common/magnification/enabled": false + } + }, + "fakemag2": { + "active": false, + "settings": { + "http://registry.gpii.net/common/magnification": 150, + "http://registry.gpii.net/common/magnification/enabled": false + } + } + } + } + } + } + }, { + description: "/enabled support - when 'magnification/enabled: true' preference comes from capabilities block, we have 'active: true'", + input: require("./data/pre_mm_payload2.json"), + preferences: { + "gpii-default": { + "name": "Default preferences", + "preferences": { + "http://registry.gpii.net/common/magnification": 150, + "http://registry.gpii.net/common/magnification/enabled": true + }, + "metadata": [{ // We select fakemag1 + "type": "priority", + "scope": [ + "http://registry.gpii.net/applications/fakemag1" + ], + "value": 1024 + }] + } + }, + expect: { + "inferredConfiguration": { + "gpii-default": { + "applications": { + "fakemag1": { + "active": true, + "settings": { + "http://registry.gpii.net/common/magnification": 150, + "http://registry.gpii.net/common/magnification/enabled": true + } + }, + "fakemag2": { + "active": false, + "settings": { + "http://registry.gpii.net/common/magnification": 150, + "http://registry.gpii.net/common/magnification/enabled": true + } } } } @@ -439,7 +662,7 @@ var matchFixtures = [ } }, { description: "GPII-2074: Non-matching applications are ignored", - input: require("./data/full_mm_payload2.json"), + input: require("./data/pre_mm_payload2.json"), preferences: { "gpii-default": { "name": "Default preferences", @@ -462,8 +685,9 @@ var matchFixtures = [ gpii.canopyMatchMaker.tests.match = function (ontologyHandler) { fluid.each(matchFixtures, function (fixture) { - fluid.set(fixture.input, ["preferences", "contexts"], fixture.preferences); - var result = gpii.canopyMatchMaker.match(ontologyHandler, fixture.input, gpii.canopyMatchMaker.utils.disposeStrategy); + fluid.set(fixture.input, ["preferences", "contexts"], fixture.preferences); // add testCase specific preferences + var mmInput = gpii.matchMakerFramework.utils.preProcess(fixture.input); // run MM preprocessing to add datastructures + var result = gpii.canopyMatchMaker.match(ontologyHandler, mmInput, gpii.canopyMatchMaker.utils.disposeStrategy); jqUnit.assertDeepEq(fixture.description, fixture.expect, result); }); }; diff --git a/gpii/node_modules/canopyMatchMaker/test/data/full_mm_payload1.json b/gpii/node_modules/canopyMatchMaker/test/data/pre_mm_payload1.json similarity index 82% rename from gpii/node_modules/canopyMatchMaker/test/data/full_mm_payload1.json rename to gpii/node_modules/canopyMatchMaker/test/data/pre_mm_payload1.json index 6f2dc7e5f..840ce5861 100644 --- a/gpii/node_modules/canopyMatchMaker/test/data/full_mm_payload1.json +++ b/gpii/node_modules/canopyMatchMaker/test/data/pre_mm_payload1.json @@ -6,8 +6,8 @@ "name": "Default preferences", "preferences": { "http://registry.gpii.net/common/fontSize": 16, - "http://registry.gpii.net/common/screenReaderTTSEnabled": false, - "http://registry.gpii.net/common/magnifierEnabled": false, + "http://registry.gpii.net/common/screenReaderTTS/enabled": false, + "http://registry.gpii.net/common/magnification/enabled": false, "http://registry.gpii.net/common/magnification": 1 } } @@ -43,11 +43,10 @@ "options": { "path": "/path/to/some/file.json" }, - "capabilities": [], "capabilitiesTransformations": { "setting1": "http://registry\\.gpii\\.net/common/fontSize", - "setting2.path1": "http://registry\\.gpii\\.net/common/screenReaderTTSEnabled", - "setting2.path2": "http://registry\\.gpii\\.net/common/magnifierEnabled", + "setting2.path1": "http://registry\\.gpii\\.net/common/screenReaderTTS/enabled", + "setting2.path2": "http://registry\\.gpii\\.net/common/magnification/enabled", "setting2.path3.hello": "http://registry\\.gpii\\.net/common/magnification" } } @@ -70,19 +69,11 @@ }, "settingsHandlers": { "otherconf": { - "type": "gpii.settingsHandlers.noSettings", - "capabilities": [] + "type": "gpii.settingsHandlers.noSettings" } }, "start": [], "stop": [] } - }, - "activeContexts": [ - "gpii-default" - ], - "environmentReporter": {}, - "inferredCommonTerms": { - "gpii-default": {} } } \ No newline at end of file diff --git a/gpii/node_modules/canopyMatchMaker/test/data/full_mm_payload2.json b/gpii/node_modules/canopyMatchMaker/test/data/pre_mm_payload2.json similarity index 86% rename from gpii/node_modules/canopyMatchMaker/test/data/full_mm_payload2.json rename to gpii/node_modules/canopyMatchMaker/test/data/pre_mm_payload2.json index 178fb961b..647c2e040 100644 --- a/gpii/node_modules/canopyMatchMaker/test/data/full_mm_payload2.json +++ b/gpii/node_modules/canopyMatchMaker/test/data/pre_mm_payload2.json @@ -34,15 +34,15 @@ } ] }, + "capabilities": [ + "http://registry\\.gpii\\.net/common/magnification/enabled" + ], "settingsHandlers": { "configuration": { "type": "gpii.settingsHandlers.JSONSettingsHandler", "options": { "filename": "/tmp/fakemag1.settings.json" }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/magnifierEnabled" - ], "capabilitiesTransformations": { "magnification": "http://registry\\.gpii\\.net/common/magnification" } @@ -65,10 +65,8 @@ "options": { "filename": "/tmp/fakemag2.settings.json" }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/magnifierEnabled" - ], "capabilitiesTransformations": { + "enableMagnification": "http://registry\\.gpii\\.net/common/magnification/enabled", "magnification": "http://registry\\.gpii\\.net/common/magnification", "invert": "http://registry\\.gpii\\.net/common/invertColours" } @@ -98,15 +96,15 @@ } ] }, + "capabilities": [ + "http://registry\\.gpii\\.net/common/screenReaderTTS/enabled" + ], "settingsHandlers": { "configuration": { "type": "gpii.settingsHandlers.JSONSettingsHandler", "options": { "filename": "/tmp/fakescreenreader1.json" }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/screenReaderTTSEnabled" - ], "capabilitiesTransformations": { "pitch": "http://registry\\.gpii\\.net/common/pitch", "volumeTTS": "http://registry\\.gpii\\.net/common/volumeTTS", @@ -131,19 +129,11 @@ "options": { "filename": "/tmp/otherapp.json" }, - "capabilities": [], "capabilitiesTransformations": { "pitch": "http://registry\\.gpii\\.net/common/volume" } } } } - }, - "activeContexts": [ - "gpii-default" - ], - "environmentReporter": {}, - "inferredCommonTerms": { - "gpii-default": {} } } \ No newline at end of file diff --git a/gpii/node_modules/canopyMatchMaker/test/web/js/CanopyMatchMakerUtilitiesTests.js b/gpii/node_modules/canopyMatchMaker/test/web/js/CanopyMatchMakerUtilitiesTests.js index d27d56b1c..d10fd0b42 100644 --- a/gpii/node_modules/canopyMatchMaker/test/web/js/CanopyMatchMakerUtilitiesTests.js +++ b/gpii/node_modules/canopyMatchMaker/test/web/js/CanopyMatchMakerUtilitiesTests.js @@ -29,7 +29,6 @@ var magnifier = { "settingsHandlers": { "myconf": { "type": "gpii.integrationTesting.mockSettingsHandler", - "capabilities": ["display.screenEnhancement"], "capabilitiesTransformations": { "mag-factor": "display.screenEnhancement.magnification", "show-cross-hairs": "display.screenEnhancement.-provisional-showCrosshairs", @@ -56,8 +55,7 @@ var lesserMagnifier = { } }, "yourconf": { - "type": "gpii.integrationTesting.mockSettingsHandler", - "capabilities": "display.screenEnhancement.magnification" + "type": "gpii.integrationTesting.mockSettingsHandler" } } }; @@ -160,7 +158,17 @@ gpii.tests.canopyMatchMaker.runBasicTests = function () { "lesserMag": lesserMagnifier, "mag": magnifier }; - var solrecs = gpii.matchMakerFramework.utils.expandSolutions(solutions, { "*": "*" }); + var capabilities = { + lesserMag: [ + "display.screenEnhancement.magnification" + ], + mag: [ + "display.screenEnhancement.magnification", + "display.screenEnhancement.-provisional-showCrosshairs", + "display.screenEnhancement.tracking" + ] + }; + var solrecs = gpii.matchMakerFramework.utils.expandSolutions(solutions, capabilities, { "*": "*" }); var ranked = gpii.canopyMatchMaker.utils.rankSolutions(sammyLeaves, solrecs, gpii.canopyMatchMaker.utils.ISO24751.ontologicalMetric); var minimalData = { solutionTypes: { @@ -169,14 +177,17 @@ gpii.tests.canopyMatchMaker.runBasicTests = function () { }, solutionTypeMapping: { "http://registry.gpii.net/common/magnifier": [ "lesserMag", "mag" ] - } + }, + specialPreferences: {}, + specialCapabilities: {}, + solutionsRegistryEntries: {} }; // var indices = extractIndices(ranked); var expected = ["mag", "lesserMag"]; jqUnit.assertDeepEq("Ranked solutions", expected, ranked); - var disposed = gpii.canopyMatchMaker.utils.disposeFromCanopy(sammyLeaves, ranked, solrecs, minimalData, gpii.canopyMatchMaker.utils.ISO24751.ontologicalMetric); + var disposed = gpii.canopyMatchMaker.utils.disposeFromCanopy(sammyLeaves, ranked, solrecs, minimalData, "gpii-default", gpii.canopyMatchMaker.utils.ISO24751.ontologicalMetric); var itions = gpii.canopyMatchMaker.utils.extractDispositions(disposed); expected = { "mag": "accept", @@ -192,8 +203,8 @@ var disposeStrategyFixtures = [ leavesArg: [ "display.screenEnhancement.fontSize", "display.screenEnhancement.magnification", - "display.screenEnhancement.-provisional-magnifierEnabled", - "display.screenReader.-provisional-screenReaderTTSEnabled" + "display.screenEnhancement.-provisional-magnification/enabled", + "display.screenReader.-provisional-screenReaderTTS/enabled" ], solRecsArg: { "test.dummy": { @@ -206,11 +217,10 @@ var disposeStrategyFixtures = [ "options": { "path": "/some/path/to/file.json" }, - "capabilities": [], "capabilitiesTransformations": { "setting1": "http://registry\\.gpii\\.net/common/fontSize", - "setting2.path1": "http://registry\\.gpii\\.net/common/screenReaderTTSEnabled", - "setting2.path2": "http://registry\\.gpii\\.net/common/magnifierEnabled", + "setting2.path1": "http://registry\\.gpii\\.net/common/screenReaderTTS/enabled", + "setting2.path2": "http://registry\\.gpii\\.net/common/magnification/enabled", "setting2.path3.hello": "http://registry\\.gpii\\.net/common/magnification" } } @@ -226,10 +236,10 @@ var disposeStrategyFixtures = [ "screenEnhancement": { "fontSize": {}, "magnification": {}, - "-provisional-magnifierEnabled": {} + "-provisional-magnification/enabled": {} }, "screenReader": { - "-provisional-screenReaderTTSEnabled": {} + "-provisional-screenReaderTTS/enabled": {} } } }, @@ -241,8 +251,7 @@ var disposeStrategyFixtures = [ "contexts": {}, "settingsHandlers": { "myconf": { - "type": "gpii.settingsHandlers.noSettings", - "capabilities": [] + "type": "gpii.settingsHandlers.noSettings" } } }, @@ -280,7 +289,10 @@ gpii.tests.canopyMatchMaker.disposeStrategyTests = function () { solutionTypeMapping: { "http://registry.gpii.net/common/someType": [ "test.dummy" ], "http://registry.gpii.net/common/someOtherType": [ "test.dummy_2" ] - } + }, + specialPreferences: {}, + specialCapabilities: {}, + solutionsRegistryEntries: {} }; var result = gpii.canopyMatchMaker.utils.disposeStrategy(fixture.leavesArg, fixture.solRecsArg, data); var expected = $.extend(true, {}, fixture.solRecsArg, fixture.expect); diff --git a/gpii/node_modules/contextManager/src/ContextManager.js b/gpii/node_modules/contextManager/src/ContextManager.js index 9299f0b11..e3c955b70 100644 --- a/gpii/node_modules/contextManager/src/ContextManager.js +++ b/gpii/node_modules/contextManager/src/ContextManager.js @@ -172,7 +172,7 @@ gpii.contextManager.contextChanged = function (that, lifecycleManager, forceCont that.updateActiveContextName(fullPayload, forceContextName); if (oldActiveContext === fullPayload.activeContextName) { - fluid.log("contextManager: Same context as before (" + oldActiveContext + ") so doing nothing"); + fluid.log(fluid.logLevel.TRACE, "contextManager: Same context as before (" + oldActiveContext + ") so doing nothing"); return; } fluid.log("contextManager: New active contexts: " + fullPayload.activeContextName); diff --git a/gpii/node_modules/contextManager/test/data/standardMMInput.json b/gpii/node_modules/contextManager/test/data/standardMMInput.json index 9a7ad1570..7114339fd 100644 --- a/gpii/node_modules/contextManager/test/data/standardMMInput.json +++ b/gpii/node_modules/contextManager/test/data/standardMMInput.json @@ -68,6 +68,9 @@ } ] }, + "capabilities": [ + "http://registry\\.gpii\\.net/common/screenReaderTTS/enabled" + ], "settingsHandlers": { "configuration1": { "type": "gpii.settingsHandlers.INISettingsHandler", @@ -75,9 +78,6 @@ "filename": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\17.0\\Settings\\enu\\DEFAULT.JCF" }, "supportedSettings": {}, - "capabilities": [ - "http://registry\\.gpii\\.net/common/screenReaderTTSEnabled" - ], "capabilitiesTransformations": {}, "inverseCapabilitiesTransformations": {} }, @@ -95,7 +95,6 @@ "ENU-Message.Rate": {}, "ENU-PCCursor.Rate": {} }, - "capabilities": [], "capabilitiesTransformations": { "ENU-Global\\.Rate": "http://registry\\.gpii\\.net/common/speechRate", "ENU-JAWSCursor\\.Rate": "http://registry\\.gpii\\.net/common/speechRate", @@ -156,7 +155,6 @@ "allowNumberSignComments": true, "allowSubSections": true }, - "capabilities": [], "capabilitiesTransformations": { "speech\\.espeak\\.rate": { "transform": { @@ -264,9 +262,6 @@ }, "verifySettings": true }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/mouseTrailing" - ], "capabilitiesTransformations": { "MouseTrails": { "transform": { diff --git a/gpii/node_modules/contextManager/test/data/standardMMOutput.json b/gpii/node_modules/contextManager/test/data/standardMMOutput.json index cf518c076..6a7eec50e 100644 --- a/gpii/node_modules/contextManager/test/data/standardMMOutput.json +++ b/gpii/node_modules/contextManager/test/data/standardMMOutput.json @@ -27,7 +27,6 @@ "speech\\.espeak\\.pitch": 63 } }, - "capabilities": [], "capabilitiesTransformations": { "speech\\.espeak\\.rate": { "transform": { @@ -140,9 +139,6 @@ }, "verifySettings": true }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/mouseTrailing" - ], "capabilitiesTransformations": { "MouseTrails": { "transform": { diff --git a/gpii/node_modules/flatMatchMaker/src/FlatMatchMaker.js b/gpii/node_modules/flatMatchMaker/src/FlatMatchMaker.js index de14b458c..245de97c6 100644 --- a/gpii/node_modules/flatMatchMaker/src/FlatMatchMaker.js +++ b/gpii/node_modules/flatMatchMaker/src/FlatMatchMaker.js @@ -78,7 +78,7 @@ * buildReturnPayload function of the MM framework. */ gpii.flatMatchMaker.match = function (ontologyHandler, payload, disposeStrategy) { - payload.preferences = gpii.matchMakerFramework.utils.addInferredCommonTerms(payload.preferences, payload.inferredCommonTerms); + payload.preferences = gpii.matchMakerFramework.utils.addInferredCommonTermsToPreferences(payload.preferences, payload.inferredCommonTerms); payload.hierarchicalPrefs = ontologyHandler.prefsToOntology(payload.preferences, "flat", "ISO24751"); var transformSpec = gpii.ontologyHandler.getTransformSpec(ontologyHandler.ontologyTransformSpecs, "flat", "ISO24751"); @@ -89,7 +89,10 @@ /* * Very simple strategy that accepts any solution for which any preference el-path matches * a one of the solutions capabilities (inferred from the capabilities transformations and - * capabilities block of that solution) + * capabilities block of that solution). + * + * We consider that any accepted solution will be activated because of the simple-minded + * policy adopted by the flat matchmaker */ gpii.flatMatchMaker.disposeStrategy = function (leaves, solrecs) { fluid.each(solrecs, function (solrec) { @@ -99,7 +102,10 @@ if (solrec.priority !== undefined) { accepted = true; } - solrec.disposition = accepted ? "accept" : "reject"; + fluid.extend(solrec, { + disposition: accepted ? "accept" : "reject", + active: accepted ? true : false // always true if accepted + }); }); return solrecs; }; diff --git a/gpii/node_modules/flatMatchMaker/test/FlatMatchMakerTests.js b/gpii/node_modules/flatMatchMaker/test/FlatMatchMakerTests.js index 328263549..a3726f990 100644 --- a/gpii/node_modules/flatMatchMaker/test/FlatMatchMakerTests.js +++ b/gpii/node_modules/flatMatchMaker/test/FlatMatchMakerTests.js @@ -47,8 +47,8 @@ leavesArg: [ "display.screenEnhancement.fontSize", "display.screenEnhancement.magnification", - "display.screenEnhancement.-provisional-magnifierEnabled", - "display.screenReader.-provisional-screenReaderTTSEnabled" + "display.screenEnhancement.-provisional-magnification/enabled", + "display.screenReader.-provisional-screenReaderTTS/enabled" ], solRecsArg: { "test.dummy": { @@ -61,11 +61,10 @@ "options": { "path": "/some/path/to/file.json" }, - "capabilities": [], "capabilitiesTransformations": { "setting1": "http://registry\\.gpii\\.net/common/fontSize", - "setting2.path1": "http://registry\\.gpii\\.net/common/screenReaderTTSEnabled", - "setting2.path2": "http://registry\\.gpii\\.net/common/magnifierEnabled", + "setting2.path1": "http://registry\\.gpii\\.net/common/screenReaderTTS/enabled", + "setting2.path2": "http://registry\\.gpii\\.net/common/magnification/enabled", "setting2.path3.hello": "http://registry\\.gpii\\.net/common/magnification" } } @@ -81,10 +80,10 @@ "screenEnhancement": { "fontSize": {}, "magnification": {}, - "-provisional-magnifierEnabled": {} + "-provisional-magnification/enabled": {} }, "screenReader": { - "-provisional-screenReaderTTSEnabled": {} + "-provisional-screenReaderTTS/enabled": {} } } }, @@ -96,8 +95,7 @@ "contexts": {}, "settingsHandlers": { "myconf": { - "type": "gpii.settingsHandlers.noSettings", - "capabilities": [] + "type": "gpii.settingsHandlers.noSettings" } } }, @@ -134,7 +132,7 @@ var matchFixtures = [ { description: "Full match call test", - input: require("./data/full_mm_payload1.json"), + input: require("./data/pre_mm_payload1.json"), expect: { "inferredConfiguration": { "gpii-default": { @@ -143,8 +141,8 @@ "active": true, "settings": { "http://registry.gpii.net/common/fontSize": 16, - "http://registry.gpii.net/common/screenReaderTTSEnabled": false, - "http://registry.gpii.net/common/magnifierEnabled": false, + "http://registry.gpii.net/common/screenReaderTTS/enabled": false, + "http://registry.gpii.net/common/magnification/enabled": false, "http://registry.gpii.net/common/magnification": 1 } } @@ -157,6 +155,7 @@ gpii.flatMatchMaker.tests.match = function (ontologyHandler) { fluid.each(matchFixtures, function (fixture) { + fixture.input = gpii.matchMakerFramework.utils.preProcess(fixture.input); var result = gpii.flatMatchMaker.match(ontologyHandler, fixture.input, gpii.flatMatchMaker.disposeStrategy); jqUnit.assertDeepEq(fixture.description, fixture.expect, result); }); diff --git a/gpii/node_modules/flatMatchMaker/test/data/full_mm_payload1.json b/gpii/node_modules/flatMatchMaker/test/data/pre_mm_payload1.json similarity index 82% rename from gpii/node_modules/flatMatchMaker/test/data/full_mm_payload1.json rename to gpii/node_modules/flatMatchMaker/test/data/pre_mm_payload1.json index 6f2dc7e5f..840ce5861 100644 --- a/gpii/node_modules/flatMatchMaker/test/data/full_mm_payload1.json +++ b/gpii/node_modules/flatMatchMaker/test/data/pre_mm_payload1.json @@ -6,8 +6,8 @@ "name": "Default preferences", "preferences": { "http://registry.gpii.net/common/fontSize": 16, - "http://registry.gpii.net/common/screenReaderTTSEnabled": false, - "http://registry.gpii.net/common/magnifierEnabled": false, + "http://registry.gpii.net/common/screenReaderTTS/enabled": false, + "http://registry.gpii.net/common/magnification/enabled": false, "http://registry.gpii.net/common/magnification": 1 } } @@ -43,11 +43,10 @@ "options": { "path": "/path/to/some/file.json" }, - "capabilities": [], "capabilitiesTransformations": { "setting1": "http://registry\\.gpii\\.net/common/fontSize", - "setting2.path1": "http://registry\\.gpii\\.net/common/screenReaderTTSEnabled", - "setting2.path2": "http://registry\\.gpii\\.net/common/magnifierEnabled", + "setting2.path1": "http://registry\\.gpii\\.net/common/screenReaderTTS/enabled", + "setting2.path2": "http://registry\\.gpii\\.net/common/magnification/enabled", "setting2.path3.hello": "http://registry\\.gpii\\.net/common/magnification" } } @@ -70,19 +69,11 @@ }, "settingsHandlers": { "otherconf": { - "type": "gpii.settingsHandlers.noSettings", - "capabilities": [] + "type": "gpii.settingsHandlers.noSettings" } }, "start": [], "stop": [] } - }, - "activeContexts": [ - "gpii-default" - ], - "environmentReporter": {}, - "inferredCommonTerms": { - "gpii-default": {} } } \ No newline at end of file diff --git a/gpii/node_modules/flowManager/src/FlowManagerRequests.js b/gpii/node_modules/flowManager/src/FlowManagerRequests.js index 7d63c81fa..f36c885e0 100644 --- a/gpii/node_modules/flowManager/src/FlowManagerRequests.js +++ b/gpii/node_modules/flowManager/src/FlowManagerRequests.js @@ -180,7 +180,7 @@ processMatch: [{ // Definition of the MatchMaking processing chain priority: gpii.flowManager.processMatch.priorities.preProcess, namespace: "preProcess", - listener: "{flowManager}.matchMakerFramework.preProcess" + listener: "gpii.matchMakerFramework.utils.preProcess" }, { priority: gpii.flowManager.processMatch.priorities.matchMakerDispatcher, namespace: "matchMakerDispatcher", diff --git a/gpii/node_modules/flowManager/src/PCPChannel.js b/gpii/node_modules/flowManager/src/PCPChannel.js index 15f18010f..1f28ea1b4 100644 --- a/gpii/node_modules/flowManager/src/PCPChannel.js +++ b/gpii/node_modules/flowManager/src/PCPChannel.js @@ -103,7 +103,7 @@ gpii.pcpChannel.updatePreferences = function (pcpChannel, lifecycleManager, newP session.applier.change(["preferences", "contexts", session.model.activeContextName, "preferences"], contextualPrefs); // get new inferred configuration to be applied: - var newInferred = gpii.matchMakerFramework.utils.updateInferredConfiguration(session.model.preferences, session.model.matchMakerOutput.inferredConfiguration); + var newInferred = gpii.matchMakerFramework.utils.updateInferredConfiguration(session.model.preferences, session.model.matchMakerOutput.inferredConfiguration, session.model.solutionsRegistryEntries); // full payload from session: var fullPayload = fluid.extend(true, {}, session.model); @@ -199,14 +199,14 @@ gpii.pcpChannel.sessionToPCP = function (model, transformSpec) { var solution = model.solutionsRegistryEntries[solKey]; if (solution) { fluid.each(prefsVal, function (innerPrefsVal, innerPrefsKey) { - var liveness = gpii.matchMakerFramework.utils.getLeastLiveness(innerPrefsKey, [ solution ]); + var liveness = gpii.matchMakerFramework.utils.getLeastLiveness([ solution ], innerPrefsKey); gpii.pcpChannel.emitSettingControl(settingControls, schemas[innerPrefsKey], innerPrefsVal, [prefsKey, innerPrefsKey], liveness, solution.name); }); } } else { var activeSolutionIds = Object.keys(fluid.get(model, "activeConfiguration.inferredConfiguration.applications")); var activeSolutions = fluid.filterKeys(model.solutionsRegistryEntries, activeSolutionIds); - var liveness = gpii.matchMakerFramework.utils.getLeastLiveness(prefsKey, activeSolutions); + var liveness = gpii.matchMakerFramework.utils.getLeastLiveness(activeSolutions, prefsKey); gpii.pcpChannel.emitSettingControl(settingControls, schemas[prefsKey], prefsVal, [prefsKey], liveness); } }); diff --git a/gpii/node_modules/flowManager/test/PCPChannelTests.js b/gpii/node_modules/flowManager/test/PCPChannelTests.js index 212b756f0..3b05ec033 100644 --- a/gpii/node_modules/flowManager/test/PCPChannelTests.js +++ b/gpii/node_modules/flowManager/test/PCPChannelTests.js @@ -126,7 +126,7 @@ gpii.tests.pcpChannel.payloads = { }, "liveness": "live" }, - "http://registry\\.gpii\\.net/applications/com\\.microsoft\\.windows\\.highContrast.http://registry\\.gpii\\.net/common/highContrastEnabled": { + "http://registry\\.gpii\\.net/applications/com\\.microsoft\\.windows\\.highContrast.http://registry\\.gpii\\.net/common/highContrast/enabled": { "value": true, "schema": { "title": "High Contrast", @@ -152,7 +152,7 @@ gpii.tests.pcpChannel.payloads = { "solutionName": "Windows High Contrast", "liveness": "live" }, - "http://registry\\.gpii\\.net/applications/net\\.gpii\\.uioPlus.http://registry\\.gpii\\.net/common/highContrastEnabled": { + "http://registry\\.gpii\\.net/applications/net\\.gpii\\.uioPlus.http://registry\\.gpii\\.net/common/highContrast/enabled": { "value": true, "schema": { "title": "High Contrast", diff --git a/gpii/node_modules/flowManager/test/data/browserChannel_solutionsRegistry.json b/gpii/node_modules/flowManager/test/data/browserChannel_solutionsRegistry.json index 0f06106c9..6ed447d9b 100644 --- a/gpii/node_modules/flowManager/test/data/browserChannel_solutionsRegistry.json +++ b/gpii/node_modules/flowManager/test/data/browserChannel_solutionsRegistry.json @@ -14,8 +14,7 @@ "type": "gpii.settingsHandlers.webSockets", "options": { "path": "org.chrome.cloud4chrome" - }, - "capabilities": [] + } } }, "configure": [ @@ -39,8 +38,7 @@ "type": "gpii.settingsHandlers.webSockets", "options": { "path": "org.mozilla.cloud4firefox" - }, - "capabilities": [] + } } }, "configure": [ diff --git a/gpii/node_modules/flowManager/test/data/chrome2.json b/gpii/node_modules/flowManager/test/data/chrome2.json index ee1079223..dde799ddc 100644 --- a/gpii/node_modules/flowManager/test/data/chrome2.json +++ b/gpii/node_modules/flowManager/test/data/chrome2.json @@ -5,8 +5,8 @@ "name": "Default preferences", "preferences": { "http://registry.gpii.net/applications/org.chrome.cloud4chrome": { - "screenReaderTTSEnabled": false, - "highContrastEnabled": true, + "screenReaderTTS/enabled": false, + "highContrast/enabled": true, "invertColours": false, "magnifierEnabled": true, "magnification": 2, diff --git a/gpii/node_modules/flowManager/test/data/chrome_and_firefox.json b/gpii/node_modules/flowManager/test/data/chrome_and_firefox.json index dd29e7041..598161bb8 100644 --- a/gpii/node_modules/flowManager/test/data/chrome_and_firefox.json +++ b/gpii/node_modules/flowManager/test/data/chrome_and_firefox.json @@ -5,8 +5,8 @@ "name": "Default preferences", "preferences": { "http://registry.gpii.net/applications/org.chrome.cloud4chrome": { - "screenReaderTTSEnabled": false, - "highContrastEnabled": true, + "screenReaderTTS/enabled": false, + "highContrast/enabled": true, "invertColours": false, "magnifierEnabled": true, "magnification": 2, @@ -15,8 +15,8 @@ "highContrastTheme": "white-black" }, "http://registry.gpii.net/applications/org.mozilla.cloud4firefox": { - "screenReaderTTSEnabled": false, - "highContrastEnabled": true, + "screenReaderTTS/enabled": false, + "highContrast/enabled": true, "invertColours": false, "magnifierEnabled": true, "magnification": 2, diff --git a/gpii/node_modules/flowManager/test/data/firefox.json b/gpii/node_modules/flowManager/test/data/firefox.json index e3c5a8e16..56dac6a44 100644 --- a/gpii/node_modules/flowManager/test/data/firefox.json +++ b/gpii/node_modules/flowManager/test/data/firefox.json @@ -5,8 +5,8 @@ "name": "Default preferences", "preferences": { "http://registry.gpii.net/applications/org.mozilla.cloud4firefox": { - "screenReaderTTSEnabled": false, - "highContrastEnabled": true, + "screenReaderTTS/enabled": false, + "highContrast/enabled": true, "invertColours": false, "magnifierEnabled": true, "magnification": 2, diff --git a/gpii/node_modules/flowManager/test/data/matchmaker.output.payload.json b/gpii/node_modules/flowManager/test/data/matchmaker.output.payload.json index 363a29558..80ae07a49 100644 --- a/gpii/node_modules/flowManager/test/data/matchmaker.output.payload.json +++ b/gpii/node_modules/flowManager/test/data/matchmaker.output.payload.json @@ -13,9 +13,9 @@ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/screenReaderTTSEnabled": true, + "http://registry.gpii.net/common/screenReaderTTS/enabled": true, "http://registry.gpii.net/common/speechRate": 200, - "http://registry.gpii.net/common/magnifierEnabled": true, + "http://registry.gpii.net/common/magnification/enabled": true, "http://registry.gpii.net/common/magnification": 1.5, "http://registry.gpii.net/common/matchMakerType": "RuleBased" }, @@ -33,11 +33,11 @@ "turn-down-light": { "name": "turn down light", "preferences": { - "http://registry.gpii.net/common/screenReaderTTSEnabled": true, + "http://registry.gpii.net/common/screenReaderTTS/enabled": true, "http://registry.gpii.net/common/speechRate": 200, - "http://registry.gpii.net/common/magnifierEnabled": true, + "http://registry.gpii.net/common/magnification/enabled": true, "http://registry.gpii.net/common/magnification": 2, - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/matchMakerType": "RuleBased" }, "metadata": [ @@ -187,7 +187,6 @@ "options": { "schema": "org.gnome.desktop.a11y.magnifier" }, - "capabilities": [], "capabilitiesTransformations": { "mag-factor": "http://registry\\.gpii\\.net/common/magnification", "show-cross-hairs": "http://registry\\.gpii\\.net/common/showCrosshairs", @@ -259,7 +258,6 @@ "settingsHandlers": [ { "type": "gpii.gsettings", - "capabilities": [], "capabilitiesTransformations": { "text-scaling-factor": { "transform": { @@ -294,7 +292,7 @@ "gtk-theme": { "transform": { "type": "fluid.transforms.condition", - "conditionPath": "http://registry\\.gpii\\.net/common/highContrastEnabled", + "conditionPath": "http://registry\\.gpii\\.net/common/highContrast/enabled", "true": "HighContrast", "false": "Adwaita" } @@ -302,7 +300,7 @@ "icon-theme": { "transform": { "type": "fluid.transforms.condition", - "conditionPath": "http://registry\\.gpii\\.net/common/highContrastEnabled", + "conditionPath": "http://registry\\.gpii\\.net/common/highContrast/enabled", "true": "HighContrast", "false": "gnome" } @@ -341,7 +339,6 @@ "settingsHandlers": [ { "type": "gpii.gsettings", - "capabilities": [], "capabilitiesTransformations": { "font": "http://registry\\.gpii\\.net/common/0" }, @@ -375,13 +372,8 @@ } ] }, - "settingsHandlers": [ - { - "type": "gpii.settingsHandlers.noSettings", - "capabilities": [ - "http://registry\\.gpii\\.net/common/onScreenKeyboardEnabled" - ] - } + "capabilities": [ + "http://registry.gpii.net/common/onScreenKeyboard/enabled" ], "lifecycleManager": { "start": [ @@ -417,10 +409,9 @@ "settingsHandlers": [ { "type": "gpii.gsettings", - "capabilities": [], "capabilitiesTransformations": { "stickykeys-enable": "http://registry\\.gpii\\.net/common/stickyKeys", - "slowkeys-enable": "http://registry\\.gpii\\.net/common/slowKeysEnabled", + "slowkeys-enable": "http://registry\\.gpii\\.net/common/slowKeys/enabled", "slowkeys-delay": { "transform": { "type": "fluid.transforms.linearScale", @@ -428,7 +419,7 @@ "factor": 1000 } }, - "bouncekeys-enable": "http://registry\\.gpii\\.net/common/debounceEnabled", + "bouncekeys-enable": "http://registry\\.gpii\\.net/common/debounce/enabled", "bouncekeys-delay": { "transform": { "type": "fluid.transforms.linearScale", @@ -436,7 +427,7 @@ "factor": 1000 } }, - "mousekeys-enable": "http://registry\\.gpii\\.net/common/mouseEmulationEnabled", + "mousekeys-enable": "http://registry\\.gpii\\.net/common/mouseEmulation/enabled", "mousekeys-init-delay": { "transform": { "type": "fluid.transforms.linearScale", @@ -492,7 +483,6 @@ "settingsHandlers": [ { "type": "gpii.gsettings", - "capabilities": [], "options": { "schema": "org.gnome.desktop.wm.preferences" } @@ -526,7 +516,6 @@ "settingsHandlers": [ { "type": "gpii.gsettings", - "capabilities": [], "options": { "schema": "org.gnome.shell.overrides" } @@ -557,21 +546,21 @@ } ] }, + "capabilities": [ + "http://registry.gpii.net/common/screenReaderTTS/enabled" + ], "settingsHandlers": [ { "type": "gpii.orca", "options": { "user": "${{userToken}}" }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/screenReaderTTSEnabled" - ], "capabilitiesTransformations": { "enableTutorialMessages": "http://registry\\.gpii\\.net/common/speakTutorialMessages", "enableEchoByCharacter": "http://registry\\.gpii\\.net/common/keyEcho", "enableEchoByWord": "http://registry\\.gpii\\.net/common/wordEcho", "enableBraille": "http://registry\\.gpii\\.net/common/screenReaderBrailleOutput", - "enableSpeech": "http://registry\\.gpii\\.net/common/screenReaderTTSEnabled", + "enableSpeech": "http://registry\\.gpii\\.net/common/screenReaderTTS/enabled", "sayAllStyle": { "transform": { "type": "fluid.transforms.valueMapper", @@ -1073,7 +1062,6 @@ "settingsHandlers": [ { "type": "gpii.alsa", - "capabilities": [], "capabilitiesTransformations": { "masterVolume": { "transform": { @@ -1118,13 +1106,8 @@ } ] }, - "settingsHandlers": [ - { - "type": "gpii.settingsHandlers.noSettings", - "capabilities": [ - "http://registry\\.gpii\\.net/common/simplification" - ] - } + "capabilities": [ + "http://registry.gpii.net/common/simplification" ], "lifecycleManager": { "start": [ @@ -1165,13 +1148,8 @@ } ] }, - "settingsHandlers": [ - { - "type": "gpii.settingsHandlers.noSettings", - "capabilities": [ - "http://registry\\.gpii\\.net/common/pictorialSimplification" - ] - } + "capabilities": [ + "http://registry.gpii.net/common/pictorialSimplification" ], "lifecycleManager": { "start": [ @@ -1212,13 +1190,8 @@ } ] }, - "settingsHandlers": [ - { - "type": "gpii.settingsHandlers.noSettings", - "capabilities": [ - "http://registry\\.gpii\\.net/common/screenReaderTTSEnabled" - ] - } + "capabilities": [ + "http://registry.gpii.net/common/screenReaderTTS/enabled" ], "lifecycleManager": { "start": [ @@ -1253,8 +1226,7 @@ }, "settingsHandlers": [ { - "type": "gpii.xrandr", - "capabilities": [] + "type": "gpii.xrandr" } ], "lifecycleManager": { @@ -1282,12 +1254,8 @@ "options": { "path": "org.chrome.cloud4chrome" }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/contrastTheme", - "http://registry\\.gpii\\.net/common/fontSize" - ], "capabilitiesTransformations": { - "screenReaderTTSEnabled": "http://registry\\.gpii\\.net/common/screenReaderTTSEnabled", + "screenReaderTTS/enabled": "http://registry\\.gpii\\.net/common/screenReaderTTS/enabled", "fontSize": { "transform": { "type": "fluid.transforms.quantize", @@ -1308,7 +1276,7 @@ ] } }, - "magnifierEnabled": "http://registry\\.gpii\\.net/common/magnifierEnabled", + "magnifierEnabled": "http://registry\\.gpii\\.net/common/magnification/enabled", "magnification": { "transform": { "type": "fluid.transforms.quantize", @@ -1329,7 +1297,7 @@ ] } }, - "highContrastEnabled": "http://registry\\.gpii\\.net/common/highContrastEnabled", + "highContrast/enabled": "http://registry\\.gpii\\.net/common/highContrast/enabled", "highContrastTheme": "http://registry\\.gpii\\.net/common/highContrastTheme", "invertColours": "http://registry\\.gpii\\.net/common/invertColours" } @@ -1352,9 +1320,9 @@ "org.gnome.desktop.a11y.magnifier": { "active": true, "settings": { - "http://registry.gpii.net/common/screenReaderTTSEnabled": true, + "http://registry.gpii.net/common/screenReaderTTS/enabled": true, "http://registry.gpii.net/common/speechRate": 200, - "http://registry.gpii.net/common/magnifierEnabled": true, + "http://registry.gpii.net/common/magnification/enabled": true, "http://registry.gpii.net/common/magnification": 1.5, "http://registry.gpii.net/common/matchMakerType": "RuleBased" } @@ -1362,9 +1330,9 @@ "org.gnome.orca": { "active": true, "settings": { - "http://registry.gpii.net/common/screenReaderTTSEnabled": true, + "http://registry.gpii.net/common/screenReaderTTS/enabled": true, "http://registry.gpii.net/common/speechRate": 200, - "http://registry.gpii.net/common/magnifierEnabled": true, + "http://registry.gpii.net/common/magnification/enabled": true, "http://registry.gpii.net/common/magnification": 1.5, "http://registry.gpii.net/common/matchMakerType": "RuleBased" } @@ -1372,9 +1340,9 @@ "org.chrome.cloud4chrome": { "active": true, "settings": { - "http://registry.gpii.net/common/screenReaderTTSEnabled": true, + "http://registry.gpii.net/common/screenReaderTTS/enabled": true, "http://registry.gpii.net/common/speechRate": 200, - "http://registry.gpii.net/common/magnifierEnabled": true, + "http://registry.gpii.net/common/magnification/enabled": true, "http://registry.gpii.net/common/magnification": 1.5, "http://registry.gpii.net/common/matchMakerType": "RuleBased" } @@ -1386,44 +1354,44 @@ "org.gnome.desktop.a11y.magnifier": { "active": true, "settings": { - "http://registry.gpii.net/common/screenReaderTTSEnabled": true, + "http://registry.gpii.net/common/screenReaderTTS/enabled": true, "http://registry.gpii.net/common/speechRate": 200, - "http://registry.gpii.net/common/magnifierEnabled": true, + "http://registry.gpii.net/common/magnification/enabled": true, "http://registry.gpii.net/common/magnification": 2, - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/matchMakerType": "RuleBased" } }, "org.gnome.desktop.interface": { "active": true, "settings": { - "http://registry.gpii.net/common/screenReaderTTSEnabled": true, + "http://registry.gpii.net/common/screenReaderTTS/enabled": true, "http://registry.gpii.net/common/speechRate": 200, - "http://registry.gpii.net/common/magnifierEnabled": true, + "http://registry.gpii.net/common/magnification/enabled": true, "http://registry.gpii.net/common/magnification": 2, - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/matchMakerType": "RuleBased" } }, "org.gnome.orca": { "active": true, "settings": { - "http://registry.gpii.net/common/screenReaderTTSEnabled": true, + "http://registry.gpii.net/common/screenReaderTTS/enabled": true, "http://registry.gpii.net/common/speechRate": 200, - "http://registry.gpii.net/common/magnifierEnabled": true, + "http://registry.gpii.net/common/magnification/enabled": true, "http://registry.gpii.net/common/magnification": 2, - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/matchMakerType": "RuleBased" } }, "org.chrome.cloud4chrome": { "active": true, "settings": { - "http://registry.gpii.net/common/screenReaderTTSEnabled": true, + "http://registry.gpii.net/common/screenReaderTTS/enabled": true, "http://registry.gpii.net/common/speechRate": 200, - "http://registry.gpii.net/common/magnifierEnabled": true, + "http://registry.gpii.net/common/magnification/enabled": true, "http://registry.gpii.net/common/magnification": 2, - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/matchMakerType": "RuleBased" } } diff --git a/gpii/node_modules/flowManager/test/data/update_solutionsRegistry.json b/gpii/node_modules/flowManager/test/data/update_solutionsRegistry.json index af7ccf22d..051e75cfa 100644 --- a/gpii/node_modules/flowManager/test/data/update_solutionsRegistry.json +++ b/gpii/node_modules/flowManager/test/data/update_solutionsRegistry.json @@ -12,7 +12,6 @@ "settingsHandlers": { "myconf": { "type": "gpii.settingsHandlers.noSettings", - "capabilities": [], "capabilitiesTransformations": { "dummySetting1": "http://registry\\.gpii\\.net/common/fontSize", "dummySetting2": "http://registry\\.gpii\\.net/common/setting2" diff --git a/gpii/node_modules/flowManager/test/shared/BrowserChannelTestDefs.js b/gpii/node_modules/flowManager/test/shared/BrowserChannelTestDefs.js index 5c8326424..1d60732ad 100644 --- a/gpii/node_modules/flowManager/test/shared/BrowserChannelTestDefs.js +++ b/gpii/node_modules/flowManager/test/shared/BrowserChannelTestDefs.js @@ -25,8 +25,8 @@ gpii.tests.flowManager.browserChannel.chromeAndFirefoxUserToken = "chrome_and_fi gpii.tests.flowManager.browserChannel.payloads = { "org.chrome.cloud4chrome": { - "screenReaderTTSEnabled": false, - "highContrastEnabled": true, + "screenReaderTTS/enabled": false, + "highContrast/enabled": true, "invertColours": false, "magnifierEnabled": true, "magnification": 2, @@ -35,8 +35,8 @@ gpii.tests.flowManager.browserChannel.payloads = { "highContrastTheme": "white-black" }, "org.mozilla.cloud4firefox": { - "screenReaderTTSEnabled": false, - "highContrastEnabled": true, + "screenReaderTTS/enabled": false, + "highContrast/enabled": true, "invertColours": false, "magnifierEnabled": true, "magnification": 2, diff --git a/gpii/node_modules/lifecycleManager/src/LifecycleManager.js b/gpii/node_modules/lifecycleManager/src/LifecycleManager.js index 066ee8ee0..5d7de28a5 100644 --- a/gpii/node_modules/lifecycleManager/src/LifecycleManager.js +++ b/gpii/node_modules/lifecycleManager/src/LifecycleManager.js @@ -133,15 +133,25 @@ var gpii = fluid.registerNamespace("gpii"); args: ["{that}", "{arguments}.0", "{arguments}.1", "{arguments}.2", "{arguments}.3", "{arguments}.4"] // solutionId, settingsHandlers, actions, session, rootAction }, - invokeSettingsHandler: { - funcName: "gpii.lifecycleManager.invokeSettingsHandler", - args: ["{that}", "{arguments}.0", "{arguments}.1", "{arguments}.2"] - // solutionId, settingsHandlers, isMultiSH + invokeSettingsHandlerGet: { + funcName: "gpii.lifecycleManager.invokeSettingsHandlerGet", + args: ["{that}", "{arguments}.0", "{arguments}.1"] + // solutionId, settingsHandlers + }, + invokeSettingsHandlerSet: { + funcName: "gpii.lifecycleManager.invokeSettingsHandlerSet", + args: ["{that}", "{arguments}.0", "{arguments}.1"] + // solutionId, settingsHandlers }, restoreSnapshot: { funcName: "gpii.lifecycleManager.restoreSnapshot", args: ["{that}", "{arguments}.0"] // originalSettings + }, + getSolutionRunningState: { + funcName: "gpii.lifecycleManager.getSolutionRunningState", + args: ["{that}", "{arguments}.0", "{arguments}.1", "{arguments}.2"] + // solutionId, solution, session } } }); @@ -216,21 +226,14 @@ var gpii = fluid.registerNamespace("gpii"); /** Transforms the handlerSpec (handler part of the transformer's response payload) to a form * accepted by a settingsHandler - we use a 1-element array holding the payload for a single solution * per handler - * @param isMultiSH {boolean} is a flag denoting whether it's a multi-settingshandler solution - * If it is, a supported settings block is required for each entry */ - gpii.lifecycleManager.specToSettingsHandler = function (solutionId, handlerSpec, isMultiSH) { + gpii.lifecycleManager.specToSettingsHandler = function (solutionId, handlerSpec) { var returnObj = {}, settings = {}; if (handlerSpec.supportedSettings === undefined) { - if (isMultiSH) { - fluid.fail("Solution " + solutionId + " has multiple settingshandlers but is missing " + - "the 'supportedSettings' directive. Will not set the settings for this settingshandler"); - } else { - // if supportedSettings directive is not present, pass all settings: - settings = handlerSpec.settings; - } + // if supportedSettings directive is not present, pass all settings: + settings = handlerSpec.settings; } else { // we cant simply use fluid.filterKeys because that wont handle the cases where // there are 'undefined' values for the keys in handlerSpec.settings @@ -238,18 +241,17 @@ var gpii = fluid.registerNamespace("gpii"); // that the transformation of common terms into application specific settings doesn't occur until the // transformation stage - so we don't have the full list of app-specific settings to filter until now. for (var settingName in handlerSpec.supportedSettings) { - if (settingName in handlerSpec.settings) { + if (handlerSpec.settings && settingName in handlerSpec.settings) { settings[settingName] = handlerSpec.settings[settingName]; } } } - returnObj[solutionId] = [{ settings: settings, options: handlerSpec.options }]; - return returnObj; // NB array removed here + return returnObj; }; // Transform the response from the handler SET to a format that we can persist in models before passing to handler SET on restore @@ -264,20 +266,27 @@ var gpii = fluid.registerNamespace("gpii"); return fluid.get(armoured, [solutionId, 0]); }; - /** + gpii.lifecycleManager.invokeSettingsHandlerGet = function (that, solutionId, handlerSpec) { + // first prepare the payload for the settingsHandler in question - a more efficient + // implementation might bulk together payloads destined for the same handler + var settingsHandlerPayload = gpii.lifecycleManager.specToSettingsHandler(solutionId, handlerSpec); + var resolvedName = that.nameResolver.resolveName(handlerSpec.type, "settingsHandler"); + return gpii.settingsHandlers.dispatchSettingsHandlerGet(resolvedName, settingsHandlerPayload); + }; + + /** * @param handlerSpec {Object} A single settings handler specification - * @param isMultiSH {Boolean} [optional] if present and true, the solution has multiple settingshandlers * Payload example: * http://wiki.gpii.net/index.php/Settings_Handler_Payload_Examples * Transformer output: * http://wiki.gpii.net/index.php/Transformer_Payload_Examples */ - gpii.lifecycleManager.invokeSettingsHandler = function (that, solutionId, handlerSpec, isMultiSH) { + gpii.lifecycleManager.invokeSettingsHandlerSet = function (that, solutionId, handlerSpec) { // first prepare the payload for the settingsHandler in question - a more efficient // implementation might bulk together payloads destined for the same handler - var settingsHandlerPayload = gpii.lifecycleManager.specToSettingsHandler(solutionId, handlerSpec, isMultiSH); + var settingsHandlerPayload = gpii.lifecycleManager.specToSettingsHandler(solutionId, handlerSpec); var resolvedName = that.nameResolver.resolveName(handlerSpec.type, "settingsHandler"); - var setSettingsPromise = gpii.settingsHandlers.dispatchSettingsHandler(resolvedName, settingsHandlerPayload, that.options.retryOptions); + var setSettingsPromise = gpii.settingsHandlers.dispatchSettingsHandlerSet(resolvedName, settingsHandlerPayload, that.options.retryOptions); var togo = fluid.promise(); setSettingsPromise.then(function (handlerResponse) { @@ -311,22 +320,40 @@ var gpii = fluid.registerNamespace("gpii"); return value; }; + /** Remove all the settings blocks from a solutions registry entry + */ + gpii.lifecycleManager.removeSettingsBlocks = function (solutionEntry) { + fluid.each(["settingsHandlers", "launchHandlers"], function (handlersBlock) { + solutionEntry[handlersBlock] = fluid.transform(solutionEntry[handlersBlock], function (handler) { + return fluid.filterKeys(handler, "settings", true); + }); + }); + return solutionEntry; + }; + /** Applies snapshotted settings from a single settingsHandler block attached to a single solution into the "originalSettings" * model snapshot area in the LifecycleManager's session. Tightly bound to executeSettingsAction, executes one-to-one with it * with almost identical argument list. */ - - gpii.lifecycleManager.recordSnapshotInSession = function (that, snapshot, solutionId, solutionRecord, session, settingsHandlerBlockName, rootAction) { - var toSnapshot = fluid.copy(solutionRecord); - toSnapshot.settingsHandlers = {}; - toSnapshot.settingsHandlers[settingsHandlerBlockName] = snapshot; - if (rootAction === "start") { - session.applier.change(["originalSettings", solutionId], toSnapshot); - } else if (rootAction === "update") { - // if we're doing an update, keep the settings that are already stored from the + gpii.lifecycleManager.recordSnapshotInSession = function (that, snapshot, solutionId, solutionRecord, session, handlerType, settingsHandlerBlockName, rootAction) { + if (rootAction === "start" || rootAction === "update") { + var toSnapshot = gpii.lifecycleManager.removeSettingsBlocks(fluid.copy(solutionRecord)); + + // d not remove the settingshandlers blocks, since we need them when restoring the system. + // This is particularly relevant for launch handlers, where we will need to run the "get" directives on logout to decide + // whether we an application is running or not, and consequently, whether to run the "update" or "stop" block + toSnapshot[handlerType][settingsHandlerBlockName] = snapshot; + // keep the settings that are already stored from the // original snapshot, but augment it with any settings from the new snapshot // that were not present in the original snapshot. - // This workflow is tested in LifecycleManagerTests.js "Updating with normal reference to settingsHandler block, and 'undefined' value stored in snapshot" + // + // This is relevant when doing an update for obvious reasons + // (and tested) in LifecycleManagerTests.js "Updating with normal reference to settingsHandler block, and 'undefined' value stored in snapshot" + // + // It is also relevant for logins ("start" root action), in case a solution is already running. + // This would trigger a call to its "update" block. If that in turn eg. looks like the following + // [ "stop", "configure", "start" ] we would want the original state recorded during the "stop" + // action to persist - even when the "start" block is later run var mergedSettings = fluid.extend(true, {}, toSnapshot, session.model.originalSettings[solutionId]); var cleanedSettings = gpii.lifecycleManager.transformSolutionSettings(mergedSettings, gpii.lifecycleManager.cleanDeletes); session.applier.change(["originalSettings", solutionId], cleanedSettings); @@ -351,30 +378,34 @@ var gpii = fluid.registerNamespace("gpii"); * @param solutionRecord {Object} The solution registry entry for the solution * @param session {Component} The current session component. This function will attach the * solution record to the 'appliedSolutions' of the session's model (if successful) + * @param handlerType {String} The name of the handler block (i.e. "settings" or "launchers") * @param settingsHandlerBlockName {String} should be a reference to a settings block from the * settingsHandlers section. * @param rootAction {String} The root action on the LifecycleManager which is being serviced: "start", "stop", - * "update" or "restore" + * "update", "restore" or "isRunning" * @return {Function} a nullary function (a task), that once executed will set the settings returning a promise * that will be resolved once the settings are successfully set. - */ - gpii.lifecycleManager.executeSettingsAction = function (that, solutionId, solutionRecord, session, - settingsHandlerBlockName, rootAction) { - var isMultiSH = Object.keys(solutionRecord.settingsHandlers).length > 1; - var settingsHandlerBlock = solutionRecord.settingsHandlers[settingsHandlerBlockName]; + */ + gpii.lifecycleManager.executeSettingsAction = function (that, solutionId, solutionRecord, session, handlerType, settingsHandlerBlockName, rootAction) { + var settingsHandlerBlock = solutionRecord[handlerType][settingsHandlerBlockName]; if (settingsHandlerBlock === undefined) { fluid.fail("Reference to non-existing settingsHandler block named " + settingsHandlerBlockName + " in solution " + solutionId); } return function () { var expanded = session.localResolver(settingsHandlerBlock); - var settingsPromise = that.invokeSettingsHandler(solutionId, expanded, isMultiSH); - settingsPromise.then(function (snapshot) { - session.applier.change(["appliedSolutions", solutionId], solutionRecord); - gpii.lifecycleManager.recordSnapshotInSession(that, snapshot, solutionId, solutionRecord, session, - settingsHandlerBlockName, rootAction); - }); - return gpii.lifecycleManager.wrapRestorePromise(settingsPromise, rootAction); + if (rootAction === "isRunning") { // only run get and return directly if where checking for running applications + return that.invokeSettingsHandlerGet(solutionId, expanded); + } else { + var settingsPromise = that.invokeSettingsHandlerSet(solutionId, expanded); + + settingsPromise.then(function (snapshot) { + session.applier.change(["appliedSolutions", solutionId], solutionRecord); + gpii.lifecycleManager.recordSnapshotInSession(that, snapshot, solutionId, solutionRecord, session, + handlerType, settingsHandlerBlockName, rootAction); + }); + return gpii.lifecycleManager.wrapRestorePromise(settingsPromise, rootAction); + } }; }; @@ -384,15 +415,22 @@ var gpii = fluid.registerNamespace("gpii"); * back to settings. In a future version of the SettingsHandler API, this will not be necessary. * This is called during the "stop" action to convert the snapshotted "originalSettings" model material back to material * suitable for being sent to executeSettingsAction, as well as at the corresponding point during the "journal restore" - * operation + * operationf * @param solutionSettings {Object} A settings block for a single solution, holding a member named `settingsHandlers` * @param transformer {Function} A function which will transform one settingsHandlers block in the supplied `solutionSettings` */ gpii.lifecycleManager.transformSolutionSettings = function (solutionSettings, transformer) { var togo = fluid.copy(solutionSettings); // safe since armoured - togo.settingsHandlers = fluid.transform(solutionSettings.settingsHandlers, function (handlerBlock) { - return gpii.settingsHandlers.transformOneSolutionSettings(handlerBlock, transformer); + fluid.each(["settingsHandlers", "launchHandlers"], function (handlersBlock) { + togo[handlersBlock] = fluid.transform(solutionSettings[handlersBlock], function (handler) { + return gpii.settingsHandlers.transformOneSolutionSettings(handler, transformer); + }); + // avoid the handlerBlock to be `undefined` if it's not defined in solutionsRegistry entry. This is necessary for testing assertion purposes + if (togo[handlersBlock] === undefined) { + delete togo[handlersBlock]; + } }); + return togo; }; @@ -448,6 +486,39 @@ var gpii = fluid.registerNamespace("gpii"); return togo; }; + /** + * Infer an action block such as "start", "stop", "configure", etc. + * + * If some lifecycle block is not present, the system will use default actions for each block. These are as follows: + * * "start", "stop" and "isRunning": will by default be references to all launch handler blocks + * * "configure" and "restore": will by default be references to all settings handler blocks + * * "update": depends on the solutions "liveness" value where "live" means set settings only and + * "liveRestart"/"manualRestart"/"OSRestart" means a [stop, configure, start] cycle + */ + gpii.lifecycleManager.inferActionBlockSteps = function (actionName, solutionRecord) { + var steps = []; + if (["start", "stop", "isRunning"].indexOf(actionName) !== -1 && solutionRecord.launchHandlers) { + // grab all lifecycle block names and make these the steps + steps = fluid.transform(Object.keys(solutionRecord.launchHandlers), function (stepName) { + return "launchers." + stepName; + }); + } else if (["configure", "restore"].indexOf(actionName) !== -1 && solutionRecord.settingsHandlers) { + // grab all settingshandler block names and make these the steps + steps = fluid.transform(Object.keys(solutionRecord.settingsHandlers), function (stepName) { + return "settings." + stepName; + }); + } else if (actionName === "update") { + // check liveness: + var liveness = gpii.matchMakerFramework.utils.getLeastLiveness([solutionRecord]); + if (liveness === "live") { + steps = [ "configure" ]; + } else if (["liveRestart", "manualRestart", "OSRestart"].indexOf(liveness) !== -1) { + steps = [ "stop", "configure", "start"]; + } + } + return steps; + }; + /** Called for each solution during "start", "stop" and "update" phases * Actions to be performed are held in array "actions" and the settingsHandlers block from "solutions" (either Transformer * output, or snapshot output from "start" phase) encodes the settings to be set. @@ -468,7 +539,7 @@ var gpii = fluid.registerNamespace("gpii"); */ gpii.lifecycleManager.executeActions = function (that, solutionId, solutionRecord, session, actionBlock, rootAction) { - var steps = solutionRecord[actionBlock]; + var steps = solutionRecord[actionBlock] || gpii.lifecycleManager.inferActionBlockSteps(actionBlock, solutionRecord); if (steps === undefined) { fluid.log("No " + actionBlock + " actions defined for solution " + solutionId); return fluid.promise().resolve(); @@ -477,28 +548,35 @@ var gpii = fluid.registerNamespace("gpii"); if (typeof(action) === "string") { // if the action is a reference to a settings block (settings. where is a key to // the settings handler block) - if (action.indexOf("settings.") === 0) { + if (action.startsWith("settings.")) { var settingsHandlerBlockName = action.substring("settings.".length); - return gpii.lifecycleManager.executeSettingsAction(that, solutionId, solutionRecord, session, - settingsHandlerBlockName, rootAction); + return gpii.lifecycleManager.executeSettingsAction(that, solutionId, solutionRecord, session, "settingsHandlers", settingsHandlerBlockName, rootAction); + } else if (action.startsWith("launchers.")) { + var launchHandlerBlockName = action.substring("launchers.".length); + + if (actionBlock === "isRunning") { + // if we're just checking for the run state, don't actually modify the solutionRecord with settings: + solutionRecord = fluid.copy(solutionRecord); + } + // Set appropritate settings (i.e. { running: true } if we're in a start block, else { running: false }. + var launchSettings = { running: actionBlock === "start" ? true : false }; + fluid.set(solutionRecord, [ "launchHandlers", launchHandlerBlockName, "settings"], launchSettings); + return gpii.lifecycleManager.executeSettingsAction(that, solutionId, solutionRecord, session, "launchHandlers", launchHandlerBlockName, rootAction); } else if (actionBlock === "update") { // Keywords: "start", "stop", "configure" are allowed here as well, and // and will result in evaluating the respective block // TODO (GPII-1230) Fix this up so we don't always run the full start and stops (including) // system restoration, etc. - if (action === "start" || action === "configure") { - return that.executeActions(solutionId, solutionRecord, session, action, rootAction); - } else if (action === "stop") { - // This branch is used when an "update" action requires a stop and start of the solution - var unarmoured = gpii.lifecycleManager.transformSolutionSettings( - session.model.originalSettings[solutionId], gpii.settingsHandlers.changesToSettings); - return that.executeActions(solutionId, unarmoured, session, "stop", rootAction); + if (action === "start" || action === "configure" || action === "stop") { + return function () { + return that.executeActions(solutionId, solutionRecord, session, action, rootAction); + }; } else { fluid.fail("Unrecognised string action in LifecycleManager: " + action + " inside 'update' section for solution " + solutionId); } } - } else { // TODO should be removed when GPII-1235 has been solved (lifecycle actions are settings handlers) + } else { // We allow free lifecycle actions, but strongly discourage them, since we don't have control of logging state like with settings/launch handlers return function () { var expanded = session.localResolver(action); var result = gpii.lifecycleManager.invokeAction(expanded, that.nameResolver); @@ -536,6 +614,38 @@ var gpii = fluid.registerNamespace("gpii"); return fluid.promise.sequence(promises); }; + /** + * Based on the current state of an application (ie. if it is running or not) and the desired state, + * this function returns an array of actions for the lifecycle manager to run to get it to its + * recorded state + * + * @param currentRunState {boolean}: True if application is currently running + * @param desiredRunState {boolean}: True if application should be running + * @param isRestore {boolean}: If this is true, a "restore" will be used as the configuration action + * in the array that is returned. Else a "configure" will be used. In general, isRestore should be provided and + * true only of this is called by the logout/restore functionality of the system. + * @return {Array} An array of actions (strings) that needs to be run to restore the application + * to its original state + */ + gpii.lifecycleManager.calculateLifecycleActions = function (currentRunState, desiredRunState, isRestore) { + var configurationType = isRestore ? "restore" : "configure"; + var actions; + if (currentRunState === true) { // if it's already running + if (desiredRunState === false) { // and it was not running on start + actions = [ "stop", configurationType ]; + } else { // else update it + actions = [ "update" ]; + } + } else { // if it is not running + if (desiredRunState === true) { // and it was running when we started + actions = [ configurationType, "start" ]; + } else { // just restore settings + actions = [ "restore" ]; + } + } + return actions; + }; + /** Common utility used by gpii.lifecycleManager.stop and gpii.lifecycleManager.restoreSnapshot * @param session {gpii.lifecycleManager.session} which must contain * * A `originalSettings` snapshot in its model @@ -544,13 +654,28 @@ var gpii = fluid.registerNamespace("gpii"); * @return {Promise} A promise for the action of restoring the system */ gpii.lifecycleManager.restoreSystem = function (that, session, rootAction) { - var promises = fluid.transform(session.model.originalSettings, function (changesSolutionRecord, solutionId) { - var solutionRecord = gpii.lifecycleManager.transformSolutionSettings(changesSolutionRecord, gpii.settingsHandlers.changesToSettings); - return that.applySolution(solutionId, solutionRecord, session, [ "stop", "restore" ], rootAction); + var tasks = []; + fluid.each(session.model.originalSettings, function (changesSolutionRecord, solutionId) { + tasks.push(function () { + // check the current state of the solution to decide whether we should run the + // "restore", "update, or "stop" + return that.getSolutionRunningState(solutionId, changesSolutionRecord, session); + }); + tasks.push(function () { + if (!fluid.isDestroyed(that)) { // See above comment for GPII-580 + var solutionRecord = gpii.lifecycleManager.transformSolutionSettings(changesSolutionRecord, gpii.settingsHandlers.changesToSettings); + var recordedRunState = gpii.lifecycleManager.getSolutionRunningStateFromSnapshot(solutionRecord); + var currentRunState = session.model.runningOnLogin[solutionId]; + + var actions = gpii.lifecycleManager.calculateLifecycleActions(currentRunState, recordedRunState, true); + // build structure for returned values (for later reset) + return that.applySolution(solutionId, solutionRecord, session, actions, rootAction); + } + }); }); + var sequence = fluid.promise.sequence(tasks); - // TODO: In theory we could stop all solutions in parallel - var sequence = fluid.promise.sequence(fluid.values(promises)); + // // TODO: In theory we could stop all solutions in parallel return sequence; }; @@ -574,6 +699,29 @@ var gpii = fluid.registerNamespace("gpii"); }); }; + gpii.lifecycleManager.getSolutionRunningStateFromSnapshot = function (solutionSnapshot) { + // get isRunning entry from snapshot and block to run: + var isRunningBlock = fluid.makeArray(solutionSnapshot.isRunning || gpii.lifecycleManager.inferActionBlockSteps("isRunning", solutionSnapshot))[0]; + if (isRunningBlock && isRunningBlock.indexOf("launchers.") === 0) { + var settingsHandlerBlockName = isRunningBlock.substring("launchers.".length); + var recordedState = fluid.get(solutionSnapshot, ["launchHandlers", settingsHandlerBlockName, "settings", "running"]); + return recordedState; + } + }; + + gpii.lifecycleManager.getSolutionRunningState = function (that, solutionId, solutionRecord, session) { + if (!fluid.isDestroyed(that)) { + var promise = that.executeActions(solutionId, solutionRecord, session, "isRunning", "isRunning"); + var togo = fluid.promise(); + promise.then(function (val) { + var isRunning = fluid.get(val, [0, solutionId, 0, "settings", "running"]); + session.applier.change(["runningOnLogin", solutionId], isRunning); + togo.resolve(isRunning); + }); + return togo; + } + }; + /** * The lifecycleManager queue is used to hold the high-level actions that needs to happen, * such as starting the login process, starting logout process, starting the update process. @@ -703,9 +851,19 @@ var gpii = fluid.registerNamespace("gpii"); fluid.each(lifecycleInstructions, function (solution, solutionId) { tasks.push(function () { if (!fluid.isDestroyed(that)) { // See above comment for GPII-580 + // check the current state of the solution to decide whether we should run the + // "update", "start" or "stop" directive + return that.getSolutionRunningState(solutionId, solution, session); + } + }); + tasks.push(function () { + if (!fluid.isDestroyed(that)) { // See above comment for GPII-580 + // if solution is already running, call "update" directive - else use "start" directive + var isRunning = session.model.runningOnLogin[solutionId]; + var actions = gpii.lifecycleManager.calculateLifecycleActions(isRunning, solution.active); + // build structure for returned values (for later reset) - return that.applySolution(solutionId, solution, session, - (solution.active ? [ "configure", "start" ] : [ "configure" ]), "start"); + return that.applySolution(solutionId, solution, session, actions, "start"); } }); }); diff --git a/gpii/node_modules/lifecycleManager/test/html/LifecycleManagerTest.html b/gpii/node_modules/lifecycleManager/test/html/LifecycleManagerTest.html index ed00a1a19..3a29569f7 100644 --- a/gpii/node_modules/lifecycleManager/test/html/LifecycleManagerTest.html +++ b/gpii/node_modules/lifecycleManager/test/html/LifecycleManagerTest.html @@ -20,6 +20,7 @@ + diff --git a/gpii/node_modules/lifecycleManager/test/js/LifecycleManagerTests.js b/gpii/node_modules/lifecycleManager/test/js/LifecycleManagerTests.js index 061b54d04..77446a9d9 100644 --- a/gpii/node_modules/lifecycleManager/test/js/LifecycleManagerTests.js +++ b/gpii/node_modules/lifecycleManager/test/js/LifecycleManagerTests.js @@ -2,7 +2,7 @@ GPII Lifecycle Manager Tests Copyright 2012 OCAD University -Copyright 2012 Raising The Floor - International +Copyright 2012, 2017 Raising The Floor - International Licensed under the New BSD license. You may not use this file except in compliance with this License. @@ -51,8 +51,8 @@ https://github.com/GPII/universal/blob/master/LICENSE.txt }; /** - * Create a solution entry, keyed by solution ID. - * All subsequent arguments will be part of the solution entry key by solId + * Create a solution entry keyed by solution ID. + * All subsequent arguments will be part of the solution entry */ gpii.tests.lifecycleManager.buildLifecycleInstructions = function (solId) { var togo = {}; @@ -64,16 +64,65 @@ https://github.com/GPII/universal/blob/master/LICENSE.txt return togo; }; - gpii.tests.lifecycleManager.buildSettingsHandlersEntry = function (settings) { - return { + /** + * Used by a bunch of the tests to avoid having to write out the almost-identical full set of lifecycle + * instructions for each test. Instead one can have a "base set" of lifecycle instructions + * that can be shared across multiple tests/multiple phases of a single test, and then use + * this function to extend base set to match the specific test/test phase. + * + * The function takes an unlimited number of arguments. The first argument is mandatory and must + * be a set of lifecycle instructions entries keyed by solution ids. While the system wont explode + * if entries for multiple solutions are provided, only the "first" solution entry will be + * extended. The remaining arguments will be fluid.extended onto the first argument. + * + * @param currentInstructions {Object} a set of lifecycle instructions keyed by a solution id. For example, + * this could be the output of the buildLifecycleInstructions function. + * @param arguments {..Object..} The remaining arguments should be valid lifecycleInstructions that will + * be extended onto the original + * @param return {Object} The original lifecycle instructions, but with the remaining arguments fluid.extend'ed + * onto the first solution entry in the currentInstructions + */ + gpii.tests.lifecycleManager.extendLifecycleInstructions = function (currentInstructions) { + if (Object.keys(currentInstructions).length < 1) { + jqUnit.assertTrue("Instructions passed to extendLifecycleInstructions didn't contain an entry as expected", false); + } + var togo = fluid.copy(currentInstructions); + var solId = Object.keys(currentInstructions)[0]; + + for (var i = 1; i < arguments.length; ++i) { + togo[solId] = fluid.extend(true, {}, togo[solId], arguments[i]); + } + + return togo; + }; + + gpii.tests.lifecycleManager.buildSettingsHandlersEntry = function (settings, setRunning, removeLifecycleHandlerBlock) { + var togo = { "settingsHandlers": { "myconf": { "type": "gpii.tests.lifecycleManager.mockSettingsHandler", - "settings": settings, + "options": {} + } + }, + "launchHandlers": { + "launcher": { + "type": "gpii.tests.lifecycleManager.mockLaunchHandler", "options": {} } } }; + if (settings !== undefined) { + fluid.set(togo, [ "settingsHandlers", "myconf", "settings" ], settings); + } else { + delete togo.settingsHandlers; + } + if (setRunning !== undefined) { + fluid.set(togo, [ "launchHandlers", "launcher", "settings" ], { running: setRunning }); + } + if (removeLifecycleHandlerBlock) { + delete togo.launchHandlers; + } + return togo; }; gpii.tests.lifecycleManager.noUpdateLifecycle = { @@ -100,7 +149,27 @@ https://github.com/GPII/universal/blob/master/LICENSE.txt ] }; - gpii.tests.lifecycleManager.configurationSpec = gpii.tests.lifecycleManager.buildLifecycleInstructions("org.gnome.desktop.a11y.magnifier", + gpii.tests.lifecycleManager.standardLifecycle = { + "active": true, + "configure": [ + "settings.myconf" + ], + "restore": [ + "settings.myconf" + ], + "start": [ + "launchers.launcher" + ], + "stop": [ + "launchers.launcher" + ], + "isRunning": [ + "launchers.launcher" + ] + }; + + gpii.tests.lifecycleManager.configurationSpec = gpii.tests.lifecycleManager.buildLifecycleInstructions( + "org.gnome.desktop.a11y.magnifier", gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-clip": true, "cross-hairs-color": "red" }), gpii.tests.lifecycleManager.noUpdateLifecycle, { "update": [ "settings.myconf" ] }); @@ -123,81 +192,6 @@ https://github.com/GPII/universal/blob/master/LICENSE.txt }, "options": {} }] - }, - "If supportedSettings directive is present, only supported settings are passed": { - request: { - "type": "gpii.gsettings.set", - "options": {}, - "supportedSettings": { - "weirdSetting": {} - }, - "settings": { - "weirdSetting": "foo", - "otherSetting": "bar" - } - }, - response: [{ - "settings": { - "weirdSetting": "foo" - }, - "options": {} - }] - }, - "If supportedSettings directive and we have a multi SH solution, we should still be good": { - request: { - "type": "gpii.gsettings.set", - "options": {}, - "supportedSettings": { - "weirdSetting": {} - }, - "settings": { - "weirdSetting": "foo", - "otherSetting": "bar" - } - }, - isMultiSH: true, - response: [{ - "settings": { - "weirdSetting": "foo" - }, - "options": {} - }] - }, - "If supportedSettings directive is present - test no matching": { - request: { - "type": "gpii.gsettings.set", - "options": {}, - "supportedSettings": { - "thirdSetting": {} - }, - "settings": { - "weirdSetting": "foo", - "otherSetting": "bar" - } - }, - response: [{ - "settings": {}, - "options": {} - }] - }, - "Works with `undefined` values for settings (required when restoring)": { - request: { - "type": "gpii.gsettings.set", - "options": {}, - "supportedSettings": { - "weirdSetting": {} - }, - "settings": { - "weirdSetting": undefined, - "otherSetting": undefined - } - }, - response: [{ - "settings": { - "weirdSetting": undefined - }, - "options": {} - }] } }; @@ -261,11 +255,15 @@ https://github.com/GPII/universal/blob/master/LICENSE.txt userToken: 123 }; - gpii.tests.lifecycleManager.startPayload = fluid.extend(true, {}, gpii.tests.lifecycleManager.userOptions, { - activeConfiguration: { - lifecycleInstructions: gpii.tests.lifecycleManager.configurationSpec - } - }); + gpii.tests.lifecycleManager.buildStartPayload = function (lifecycleInstructions) { + return fluid.extend(true, {}, gpii.tests.lifecycleManager.userOptions, { + activeConfiguration: { + lifecycleInstructions: lifecycleInstructions + } + }); + }; + + gpii.tests.lifecycleManager.startPayload = gpii.tests.lifecycleManager.buildStartPayload(gpii.tests.lifecycleManager.configurationSpec); gpii.tests.lifecycleManager.sampleActiveSession = { 123: { @@ -311,10 +309,31 @@ https://github.com/GPII/universal/blob/master/LICENSE.txt gpii.tests.lifecycleManager.backingMockSettingsHandler = null; // initialised in every test that requires it - gpii.tests.lifecycleManager.initBackingMock = function () { - gpii.tests.lifecycleManager.backingMockSettingsHandler = gpii.test.integration.mockSettingsHandler(); + gpii.tests.lifecycleManager.initBackingMock = function (origSettings, setRunning) { + gpii.tests.lifecycleManager.backingMockSettingsHandler = gpii.test.integration.mockSettingsHandler({ + optionsPathKey: function (options, solutionId) { + return "settings|" + solutionId; + } + }); + gpii.tests.lifecycleManager.backingMockLaunchHandler = gpii.test.integration.mockSettingsHandler({ + optionsPathKey: function (options, solutionId) { + return "launch|" + solutionId; + } + }); + + var settings = origSettings === undefined ? // use default if no parameter is given + gpii.tests.lifecycleManager.settingsHandlerOriginalSystemSettings : + origSettings; + + setRunning = (setRunning === undefined) ? false : setRunning; // default to false + var launchSettings = gpii.tests.lifecycleManager.launchHandlerOriginalSystemSettingsRunning(setRunning); // initialise the mock with the initial settings expected at the end of the test - gpii.tests.lifecycleManager.backingMockSettingsHandler.set(gpii.tests.lifecycleManager.settingsHandlerOriginalSystemSettings); + gpii.tests.lifecycleManager.backingMockSettingsHandler.set(settings); + gpii.tests.lifecycleManager.backingMockLaunchHandler.set(launchSettings); + // and ensure our 'local' storage is reset + gpii.tests.lifecycleManager.staticRepository.settingsHandler = undefined; + gpii.tests.lifecycleManager.staticRepository.launchHandler = undefined; + gpii.tests.lifecycleManager.staticRepository.launchHandlerCalls = 0; }; gpii.tests.lifecycleManager.mockSettingsHandler = { @@ -332,20 +351,35 @@ https://github.com/GPII/universal/blob/master/LICENSE.txt } }; - gpii.tests.lifecycleManager.assertExpectedExec = function () { - jqUnit.assertDeepEq("Exec handler fired with expected arguments", { - "command": gpii.tests.lifecycleManager.fakeEnvironment.JAWS_DIR + "jaws.exe", - args: ["-settingsDirectory", gpii.tests.lifecycleManager.fakeEnvironment.WINDIR] - }, gpii.tests.lifecycleManager.staticRepository.execHandler); - }; - - gpii.tests.lifecycleManager.assertNoExec = function () { - jqUnit.assertUndefined("Exec handler has not been fired", - gpii.tests.lifecycleManager.staticRepository.execHandler); + gpii.tests.lifecycleManager.mockLaunchHandler = { + set: function (data) { + var togo = fluid.promise(); + gpii.invokeLater(function () { + gpii.tests.lifecycleManager.staticRepository.launchHandlerCalls++; + gpii.tests.lifecycleManager.staticRepository.launchHandler = data; + var response = gpii.resolveSync(gpii.tests.lifecycleManager.backingMockLaunchHandler.set(data)); + togo.resolve(response); + }, 100); + return togo; + }, + get: function (data) { + return gpii.resolveSync(gpii.tests.lifecycleManager.backingMockLaunchHandler.get(data)); + } }; - gpii.tests.lifecycleManager.assertExpectedSettingsHandler = function (message, expected) { - jqUnit.assertDeepEq("expected input sent to settingsHandler" + message, expected, gpii.tests.lifecycleManager.staticRepository.settingsHandler); + gpii.tests.lifecycleManager.createSettingsHandlerPayload = function (solutionId, settings) { + if (settings === undefined) { + return undefined; + } else { + var togo = {}; + togo[solutionId] = [ + { + options: {}, + settings: settings + } + ]; + return togo; + } }; gpii.tests.lifecycleManager.settingsHandlerOriginalSystemSettings = { @@ -356,16 +390,30 @@ https://github.com/GPII/universal/blob/master/LICENSE.txt "iamasetting": 200, "undefSetting": undefined }, - "options": {} + "options": { + // "storePath": "settingsBlock1" + } }], "other.application": [{ "settings": { "mysetting": "Hello World" }, - "type": "gpii.tests.lifecycleManager.mockSettingsHandler" + "options": { + // "storePath": "settingsBlock1" + } }] }; + gpii.tests.lifecycleManager.launchHandlerOriginalSystemSettingsRunning = function (setRunning) { + return { + "org.gnome.desktop.a11y.magnifier": [{ + "settings": { + "running": setRunning + } + }] + }; + }; + gpii.tests.lifecycleManager.settingsHandlerExpectedInputNewSettings = { "org.gnome.desktop.a11y.magnifier": [{ "settings": { @@ -386,342 +434,734 @@ https://github.com/GPII/universal/blob/master/LICENSE.txt }] }; - gpii.tests.lifecycleManager.updateTestDefs = fluid.freezeRecursive([{ - name: "Updating with the same prefs and values as already applied", - activeSessions: gpii.tests.lifecycleManager.sampleActiveSession, - startPayload: gpii.tests.lifecycleManager.startPayload, - updateSpec: gpii.tests.lifecycleManager.buildLifecycleInstructions("org.gnome.desktop.a11y.magnifier", - gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-clip": false, "cross-hairs-color": "green" }), - gpii.tests.lifecycleManager.noUpdateLifecycle, - { "update": [ "settings.myconf" ] }), - expectedAppliedSolutions: gpii.tests.lifecycleManager.buildLifecycleInstructions("org.gnome.desktop.a11y.magnifier", - gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-clip": false, "cross-hairs-color": "green" }), - gpii.tests.lifecycleManager.noUpdateLifecycle, - { "update": [ "settings.myconf" ] }), - expectedOriginalSettings: gpii.tests.lifecycleManager.buildLifecycleInstructions("org.gnome.desktop.a11y.magnifier", - gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-clip": false, "cross-hairs-color": "red" }), - gpii.tests.lifecycleManager.noUpdateLifecycle, - { "update": [ "settings.myconf" ] }) + gpii.tests.lifecycleManager.startTestDefs = [{ + name: "Solution with all lifecycle blocks", + basePayload: gpii.tests.lifecycleManager.buildLifecycleInstructions( + "org.gnome.desktop.a11y.magnifier", + gpii.tests.lifecycleManager.standardLifecycle + ), + originalSettings: { "cross-hairs-clip": false, "cross-hairs-color": "red" }, + runningOnLogin: false, + appliedSettings: { "cross-hairs-clip": false, "cross-hairs-color": "green" }, + runningAfterLogin: true, + expectedLaunchHandlerCalls: 2 }, { - name: "single pref changed without 'update' directive in solution registry entry", - activeSessions: gpii.tests.lifecycleManager.sampleActiveSession, - startPayload: fluid.extend(true, {}, gpii.tests.lifecycleManager.userOptions, { - activeConfiguration: { - lifecycleInstructions: gpii.tests.lifecycleManager.buildLifecycleInstructions("org.gnome.desktop.a11y.magnifier", - gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-clip": true, "cross-hairs-color": "red" }), - gpii.tests.lifecycleManager.noUpdateLifecycle) + name: "Solution with no explicit configure and restore (GPII-2106)", + basePayload: gpii.tests.lifecycleManager.buildLifecycleInstructions( + "org.gnome.desktop.a11y.magnifier", + { + "active": true, + "start": [ + "launchers.launcher" + ], + "stop": [ + "launchers.launcher" + ], + "isRunning": [ + "launchers.launcher" + ] } - }), - updateSpec: gpii.tests.lifecycleManager.buildLifecycleInstructions("org.gnome.desktop.a11y.magnifier", - gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-color": "green" }), - gpii.tests.lifecycleManager.noUpdateLifecycle), - // dont expect changes on update due to missing 'update' directive - expectedAppliedSolutions: gpii.tests.lifecycleManager.buildLifecycleInstructions("org.gnome.desktop.a11y.magnifier", - gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-clip": true, "cross-hairs-color": "red" }), - gpii.tests.lifecycleManager.noUpdateLifecycle), - expectedOriginalSettings: gpii.tests.lifecycleManager.buildLifecycleInstructions("org.gnome.desktop.a11y.magnifier", - gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-clip": false, "cross-hairs-color": "red" }), - gpii.tests.lifecycleManager.noUpdateLifecycle) + ), + originalSettings: { "cross-hairs-clip": false, "cross-hairs-color": "red" }, + runningOnLogin: false, + appliedSettings: { "cross-hairs-clip": false, "cross-hairs-color": "green" }, + runningAfterLogin: true, + expectedLaunchHandlerCalls: 2 }, { - name: "Updating with normal reference to settingsHandler block, single settings", - activeSessions: gpii.tests.lifecycleManager.sampleActiveSession, - startPayload: gpii.tests.lifecycleManager.startPayload, - updateSpec: gpii.tests.lifecycleManager.buildLifecycleInstructions("org.gnome.desktop.a11y.magnifier", - gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-color": "green" }), - gpii.tests.lifecycleManager.noUpdateLifecycle, - { "update": [ "settings.myconf" ] }), - expectedAppliedSolutions: gpii.tests.lifecycleManager.buildLifecycleInstructions("org.gnome.desktop.a11y.magnifier", - gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-clip": true, "cross-hairs-color": "green" }), - gpii.tests.lifecycleManager.noUpdateLifecycle, - { "update": [ "settings.myconf" ] }), - expectedOriginalSettings: gpii.tests.lifecycleManager.buildLifecycleInstructions("org.gnome.desktop.a11y.magnifier", - gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-clip": false, "cross-hairs-color": "red" }), - gpii.tests.lifecycleManager.noUpdateLifecycle, - { "update": [ "settings.myconf" ] }) + name: "Solution with no configure and restore and no settingsHandler block", + basePayload: gpii.tests.lifecycleManager.buildLifecycleInstructions( + "org.gnome.desktop.a11y.magnifier", + { + "active": true, + "start": [ + "launchers.launcher" + ], + "stop": [ + "launchers.launcher" + ], + "isRunning": [ + "launchers.launcher" + ] + } + ), + originalSettings: undefined, + runningOnLogin: false, + appliedSettings: undefined, + runningAfterLogin: true, + expectedLaunchHandlerCalls: 2 }, { - name: "Updating with normal reference to settingsHandler block, multiple settings", - activeSessions: gpii.tests.lifecycleManager.sampleActiveSession, - startPayload: gpii.tests.lifecycleManager.startPayload, - updateSpec: gpii.tests.lifecycleManager.buildLifecycleInstructions("org.gnome.desktop.a11y.magnifier", - gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-color": "green", "cross-hairs-clip": false }), - gpii.tests.lifecycleManager.noUpdateLifecycle, - { "update": [ "settings.myconf" ] }), - expectedAppliedSolutions: gpii.tests.lifecycleManager.buildLifecycleInstructions("org.gnome.desktop.a11y.magnifier", - gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-clip": false, "cross-hairs-color": "green" }), - gpii.tests.lifecycleManager.noUpdateLifecycle, - { "update": [ "settings.myconf" ] }), - expectedOriginalSettings: gpii.tests.lifecycleManager.buildLifecycleInstructions("org.gnome.desktop.a11y.magnifier", - gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-clip": false, "cross-hairs-color": "red" }), - gpii.tests.lifecycleManager.noUpdateLifecycle, - { "update": [ "settings.myconf" ] }) + name: "no explicit start, stop, isRunning directives", + basePayload: gpii.tests.lifecycleManager.buildLifecycleInstructions( + "org.gnome.desktop.a11y.magnifier", + { + "active": true, + "configure": [ + "settings.myconf" + ], + "restore": [ + "settings.myconf" + ] + } + ), + originalSettings: { "cross-hairs-clip": false, "cross-hairs-color": "red" }, + runningOnLogin: false, + appliedSettings: { "cross-hairs-clip": false, "cross-hairs-color": "green" }, + runningAfterLogin: true, + expectedLaunchHandlerCalls: 2 }, { - name: "Updating with reference to 'configure' directive, single settings", - activeSessions: gpii.tests.lifecycleManager.sampleActiveSession, - startPayload: fluid.extend(true, {}, gpii.tests.lifecycleManager.userOptions, { - activeConfiguration: { - lifecycleInstructions: gpii.tests.lifecycleManager.buildLifecycleInstructions("org.gnome.desktop.a11y.magnifier", - gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-clip": true, "cross-hairs-color": "red" }), - gpii.tests.lifecycleManager.noUpdateLifecycle, - { "update": [ "configure" ] }) + name: "no explicit start, stop, isRunning directives and no launchHandlers block", // expect no launch handler calls + basePayload: gpii.tests.lifecycleManager.buildLifecycleInstructions( + "org.gnome.desktop.a11y.magnifier", + { + "active": true, + "configure": [ + "settings.myconf" + ], + "restore": [ + "settings.myconf" + ] } - }), - updateSpec: gpii.tests.lifecycleManager.buildLifecycleInstructions("org.gnome.desktop.a11y.magnifier", - gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-color": "green" }), - gpii.tests.lifecycleManager.noUpdateLifecycle, - { "update": [ "configure" ] }), - expectedAppliedSolutions: gpii.tests.lifecycleManager.buildLifecycleInstructions("org.gnome.desktop.a11y.magnifier", - gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-clip": true, "cross-hairs-color": "green" }), - gpii.tests.lifecycleManager.noUpdateLifecycle, - { "update": [ "configure" ] }), - expectedOriginalSettings: gpii.tests.lifecycleManager.buildLifecycleInstructions("org.gnome.desktop.a11y.magnifier", - gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-clip": false, "cross-hairs-color": "red" }), - gpii.tests.lifecycleManager.noUpdateLifecycle, - { "update": [ "configure" ] }) + ), + originalSettings: { "cross-hairs-clip": false, "cross-hairs-color": "red" }, + runningOnLogin: undefined, + appliedSettings: { "cross-hairs-clip": false, "cross-hairs-color": "green" }, + runningAfterLogin: undefined, + expectedLaunchHandlerCalls: 0, + removeLifecycleHandlerBlock: true }, { - name: "Updating with normal reference to settingsHandler block, and a setting not in the original settings applied to the system", - activeSessions: gpii.tests.lifecycleManager.sampleActiveSession, - startPayload: gpii.tests.lifecycleManager.startPayload, - updateSpec: gpii.tests.lifecycleManager.buildLifecycleInstructions("org.gnome.desktop.a11y.magnifier", - gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-color": "green", "iamasetting": 100 }), - gpii.tests.lifecycleManager.noUpdateLifecycle, - { "update": [ "settings.myconf" ] }), - expectedAppliedSolutions: gpii.tests.lifecycleManager.buildLifecycleInstructions("org.gnome.desktop.a11y.magnifier", - gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-clip": true, "cross-hairs-color": "green", "iamasetting": 100 }), - gpii.tests.lifecycleManager.noUpdateLifecycle, - { "update": [ "settings.myconf" ] }), - expectedOriginalSettings: gpii.tests.lifecycleManager.buildLifecycleInstructions("org.gnome.desktop.a11y.magnifier", - gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-clip": false, "cross-hairs-color": "red", "iamasetting": 200 }), - gpii.tests.lifecycleManager.noUpdateLifecycle, - { "update": [ "settings.myconf" ] }) + name: "no explicit lifecycle directives (i.e. start,stop,configure,restore,isRunning)", + basePayload: gpii.tests.lifecycleManager.buildLifecycleInstructions( + "org.gnome.desktop.a11y.magnifier", + { + "active": true + } + ), + originalSettings: { "cross-hairs-clip": false, "cross-hairs-color": "red" }, + runningOnLogin: false, + appliedSettings: { "cross-hairs-clip": false, "cross-hairs-color": "green" }, + runningAfterLogin: true, + expectedLaunchHandlerCalls: 2 }, { - name: "Updating with normal reference to settingsHandler block, and a an application not in the original settings applied to the system", - activeSessions: gpii.tests.lifecycleManager.sampleActiveSession, - startPayload: gpii.tests.lifecycleManager.startPayload, - updateSpec: gpii.tests.lifecycleManager.buildLifecycleInstructions("other.application", - gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "mysetting": "Hallow World" }), - gpii.tests.lifecycleManager.noUpdateLifecycle, - { "update": [ "settings.myconf" ] }), - expectedAppliedSolutions: fluid.extend(true, {}, - gpii.tests.lifecycleManager.buildLifecycleInstructions("org.gnome.desktop.a11y.magnifier", - gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-clip": true, "cross-hairs-color": "red" }), - gpii.tests.lifecycleManager.noUpdateLifecycle, - { "update": [ "settings.myconf" ] }), - gpii.tests.lifecycleManager.buildLifecycleInstructions("other.application", - gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "mysetting": "Hallow World" }), - gpii.tests.lifecycleManager.noUpdateLifecycle, - { "update": [ "settings.myconf" ] })), - expectedOriginalSettings: fluid.extend(true, {}, - gpii.tests.lifecycleManager.buildLifecycleInstructions("org.gnome.desktop.a11y.magnifier", - gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-clip": false, "cross-hairs-color": "red" }), - gpii.tests.lifecycleManager.noUpdateLifecycle, - { "update": [ "settings.myconf" ] }), - gpii.tests.lifecycleManager.buildLifecycleInstructions("other.application", - gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "mysetting": "Hello World" }), - gpii.tests.lifecycleManager.noUpdateLifecycle, - { "update": [ "settings.myconf" ] })) + name: "solution with active: false", // no launch handler calls + basePayload: gpii.tests.lifecycleManager.buildLifecycleInstructions( + "org.gnome.desktop.a11y.magnifier", + gpii.tests.lifecycleManager.standardLifecycle, + { "active": false } + ), + originalSettings: { "cross-hairs-clip": false, "cross-hairs-color": "red" }, + runningOnLogin: false, + appliedSettings: { "cross-hairs-clip": false, "cross-hairs-color": "green" }, + runningAfterLogin: undefined, + expectedLaunchHandlerCalls: 0 }, { - // TODO: What is the difference between this test and the next one? Also, eliminate the massive duplication - name: "Updating with normal reference to settingsHandler block, and 'undefined' value stored in snapshot", - activeSessions: gpii.tests.lifecycleManager.sampleActiveSession, - startPayload: fluid.extend(true, {}, gpii.tests.lifecycleManager.userOptions, { - activeConfiguration: { - lifecycleInstructions: fluid.extend(true, {}, - gpii.tests.lifecycleManager.buildLifecycleInstructions("org.gnome.desktop.a11y.magnifier", - gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-clip": true, "undefSetting": "some value" }), - gpii.tests.lifecycleManager.noUpdateLifecycle, - { "update": [ "settings.myconf" ] })) - } - }), - expectedFirstAppliedSettings: { - "org.gnome.desktop.a11y.magnifier": [{ - "options": {}, - "settings": { - "cross-hairs-clip": true, - "undefSetting": "some value" - } - }] - }, - updateSpec: gpii.tests.lifecycleManager.buildLifecycleInstructions("org.gnome.desktop.a11y.magnifier", - gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "undefSetting": "some other value" }), - gpii.tests.lifecycleManager.noUpdateLifecycle, - { "update": [ "settings.myconf" ] }), - expectedAppliedSolutions: gpii.tests.lifecycleManager.buildLifecycleInstructions("org.gnome.desktop.a11y.magnifier", - gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-clip": true, "undefSetting": "some other value" }), - gpii.tests.lifecycleManager.noUpdateLifecycle, - { "update": [ "settings.myconf" ] }), - expectedOriginalSettings: { - "org.gnome.desktop.a11y.magnifier": { - "active": true, + name: "solution with active: undefined", // expect no launch handler calls + basePayload: gpii.tests.lifecycleManager.buildLifecycleInstructions( + "org.gnome.desktop.a11y.magnifier", + { + "active": undefined, "configure": [ "settings.myconf" ], "restore": [ "settings.myconf" ], - "settingsHandlers": { - "myconf": { - "options": {}, - "settings": { - "cross-hairs-clip": false, - "undefSetting": gpii.undefinedEncoding - }, - "type": "gpii.tests.lifecycleManager.mockSettingsHandler" - } - }, "start": [ - { - "args": [ - "-settingsDirectory", - "${{environment}.WINDIR}" - ], - "command": "${{environment}.JAWS_DIR}jaws.exe", - "name": "exec", - "type": "gpii.tests.lifecycleManager.mockExecHandler" - } + "launchers.launcher" ], "stop": [ - { - "pid": "${{exec}.pid}", - "type": "gpii.tests.lifecycleManager.mockKillHandler" - } + "launchers.launcher" ], + "isRunning": [ + "launchers.launcher" + ] + } + ), + originalSettings: { "cross-hairs-clip": false, "cross-hairs-color": "red" }, + runningOnLogin: false, + appliedSettings: { "cross-hairs-clip": false, "cross-hairs-color": "green" }, + runningAfterLogin: undefined, + expectedLaunchHandlerCalls: 0 + }, { + name: "running on login - 'update' with reference to settings handler block", + basePayload: gpii.tests.lifecycleManager.buildLifecycleInstructions( + "org.gnome.desktop.a11y.magnifier", + gpii.tests.lifecycleManager.standardLifecycle, + { "update": [ "settings.myconf" ] } - } + ), + originalSettings: { "cross-hairs-clip": false, "cross-hairs-color": "red" }, + runningOnLogin: true, + appliedSettings: { "cross-hairs-clip": false, "cross-hairs-color": "green" }, + runningAfterLogin: undefined, + expectedLaunchHandlerCalls: 0 }, { - name: "Updating with normal reference to settingsHandler block, and 'undefined' value stored in snapshot on update", - activeSessions: gpii.tests.lifecycleManager.sampleActiveSession, - startPayload: gpii.tests.lifecycleManager.startPayload, - updateSpec: gpii.tests.lifecycleManager.buildLifecycleInstructions("org.gnome.desktop.a11y.magnifier", - gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "undefSetting": "some value" }), - gpii.tests.lifecycleManager.noUpdateLifecycle, - { "update": [ "settings.myconf" ] }), - expectedAppliedSolutions: gpii.tests.lifecycleManager.buildLifecycleInstructions("org.gnome.desktop.a11y.magnifier", - gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-clip": true, "cross-hairs-color": "red", "undefSetting": "some value" }), - gpii.tests.lifecycleManager.noUpdateLifecycle, - { "update": [ "settings.myconf" ] }), - expectedOriginalSettings: { - "org.gnome.desktop.a11y.magnifier": { - "active": true, + name: "running on login - 'update' with reference to 'configure' block", + basePayload: gpii.tests.lifecycleManager.buildLifecycleInstructions( + "org.gnome.desktop.a11y.magnifier", + gpii.tests.lifecycleManager.standardLifecycle, + { + "update": [ + "configure" + ] + } + ), + originalSettings: { "cross-hairs-clip": false, "cross-hairs-color": "red" }, + runningOnLogin: true, + appliedSettings: { "cross-hairs-clip": false, "cross-hairs-color": "green" }, + runningAfterLogin: undefined, + expectedLaunchHandlerCalls: 0 + }, { + name: "running on login - 'update' with reference to 'stop', 'configure' and 'start' blocks", + basePayload: gpii.tests.lifecycleManager.buildLifecycleInstructions( + "org.gnome.desktop.a11y.magnifier", + gpii.tests.lifecycleManager.standardLifecycle, + { + "update": [ + "stop", + "configure", + "start" + ] + } + ), + originalSettings: { "cross-hairs-clip": false, "cross-hairs-color": "red" }, + runningOnLogin: true, + appliedSettings: { "cross-hairs-clip": false, "cross-hairs-color": "green" }, + runningAfterLogin: true, + expectedLaunchHandlerCalls: 4 // we run start/stop cycle both on login and logout + }, { + name: "running on login - with active: false", + basePayload: gpii.tests.lifecycleManager.buildLifecycleInstructions( + "org.gnome.desktop.a11y.magnifier", + gpii.tests.lifecycleManager.standardLifecycle, + { + "active": false + } + ), + originalSettings: { "cross-hairs-clip": false, "cross-hairs-color": "red" }, + runningOnLogin: true, + appliedSettings: { "cross-hairs-clip": false, "cross-hairs-color": "green" }, + runningAfterLogin: false, + expectedLaunchHandlerCalls: 2 + }, { + name: "running on login - with active: undefined", + basePayload: gpii.tests.lifecycleManager.buildLifecycleInstructions( + "org.gnome.desktop.a11y.magnifier", + { + "active": undefined, "configure": [ "settings.myconf" ], "restore": [ "settings.myconf" ], - "settingsHandlers": { - "myconf": { - "options": {}, - "settings": { - "cross-hairs-clip": false, - "cross-hairs-color": "red", - "undefSetting": undefined - }, - "type": "gpii.tests.lifecycleManager.mockSettingsHandler" - } - }, "start": [ - { - "args": [ - "-settingsDirectory", - "${{environment}.WINDIR}" - ], - "command": "${{environment}.JAWS_DIR}jaws.exe", - "name": "exec", - "type": "gpii.tests.lifecycleManager.mockExecHandler" - } + "launchers.launcher" ], "stop": [ - { - "pid": "${{exec}.pid}", - "type": "gpii.tests.lifecycleManager.mockKillHandler" - } + "launchers.launcher" + ], + "isRunning": [ + "launchers.launcher" ], "update": [ - "settings.myconf" + "stop", + "configure", + "start" ] } + ), + originalSettings: { "cross-hairs-clip": false, "cross-hairs-color": "red" }, + runningOnLogin: true, + appliedSettings: { "cross-hairs-clip": false, "cross-hairs-color": "green" }, + runningAfterLogin: true, + expectedLaunchHandlerCalls: 4 // we run start/stop cycle both on login and logout + }]; + + + gpii.tests.lifecycleManager.updateTestDefs = [{ + name: "Updating with the same prefs and values as already applied", + basePayload: gpii.tests.lifecycleManager.buildLifecycleInstructions( + "org.gnome.desktop.a11y.magnifier", + gpii.tests.lifecycleManager.standardLifecycle, + { "update": [ "settings.myconf" ] } + ), + originalSettings: { "cross-hairs-clip": false, "cross-hairs-color": "red" }, + runningOnLogin: false, + loginSettings: { "cross-hairs-clip": true, "cross-hairs-color": "red" }, + runningAfterLogin: true, + updateSettings: { "cross-hairs-clip": true, "cross-hairs-color": "red" }, + runningAfterUpdate: true, + expectedSettings: { "cross-hairs-clip": true, "cross-hairs-color": "red" }, + expectedLaunchHandlerCalls: 2 + }, { + name: "single pref changed without 'update' directive in solution registry entry", + basePayload: gpii.tests.lifecycleManager.buildLifecycleInstructions( + "org.gnome.desktop.a11y.magnifier", + gpii.tests.lifecycleManager.standardLifecycle + ), + originalSettings: { "cross-hairs-clip": false, "cross-hairs-color": "red" }, + runningOnLogin: false, + loginSettings: { "cross-hairs-clip": true, "cross-hairs-color": "red" }, + runningAfterLogin: true, + updateSettings: { "cross-hairs-clip": false, "cross-hairs-color": "green" }, // don't expect these to apply + runningAfterUpdate: true, + expectedSettings: { "cross-hairs-clip": true, "cross-hairs-color": "red" }, + expectedLaunchHandlerCalls: 2 + }, { + name: "Updating with normal reference to settingsHandler block, single settings", + basePayload: gpii.tests.lifecycleManager.buildLifecycleInstructions( + "org.gnome.desktop.a11y.magnifier", + gpii.tests.lifecycleManager.standardLifecycle, + { "update": [ "settings.myconf" ] } + ), + originalSettings: { "cross-hairs-clip": false, "cross-hairs-color": "red" }, + runningOnLogin: false, + loginSettings: { "cross-hairs-clip": true, "cross-hairs-color": "red" }, + runningAfterLogin: true, + updateSettings: { "cross-hairs-color": "green" }, + runningAfterUpdate: true, + expectedSettings: { "cross-hairs-clip": true, "cross-hairs-color": "green" }, + expectedLaunchHandlerCalls: 2 + }, { + name: "Updating with normal reference to settingsHandler block, multiple settings", + basePayload: gpii.tests.lifecycleManager.buildLifecycleInstructions( + "org.gnome.desktop.a11y.magnifier", + gpii.tests.lifecycleManager.standardLifecycle, + { "update": [ "settings.myconf" ] } + ), + originalSettings: { "cross-hairs-clip": false, "cross-hairs-color": "red" }, + runningOnLogin: false, + loginSettings: { "cross-hairs-clip": true, "cross-hairs-color": "red" }, + runningAfterLogin: true, + updateSettings: { "cross-hairs-clip": false, "cross-hairs-color": "green" }, + runningAfterUpdate: true, + expectedSettings: { "cross-hairs-clip": false, "cross-hairs-color": "green" }, + expectedLaunchHandlerCalls: 2 + }, { + name: "Updating with reference to 'configure' directive, single settings", + basePayload: gpii.tests.lifecycleManager.buildLifecycleInstructions( + "org.gnome.desktop.a11y.magnifier", + gpii.tests.lifecycleManager.standardLifecycle, + { "update": [ "configure" ] } + ), + originalSettings: { "cross-hairs-clip": false, "cross-hairs-color": "red" }, + runningOnLogin: false, + loginSettings: { "cross-hairs-clip": true, "cross-hairs-color": "red" }, + runningAfterLogin: true, + updateSettings: { "cross-hairs-color": "green" }, + runningAfterUpdate: true, + expectedSettings: { "cross-hairs-clip": true, "cross-hairs-color": "green" }, + expectedLaunchHandlerCalls: 2 + }, { + name: "Updating with normal reference to settingsHandler block, and a setting not in the original settings applied to the system", + basePayload: gpii.tests.lifecycleManager.buildLifecycleInstructions( + "org.gnome.desktop.a11y.magnifier", + gpii.tests.lifecycleManager.standardLifecycle, + { "update": [ "settings.myconf" ] } + ), + originalSettings: { "cross-hairs-clip": false, "cross-hairs-color": "red" }, + runningOnLogin: false, + loginSettings: { "cross-hairs-clip": true, "cross-hairs-color": "red" }, + runningAfterLogin: true, + updateSettings: { "cross-hairs-color": "green", "iamasetting": 100 }, + runningAfterUpdate: true, + expectedSettings: { "cross-hairs-clip": true, "cross-hairs-color": "green", "iamasetting": 100 }, + originalSettingsAfterUpdate: { "cross-hairs-clip": false, "cross-hairs-color": "red", "iamasetting": undefined }, + expectedLaunchHandlerCalls: 2 + }, { + name: "Updating with no 'update' block in solutions registry entry and 'live' liveness", + basePayload: gpii.tests.lifecycleManager.buildLifecycleInstructions( + "org.gnome.desktop.a11y.magnifier", + gpii.tests.lifecycleManager.standardLifecycle + ), + payloadExtras: { + settingsHandlers: { + myconf: { + liveness: "live" + } + } + }, + originalSettings: { "cross-hairs-clip": false, "cross-hairs-color": "red" }, + runningOnLogin: false, + loginSettings: { "cross-hairs-clip": true, "cross-hairs-color": "red" }, + runningAfterLogin: true, + updateSettings: { "cross-hairs-clip": true, "cross-hairs-color": "green" }, + runningAfterUpdate: true, + expectedSettings: { "cross-hairs-clip": true, "cross-hairs-color": "green" }, + expectedLaunchHandlerCalls: 2 + }, { + name: "Updating with no 'update' block in solutions registry entry and no liveness", + basePayload: gpii.tests.lifecycleManager.buildLifecycleInstructions( + "org.gnome.desktop.a11y.magnifier", + gpii.tests.lifecycleManager.standardLifecycle + ), + originalSettings: { "cross-hairs-clip": false, "cross-hairs-color": "red" }, + runningOnLogin: false, + loginSettings: { "cross-hairs-clip": true, "cross-hairs-color": "red" }, + runningAfterLogin: true, + updateSettings: { "cross-hairs-clip": true, "cross-hairs-color": "green" }, + runningAfterUpdate: true, + expectedSettings: { "cross-hairs-clip": true, "cross-hairs-color": "red" }, + expectedLaunchHandlerCalls: 2 + }, { + name: "Updating with no 'update' block in solutions registry entry and 'liveRestart' liveness", + basePayload: gpii.tests.lifecycleManager.buildLifecycleInstructions( + "org.gnome.desktop.a11y.magnifier", + gpii.tests.lifecycleManager.standardLifecycle + ), + payloadExtras: { + settingsHandlers: { + myconf: { + liveness: "liveRestart" + } + } + }, + originalSettings: { "cross-hairs-clip": false, "cross-hairs-color": "red" }, + runningOnLogin: false, + loginSettings: { "cross-hairs-clip": true, "cross-hairs-color": "red" }, + runningAfterLogin: true, + updateSettings: { "cross-hairs-clip": true, "cross-hairs-color": "green" }, + runningAfterUpdate: true, + expectedSettings: { "cross-hairs-clip": true, "cross-hairs-color": "green" }, + expectedLaunchHandlerCalls: 4 + }, { + name: "Updating with no 'update' block in solutions registry entry and 'manualRestart' liveness", + basePayload: gpii.tests.lifecycleManager.buildLifecycleInstructions( + "org.gnome.desktop.a11y.magnifier", + gpii.tests.lifecycleManager.standardLifecycle + ), + payloadExtras: { + settingsHandlers: { + myconf: { + liveness: "manualRestart" + } + } + }, + originalSettings: { "cross-hairs-clip": false, "cross-hairs-color": "red" }, + runningOnLogin: false, + loginSettings: { "cross-hairs-clip": true, "cross-hairs-color": "red" }, + runningAfterLogin: true, + updateSettings: { "cross-hairs-clip": true, "cross-hairs-color": "green" }, + runningAfterUpdate: true, + expectedSettings: { "cross-hairs-clip": true, "cross-hairs-color": "green" }, + expectedLaunchHandlerCalls: 4 + }, { + name: "Updating with no 'update' block in solutions registry entry and 'OSRestart' liveness", + basePayload: gpii.tests.lifecycleManager.buildLifecycleInstructions( + "org.gnome.desktop.a11y.magnifier", + gpii.tests.lifecycleManager.standardLifecycle + ), + payloadExtras: { + settingsHandlers: { + myconf: { + liveness: "OSRestart" + } + } + }, + originalSettings: { "cross-hairs-clip": false, "cross-hairs-color": "red" }, + runningOnLogin: false, + loginSettings: { "cross-hairs-clip": true, "cross-hairs-color": "red" }, + runningAfterLogin: true, + updateSettings: { "cross-hairs-clip": true, "cross-hairs-color": "green" }, + runningAfterUpdate: true, + expectedSettings: { "cross-hairs-clip": true, "cross-hairs-color": "green" }, + expectedLaunchHandlerCalls: 4 + }]; + + gpii.tests.lifecycleManager.completeLifecycleTests = [{ + name: "Updating with normal reference to settingsHandler block, and an application not in the original settings applied to the system", + expect: 9, + expectedLaunchHandlerCalls: 2, + runningOnLogin: false, + originalSettings: { + "org.gnome.desktop.a11y.magnifier": [{ options: {}, settings: { "cross-hairs-clip": false, "cross-hairs-color": "red" }}] + }, + loginPayload: gpii.tests.lifecycleManager.buildLifecycleInstructions( + "org.gnome.desktop.a11y.magnifier", + gpii.tests.lifecycleManager.standardLifecycle, + { "update": [ "configure" ] }, + gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-clip": true, "cross-hairs-color": "red" })), + expectedOriginal: gpii.tests.lifecycleManager.buildLifecycleInstructions( + "org.gnome.desktop.a11y.magnifier", + gpii.tests.lifecycleManager.standardLifecycle, + { "update": [ "configure" ] }, + gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-clip": false, "cross-hairs-color": "red" }, false)), + expectedAfterLogin: gpii.tests.lifecycleManager.buildLifecycleInstructions( + "org.gnome.desktop.a11y.magnifier", + gpii.tests.lifecycleManager.standardLifecycle, + { "update": [ "configure" ] }, + gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-clip": true, "cross-hairs-color": "red" }, true)), + runningAfterLogin: true, + updatePayload: gpii.tests.lifecycleManager.buildLifecycleInstructions("other.application", + gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "mysetting": "Hallow World" }), + gpii.tests.lifecycleManager.standardLifecycle, + { "update": [ "configure" ] }), + expectedAfterUpdate: fluid.extend(true, {}, + gpii.tests.lifecycleManager.buildLifecycleInstructions("org.gnome.desktop.a11y.magnifier", + gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-clip": true, "cross-hairs-color": "red" }, true), + gpii.tests.lifecycleManager.standardLifecycle, + { "update": [ "configure" ] }), + gpii.tests.lifecycleManager.buildLifecycleInstructions("other.application", + gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "mysetting": "Hallow World" }), + gpii.tests.lifecycleManager.standardLifecycle, + { "update": [ "configure" ] })), + expectedOriginalSettingsAfterUpdate: gpii.tests.lifecycleManager.buildLifecycleInstructions("org.gnome.desktop.a11y.magnifier", + gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-clip": false, "cross-hairs-color": "red" }, false), + gpii.tests.lifecycleManager.standardLifecycle, + { "update": [ "configure" ] }), + originalSettingsAfterUpdate: { + "other.application": [{ + "options": {}, + "settings": { + "mysetting": undefined + } + }] + }, + runningAfterUpdate: true + }, { + name: "Updating with normal reference to settingsHandler block, and 'undefined' value stored in snapshot", + expect: 9, + expectedLaunchHandlerCalls: 2, + runningOnLogin: false, + originalSettings: { + "org.gnome.desktop.a11y.magnifier": [{ options: {}, settings: { "cross-hairs-clip": false, "cross-hairs-color": "red" }}] + }, + loginPayload: gpii.tests.lifecycleManager.buildLifecycleInstructions( + "org.gnome.desktop.a11y.magnifier", + gpii.tests.lifecycleManager.standardLifecycle, + { "update": [ "configure" ] }, + gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-clip": true })), + expectedOriginal: gpii.tests.lifecycleManager.buildLifecycleInstructions( + "org.gnome.desktop.a11y.magnifier", + gpii.tests.lifecycleManager.standardLifecycle, + { "update": [ "configure" ] }, + gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-clip": false }, false)), + expectedAfterLogin: gpii.tests.lifecycleManager.buildLifecycleInstructions( + "org.gnome.desktop.a11y.magnifier", + gpii.tests.lifecycleManager.standardLifecycle, + { "update": [ "configure" ] }, + gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-clip": true }, true)), + runningAfterLogin: true, + updatePayload: gpii.tests.lifecycleManager.buildLifecycleInstructions( + "org.gnome.desktop.a11y.magnifier", + gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "undefSetting": "some other value" }), + gpii.tests.lifecycleManager.standardLifecycle, + { "update": [ "configure" ] }), + expectedAfterUpdate: gpii.tests.lifecycleManager.buildLifecycleInstructions( + "org.gnome.desktop.a11y.magnifier", + gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-clip": true, "undefSetting": "some other value" }, true), + gpii.tests.lifecycleManager.standardLifecycle, + { "update": [ "configure" ] }), + expectedOriginalSettingsAfterUpdate: gpii.tests.lifecycleManager.buildLifecycleInstructions("org.gnome.desktop.a11y.magnifier", + gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-clip": false, "undefSetting": undefined }, false), + gpii.tests.lifecycleManager.standardLifecycle, + { "update": [ "configure" ] }), + originalSettingsAfterUpdate: gpii.tests.lifecycleManager.createSettingsHandlerPayload("org.gnome.desktop.a11y.magnifier", { "cross-hairs-clip": false, "undefSetting": undefined }), + runningAfterUpdate: true + }]; + + gpii.tests.lifecycleManager.checkFinalSettingsPayload = function (msg, expSettings, store) { + var expectedLastSettings; + if (expSettings === undefined) { + expectedLastSettings = expSettings; + } else { + // change to the format that is stoed by the mock settingshandler: + expectedLastSettings = { + "org.gnome.desktop.a11y.magnifier": [ + { + "options": {}, + "settings": expSettings + } + ] + }; } - }]); + jqUnit.assertDeepEq(msg, expectedLastSettings, store); + }; - gpii.tests.lifecycleManager.buildSequentialUpdateTests = function () { - jqUnit.module("Sequential update tests"); - fluid.each(gpii.tests.lifecycleManager.updateTestDefs, function (test) { - jqUnit.asyncTest("gpii.lifecycleManager.update() with active user session: " + test.name, function () { - gpii.tests.lifecycleManager.setup(); - jqUnit.expect(5); - - var lifecycleManager = gpii.lifecycleManager(gpii.tests.lifecycleManager.testOptions); - gpii.tests.lifecycleManager.initBackingMock(); - - lifecycleManager.start(test.startPayload).then(function () { - var updatePayload = fluid.extend(true, {}, test.startPayload, { - activeConfiguration: { - lifecycleInstructions: test.updateSpec - } + /** + * expects an input with the following: + * name: name of the test + * expect: number of tests to expect + * expectedLaunchHandlerCalls: number of luanch handler calls to expect (incl. logout) + * originalSettings: the original settings to apply to the system (ie. before login) + * runningOnLogin: boolean - if the magnifier should be running before login + * loginPayload: payload to send to the start() function + * expectedOriginal: the expected "originalSettings" of the session after login + * expectedAfterLogin: the expected "appliedSolutions" of the session after login + * runningAfterLogin: boolean - if the magnifier should be running after login + * --- The below keys are optional and will trigger an update cycle if present. --- + * updatePayload: payload to send to the update() function + * expectedAfterUpdate: the expected "appliedSOlutions" of the session after update call + * expectedOriginalSettingsAfterUpdate: the original after a call to update() has been done, + * originalSettingsAfterUpdate: the settings that the system should reset to (ie. last call to settingsHandler) + * runningAfterUpdate: boolean - if the magnifier should be running after update + */ + gpii.tests.lifecycleManager.runSequentialLifecycleTest = function (testDef) { + var originalRunSetting = testDef.expectedLaunchHandlerCalls === 0 ? undefined : testDef.runningOnLogin; + jqUnit.asyncTest("Sequential " + testDef.name, function () { + gpii.tests.lifecycleManager.setup(); + jqUnit.expect(testDef.expect); + var lifecycleManager = gpii.lifecycleManager(gpii.tests.lifecycleManager.testOptions); + gpii.tests.lifecycleManager.initBackingMock(testDef.originalSettings, testDef.runningOnLogin); + + lifecycleManager.start(gpii.tests.lifecycleManager.buildStartPayload(testDef.loginPayload)).then(function (success) { + jqUnit.assertTrue("gpii.lifecycleManager.start() succeeds", success); + var session = lifecycleManager.getSession(123); // always just use the default user token + jqUnit.assertDeepEq("Checking appliedSolutions after start", testDef.expectedAfterLogin, session.model.appliedSolutions); + + var originalSettings = session.model.originalSettings; + jqUnit.assertDeepEq("Checking originalSettings after start", gpii.lifecycleManager.transformAllSolutionSettings(testDef.expectedOriginal, gpii.settingsHandlers.settingsToChanges), originalSettings); + + var stopCycle = function () { + lifecycleManager.stop(gpii.tests.lifecycleManager.userOptions).then(function () { + jqUnit.assertDeepEq("Session not running after stop", lifecycleManager.getSession(123)); + jqUnit.assertEquals("Number of calls to launch handler", testDef.expectedLaunchHandlerCalls, gpii.tests.lifecycleManager.staticRepository.launchHandlerCalls); + // Check that last calls to launch and settings handlers were actually the ones resetting to expected state + jqUnit.assertDeepEq("checking last payload sent to settingshandler:", testDef.originalSettingsAfterUpdate || testDef.originalSettings, gpii.tests.lifecycleManager.staticRepository.settingsHandler); + + // Check that last calls to launch and settings handlers were actually the ones resetting to expected state + gpii.tests.lifecycleManager.checkFinalSettingsPayload("checking last set launch settings", (originalRunSetting === undefined) ? undefined : { running: originalRunSetting }, gpii.tests.lifecycleManager.staticRepository.launchHandler); + jqUnit.start(); }); - gpii.tests.lifecycleManager.assertExpectedExec(); - var expectedFirstAppliedSettings = (test.expectedFirstAppliedSettings !== undefined) ? test.expectedFirstAppliedSettings : gpii.tests.lifecycleManager.settingsHandlerExpectedInputNewSettings; - gpii.tests.lifecycleManager.assertExpectedSettingsHandler(" - on start", expectedFirstAppliedSettings); - - lifecycleManager.update(updatePayload).then(function () { - var session = lifecycleManager.getSession(test.startPayload.userToken); - var appliedSolutions = session.model.appliedSolutions; - var originalSettings = session.model.originalSettings; - jqUnit.assertDeepEq("Checking appliedSolutions after update", test.expectedAppliedSolutions, appliedSolutions); - var expected = gpii.lifecycleManager.transformAllSolutionSettings(test.expectedOriginalSettings, gpii.settingsHandlers.settingsToChanges); + }; + if (testDef.updatePayload) { + lifecycleManager.update(gpii.tests.lifecycleManager.buildStartPayload(testDef.updatePayload)).then(function () { + jqUnit.assertDeepEq("Checking appliedSolutions after update", testDef.expectedAfterUpdate, session.model.appliedSolutions); + var expected = gpii.lifecycleManager.transformAllSolutionSettings(testDef.expectedOriginalSettingsAfterUpdate, gpii.settingsHandlers.settingsToChanges); jqUnit.assertDeepEq("Checking originalSettings after update", expected, originalSettings); - lifecycleManager.stop(gpii.tests.lifecycleManager.userOptions).then(function () { - jqUnit.assertDeepEq("Session not running after stop", lifecycleManager.getSession(test.startPayload.userToken)); - jqUnit.start(); - }); + }); - }); + stopCycle(); + } else { + stopCycle(); + } }); }); }; - gpii.tests.lifecycleManager.buildAsyncUpdateTests = function () { - jqUnit.module("Asynchronous update tests"); - fluid.each(gpii.tests.lifecycleManager.updateTestDefs, function (test) { - jqUnit.asyncTest("gpii.lifecycleManager.update() with active user session: " + test.name, function () { - gpii.tests.lifecycleManager.setup(); - jqUnit.expect(5); - - var lifecycleManager = gpii.lifecycleManager(gpii.tests.lifecycleManager.testOptions); - gpii.tests.lifecycleManager.initBackingMock(); + /** + * expects an input with the following: + * name: name of the test + * expect: number of tests to expect + * expectedLaunchHandlerCalls: number of luanch handler calls to expect (incl. logout) + * originalSettings: the original settings to apply to the system (ie. before login) + * runningOnLogin: boolean - if the magnifier should be running before login + * loginPayload: payload to send to the start() function + * expectedOriginal: the expected "originalSettings" of the session after login + * expectedAfterLogin: the expected "appliedSolutions" of the session after login + * runningAfterLogin: boolean - if the magnifier should be running after login + * --- The below keys are optional and will trigger an update cycle if present. --- + * updatePayload: payload to send to the update() function + * expectedAfterUpdate: the expected "appliedSOlutions" of the session after update call + * expectedOriginalSettingsAfterUpdate: the original after a call to update() has been done, + * originalSettingsAfterUpdate: the settings that the system should reset to (ie. last call to settingsHandler) + * runningAfterUpdate: boolean - if the magnifier should be running after update + */ + gpii.tests.lifecycleManager.runAsyncLifecycleTest = function (testDef) { + var originalRunSetting = testDef.expectedLaunchHandlerCalls === 0 ? undefined : testDef.runningOnLogin; + jqUnit.asyncTest("Async " + testDef.name, function () { + gpii.tests.lifecycleManager.setup(); + jqUnit.expect(testDef.expect); + var lifecycleManager = gpii.lifecycleManager(gpii.tests.lifecycleManager.testOptions); + gpii.tests.lifecycleManager.initBackingMock(testDef.originalSettings, testDef.runningOnLogin); + var session, + originalSettings; + + lifecycleManager.start(gpii.tests.lifecycleManager.buildStartPayload(testDef.loginPayload)).then(function (success) { + session = lifecycleManager.getSession(123); // always just use the default user token + jqUnit.assertTrue("gpii.lifecycleManager.start() succeeds", success); + jqUnit.assertDeepEq("Checking appliedSolutions after start", testDef.expectedAfterLogin, session.model.appliedSolutions); + originalSettings = session.model.originalSettings; + jqUnit.assertDeepEq("Checking originalSettings after start", gpii.lifecycleManager.transformAllSolutionSettings(testDef.expectedOriginal, gpii.settingsHandlers.settingsToChanges), originalSettings); + }); - var updatePayload = fluid.extend(true, {}, test.startPayload, { - activeConfiguration: { - lifecycleInstructions: test.updateSpec - } - }); + if (testDef.updatePayload) { + lifecycleManager.update(gpii.tests.lifecycleManager.buildStartPayload(testDef.updatePayload)).then(function () { + jqUnit.assertDeepEq("Checking appliedSolutions after update", testDef.expectedAfterUpdate, session.model.appliedSolutions); + var expected = gpii.lifecycleManager.transformAllSolutionSettings(testDef.expectedOriginalSettingsAfterUpdate, gpii.settingsHandlers.settingsToChanges); + jqUnit.assertDeepEq("Checking originalSettings after update", expected, originalSettings); - lifecycleManager.start(test.startPayload).then(function () { - gpii.tests.lifecycleManager.assertExpectedExec(); - var expectedFirstAppliedSettings = (test.expectedFirstAppliedSettings !== undefined) ? test.expectedFirstAppliedSettings : gpii.tests.lifecycleManager.settingsHandlerExpectedInputNewSettings; - gpii.tests.lifecycleManager.assertExpectedSettingsHandler(" - on start", expectedFirstAppliedSettings); }); + } - lifecycleManager.update(updatePayload).then(function () { - var session = lifecycleManager.getSession(test.startPayload.userToken); - var appliedSolutions = session.model.appliedSolutions; - var originalSettings = session.model.originalSettings; - jqUnit.assertDeepEq("Checking appliedSolutions after update", test.expectedAppliedSolutions, appliedSolutions); - var expected = gpii.lifecycleManager.transformAllSolutionSettings(test.expectedOriginalSettings, gpii.settingsHandlers.settingsToChanges); - jqUnit.assertDeepEq("Checking originalSettings after update", expected, originalSettings); - }); + lifecycleManager.stop(gpii.tests.lifecycleManager.userOptions).then(function () { + jqUnit.assertDeepEq("Session not running after stop", lifecycleManager.getSession(123)); + jqUnit.assertEquals("Number of calls to launch handler", testDef.expectedLaunchHandlerCalls, gpii.tests.lifecycleManager.staticRepository.launchHandlerCalls); + // Check that last calls to launch and settings handlers were actually the ones resetting to expected state + jqUnit.assertDeepEq("checking last payload sent to settingshandler:", testDef.originalSettingsAfterUpdate || testDef.originalSettings, gpii.tests.lifecycleManager.staticRepository.settingsHandler); - lifecycleManager.stop(gpii.tests.lifecycleManager.userOptions).then(function () { - jqUnit.assertDeepEq("Session not running after stop", lifecycleManager.getSession(test.startPayload.userToken)); - jqUnit.start(); - }); + // Check that last calls to launch and settings handlers were actually the ones resetting to expected state + gpii.tests.lifecycleManager.checkFinalSettingsPayload("checking last set launch settings", (originalRunSetting === undefined) ? undefined : { running: originalRunSetting }, gpii.tests.lifecycleManager.staticRepository.launchHandler); + jqUnit.start(); }); }); }; + gpii.tests.lifecycleManager.buildUpdateTests = function () { + fluid.each(gpii.tests.lifecycleManager.updateTestDefs, function (test) { + var expectedOriginal = gpii.tests.lifecycleManager.extendLifecycleInstructions(test.basePayload, + gpii.tests.lifecycleManager.buildSettingsHandlersEntry(test.originalSettings, test.runningOnLogin), test.payloadExtras); + var loginPayload = gpii.tests.lifecycleManager.extendLifecycleInstructions(test.basePayload, + gpii.tests.lifecycleManager.buildSettingsHandlersEntry(test.loginSettings), test.payloadExtras); + var expectedAfterLogin = gpii.tests.lifecycleManager.extendLifecycleInstructions(test.basePayload, + gpii.tests.lifecycleManager.buildSettingsHandlersEntry(test.loginSettings, test.runningAfterLogin), test.payloadExtras); + var updatePayload = gpii.tests.lifecycleManager.extendLifecycleInstructions(test.basePayload, + gpii.tests.lifecycleManager.buildSettingsHandlersEntry(test.updateSettings), test.payloadExtras); + var expectedAfterUpdate = gpii.tests.lifecycleManager.extendLifecycleInstructions(test.basePayload, + gpii.tests.lifecycleManager.buildSettingsHandlersEntry(test.expectedSettings, test.runningAfterUpdate), test.payloadExtras); + + var originalSettingsAfterUpdate = test.originalSettingsAfterUpdate || test.originalSettings; + var expectedOriginalSettingsAfterUpdate = gpii.tests.lifecycleManager.extendLifecycleInstructions(test.basePayload, + gpii.tests.lifecycleManager.buildSettingsHandlersEntry(originalSettingsAfterUpdate, test.runningOnLogin), test.payloadExtras); + + var testDef = { + name: "gpii.lifecycleManager.update() with active user session: " + test.name, + expect: 9, + expectedLaunchHandlerCalls: test.expectedLaunchHandlerCalls, + originalSettings: gpii.tests.lifecycleManager.createSettingsHandlerPayload("org.gnome.desktop.a11y.magnifier", test.originalSettings), + runningOnLogin: test.runningOnLogin, + loginPayload: loginPayload, + expectedOriginal: expectedOriginal, + expectedAfterLogin: expectedAfterLogin, + runningAfterLogin: test.runningAfterLogin, + updatePayload: updatePayload, + expectedAfterUpdate: expectedAfterUpdate, + expectedOriginalSettingsAfterUpdate: expectedOriginalSettingsAfterUpdate, + runningAfterUpdate: test.runningAfterUpdate, + originalSettingsAfterUpdate: gpii.tests.lifecycleManager.createSettingsHandlerPayload("org.gnome.desktop.a11y.magnifier", originalSettingsAfterUpdate) + }; + + gpii.tests.lifecycleManager.runSequentialLifecycleTest(testDef); + gpii.tests.lifecycleManager.runAsyncLifecycleTest(testDef); + }); + }; + + gpii.tests.lifecycleManager.buildStartTests = function () { + fluid.each(gpii.tests.lifecycleManager.startTestDefs, function (test) { + var testDef = { + name: "gpii.lifecycleManager.start()/stop(): " + test.name, + expect: 7, + expectedLaunchHandlerCalls: test.expectedLaunchHandlerCalls, + runningOnLogin: test.runningOnLogin, + originalSettings: gpii.tests.lifecycleManager.createSettingsHandlerPayload("org.gnome.desktop.a11y.magnifier", test.originalSettings), + loginPayload: gpii.tests.lifecycleManager.extendLifecycleInstructions(test.basePayload, + gpii.tests.lifecycleManager.buildSettingsHandlersEntry(test.appliedSettings, undefined, test.removeLifecycleHandlerBlock)), + expectedAfterLogin: gpii.tests.lifecycleManager.extendLifecycleInstructions(test.basePayload, + gpii.tests.lifecycleManager.buildSettingsHandlersEntry(test.appliedSettings, test.runningAfterLogin, test.removeLifecycleHandlerBlock)), + runningAfterLogin: test.runningAfterLogin, + // only expect launch handler settings to be in the original snapshot if we've run a launchHandler call during login + expectedOriginal: gpii.tests.lifecycleManager.extendLifecycleInstructions(test.basePayload, + gpii.tests.lifecycleManager.buildSettingsHandlersEntry(test.originalSettings, test.expectedLaunchHandlerCalls === 0 ? undefined : test.runningOnLogin, test.removeLifecycleHandlerBlock)) + }; + + gpii.tests.lifecycleManager.runSequentialLifecycleTest(testDef); + gpii.tests.lifecycleManager.runAsyncLifecycleTest(testDef); + }); + }; + gpii.tests.lifecycleManager.settingsToChanges = function (expected) { return gpii.settingsHandlers.transformOneSolutionSettings(expected, gpii.settingsHandlers.settingsToChanges); }; @@ -738,23 +1178,9 @@ https://github.com/GPII/universal/blob/master/LICENSE.txt jqUnit.test("gpii.lifecycleManager.specToSettingsHandler()", function () { fluid.each(gpii.tests.lifecycleManager.specToSettingsHandlerTests, function (spec, name) { jqUnit.expect(1); - var response = gpii.lifecycleManager.specToSettingsHandler("fake.solution", spec.request, spec.isMultiSH); + var response = gpii.lifecycleManager.specToSettingsHandler("fake.solution", spec.request); jqUnit.assertDeepEq(name, { "fake.solution": spec.response }, response); }); - - // Test for fail if a multi settingshandler solution doesn't have a supportedSettings directive - var failingFunc = function () { - gpii.lifecycleManager.specToSettingsHandler("fake.solution", { - "type": "gpii.gsettings.set", - "options": {}, - "settings": { - "weirdSetting": "foo", - "otherSetting": "bar" - } - }, true); - }; - jqUnit.expectFrameworkDiagnostic("Expect failure if no supportedSettings for multiple SH solution", - failingFunc, "missing the 'supportedSettings' directive"); }); jqUnit.test("gpii.lifecycleManager.responseToSnapshot() no settings", function () { @@ -772,64 +1198,35 @@ https://github.com/GPII/universal/blob/master/LICENSE.txt jqUnit.assertDeepEq("responseToSnapshot returning the correct payload", expected, response); }); - jqUnit.asyncTest("gpii.lifecycleManager.invokeSettingsHandler()", function () { + jqUnit.asyncTest("gpii.lifecycleManager.invokeSettingsHandlerSet()", function () { jqUnit.expect(2); var lifecycleManager = gpii.lifecycleManager(); gpii.tests.lifecycleManager.initBackingMock(); - var snapshotPromise = lifecycleManager.invokeSettingsHandler("org.gnome.desktop.a11y.magnifier", gpii.tests.lifecycleManager.invokeSettingsHandlersRequest); + var snapshotPromise = lifecycleManager.invokeSettingsHandlerSet("org.gnome.desktop.a11y.magnifier", gpii.tests.lifecycleManager.invokeSettingsHandlersRequest); var expected = gpii.tests.lifecycleManager.settingsToChanges(gpii.tests.lifecycleManager.invokeSettingsHandlersExpectedSnapshot); snapshotPromise.then(function (snapshot) { jqUnit.assertDeepEq("invokeSettingsHandlers produced snapshot", expected, snapshot); - gpii.tests.lifecycleManager.assertExpectedSettingsHandler(" - standalone", gpii.tests.lifecycleManager.settingsHandlerExpectedInputNewSettings); + jqUnit.assertDeepEq("expected input sent to settingsHandler", gpii.tests.lifecycleManager.settingsHandlerExpectedInputNewSettings, gpii.tests.lifecycleManager.staticRepository.settingsHandler); jqUnit.start(); }); }); - jqUnit.asyncTest("gpii.lifecycleManager.start() and stop()", function () { - gpii.tests.lifecycleManager.setup(); - // 2 tests for the settingsHandler (see mockSettingsHandler function above) - // 2 tests for the launchHandler (see mockLaunchHandler function above) - // and the two asserts below - jqUnit.expect(5); - var lifecycleManager = gpii.lifecycleManager(gpii.tests.lifecycleManager.testOptions); + jqUnit.asyncTest("gpii.lifecycleManager.invokeSettingsHandlerGet()", function () { + jqUnit.expect(1); + var lifecycleManager = gpii.lifecycleManager(); gpii.tests.lifecycleManager.initBackingMock(); - - var promise = lifecycleManager.start(gpii.tests.lifecycleManager.startPayload); - promise.then(function () { - gpii.tests.lifecycleManager.assertExpectedExec(); - gpii.tests.lifecycleManager.assertExpectedSettingsHandler(" - on start", gpii.tests.lifecycleManager.settingsHandlerExpectedInputNewSettings); - var stopPromise = lifecycleManager.stop(gpii.tests.lifecycleManager.userOptions); - stopPromise.then(function () { - gpii.tests.lifecycleManager.assertExpectedSettingsHandler(" - on stop", gpii.tests.lifecycleManager.settingsHandlerExpectedInputRestoreSettings); - jqUnit.assertEquals("Expected pid has been sent to kill handler", - 8839, gpii.tests.lifecycleManager.staticRepository.killHandler.pid); - gpii.tests.lifecycleManager.assertNoActiveSessions(lifecycleManager, "stop: Stop message to lifecycle manager"); - jqUnit.start(); - }); - }); - }); - - // tests for active: false and active: undefined. - // active: true is tested in all the other tests - var activeValues = [ false, undefined ]; - fluid.each(activeValues, function (active) { - jqUnit.asyncTest("gpii.lifecycleManager.start() with active: " + (active === undefined ? "undefined" : active), function () { - //reset the exec values - gpii.tests.lifecycleManager.setup(); - - jqUnit.expect(2); - var lifecycleManager = gpii.lifecycleManager(gpii.tests.lifecycleManager.testOptions); - gpii.tests.lifecycleManager.initBackingMock(); - - // set up payload with active false - var activeFalsePayload = fluid.copy(gpii.tests.lifecycleManager.startPayload); - fluid.set(activeFalsePayload, [ "activeConfiguration", "lifecycleInstructions", "org.gnome.desktop.a11y.magnifier", "active" ], active); - - lifecycleManager.start(activeFalsePayload).then(function () { - gpii.tests.lifecycleManager.assertExpectedSettingsHandler(" - on start", gpii.tests.lifecycleManager.settingsHandlerExpectedInputNewSettings); - gpii.tests.lifecycleManager.assertNoExec(); - jqUnit.start(); - }); + var snapshotPromise = lifecycleManager.invokeSettingsHandlerGet("org.gnome.desktop.a11y.magnifier", gpii.tests.lifecycleManager.invokeSettingsHandlersRequest); + var expected = { + "org.gnome.desktop.a11y.magnifier": [{ + "settings": { + "cross-hairs-clip": false, + "cross-hairs-color": "red" + } + }] + }; + snapshotPromise.then(function (snapshot) { + jqUnit.assertDeepEq("invokeSettingsHandlerGet produced snapshot", expected, snapshot); + jqUnit.start(); }); }); @@ -842,76 +1239,11 @@ https://github.com/GPII/universal/blob/master/LICENSE.txt }); }); - gpii.tests.lifecycleManager.buildSequentialUpdateTests(); - gpii.tests.lifecycleManager.buildAsyncUpdateTests(); - - - jqUnit.asyncTest("gpii.lifecycleManager.update() tests for 'stop' reference", function () { - // initial payload: - var startPayload = fluid.extend(true, {}, gpii.tests.lifecycleManager.userOptions, { - activeConfiguration: { - lifecycleInstructions: gpii.tests.lifecycleManager.buildLifecycleInstructions("org.gnome.desktop.a11y.magnifier", - gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-clip": true, "cross-hairs-color": "red" }), - gpii.tests.lifecycleManager.noUpdateLifecycle, - { "update": [ "stop" ] }) - } - }); - - gpii.tests.lifecycleManager.setup(); - jqUnit.expect(3); - - var lifecycleManager = gpii.lifecycleManager(gpii.tests.lifecycleManager.testOptions); - gpii.tests.lifecycleManager.initBackingMock(); - - lifecycleManager.start(startPayload).then(function () { - // check that things have 'started' - gpii.tests.lifecycleManager.assertExpectedExec(); - - lifecycleManager.update(startPayload).then(function () { - // check that things have 'stopped' - jqUnit.assertEquals("Expected pid has been sent to kill handler", - 8839, gpii.tests.lifecycleManager.staticRepository.killHandler.pid); - lifecycleManager.stop(gpii.tests.lifecycleManager.userOptions).then(function () { - gpii.tests.lifecycleManager.assertNoActiveSessions(lifecycleManager, "no active sessions running after stop"); - jqUnit.start(); - }); - }); - }); - }); - - jqUnit.asyncTest("gpii.lifecycleManager.update() tests for 'stop' and 'start' reference", function () { - // initial payload: - var startPayload = fluid.extend(true, {}, gpii.tests.lifecycleManager.userOptions, { - activeConfiguration: { - lifecycleInstructions: gpii.tests.lifecycleManager.buildLifecycleInstructions("org.gnome.desktop.a11y.magnifier", - gpii.tests.lifecycleManager.buildSettingsHandlersEntry({ "cross-hairs-clip": true, "cross-hairs-color": "red" }), - gpii.tests.lifecycleManager.noUpdateLifecycle, - { "update": [ "stop", "start" ] }) - } - }); - - gpii.tests.lifecycleManager.setup(); - jqUnit.expect(4); - - var lifecycleManager = gpii.lifecycleManager(gpii.tests.lifecycleManager.testOptions); - gpii.tests.lifecycleManager.initBackingMock(); - - lifecycleManager.start(startPayload).then(function () { - // check that things have 'started' - gpii.tests.lifecycleManager.assertExpectedExec(); - - lifecycleManager.update(startPayload).then(function () { - // check that things have 'stopped' - jqUnit.assertEquals("Expected pid has been sent to kill handler", - 8839, gpii.tests.lifecycleManager.staticRepository.killHandler.pid); - gpii.tests.lifecycleManager.assertExpectedExec(); - - lifecycleManager.stop(gpii.tests.lifecycleManager.userOptions).then(function () { - gpii.tests.lifecycleManager.assertNoActiveSessions(lifecycleManager, "no active sessions running after stop"); - jqUnit.start(); - }); - }); - }); + gpii.tests.lifecycleManager.buildUpdateTests(); + gpii.tests.lifecycleManager.buildStartTests(); + fluid.each(gpii.tests.lifecycleManager.completeLifecycleTests, function (testDef) { + gpii.tests.lifecycleManager.runSequentialLifecycleTest(testDef); + gpii.tests.lifecycleManager.runAsyncLifecycleTest(testDef); }); }; })(); diff --git a/gpii/node_modules/matchMakerFramework/src/MatchMakerFramework.js b/gpii/node_modules/matchMakerFramework/src/MatchMakerFramework.js index 89b21a5df..26d122405 100644 --- a/gpii/node_modules/matchMakerFramework/src/MatchMakerFramework.js +++ b/gpii/node_modules/matchMakerFramework/src/MatchMakerFramework.js @@ -38,10 +38,6 @@ fluid.defaults("gpii.matchMakerFramework", { } }, invokers: { - preProcess: { - funcName: "gpii.matchMakerFramework.preProcess", - args: ["{that}", "{arguments}.0"] - }, // initialPayload matchMakerDispatcher: { funcName: "gpii.matchMakerFramework.matchMakerDispatcher", args: ["{that}", "{arguments}.0"] @@ -52,26 +48,6 @@ fluid.defaults("gpii.matchMakerFramework", { } }); -/* - * responsible for building the input payload to the matchmaker, via a bunch of helper functions - * initialPayload consists of: - * userToken, preferences, deviceContext, solutionsRegistryEntries - */ -gpii.matchMakerFramework.preProcess = function (that, initialPayload) { - var matchMakerInput = fluid.extend({ - activeContexts: [ // TODO calculate properly - "gpii-default" - ], - environmentReporter: {}, // TODO, - inferredCommonTerms: gpii.matchMakerFramework.utils.inferCommonTerms(initialPayload.preferences, initialPayload.fullSolutionsRegistry) - }, initialPayload); - // remove full solutions registry from the payload, now that we've used it - // to avoid sending a too large payload to the matchmaker (see GPII-1880) - delete matchMakerInput.fullSolutionsRegistry; - - return matchMakerInput; -}; - /** * Asynchronous function responsible for, given a matchMaker input payload, deciding which matchmaker is most * suitable to do the actual matching process and send the payload there. Once the matchmaker diff --git a/gpii/node_modules/matchMakerFramework/src/MatchMakerUtilities.js b/gpii/node_modules/matchMakerFramework/src/MatchMakerUtilities.js index f5a21b56e..2e911ce76 100644 --- a/gpii/node_modules/matchMakerFramework/src/MatchMakerUtilities.js +++ b/gpii/node_modules/matchMakerFramework/src/MatchMakerUtilities.js @@ -30,34 +30,59 @@ var fluid = fluid || require("infusion"), /** * APP_SETTING_PRIORITY: the priority that an application is given if the user has application * specific settings in their NP set for that application, but has no explicit priority for - * that application. - * MIN_USER_PRIORITY: If an explicit priority is set by the user for an application, this is + * that application. * MIN_USER_PRIORITY: If an explicit priority is set by the user for an application, this is * the minimum value it should have, to avoid conflicting with system generated priorities. */ gpii.matchMakerFramework.APP_SETTING_PRIORITY = 512; gpii.matchMakerFramework.MIN_USER_PRIORITY = 1024; + /* + * responsible for building the input payload to the matchmaker, via a bunch of helper functions + * + * @params initialPayload {Object}: The initial payload sent to the matchmaking framework. It should as a + * minimum contain: userToken, preferences, deviceContext, solutionsRegistryEntries + * The values from this object will become part of the new matchmaker input object returned from this function, + */ + gpii.matchMakerFramework.utils.preProcess = function (initialPayload) { + var matchMakerInput = fluid.extend({ + activeContexts: [], // set later in the process + environmentReporter: {}, // for holding any environment information + inferredCommonTerms: gpii.matchMakerFramework.utils.inferCommonTerms(initialPayload.preferences, initialPayload.fullSolutionsRegistry), + specialPreferences: gpii.matchMakerFramework.utils.findSpecialPreferences(initialPayload.preferences) + }, fluid.copy(initialPayload)); + gpii.matchMakerFramework.utils.addCapabilitiesInformation(matchMakerInput); + // remove full solutions registry from the payload, now that we've used it + // to avoid sending a too large payload to the matchmaker (see GPII-1880) + delete matchMakerInput.fullSolutionsRegistry; + + return matchMakerInput; + }; /** * extracts the capabilities from a settingshandler block based on the `capabilities` entry * and the inputPaths of the capabilitiesTransformations block */ gpii.matchMakerFramework.utils.extractCapabilities = function (settingsHandler) { - var capabilities = fluid.model.transform.collectInputPaths(settingsHandler.capabilitiesTransformations || {}); - return capabilities.concat(fluid.makeArray(settingsHandler.capabilities)); + return fluid.model.transform.collectInputPaths(settingsHandler.capabilitiesTransformations || {}); }; /** - * Helper function for computeAndOntologizeCapabilitiesFromSettingsHandler. Grabs the capabilities (incl. those from the - * capabilities transformations) for a single settings handler. Returns them in the ontology - * provided via the transform spec - */ - gpii.matchMakerFramework.utils.computeAndOntologizeCapabilitiesFromSettingsHandler = function (settingsHandler, transformSpec) { - var inputPaths = gpii.matchMakerFramework.utils.extractCapabilities(settingsHandler); - + * Takes an array of paths as input and returns them in the ontology provided via the transform spec. + * The result will be an array list of el-paths in the ontology transformed to. + * + * @param paths {Array} An array of supported capabilities by a solution (as returned by the + * gpii.matchMakerFramework.utils.computeCapabilitiesFromSolution function) + * @param transformSpec {Object} transformation rules to transform the input paths from the solution + * registry format into the format desired in the output array. If if one would like the result + * as a list of ISO24751 el-paths and the solutionsregistry transformations are given in + * the flat format, a transformation rules for 'flat' to ISO24751 should be given + * @return {Array} An array of el-paths to all the input paths of the given capabilities in the + * ontology produced by the transformSpec + */ + gpii.matchMakerFramework.utils.transformCapabilitiesToOntologizedLeaves = function (paths, transformSpec) { // Input paths are flat so need to be transformed into hierarchical - var skel = gpii.matchMakerFramework.utils.pathsToSkeleton(inputPaths, true); + var skel = gpii.matchMakerFramework.utils.pathsToSkeleton(paths, true); var hskeleton = fluid.model.transformWithRules(skel, transformSpec); return gpii.matchMakerFramework.utils.computeLeaves(hskeleton); @@ -66,25 +91,21 @@ var fluid = fluid || require("infusion"), /** * Given a solution entry, all the capabilities of that solution will be calculated based on * input paths in the transformations (specified in the capabilitiesTransformations block) and - * on the list in the capabilities block of that solution. The collected capabilities will be - * transformed via the transformspec, and the result will be an array list of el-paths in the - * ontology transformed to. + * on the list in the capabilities block of that solution * * @param solution {Object} A single solution entry, as can be found in the solutions registry - * @param transformSpec {Object} transformation rules to transform the input paths from the solution - * registry format into the format desired in the output array. If if one would like the result - * as a list of ISO24751 el-paths and the solutionsregistry transformations are given in - * the flat format, a transformation rules for 'flat' to ISO24751 should be given - * @return {Array} An array of el-paths to all the input paths of the capabilitiesTransformations - * concatenated with the list given in the capabilities block of the solution entry. + * @return {Array} An array capabilities supported by the given solution */ - gpii.matchMakerFramework.utils.computeAndOntologizeCapabilitiesFromSolution = function (solution, transformSpec) { - var settingsHandlerBlocks = []; + gpii.matchMakerFramework.utils.computeCapabilitiesFromSolution = function (solution) { + var paths = []; fluid.each(solution.settingsHandlers, function (handlerBlock) { - var capabilities = gpii.matchMakerFramework.utils.computeAndOntologizeCapabilitiesFromSettingsHandler(handlerBlock, transformSpec); - settingsHandlerBlocks = settingsHandlerBlocks.concat(capabilities); + paths = paths.concat(gpii.matchMakerFramework.utils.extractCapabilities(handlerBlock)); }); - return settingsHandlerBlocks; + // grab the capabilities block from the solution if present: + if (solution.capabilities) { + paths = paths.concat(solution.capabilities); + } + return paths; }; /** @@ -140,9 +161,10 @@ var fluid = fluid || require("infusion"), }; /** - * Given a list of solutions, calculate the capabilities and generate a skeleton based on those. + * Given a list of solutions and capabilities, ontologize the capabilities and generate a skeleton based on those. * - * @param solutions {Object} list of solution entries in the same format as the solutions registry + * @param solutions {Object} list of solution entries in the same format as the solutions registry\ + * @param capabilities {Object} (array)listings of solution capabilities, keyed by solution ID * @param transformSpec {Object} transformation rules to translate from the format the input paths are * given in in the solutions entries' capabilitiesTransformations block, to the ontology * that the skeleton should be in @@ -151,13 +173,13 @@ var fluid = fluid || require("infusion"), * entry. 'skeleton' which contains the capabilities of the solution. 'index' which contains * the solution id. */ - gpii.matchMakerFramework.utils.expandSolutions = function (solutions, transformSpec) { + gpii.matchMakerFramework.utils.expandSolutions = function (solutions, capabilities, transformSpec) { return fluid.transform(solutions, function (solution, solutionId) { var solutionIdObj = {}; solutionIdObj["http://registry.gpii.net/applications/" + solutionId] = {}; var transformedId = fluid.model.transformWithRules(solutionIdObj, transformSpec); - var paths = gpii.matchMakerFramework.utils.computeAndOntologizeCapabilitiesFromSolution(solution, transformSpec); + var paths = gpii.matchMakerFramework.utils.transformCapabilitiesToOntologizedLeaves(capabilities[solutionId], transformSpec); var skeleton = fluid.extend(true, {}, gpii.matchMakerFramework.utils.pathsToSkeleton(paths), transformedId); return { @@ -168,6 +190,35 @@ var fluid = fluid || require("infusion"), }); }; + /** + * Based on the /enabled terms from a users' NP set and the /enabled capabilities from the solution, + * this function returns what the 'active' value of the solution should be. + * + * @param specialPreferences {Object} the specialPreferences value of the relevant context (from the value of the same name in the match maker input payload) + * @param specialCapabilities {Array} the solutions specialCapabilities (from the value of the same name in the match maker input payload) + * @param solution {Object} the solution registry entry of the solution for which to decide the 'active' value + * @param solutionId {String} the solution id + * @return {boolean} the value of the 'active' flag of the solution. + **/ + gpii.matchMakerFramework.utils.getActiveValueFromEnabledTerms = function (specialPreferences, specialCapabilities, solution, solutionId) { + var active; + + // see if solution has any enabled flags: + fluid.each(specialCapabilities, function (term) { + // if we have an /enabled term and this is not just a settings transformation: + if (term.endsWith("/enabled") && solution.capabilities && solution.capabilities.includes(term)) { + // set the active flag based on the users' preference value (from solution specific pref or general pref) + var applicationBlockKey = gpii.matchMakerFramework.utils.makeApplicationTerm(solutionId); + active = fluid.get(specialPreferences[applicationBlockKey], term, fluid.model.escapedGetConfig); + if (active === undefined) { + active = fluid.get(specialPreferences, term, fluid.model.escapedGetConfig); + } + } + }); + + return active; + }; + /** * Function that takes a MM payload set as input that *includes* an entry of * preferences in a hierarchical format, as well as a strategy for selecting solutions @@ -184,7 +235,7 @@ var fluid = fluid || require("infusion"), * to launch in that context */ gpii.matchMakerFramework.utils.disposeSolutions = function (data, strategy, transformSpec, ontologyMetadata) { - var solrecs = gpii.matchMakerFramework.utils.expandSolutions(data.solutionsRegistryEntries, transformSpec); + var solrecs = gpii.matchMakerFramework.utils.expandSolutions(data.solutionsRegistryEntries, data.solutionCapabilities, transformSpec); var togo = {}; // calculate match for each of the contexts fluid.each(data.hierarchicalPrefs.contexts, function (context, contextId) { @@ -197,11 +248,11 @@ var fluid = fluid || require("infusion"), gpii.matchMakerFramework.utils.parsePriorities(context, tmpSolrecs); var leaves = gpii.matchMakerFramework.utils.computeLeaves(context.preferences); - var disposed = strategy(leaves, tmpSolrecs, data, ontologyMetadata); - togo[contextId] = []; + var disposed = strategy(leaves, tmpSolrecs, data, contextId, ontologyMetadata); + togo[contextId] = {}; fluid.each(disposed, function (solrec, solid) { - if (solrec.disposition === "accept") { - togo[contextId].push(solid); + if (solrec.disposition === "accept") { // only output accepted solutions + togo[contextId][solid] = solrec.active; // true if it should be running } }); }); @@ -228,12 +279,12 @@ var fluid = fluid || require("infusion"), * have a format identical to the output of the gpii.matchMakerFramework.utils.expandSolutions * function. Each entry in this object will potentially be modified by the * modification/addition/deletion of the disposition, priority and/or dispositionReason. - * @param typeInfo {Object}: contains information about the type each solution is. More precisely, + * @param data {Object}: contains information about the type each solution is. More precisely, * the value for the key `solutionTypeMapping` is a map of : pairs. The second key, `solutionTypes` is a map of * with as values. */ - gpii.matchMakerFramework.utils.disposeFromPriority = function (solrecs, typeInfo) { + gpii.matchMakerFramework.utils.disposeFromPriority = function (solrecs, data, contextId) { // sort into prioritized map, eg: { 1024: [sola, solb], 200 [solc] } var prioritiesMap = {}; fluid.each(solrecs, function (sol) { @@ -251,7 +302,7 @@ var fluid = fluid || require("infusion"), // for each solution as sol for (var solutionId in sols) { var tied = []; - var solutionType = typeInfo.solutionTypes[solutionId]; + var solutionType = data.solutionTypes[solutionId]; // if a disposition is already decided for this solution, or if priority has been // removed (in case of ties), ignore it. if (solrecs[solutionId].disposition || !solrecs[solutionId].priority) { @@ -266,19 +317,24 @@ var fluid = fluid || require("infusion"), continue; } // if solutions are of equal type: - if (gpii.matchMakerFramework.utils.containsSameValue(solutionType, typeInfo.solutionTypes[otherId])) { + if (gpii.matchMakerFramework.utils.containsSameValue(solutionType, data.solutionTypes[otherId])) { // since we tie with another solution, resolve by other disposal means tied.push(otherId); } } // before accepting a solution, make sure all solutions of that type are marked reject - gpii.matchMakerFramework.utils.rejectFromTypes(typeInfo.solutionTypes[solutionId], - typeInfo.solutionTypeMapping, solrecs, + gpii.matchMakerFramework.utils.rejectFromTypes(data.solutionTypes[solutionId], + data.solutionTypeMapping, solrecs, "Another solution of same type with higher priority was found."); // if no ties, mark the current solution as "accept" if (tied.length === 0) { solrecs[solutionId].disposition = "accept"; + var prefActive = gpii.matchMakerFramework.utils.getActiveValueFromEnabledTerms(data.specialPreferences[contextId] || {}, + data.specialCapabilities[solutionId], + data.solutionsRegistryEntries[solutionId], + solutionId); + solrecs[solutionId].active = (prefActive !== undefined) ? prefActive : true; solrecs[solutionId].dispositionReason = "Has a higher priority (" + priority + ") than any solution of the same type"; } else { @@ -310,6 +366,7 @@ var fluid = fluid || require("infusion"), delete solrecs[tiedSolutionId].priority; delete solrecs[tiedSolutionId].disposition; delete solrecs[tiedSolutionId].dispositionReason; + delete solrecs[tiedSolutionId].active; }); }; @@ -336,8 +393,9 @@ var fluid = fluid || require("infusion"), for (var solutionId in solutionTypeMapping[type]) { var sol = solrecs[solutionId]; if (!sol.disposition) { - sol.disposition = "reject"; - sol.dispositionReason = disposeReason || "Solution rejected due to its type of " + type; + sol.disposition = "accept"; + sol.active = false; + sol.dispositionReason = disposeReason || "Solution accepted but deactivated due to its type of " + type; } } }); @@ -366,7 +424,7 @@ var fluid = fluid || require("infusion"), if (metadata.type === "priority") { fluid.each(metadata.scope, function (applicationId) { // set the priority of the application if it's part of our solrecs list: - var solrec = solrecs[applicationId.substr("http://registry.gpii.net/applications/".length)]; + var solrec = solrecs[gpii.matchMakerFramework.utils.applicationIdFromTerm(applicationId)]; if (solrec) { solrec.priority = metadata.value; } @@ -394,7 +452,7 @@ var fluid = fluid || require("infusion"), var applicationString = "http://registry.gpii.net/applications/" + solutionId; // find supported common terms: - var supportedCommonArr = gpii.matchMakerFramework.utils.computeAndOntologizeCapabilitiesFromSolution(solutionEntry, { "": "" }); + var supportedCommonArr = gpii.matchMakerFramework.utils.computeCapabilitiesFromSolution(solutionEntry); var supportedCommon = {}; // create object of keys that are unescaped common term URIs and values of true fluid.each(supportedCommonArr, function (common) { fluid.set(supportedCommon, common, true, fluid.model.escapedSetConfig); @@ -404,7 +462,7 @@ var fluid = fluid || require("infusion"), if (filtered[applicationString]) { // application block for this solution fluid.each(filtered[applicationString], function (value, preference) { // move all common terms outside application block: - if (preference.startsWith("http://registry.gpii.net/common/")) { + if (gpii.matchMakerFramework.utils.isCommonTerm(preference)) { filtered[preference] = value; delete filtered[applicationString][preference]; } @@ -414,7 +472,7 @@ var fluid = fluid || require("infusion"), // top level: filter everything that is not the application block and supported common terms return fluid.remove_if(filtered, function (value, preference) { // Keep preference if it is a supported common term - if (preference.startsWith("http://registry.gpii.net/common/") && supportedCommon[preference] === true) { + if (gpii.matchMakerFramework.utils.isCommonTerm(preference) && supportedCommon[preference] === true) { return false; } // Also leave the applicaiton specific block @@ -444,11 +502,11 @@ var fluid = fluid || require("infusion"), applications: {} }; var appBlock = togo.inferredConfiguration[contextId].applications; - fluid.each(solArray, function (solutionId) { + fluid.each(solArray, function (active, solutionId) { var filteredSettings = gpii.matchMakerFramework.utils.filterPreferencesForSolution(solutionId, fullModel.preferences.contexts[contextId].preferences, fullModel.solutionsRegistryEntries[solutionId]); appBlock[solutionId] = { - active: true, - settings:filteredSettings + active: active, + settings: filteredSettings }; // TODO: add metadata sections }); @@ -471,7 +529,7 @@ var fluid = fluid || require("infusion"), * @param inferred {Object} Inferred common terms, as provided in the MM input * @return {Object} A copy of the preferences object with the inferred common terms merged in */ - gpii.matchMakerFramework.utils.addInferredCommonTerms = function (preferences, inferred) { + gpii.matchMakerFramework.utils.addInferredCommonTermsToPreferences = function (preferences, inferred) { var togo = fluid.copy(preferences); fluid.each(inferred, function (context, contextId) { var tcont = togo.contexts[contextId]; @@ -482,6 +540,40 @@ var fluid = fluid || require("infusion"), return togo; }; + /** + * Simple function that takes a list of capabilities and extract all 'special' capabilities. + * This is currently all terms ending with /enabled + * + * @param capabilities {Array} an array of term/capabilities + * @return {Array} an array of all capabilities that are special (i.e. ends with /enabled) + **/ + gpii.matchMakerFramework.utils.extractSpecialCapabilities = function (capabilities) { + return fluid.remove_if(fluid.copy(capabilities), function (term) { + return !term.endsWith("/enabled"); + }); + }; + + /** + * Adds information about the supported capabilities for each solution (in the flat format) and special capabilities. + * Two things will be added to the payload: + * (1) A list of inputPaths from the capabilitiesTransformations of the settingshandlers as well as the content of the solutions "capabiliites" entry. + * (2) A list of special capabilities, meaning the (1) list run through the extractSpecialCapabilities function + * + * NOTE: This will modify the supplied payload + * + * @param payload {Object} An object with the format of a standard matchmaker input payload. At a very + * minimum this payload should have a `solutionsRegistryEntries` key with a hashmap of + * (solutionID => solution registry entry) pairs. Note that this object will be modified by + * addition of two toplevel keys: `solutionTypes` and `solutionTypeMapping`. + */ + gpii.matchMakerFramework.utils.addCapabilitiesInformation = function (payload) { + fluid.each(payload.solutionsRegistryEntries, function (solution, solutionId) { + var capabilities = gpii.matchMakerFramework.utils.computeCapabilitiesFromSolution(solution); + fluid.set(payload, [ "solutionCapabilities", solutionId ], capabilities); + fluid.set(payload, [ "specialCapabilities", solutionId ], gpii.matchMakerFramework.utils.extractSpecialCapabilities(capabilities)); + }); + }; + /** * Adds information about the solutions types to the payload paramater, which should be in the * format of an input payload for matchmakers. @@ -493,32 +585,48 @@ var fluid = fluid || require("infusion"), * NOTE: this function will modify the supplied `payload` * * @param payload {Object} An object with the format of a standard matchmaker input payload. At a very - * minimum this payload should have a `solutionRegistryEntries` key with a hashmap of - * (solutionID => solution registry entry) pairs. Note that this object will be modified by - * addition of two toplevel keys: `solutionTypes` and `solutionTypeMapping`. + * minimum this payload should have a `solutionsRegistryEntries` key with the solution entries as well + * as a 'solutionCapabilities' key, which contains information about a solutions capabilities (i.e. via + * the addCapabilitiesInformation function). * @param transformSpec {Object} ontology transform spec translating from common terms into * a solution type ontology. */ gpii.matchMakerFramework.utils.addSolutionTypeInformation = function (payload, transformSpec) { - fluid.each(payload.solutionsRegistryEntries, function (entry, entryId) { + fluid.each(payload.solutionCapabilities, function (capabilities, solutionId) { // first get an array of what solution types the current entry is: - var solutionTypes = gpii.matchMakerFramework.utils.computeAndOntologizeCapabilitiesFromSolution(entry, transformSpec); - fluid.set(payload, [ "solutionTypes", entryId], solutionTypes); + var solutionTypes = gpii.matchMakerFramework.utils.transformCapabilitiesToOntologizedLeaves(capabilities, transformSpec); + fluid.set(payload, [ "solutionTypes", solutionId], solutionTypes); // now add solution ID to the return array in the appropriate places: for (var i in solutionTypes) { // add solution ID to the solution type - fluid.set(payload, ["solutionTypeMapping", solutionTypes[i], entryId], true); + fluid.set(payload, ["solutionTypeMapping", solutionTypes[i], solutionId], true); } }); }; + gpii.matchMakerFramework.utils.isApplicationTerm = function (term) { + return term.startsWith("http://registry.gpii.net/applications/"); + }; + + gpii.matchMakerFramework.utils.isCommonTerm = function (term) { + return term.startsWith("http://registry.gpii.net/common/"); + }; + + gpii.matchMakerFramework.utils.applicationIdFromTerm = function (term) { + return term.substring("http://registry.gpii.net/applications/".length); + }; + + gpii.matchMakerFramework.utils.makeApplicationTerm = function (applicationId) { + return "http://registry.gpii.net/applications/" + applicationId; + }; + gpii.matchMakerFramework.utils.inferCommonTermsFromApplicationsPrefs = function (prefsId, prefsBlock, flattenedSolutionsRegistry) { var togo = {}; - if (prefsId.startsWith("http://registry.gpii.net/applications/")) { - var solutionId = prefsId.substring("http://registry.gpii.net/applications/".length); + if (gpii.matchMakerFramework.utils.isApplicationTerm(prefsId)) { + var solutionId = gpii.matchMakerFramework.utils.applicationIdFromTerm(prefsId); // add any common terms from the application block directly as inferred: togo[solutionId] = fluid.remove_if(fluid.copy(prefsBlock), function (val, key) { - return (!key.startsWith("http://registry.gpii.net/common/")); // keep if it's a common term + return (!gpii.matchMakerFramework.utils.isCommonTerm(key)); // keep if it's a common term }); // transform the application specific settings and add them to inferred list if (solutionId in flattenedSolutionsRegistry) { @@ -544,6 +652,37 @@ var fluid = fluid || require("infusion"), return togo; }; + /** + * Given a preference set, return a nested structure of context->appliactionBlock->special setting->value + * and context->special setting->value. + * + * This function will walk an NP set and look for any /enabled terms. Anything that is not an /enabled + * term will not be kept. A structure if returned containing the contexts on the outer level. Each context + * will have any non application specific /enabled terms, as well as any application block with its contained + * /enabled terms. + * + * @preferences {Object} a preferences set + * @return {Object} The NP set with only context names and /enabled terms + */ + gpii.matchMakerFramework.utils.findSpecialPreferences = function (preferences) { + return fluid.transform(fluid.copy(preferences.contexts), function (context) { + var togo = {}; + fluid.each(context.preferences, function (prefsBlock, prefsId) { + if (prefsId.endsWith("/enabled")) { + togo[prefsId] = prefsBlock; + } else if (gpii.matchMakerFramework.utils.isApplicationTerm(prefsId)) { + var applicationId = gpii.matchMakerFramework.utils.applicationIdFromTerm(prefsId); + fluid.each(prefsBlock, function (appPrefVal, appPrefId) { + if (appPrefId.endsWith("/enabled")) { + fluid.set(togo, [ applicationId, appPrefId ], appPrefVal); + } + }); + } + }); + return togo; + }); + }; + /** * Converts application specific settings into common terms, keyed by application ids. Given a * set of preferences, for each application block in those preferences, the settings for which @@ -606,19 +745,28 @@ var fluid = fluid || require("infusion"), * This feature is required by the PCP to allow updating e.g. a top-level common term and * ensuring that the relevant applications are affected by it */ - gpii.matchMakerFramework.utils.updateInferredConfiguration = function (preferences, inferredConfiguration) { + gpii.matchMakerFramework.utils.updateInferredConfiguration = function (preferences, inferredConfiguration, solutionsRegistryEntries) { var inferred = fluid.copy(inferredConfiguration); fluid.each(preferences.contexts, function (contextBlock, contextName) { fluid.each(contextBlock.preferences, function (val, pref) { - if (pref.startsWith("http://registry.gpii.net/common/")) { + if (gpii.matchMakerFramework.utils.isCommonTerm(pref)) { gpii.matchMakerFramework.utils.updateSingleInferredConfiguration(inferred, contextName, pref, val); - } else if (pref.startsWith("http://registry.gpii.net/applications/")) { - var solutionId = pref.substring("http://registry.gpii.net/applications/".length); + } else if (gpii.matchMakerFramework.utils.isApplicationTerm(pref)) { + var solutionId = gpii.matchMakerFramework.utils.applicationIdFromTerm(pref); fluid.each(val, function (solPrefVal, solPref) { gpii.matchMakerFramework.utils.updateSingleInferredConfiguration(inferred, contextName, solPref, solPrefVal, solutionId); }); } }); + // get active value from */enabled preferences: + fluid.each(inferred[contextName].applications, function (solutionBlock, solutionId) { + var solutionCapabilities = fluid.get(solutionsRegistryEntries, [ solutionId, "capabilities" ]) || {}; + var active = gpii.matchMakerFramework.utils.getActiveValueFromEnabledTerms(contextBlock.preferences, solutionCapabilities, + solutionsRegistryEntries[solutionId], solutionId); + if (active !== undefined) { + solutionBlock.active = active; + } + }); }); return inferred; }; @@ -632,28 +780,35 @@ var fluid = fluid || require("infusion"), ]; /** - * Given a term and one or more solutions registry entries, this function will walk each - * solution (and its settingshandlers) and find the lowest liveness for any solution that - * supports the term via its capabilities and/or capabilitiesTransformations. The lowest or least + * Given one or more solutions registry entries and optionally a term, this function will walk each + * solution (and its settingshandlers) and find the lowest liveness for any of the solutions. If a term is + * given, the liveliness reported is the lowest of those settingshandlers which supports that term + * (decided via its capabilities and/or capabilitiesTransformations). The lowest or least * liveness is dictated by gpii.matchMakerFramework.utils.livenessOrdering, where a lower * index means less/lower liveness. * - * @param term {String}: the term to find the liveness for * @param solutions {Array or Object} A list of the solutions that should be search for support of the term + * @param term {String} - optional. the term to find the liveness for * @return {String} returns the lowest/least liveness found by any solution provided that supports the term */ - gpii.matchMakerFramework.utils.getLeastLiveness = function (term, solutions) { + gpii.matchMakerFramework.utils.getLeastLiveness = function (solutions, term) { var leastLiveness; fluid.each(solutions, function (solution) { fluid.each(solution.settingsHandlers, function (handler) { - var capabilities = gpii.matchMakerFramework.utils.extractCapabilities(handler); - if (capabilities && capabilities.indexOf(fluid.pathUtil.composeSegments(term)) > -1) { - // if the liveness of term in current solution is lower than any previously checked solutions - var livenessOrder = gpii.matchMakerFramework.utils.livenessOrdering.indexOf(handler.liveness); - if (leastLiveness === undefined || livenessOrder < leastLiveness) { - leastLiveness = livenessOrder; + if (term !== undefined) { + // if term is defined, only check liveness of block if the term is within the capabilities + // of the block. If not, simply skip to next block + var capabilities = gpii.matchMakerFramework.utils.extractCapabilities(handler); + if (capabilities && capabilities.indexOf(fluid.pathUtil.composeSegments(term)) === -1) { + return; } } + + // if the liveness of term in current solution is lower than any previously checked solutions + var livenessOrder = gpii.matchMakerFramework.utils.livenessOrdering.indexOf(handler.liveness); + if (leastLiveness === undefined || livenessOrder < leastLiveness) { + leastLiveness = livenessOrder; + } }); }); return gpii.matchMakerFramework.utils.livenessOrdering[leastLiveness]; diff --git a/gpii/node_modules/matchMakerFramework/test/MatchMakerFrameworkTests.js b/gpii/node_modules/matchMakerFramework/test/MatchMakerFrameworkTests.js index 8d0998d76..15941f718 100644 --- a/gpii/node_modules/matchMakerFramework/test/MatchMakerFrameworkTests.js +++ b/gpii/node_modules/matchMakerFramework/test/MatchMakerFrameworkTests.js @@ -112,7 +112,7 @@ gpii.tests.matchMakerFramework.inferCommonTermsFixtures = { "http://registry.gpii.net/common/mouseTrailing": 10 }, "com.microsoft.windows.highContrast": { - "http://registry.gpii.net/common/highContrastEnabled": true + "http://registry.gpii.net/common/highContrast/enabled": true }, "com.microsoft.windows.cursors": { "http://registry.gpii.net/common/cursorSize": 1 @@ -140,7 +140,7 @@ gpii.tests.matchMakerFramework.inferCommonTermsFixtures = { expected: { "gpii-default": { "com.microsoft.windows.highContrast": { - "http://registry.gpii.net/common/highContrastEnabled": true + "http://registry.gpii.net/common/highContrast/enabled": true }, "com.microsoft.windows.magnifier": { "http://registry.gpii.net/common/tracking": [], diff --git a/gpii/node_modules/matchMakerFramework/test/data/common_only.json b/gpii/node_modules/matchMakerFramework/test/data/common_only.json index f71a818ec..e29459a8f 100644 --- a/gpii/node_modules/matchMakerFramework/test/data/common_only.json +++ b/gpii/node_modules/matchMakerFramework/test/data/common_only.json @@ -10,7 +10,7 @@ "http://registry.gpii.net/common/cursorSize": 0.9, "http://registry.gpii.net/common/fontSize": 9, "http://registry.gpii.net/common/mouseTrailing": 10, - "http://registry.gpii.net/common/highContrastEnabled": true + "http://registry.gpii.net/common/highContrast/enabled": true } } } 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 46256f3f6..9aa828483 100644 --- a/gpii/node_modules/matchMakerFramework/test/inverseCapabilities/os_win7_expected.json +++ b/gpii/node_modules/matchMakerFramework/test/inverseCapabilities/os_win7_expected.json @@ -1,7 +1,7 @@ { "gpii-default": { "com.microsoft.windows.highContrast": { - "http://registry.gpii.net/common/highContrastEnabled": true + "http://registry.gpii.net/common/highContrast/enabled": true }, "com.microsoft.windows.cursors": { "http://registry.gpii.net/common/cursorSize": 1 @@ -23,10 +23,10 @@ }, "com.microsoft.windows.mouseKeys": { "http://registry.gpii.net/common/cursorSpeed": 0.2571428571426, - "http://registry.gpii.net/common/mouseEmulationEnabled": true + "http://registry.gpii.net/common/mouseEmulation/enabled": true }, "com.microsoft.windows.filterKeys": { - "http://registry.gpii.net/common/debounceEnabled": true, + "http://registry.gpii.net/common/debounce/enabled": true, "http://registry.gpii.net/common/debounceInterval": 1 }, "com.microsoft.windows.screenResolution": {}, diff --git a/gpii/node_modules/matchMakerFramework/test/js/CanopyMatchMakerTests.js b/gpii/node_modules/matchMakerFramework/test/js/CanopyMatchMakerTests.js deleted file mode 100644 index 179323e50..000000000 --- a/gpii/node_modules/matchMakerFramework/test/js/CanopyMatchMakerTests.js +++ /dev/null @@ -1,191 +0,0 @@ -/* - * GPII Canopy MatchMaker Tests - * - * Copyright 2012 OCAD University - * Copyright 2012 Raising The Floor - International - * - * Licensed under the New BSD license. You may not use this file except in - * compliance with this License. - * - * The research leading to these results has received funding from the European Union's - * Seventh Framework Programme (FP7/2007-2013) - * under grant agreement no. 289016. - * - * You may obtain a copy of the License at - * https://github.com/GPII/universal/blob/master/LICENSE.txt - */ - -/* global jqUnit, fluid */ - -var gpii = fluid.registerNamespace("gpii"); - -(function () { - "use strict"; - - fluid.registerNamespace("gpii.tests.canopyMatchMaker"); - - var magnifier = { - "settingsHandlers": { - "myconf": { - "type": "gpii.integrationTesting.mockSettingsHandler", - "capabilities": ["display.screenEnhancement"], - "capabilitiesTransformations": { - "mag-factor": "display.screenEnhancement.magnification", - "show-cross-hairs": "display.screenEnhancement.-provisional-showCrosshairs", - "mouse-tracking": { - "transform": { - "type": "fluid.transforms.valueMapper", - "defaultInputPath": "display.screenEnhancement.tracking", - "match": { - "mouse": "centered" - } - } - } - } - } - } - }; - - var lesserMagnifier = { - "settingsHandlers": { - "myconf": { - "type": "gpii.integrationTesting.mockSettingsHandler", - "capabilitiesTransformations": { - "mag-factor": "display.screenEnhancement.magnification" - } - }, - "yourconf": { - "type": "gpii.integrationTesting.mockSettingsHandler", - "capabilities": "display.screenEnhancement.magnification" - } - } - }; - - var magnifierLeaves = [ - "display.screenEnhancement.magnification", - "display.screenEnhancement.-provisional-showCrosshairs", - "display.screenEnhancement.tracking", - "display.screenEnhancement" - ]; - - var magnifierSkeleton = { - display: { - screenEnhancement: { - magnification: {}, - "-provisional-showCrosshairs": {}, - tracking: {} - } - } - }; - - var escapedLeaves = [ - "display.screenReader.applications.nvda\\.screenReader" - ]; - - var escapedSkeleton = { - display: { - screenReader: { - applications: { - "nvda.screenReader": {} - } - } - } - }; - - var sammyProfile = { - "display": { - "screenEnhancement": { - "fontSize": 24, - "foregroundColor": "white", - "backgroundColor": "black", - "fontFace": { - "fontName": ["Comic Sans"], - "genericFontFace": "sans serif" - }, - "magnification": 2.0, - "tracking": ["mouse"], - "invertImages": true, - "-provisional-showCrosshairs": true - } - } - }; - - var sammyLeaves = [ - "display.screenEnhancement.-provisional-showCrosshairs", - "display.screenEnhancement.backgroundColor", - "display.screenEnhancement.fontFace.fontName.0", - "display.screenEnhancement.fontFace.genericFontFace", - "display.screenEnhancement.fontSize", - "display.screenEnhancement.foregroundColor", - "display.screenEnhancement.invertImages", - "display.screenEnhancement.magnification", - "display.screenEnhancement.tracking.0" - ]; - - var expandFitness = function (fitnesses) { - return fluid.transform(fitnesses, function (fit, index) { - return { - fitness: fit, - index: index - }; - }); - }; - - var extractIndices = function (solns) { - return fluid.transform(solns, function (soln) { - return soln.index; - }); - }; - - gpii.tests.canopyMatchMaker.runTests = function () { - jqUnit.module("Utilities"); - - jqUnit.test("Path Utilities", function () { - jqUnit.assertEquals("Exact depth", 0, gpii.matchMakerFramework.utils.prefixLength("display.screenEnhancement.fontSize", sammyProfile)); - jqUnit.assertEquals("Near depth", 0, gpii.matchMakerFramework.utils.prefixLength("display.screenEnhancement.fontSize", sammyProfile)); - jqUnit.assertEquals("Mid depth", -1, gpii.matchMakerFramework.utils.prefixLength("display.unrecognizable", sammyProfile)); - jqUnit.assertEquals("Far depth", -2, gpii.matchMakerFramework.utils.prefixLength("display.unrecognizable.thing", sammyProfile)); - var skeleton = gpii.matchMakerFramework.utils.pathsToSkeleton(magnifierLeaves); - jqUnit.assertDeepEq("Computed model skeleton", magnifierSkeleton, skeleton); - - var skeleton2 = gpii.matchMakerFramework.utils.pathsToSkeleton(escapedLeaves); - jqUnit.assertDeepEq("Computed model escaped skeleton", escapedSkeleton, skeleton2); - }); - - jqUnit.test("Fitness computation", function () { - var fitness = gpii.matchMaker.canopy.computeFitness(sammyLeaves, magnifierSkeleton); - var expected = [0, 0, -1, -1, -1, -1, -1, -2, -3]; - jqUnit.assertDeepEq("Computed fitness vector", expected, fitness); - - var fitnesses = [ - [-1, -3, 0], - [0, 0, 0], - [0, 0], - [0, 0, 0, 0], - [-1, -3, -1] - ]; - var solns = gpii.matchMaker.canopy.sortSolutions(expandFitness(fitnesses)); - var indices = extractIndices(solns); - var expected2 = [3, 1, 2, 0, 4]; - jqUnit.assertDeepEq("Ranked fitnesses", expected2, indices); - }); - - jqUnit.module("MatchMaker"); - jqUnit.test("Rank and dispose solutions", function () { - var solutions = [lesserMagnifier, - magnifier - ]; - var expanded = gpii.matchMakerFramework.utils.expandSolutions(solutions, { "*": "*" }); - var ranked = gpii.matchMaker.canopy.rankSolutions(sammyLeaves, expanded); - var indices = extractIndices(ranked); - var expected = [1, 0]; - jqUnit.assertDeepEq("Ranked solutions", expected, indices); - - var disposed = gpii.matchMaker.canopy.disposeSolutionsImpl(sammyLeaves, ranked); - var itions = gpii.matchMakerFramework.utils.extractDispositions(disposed); - expected = ["reject", "accept"]; - jqUnit.assertDeepEq("Disposed solutions", expected, itions); - }); - }; - -})(); diff --git a/gpii/node_modules/matchMakerFramework/test/js/MatchMakerUtilitiesDisposeFromPriorityTests.js b/gpii/node_modules/matchMakerFramework/test/js/MatchMakerUtilitiesDisposeFromPriorityTests.js index f088d22eb..842269c88 100644 --- a/gpii/node_modules/matchMakerFramework/test/js/MatchMakerUtilitiesDisposeFromPriorityTests.js +++ b/gpii/node_modules/matchMakerFramework/test/js/MatchMakerUtilitiesDisposeFromPriorityTests.js @@ -88,41 +88,46 @@ var fluid = fluid || require("infusion"), solC: true, solD: true } - } + }, + specialCapabilities: {}, + specialPreferences: {}, + solutionsRegistryEntries: {} } }; - // "undefined" disposition means that the solution is either tied with another solution - // or not present on the device. Decisions are based on priority and solution type - see + // `undefined` disposition means that the solution is either tied with another solution + // or not present on the device. `true` means that the solution should be configured and + // launched on startup, and `false` means configured but NOT launched on startup. + // Decisions are based on priority and solution type - see // the data block above. var testData = [{ description: "Tie between highest priority, rest rejected", priorities: [2, 2, 1, 1, 1], - expectedDispositions: [undefined, undefined, "reject", "reject", "reject"] + expectedDispositions: [undefined, undefined, false, false, false] }, { description: "Single highest priority wins, rest rejected", priorities: [2, 1, 1, 1, 1], - expectedDispositions: ["accept", "reject", "reject", "reject", "reject"] + expectedDispositions: [true, false, false, false, false] }, { // description: "Only solution covering all required solution types selected", // priorities: [2, 1, 2, 1, 1], - // expectedDispositions: ["accept", "reject", "reject", "reject", "reject"] + // expectedDispositions: [true, "reject", "reject", "reject", "reject"] // }, { description: "Highest priority selected, solution type equivalents remove", priorities: [2, 1, 3, 1, 2], - expectedDispositions: ["reject", "reject", "accept", "reject", "accept"] + expectedDispositions: [false, false, true, false, true] }, { description: "Tie between multiple solutions of different types", priorities: [2, 1, 2, 2, 2], - expectedDispositions: [undefined, "reject", undefined, undefined, undefined] + expectedDispositions: [undefined, false, undefined, undefined, undefined] }, { description: "Tie between multiple solutions of different types #2", priorities: [2, 1, 2, 1, 2], - expectedDispositions: [undefined, "reject", undefined, "reject", undefined] + expectedDispositions: [undefined, false, undefined, false, undefined] // }, { // description: "", // priorities: [1, null, 2, null, null], - // expectedDispositions: ["accept", undefined, "reject", undefined, undefined] + // expectedDispositions: [true, undefined, "reject", undefined, undefined] }]; @@ -166,10 +171,11 @@ var fluid = fluid || require("infusion"), gpii.tests.matchMakerUtilities.disposeFromPriority.singleTest = function (priorities, expectedDispositions) { var input = gpii.tests.matchMakerUtilities.disposeFromPriority.setPriorities(priorities); - gpii.matchMakerFramework.utils.disposeFromPriority(input.solrecs, input.data); + gpii.matchMakerFramework.utils.disposeFromPriority(input.solrecs, input.data, undefined); fluid.each(fullData.solIds, function (solId, index) { - var msg = "Expecting solution " + solId + " to have disposition: " + expectedDispositions[index]; - jqUnit.assertEquals(msg, expectedDispositions[index], input.solrecs[solId].disposition); + var msg = "Expecting solution " + solId + " to be: " + expectedDispositions[index]; + var actual = input.solrecs[solId].disposition ? input.solrecs[solId].active : undefined; + jqUnit.assertEquals(msg, expectedDispositions[index], actual); }); }; diff --git a/gpii/node_modules/matchMakerFramework/test/js/MatchMakerUtilitiesTests.js b/gpii/node_modules/matchMakerFramework/test/js/MatchMakerUtilitiesTests.js index a5ed20f85..be6a1830d 100644 --- a/gpii/node_modules/matchMakerFramework/test/js/MatchMakerUtilitiesTests.js +++ b/gpii/node_modules/matchMakerFramework/test/js/MatchMakerUtilitiesTests.js @@ -187,18 +187,18 @@ var fluid = fluid || require("infusion"), var computeAndOntologizeCapabilitiesFromSolutionFixture = { description: "solution incl capabilities and transformations", - model: { + solution: { "name": "GNOME Shell Magnifier", "contexts": {}, + "capabilities": [ + "http://registry\\.gpii\\.net/common/magnification/enabled" + ], "settingsHandlers": { "configuration": { "type": "gpii.gsettings", "options": { "schema": "org.gnome.desktop.a11y.magnifier" }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/invertColours" - ], "capabilitiesTransformations": { "mag-factor": "http://registry\\.gpii\\.net/common/magnification", "show-cross-hairs": "http://registry\\.gpii\\.net/common/showCrosshairs", @@ -218,42 +218,14 @@ var fluid = fluid || require("infusion"), "type": "fluid.transforms.valueMapper", "defaultInputPath": "http://registry\\.gpii\\.net/common/magnifierPosition", "match": { - "FullScreen": "full-screen", - "Lens": "full-screen", - "LeftHalf": "left-half", - "RightHalf": "right-half", - "TopHalf": "top-half", - "BottomHalf": "bottom-half" - }, - "noMatch": { - "outputValue": "full-screen" + "FullScreen": "full-screen" } } - } + }, + "someSetting": "http://registry\\.gpii\\.net/common/screenReaderTTS/enabled" } } }, - "update": [ - "settings.configuration" - ], - "configure": [ - "settings.configuration" - ], - "restore": [ - "settings.configuration" - ], - "start": [ - { - "type": "gpii.launch.exec", - "command": "gsettings set org.gnome.desktop.a11y.applications screen-magnifier-enabled true" - } - ], - "stop": [ - { - "type": "gpii.launch.exec", - "command": "gsettings set org.gnome.desktop.a11y.applications screen-magnifier-enabled false" - } - ], "isInstalled": [ { "type": "gpii.packageKit.find", @@ -261,35 +233,55 @@ var fluid = fluid || require("infusion"), } ] }, + expectedCapabilities: [ + "http://registry\\.gpii\\.net/common/tracking", + "http://registry\\.gpii\\.net/common/magnification", + "http://registry\\.gpii\\.net/common/showCrosshairs", + "http://registry\\.gpii\\.net/common/magnifierPosition", + "http://registry\\.gpii\\.net/common/screenReaderTTS/enabled", + "http://registry\\.gpii\\.net/common/magnification/enabled" + ], + expectedSpecialCapabilities: [ + "http://registry\\.gpii\\.net/common/screenReaderTTS/enabled", + "http://registry\\.gpii\\.net/common/magnification/enabled" + ], expectedISO: [ "display.screenEnhancement.tracking", "display.screenEnhancement.magnification", - "display.screenEnhancement.-provisional-invertColours", - "display.screenEnhancement.-provisional-magnifierPosition" + "display.screenEnhancement.-provisional-magnifierPosition", + "display.screenEnhancement.-provisional-magnification/enabled", + "display.screenReader.-provisional-screenReaderTTS/enabled" ], expectedApptology: [ - "http://registry\\.gpii\\.net/common/magnifierApplication" + "http://registry\\.gpii\\.net/common/magnifierApplication", + "http://registry\\.gpii\\.net/common/screenReaderApplication" ] }; gpii.tests.matchMakerUtilities.computeAndOntologizeCapabilitiesFromSolution = function () { var fixture = computeAndOntologizeCapabilitiesFromSolutionFixture; - var flatToISOSpec = fluid.model.transform.invertConfiguration(transformSpec); - var resultISO = gpii.matchMakerFramework.utils.computeAndOntologizeCapabilitiesFromSolution(fixture.model, flatToISOSpec); - jqUnit.assertDeepEq(fixture.description, fixture.expectedISO, resultISO); + var capabilities = gpii.matchMakerFramework.utils.computeCapabilitiesFromSolution(fixture.solution); + jqUnit.assertDeepEq("Capabilities computed by gpii.matchMakerFramework.utils.computeCapabilitiesFromSolution", fixture.expectedCapabilities, capabilities); + + var specialCapabilities = gpii.matchMakerFramework.utils.extractSpecialCapabilities(capabilities); + jqUnit.assertDeepEq("Special capabilities computed by gpii.matchMakerFramework.utils.extractSpecialCapabilities", fixture.expectedSpecialCapabilities, specialCapabilities); + + var flatToISOSpec = fluid.model.transform.invertConfiguration(transformSpec); + var resultISO = gpii.matchMakerFramework.utils.transformCapabilitiesToOntologizedLeaves(capabilities, flatToISOSpec); + jqUnit.assertDeepEq("Capabilities to ISO leaves (gpii.matchMakerFramework.utils.transformCapabilitiesToOntologizedLeaves)", fixture.expectedISO, resultISO); - // var resultApptology = gpii.matchMakerFramework.utils.computeAndOntologizeCapabilitiesFromSolution(fixture.model, apptologyTransformSpec); - // jqUnit.assertDeepEq(fixture.description, fixture.expectedApptology, resultApptology); + var resultApptology = gpii.matchMakerFramework.utils.transformCapabilitiesToOntologizedLeaves(capabilities, apptologyTransformSpec); + jqUnit.assertDeepEq("Capabilities to apptology (gpii.matchMakerFramework.utils.transformCapabilitiesToOntologizedLeaves)", fixture.expectedApptology, resultApptology); }; var buildReturnPayloadFixtures = [ { description: "Basic payloads", disposed: { - "gpii-default": [ - "mac.dummy" - ] + "gpii-default": { + "mac.dummy": true + } }, fullModel: { "userToken": "mac", @@ -299,8 +291,8 @@ var fluid = fluid || require("infusion"), "name": "Default preferences", "preferences": { "http://registry.gpii.net/common/fontSize": 16, - "http://registry.gpii.net/common/screenReaderTTSEnabled": false, - "http://registry.gpii.net/common/magnifierEnabled": false, + "http://registry.gpii.net/common/screenReaderTTS/enabled": false, + "http://registry.gpii.net/common/magnification/enabled": false, "http://registry.gpii.net/common/magnification": 1 } } @@ -336,11 +328,10 @@ var fluid = fluid || require("infusion"), "options": { "path": "/path/to/some/file.json" }, - "capabilities": [], "capabilitiesTransformations": { "setting1": "http://registry\\.gpii\\.net/common/fontSize", - "setting2.path1": "http://registry\\.gpii\\.net/common/screenReaderTTSEnabled", - "setting2.path2": "http://registry\\.gpii\\.net/common/magnifierEnabled", + "setting2.path1": "http://registry\\.gpii\\.net/common/screenReaderTTS/enabled", + "setting2.path2": "http://registry\\.gpii\\.net/common/magnification/enabled", "setting2.path3.hello": "http://registry\\.gpii\\.net/common/magnification" } } @@ -363,8 +354,7 @@ var fluid = fluid || require("infusion"), }, "settingsHandlers": { "otherconf": { - "type": "gpii.settingsHandlers.noSettings", - "capabilities": [] + "type": "gpii.settingsHandlers.noSettings" } }, "start": [], @@ -387,10 +377,10 @@ var fluid = fluid || require("infusion"), "screenEnhancement": { "fontSize": 16, "magnification": 1, - "-provisional-magnifierEnabled": false + "-provisional-magnification/enabled": false }, "screenReader": { - "-provisional-screenReaderTTSEnabled": false + "-provisional-screenReaderTTS/enabled": false } } } @@ -406,8 +396,8 @@ var fluid = fluid || require("infusion"), "active": true, "settings": { "http://registry.gpii.net/common/fontSize": 16, - "http://registry.gpii.net/common/screenReaderTTSEnabled": false, - "http://registry.gpii.net/common/magnifierEnabled": false, + "http://registry.gpii.net/common/screenReaderTTS/enabled": false, + "http://registry.gpii.net/common/magnification/enabled": false, "http://registry.gpii.net/common/magnification": 1 } } @@ -552,10 +542,10 @@ var fluid = fluid || require("infusion"), } ]; - gpii.tests.matchMakerUtilities.testaddInferredCommonTerms = function () { + gpii.tests.matchMakerUtilities.testaddInferredCommonTermsToPreferences = function () { jqUnit.module("Inferred common terms merging"); fluid.each(inferredCommonfixtures, function (fixture) { - var result = gpii.matchMakerFramework.utils.addInferredCommonTerms(fixture.preferences, fixture.inferred); + var result = gpii.matchMakerFramework.utils.addInferredCommonTermsToPreferences(fixture.preferences, fixture.inferred); jqUnit.assertDeepEq(fixture.name, fixture.expect, result); }); }; @@ -563,121 +553,22 @@ var fluid = fluid || require("infusion"), var addSolutionTypeInformationFixtures = [{ name: "Three solutions, two of same type", payload: { - solutionsRegistryEntries: { - "fakemag1": { - "name": "Fake Magnifier 1", - "contexts": { - "OS": [ - { - "id": "darwin" - } - ] - }, - "settingsHandlers": { - "configuration": { - "type": "gpii.settingsHandlers.JSONSettingsHandler", - "options": { - "filename": "/tmp/fakemag1.settings.json" - }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/magnifierEnabled" - ], - "capabilitiesTransformations": { - "magnification": "http://registry\\.gpii\\.net/common/magnification" - } - } - }, - "configure": [ - "settings.configuration" - ], - "restore": [ - "settings.configuration" - ], - "start": [], - "stop": [], - "isInstalled": [ - { - "type": "gpii.deviceReporter.alwaysInstalled" - } - ] - }, - "fakemag2": { - "name": "Fake Magnifier 2 - fully featured", - "contexts": { - "OS": [ - { - "id": "darwin" - } - ] - }, - "settingsHandlers": { - "configuration": { - "type": "gpii.settingsHandlers.JSONSettingsHandler", - "options": { - "filename": "/tmp/fakemag2.settings.json" - }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/magnifierEnabled" - ], - "capabilitiesTransformations": { - "magnification": "http://registry\\.gpii\\.net/common/magnification", - "invert": "http://registry\\.gpii\\.net/common/invertColours" - } - } - }, - "configure": [ - "settings.configuration" - ], - "restore": [ - "settings.configuration" - ], - "start": [], - "stop": [], - "isInstalled": [ - { - "type": "gpii.deviceReporter.alwaysInstalled" - } - ] - }, - "fakescreenreader1": { - "name": "fake screenreader", - "contexts": { - "OS": [ - { - "id": "darwin" - } - ] - }, - "settingsHandlers": { - "configuration": { - "type": "gpii.settingsHandlers.JSONSettingsHandler", - "options": { - "filename": "/tmp/fakescreenreader1.json" - }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/screenReaderTTSEnabled" - ], - "capabilitiesTransformations": { - "pitch": "http://registry\\.gpii\\.net/common/pitch", - "volumeTTS": "http://registry\\.gpii\\.net/common/volumeTTS", - "rate": "http://registry\\.gpii\\.net/common/speechRate" - } - } - }, - "configure": [ - "settings.configuration" - ], - "restore": [ - "settings.configuration" - ], - "start": [], - "stop": [], - "isInstalled": [ - { - "type": "gpii.deviceReporter.alwaysInstalled" - } - ] - } + solutionCapabilities: { + "fakemag1": [ + "http://registry\\.gpii\\.net/common/magnification/enabled", + "http://registry\\.gpii\\.net/common/magnification" + ], + "fakemag2": [ + "http://registry\\.gpii\\.net/common/magnification/enabled", + "http://registry\\.gpii\\.net/common/magnification", + "http://registry\\.gpii\\.net/common/invertColours" + ], + "fakescreenreader1": [ + "http://registry\\.gpii\\.net/common/screenReaderTTS/enabled", + "http://registry\\.gpii\\.net/common/pitch", + "http://registry\\.gpii\\.net/common/volumeTTS", + "http://registry\\.gpii\\.net/common/speechRate" + ] } }, expectedSolutionTypes: { @@ -713,8 +604,25 @@ var fluid = fluid || require("infusion"), }; + gpii.tests.matchMakerUtilities.updateInferredConfigurationSolutionRegistryEntries = { + "fake.magnifier1": { + "capabilities": [] + }, + "fake.magnifier2": { + "capabilities": [] + }, + "fake.magnifier3": { + "capabilities": [ + "http://registry\\.gpii\\.net/common/magnification/enabled" + ] + }, + "fontSizer": { + "capabilities": [] + } + }; + gpii.tests.matchMakerUtilities.updateInferredConfigurationTestDefs = [{ - name: "Basic: single top-level common term, single application", + name: "single top-level common term, single application", preferences: { "contexts": { "gpii-default": { @@ -728,12 +636,12 @@ var fluid = fluid || require("infusion"), inferredConfiguration: { "gpii-default": { "applications": { - "fake.magnifier": { + "fake.magnifier1": { "active": true, "settings": { "http://registry.gpii.net/common/fontSize": 16, - "http://registry.gpii.net/common/screenReaderTTSEnabled": false, - "http://registry.gpii.net/common/magnifierEnabled": false, + "http://registry.gpii.net/common/screenReaderTTS/enabled": false, + "http://registry.gpii.net/common/magnification/enabled": false, "http://registry.gpii.net/common/magnification": 1 } } @@ -743,12 +651,12 @@ var fluid = fluid || require("infusion"), expected: { "gpii-default": { "applications": { - "fake.magnifier": { + "fake.magnifier1": { "active": true, "settings": { "http://registry.gpii.net/common/fontSize": 20, - "http://registry.gpii.net/common/screenReaderTTSEnabled": false, - "http://registry.gpii.net/common/magnifierEnabled": false, + "http://registry.gpii.net/common/screenReaderTTS/enabled": false, + "http://registry.gpii.net/common/magnification/enabled": false, "http://registry.gpii.net/common/magnification": 1 } } @@ -756,7 +664,7 @@ var fluid = fluid || require("infusion"), } } }, { - name: "Basic: multiple top-level common terms in preferences, single application", + name: "multiple top-level common terms in preferences, single application", preferences: { "contexts": { "gpii-default": { @@ -771,12 +679,12 @@ var fluid = fluid || require("infusion"), inferredConfiguration: { "gpii-default": { "applications": { - "fake.magnifier": { + "fake.magnifier1": { "active": true, "settings": { "http://registry.gpii.net/common/fontSize": 16, - "http://registry.gpii.net/common/screenReaderTTSEnabled": false, - "http://registry.gpii.net/common/magnifierEnabled": false, + "http://registry.gpii.net/common/screenReaderTTS/enabled": false, + "http://registry.gpii.net/common/magnification/enabled": false, "http://registry.gpii.net/common/magnification": 1 } } @@ -786,12 +694,12 @@ var fluid = fluid || require("infusion"), expected: { "gpii-default": { "applications": { - "fake.magnifier": { + "fake.magnifier1": { "active": true, "settings": { "http://registry.gpii.net/common/fontSize": 20, - "http://registry.gpii.net/common/screenReaderTTSEnabled": false, - "http://registry.gpii.net/common/magnifierEnabled": false, + "http://registry.gpii.net/common/screenReaderTTS/enabled": false, + "http://registry.gpii.net/common/magnification/enabled": false, "http://registry.gpii.net/common/magnification": 2 } } @@ -799,7 +707,7 @@ var fluid = fluid || require("infusion"), } } }, { - name: "Basic: common terms in preferences not matching applications in inferred", + name: "common terms in preferences not matching applications in inferred", preferences: { "contexts": { "gpii-default": { @@ -813,10 +721,10 @@ var fluid = fluid || require("infusion"), inferredConfiguration: { "gpii-default": { "applications": { - "fake.magnifier": { + "fake.magnifier1": { "active": true, "settings": { - "http://registry.gpii.net/common/magnifierEnabled": false, + "http://registry.gpii.net/common/magnification/enabled": false, "http://registry.gpii.net/common/magnification": 1 } } @@ -826,10 +734,10 @@ var fluid = fluid || require("infusion"), expected: { "gpii-default": { "applications": { - "fake.magnifier": { + "fake.magnifier1": { "active": true, "settings": { - "http://registry.gpii.net/common/magnifierEnabled": false, + "http://registry.gpii.net/common/magnification/enabled": false, "http://registry.gpii.net/common/magnification": 1 } } @@ -837,7 +745,7 @@ var fluid = fluid || require("infusion"), } } }, { - name: "Basic: multiple top-level common terms in preferences, multiple application", + name: "multiple top-level common terms in preferences, multiple application", preferences: { "contexts": { "gpii-default": { @@ -852,10 +760,10 @@ var fluid = fluid || require("infusion"), inferredConfiguration: { "gpii-default": { "applications": { - "fake.magnifier": { + "fake.magnifier1": { "active": true, "settings": { - "http://registry.gpii.net/common/magnifierEnabled": false, + "http://registry.gpii.net/common/magnification/enabled": false, "http://registry.gpii.net/common/magnification": 1 } }, @@ -863,7 +771,7 @@ var fluid = fluid || require("infusion"), "active": true, "settings": { "http://registry.gpii.net/common/fontSize": 12, - "http://registry.gpii.net/common/screenReaderTTSEnabled": false + "http://registry.gpii.net/common/screenReaderTTS/enabled": false } } } @@ -872,10 +780,10 @@ var fluid = fluid || require("infusion"), expected: { "gpii-default": { "applications": { - "fake.magnifier": { + "fake.magnifier1": { "active": true, "settings": { - "http://registry.gpii.net/common/magnifierEnabled": false, + "http://registry.gpii.net/common/magnification/enabled": false, "http://registry.gpii.net/common/magnification": 2 } }, @@ -883,14 +791,14 @@ var fluid = fluid || require("infusion"), "active": true, "settings": { "http://registry.gpii.net/common/fontSize": 20, - "http://registry.gpii.net/common/screenReaderTTSEnabled": false + "http://registry.gpii.net/common/screenReaderTTS/enabled": false } } } } } }, { - name: "Basic: Common terms in preferences scoped to an application", + name: "Common terms in preferences scoped to an application", preferences: { "contexts": { "gpii-default": { @@ -909,14 +817,14 @@ var fluid = fluid || require("infusion"), "fake.magnifier1": { "active": true, "settings": { - "http://registry.gpii.net/common/magnifierEnabled": false, + "http://registry.gpii.net/common/magnification/enabled": false, "http://registry.gpii.net/common/magnification": 1 } }, "fake.magnifier2": { "active": true, "settings": { - "http://registry.gpii.net/common/magnifierEnabled": false, + "http://registry.gpii.net/common/magnification/enabled": false, "http://registry.gpii.net/common/magnification": 1 } } @@ -929,14 +837,14 @@ var fluid = fluid || require("infusion"), "fake.magnifier1": { "active": true, "settings": { - "http://registry.gpii.net/common/magnifierEnabled": false, + "http://registry.gpii.net/common/magnification/enabled": false, "http://registry.gpii.net/common/magnification": 2 } }, "fake.magnifier2": { "active": true, "settings": { - "http://registry.gpii.net/common/magnifierEnabled": false, + "http://registry.gpii.net/common/magnification/enabled": false, "http://registry.gpii.net/common/magnification": 1 } } @@ -944,7 +852,7 @@ var fluid = fluid || require("infusion"), } } }, { - name: "Basic: Common terms in preferences, both scoped and not scoped to an application", + name: "Common terms in preferences, both scoped and not scoped to an application", preferences: { "contexts": { "gpii-default": { @@ -953,7 +861,7 @@ var fluid = fluid || require("infusion"), "http://registry.gpii.net/applications/fake.magnifier1": { "http://registry.gpii.net/common/magnification": 2 }, - "http://registry.gpii.net/common/magnifierEnabled": true + "http://registry.gpii.net/common/magnification/enabled": true } } } @@ -964,14 +872,14 @@ var fluid = fluid || require("infusion"), "fake.magnifier1": { "active": true, "settings": { - "http://registry.gpii.net/common/magnifierEnabled": false, + "http://registry.gpii.net/common/magnification/enabled": false, "http://registry.gpii.net/common/magnification": 1 } }, "fake.magnifier2": { "active": true, "settings": { - "http://registry.gpii.net/common/magnifierEnabled": false, + "http://registry.gpii.net/common/magnification/enabled": false, "http://registry.gpii.net/common/magnification": 1 } } @@ -984,14 +892,154 @@ var fluid = fluid || require("infusion"), "fake.magnifier1": { "active": true, "settings": { - "http://registry.gpii.net/common/magnifierEnabled": true, + "http://registry.gpii.net/common/magnification/enabled": true, "http://registry.gpii.net/common/magnification": 2 } }, "fake.magnifier2": { "active": true, "settings": { - "http://registry.gpii.net/common/magnifierEnabled": true, + "http://registry.gpii.net/common/magnification/enabled": true, + "http://registry.gpii.net/common/magnification": 1 + } + } + } + } + } + }, { + name: "'enabled' term in updated preferences, resulting in 'active' change", + preferences: { + "contexts": { + "gpii-default": { + "name": "Default preferences", + "preferences": { + "http://registry.gpii.net/common/magnification/enabled": false + } + } + } + }, + inferredConfiguration: { + "gpii-default": { + "applications": { + "fake.magnifier3": { + "active": true, + "settings": { + "http://registry.gpii.net/common/fontSize": 16, + "http://registry.gpii.net/common/screenReaderTTS/enabled": true, + "http://registry.gpii.net/common/magnification/enabled": true, + "http://registry.gpii.net/common/magnification": 1 + } + } + } + } + }, + expected: { + "gpii-default": { + "applications": { + "fake.magnifier3": { + "active": false, + "settings": { + "http://registry.gpii.net/common/fontSize": 16, + "http://registry.gpii.net/common/screenReaderTTS/enabled": true, + "http://registry.gpii.net/common/magnification/enabled": false, + "http://registry.gpii.net/common/magnification": 1 + } + } + } + } + } + }, { + name: "application scoped 'enabled' term in updated preferences, resulting in 'active' change", + preferences: { + "contexts": { + "gpii-default": { + "name": "Default preferences", + "preferences": { + "http://registry.gpii.net/applications/fake.magnifier3": { + "http://registry.gpii.net/common/magnification/enabled": false + } + } + } + } + }, + inferredConfiguration: { + "gpii-default": { + "applications": { + "fake.magnifier3": { + "active": true, + "settings": { + "http://registry.gpii.net/common/fontSize": 16, + "http://registry.gpii.net/common/screenReaderTTS/enabled": true, + "http://registry.gpii.net/common/magnification/enabled": true, + "http://registry.gpii.net/common/magnification": 1 + } + } + } + } + }, + expected: { + "gpii-default": { + "applications": { + "fake.magnifier3": { + "active": false, + "settings": { + "http://registry.gpii.net/common/fontSize": 16, + "http://registry.gpii.net/common/screenReaderTTS/enabled": true, + "http://registry.gpii.net/common/magnification/enabled": false, + "http://registry.gpii.net/common/magnification": 1 + } + } + } + } + } + }, { + name: "application scoped 'enabled' term in updated preferences, but for other application (i.e. no 'active' change)", + preferences: { + "contexts": { + "gpii-default": { + "name": "Default preferences", + "preferences": { + "http://registry.gpii.net/applications/fake.magnifier2": { + "http://registry.gpii.net/common/magnification/enabled": true + } + } + } + } + }, + inferredConfiguration: { + "gpii-default": { + "applications": { + "fake.magnifier2": { + "active": false, + "settings": { + "http://registry.gpii.net/common/magnification/enabled": false, + "http://registry.gpii.net/common/magnification": 1 + } + }, + "fake.magnifier3": { + "active": false, + "settings": { + "http://registry.gpii.net/common/magnification/enabled": false, + "http://registry.gpii.net/common/magnification": 1 + } + } + } + } + }, + expected: { + "gpii-default": { + "applications": { + "fake.magnifier2": { + "active": false, + "settings": { + "http://registry.gpii.net/common/magnification/enabled": true, + "http://registry.gpii.net/common/magnification": 1 + } + }, + "fake.magnifier3": { + "active": false, + "settings": { + "http://registry.gpii.net/common/magnification/enabled": false, "http://registry.gpii.net/common/magnification": 1 } } @@ -1003,7 +1051,8 @@ var fluid = fluid || require("infusion"), gpii.tests.matchMakerUtilities.updateInferredConfiguration = function () { jqUnit.module("Tests for updateInferredConfiguration"); fluid.each(gpii.tests.matchMakerUtilities.updateInferredConfigurationTestDefs, function (testDef) { - var result = gpii.matchMakerFramework.utils.updateInferredConfiguration(testDef.preferences, testDef.inferredConfiguration); + var result = gpii.matchMakerFramework.utils.updateInferredConfiguration(testDef.preferences, testDef.inferredConfiguration, + gpii.tests.matchMakerUtilities.updateInferredConfigurationSolutionRegistryEntries); jqUnit.assertDeepEq(testDef.name, testDef.expected, result); }); }; @@ -1012,15 +1061,15 @@ var fluid = fluid || require("infusion"), gpii.tests.matchMakerUtilities.getLeastLiveness.solutions = { "fakemag1": { + "capabilities": [ + "http://registry\\.gpii\\.net/common/magnification/enabled" + ], "settingsHandlers": { "configuration": { "type": "gpii.settingsHandlers.JSONSettingsHandler", "options": { "filename": "/tmp/fakemag1.settings.json" }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/magnifierEnabled" - ], "capabilitiesTransformations": { "magnification": "http://registry\\.gpii\\.net/common/magnification" }, @@ -1029,15 +1078,15 @@ var fluid = fluid || require("infusion"), } }, "fakemag2": { + "capabilities": [ + "http://registry\\.gpii\\.net/common/magnification/enabled" + ], "settingsHandlers": { "configuration": { "type": "gpii.settingsHandlers.JSONSettingsHandler", "options": { "filename": "/tmp/fakemag2.settings.json" }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/magnifierEnabled" - ], "capabilitiesTransformations": { "magnification": "http://registry\\.gpii\\.net/common/magnification", "invert": "http://registry\\.gpii\\.net/common/invertColours" @@ -1047,15 +1096,15 @@ var fluid = fluid || require("infusion"), } }, "fakescreenreader1": { + "capabilities": [ + "http://registry\\.gpii\\.net/common/screenReaderTTS/enabled" + ], "settingsHandlers": { "configuration": { "type": "gpii.settingsHandlers.JSONSettingsHandler", "options": { "filename": "/tmp/fakescreenreader1.json" }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/screenReaderTTSEnabled" - ], "capabilitiesTransformations": { "rate": "http://registry\\.gpii\\.net/common/speechRate" }, @@ -1066,9 +1115,6 @@ var fluid = fluid || require("infusion"), "options": { "filename": "/tmp/fakescreenreader1.json" }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/screenReaderTTSEnabled" - ], "capabilitiesTransformations": { "pitch": "http://registry\\.gpii\\.net/common/pitch", "volumeTTS": "http://registry\\.gpii\\.net/common/volumeTTS", @@ -1083,12 +1129,12 @@ var fluid = fluid || require("infusion"), gpii.tests.matchMakerUtilities.getLeastLiveness.testData = [ { name: "Basic with single solution", - term: "http://registry.gpii.net/common/magnifierEnabled", + term: "http://registry.gpii.net/common/magnification", solutions: fluid.filterKeys(gpii.tests.matchMakerUtilities.getLeastLiveness.solutions, ["fakemag1"]), expected: "live" }, { name: "Term present in multiple solutions, least lively wins", - term: "http://registry.gpii.net/common/magnifierEnabled", + term: "http://registry.gpii.net/common/magnification", solutions: fluid.filterKeys(gpii.tests.matchMakerUtilities.getLeastLiveness.solutions, ["fakemag1", "fakemag2"]), expected: "liveRestart" }, { @@ -1101,6 +1147,11 @@ var fluid = fluid || require("infusion"), term: "http://registry.gpii.net/common/pitch", solutions: fluid.filterKeys(gpii.tests.matchMakerUtilities.getLeastLiveness.solutions, [ "fakescreenreader1"]), expected: "manualRestart" + }, { + name: "No terms provided", + term: undefined, + solutions: fluid.filterKeys(gpii.tests.matchMakerUtilities.getLeastLiveness.solutions, [ "fakescreenreader1"]), + expected: "OSRestart" } ]; @@ -1108,13 +1159,117 @@ var fluid = fluid || require("infusion"), gpii.tests.matchMakerUtilities.getLeastLiveness.tests = function () { jqUnit.module("Tests for getLeastLiveness"); fluid.each(gpii.tests.matchMakerUtilities.getLeastLiveness.testData, function (testDef) { - var liveness = gpii.matchMakerFramework.utils.getLeastLiveness(testDef.term, testDef.solutions); + var liveness = gpii.matchMakerFramework.utils.getLeastLiveness(testDef.solutions, testDef.term); jqUnit.assertDeepEq(testDef.name, testDef.expected, liveness); }); }; + gpii.tests.matchMakerUtilities.getActiveValueFromEnabledTermsData = [ + { + name: "no enabled terms in users' NP set", + args: { + specialPreferences: {}, + specialCapabilities: [ + "http://registry\\.gpii\\.net/common/magnification/enabled" + ], + solution: { + capabilities: [ + "http://registry\\.gpii\\.net/common/magnification/enabled" + ] + }, + solutionId: "my.solution" + }, + expected: undefined + }, { + name: "no enabled term in solutions capability", + args: { + specialPreferences: { + "http://registry.gpii.net/common/magnification/enabled": true + }, + specialCapabilities: [ + ], + solution: {}, + solutionId: "my.solution" + }, + expected: undefined + }, { + name: "enabled term in outer level of prefs - 'true' value", + args: { + specialPreferences: { + "http://registry.gpii.net/common/magnification/enabled": true + }, + specialCapabilities: [ + "http://registry\\.gpii\\.net/common/magnification/enabled" + ], + solution: { + capabilities: [ + "http://registry\\.gpii\\.net/common/magnification/enabled" + ] + }, + solutionId: "my.solution" + }, + expected: true + }, { + name: "enabled term in outer level of prefs - 'false' value", + args: { + specialPreferences: { + "http://registry.gpii.net/common/magnification/enabled": false + }, + specialCapabilities: [ + "http://registry\\.gpii\\.net/common/magnification/enabled" + ], + solution: { + capabilities: [ + "http://registry\\.gpii\\.net/common/magnification/enabled" + ] + }, + solutionId: "my.solution" + }, + expected: false + }, { + name: "enabled term in application specific block of prefs", + args: { + specialPreferences: { + "http://registry.gpii.net/applications/my.solution": { + "http://registry.gpii.net/common/magnification/enabled": true + } + }, + specialCapabilities: [ + "http://registry\\.gpii\\.net/common/magnification/enabled" + ], + solution: { + capabilities: [ + "http://registry\\.gpii\\.net/common/magnification/enabled" + ] + }, + solutionId: "my.solution" + }, + expected: true + }, { + name: "enabled capability is from capabilities transformations (not from solution's capabilities block)", + args: { + specialPreferences: { + "http://registry.gpii.net/common/magnification/enabled": true + }, + specialCapabilities: [ + "http://registry\\.gpii\\.net/common/magnification/enabled" + ], + solution: { + capabilities: [] + }, + solutionId: "my.solution" + }, + expected: undefined + } + ]; - + gpii.tests.matchMakerUtilities.getActiveValueFromEnabledTerms = function () { + jqUnit.module("Tests for getActiveValueFromEnabledTerms"); + fluid.each(gpii.tests.matchMakerUtilities.getActiveValueFromEnabledTermsData, function (def) { + var result = gpii.matchMakerFramework.utils.getActiveValueFromEnabledTerms(def.args.specialPreferences, def.args.specialCapabilities, def.args.solution, def.args.solutionId); + jqUnit.assertDeepEq(def.name, def.expected, result); + }); + }; gpii.tests.matchMakerUtilities.runTests = function () { @@ -1124,10 +1279,10 @@ var fluid = fluid || require("infusion"), jqUnit.test("Paths to Skeleton", gpii.tests.matchMakerUtilities.pathsToSkeleton); jqUnit.test("Compute Capabilities From Solution", gpii.tests.matchMakerUtilities.computeAndOntologizeCapabilitiesFromSolution); jqUnit.test("Build Return Payload", gpii.tests.matchMakerUtilities.buildReturnPayload); - jqUnit.test("Merging inferred common terms with preferences", gpii.tests.matchMakerUtilities.testaddInferredCommonTerms); + jqUnit.test("Merging inferred common terms with preferences", gpii.tests.matchMakerUtilities.testaddInferredCommonTermsToPreferences); jqUnit.test("Adding solution type information to payload", gpii.tests.matchMakerUtilities.testAddSolutionTypeInformation); jqUnit.test("Updated Inferred Configuration with preferences", gpii.tests.matchMakerUtilities.updateInferredConfiguration); jqUnit.test("Test getLeastLiveness functionality", gpii.tests.matchMakerUtilities.getLeastLiveness.tests); + jqUnit.test("Test getActiveValueFromEnabledTerms", gpii.tests.matchMakerUtilities.getActiveValueFromEnabledTerms); }; - })(); diff --git a/gpii/node_modules/ontologyHandler/src/ontologyHandler.js b/gpii/node_modules/ontologyHandler/src/ontologyHandler.js index a947ac3b8..e80f2aee9 100644 --- a/gpii/node_modules/ontologyHandler/src/ontologyHandler.js +++ b/gpii/node_modules/ontologyHandler/src/ontologyHandler.js @@ -405,7 +405,7 @@ URLs - this aspect is taken care of in the preferences server component. var togo = []; fluid.each(metadata, function (entry) { - // if metadata section is application priority, we dont want to have the + // if metadata section is application priority, we don't want to have the // scope ontologized. We want to keep the flat-style application ID if (entry.type === "priority") { togo.push(entry); diff --git a/gpii/node_modules/preferencesServer/test/data/np_ISO24751Only_singleContext.json b/gpii/node_modules/preferencesServer/test/data/np_ISO24751Only_singleContext.json index f352244b4..a47a4b6be 100644 --- a/gpii/node_modules/preferencesServer/test/data/np_ISO24751Only_singleContext.json +++ b/gpii/node_modules/preferencesServer/test/data/np_ISO24751Only_singleContext.json @@ -11,7 +11,7 @@ "-provisional-initDelay": 0.120, "cursorSpeed": 0.850, "cursorAcceleration": 0.800, - "-provisional-mouseEmulationEnabled": true + "-provisional-mouseEmulation/enabled": true } }, "unknown": true, diff --git a/gpii/node_modules/preferencesServer/test/data/np_ISO24751Only_singleContext_wildcardMetadata.json b/gpii/node_modules/preferencesServer/test/data/np_ISO24751Only_singleContext_wildcardMetadata.json index ed460b7eb..54817706f 100644 --- a/gpii/node_modules/preferencesServer/test/data/np_ISO24751Only_singleContext_wildcardMetadata.json +++ b/gpii/node_modules/preferencesServer/test/data/np_ISO24751Only_singleContext_wildcardMetadata.json @@ -11,7 +11,7 @@ "-provisional-initDelay": 0.120, "cursorSpeed": 0.850, "cursorAcceleration": 0.800, - "-provisional-mouseEmulationEnabled": true + "-provisional-mouseEmulation/enabled": true } }, "unknown": true, diff --git a/gpii/node_modules/preferencesServer/test/data/np_flatOnly_multiContext.json b/gpii/node_modules/preferencesServer/test/data/np_flatOnly_multiContext.json index 3edcc5389..505296ae6 100644 --- a/gpii/node_modules/preferencesServer/test/data/np_flatOnly_multiContext.json +++ b/gpii/node_modules/preferencesServer/test/data/np_flatOnly_multiContext.json @@ -6,7 +6,7 @@ "name": "Default preferences", "preferences": { "http://registry.gpii.net/common/cursorAcceleration": 0.800, - "http://registry.gpii.net/common/mouseEmulationEnabled": true, + "http://registry.gpii.net/common/mouseEmulation/enabled": true, "http://registry.gpii.net/common/unknown": true, "http://registry.gpii.net/applications/org.alsa-project": { "volume": 14, diff --git a/gpii/node_modules/preferencesServer/test/data/np_flatOnly_singleContext.json b/gpii/node_modules/preferencesServer/test/data/np_flatOnly_singleContext.json index f48ad31c3..33b1a2b0f 100644 --- a/gpii/node_modules/preferencesServer/test/data/np_flatOnly_singleContext.json +++ b/gpii/node_modules/preferencesServer/test/data/np_flatOnly_singleContext.json @@ -5,11 +5,11 @@ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/onScreenKeyboardEnabled": true , + "http://registry.gpii.net/common/onScreenKeyboard/enabled": true , "http://registry.gpii.net/common/initDelay": 0.120 , "http://registry.gpii.net/common/cursorSpeed": 0.850 , "http://registry.gpii.net/common/cursorAcceleration": 0.800 , - "http://registry.gpii.net/common/mouseEmulationEnabled": true , + "http://registry.gpii.net/common/mouseEmulation/enabled": true , "http://registry.gpii.net/common/unknown": true , "http://registry.gpii.net/applications/org.alsa-project": { "volume": 14, diff --git a/gpii/node_modules/preferencesServer/test/data/np_mixed_multiContext.json b/gpii/node_modules/preferencesServer/test/data/np_mixed_multiContext.json index 42a76f6a6..6f28d055c 100644 --- a/gpii/node_modules/preferencesServer/test/data/np_mixed_multiContext.json +++ b/gpii/node_modules/preferencesServer/test/data/np_mixed_multiContext.json @@ -8,7 +8,7 @@ "http://registry.gpii.net/common/initDelay": 0.120, "http://registry.gpii.net/common/cursorSpeed": 0.850, "http://registry.gpii.net/common/cursorAcceleration": 0.800, - "http://registry.gpii.net/common/mouseEmulationEnabled": true, + "http://registry.gpii.net/common/mouseEmulation/enabled": true, "http://registry.gpii.net/common/flatOnly": true, "http://registry.gpii.net/applications/org.alsa-project": { "volume": 14, diff --git a/gpii/node_modules/preferencesServer/test/data/np_mixed_singleContext.json b/gpii/node_modules/preferencesServer/test/data/np_mixed_singleContext.json index 5947b1159..780afde23 100644 --- a/gpii/node_modules/preferencesServer/test/data/np_mixed_singleContext.json +++ b/gpii/node_modules/preferencesServer/test/data/np_mixed_singleContext.json @@ -5,11 +5,11 @@ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/onScreenKeyboardEnabled": true , + "http://registry.gpii.net/common/onScreenKeyboard/enabled": true , "http://registry.gpii.net/common/initDelay": 0.120 , "http://registry.gpii.net/common/cursorSpeed": 0.850 , "http://registry.gpii.net/common/cursorAcceleration": 0.800 , - "http://registry.gpii.net/common/mouseEmulationEnabled": true , + "http://registry.gpii.net/common/mouseEmulation/enabled": true , "http://registry.gpii.net/common/flatOnly": true, "http://registry.gpii.net/applications/org.alsa-project": { "volume": 14 diff --git a/gpii/node_modules/preferencesServer/test/data/np_tiny.json b/gpii/node_modules/preferencesServer/test/data/np_tiny.json index 692810819..c40679ca3 100644 --- a/gpii/node_modules/preferencesServer/test/data/np_tiny.json +++ b/gpii/node_modules/preferencesServer/test/data/np_tiny.json @@ -5,7 +5,7 @@ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/onScreenKeyboardEnabled": true + "http://registry.gpii.net/common/onScreenKeyboard/enabled": true }, "metadata": [] } diff --git a/gpii/node_modules/preferencesServer/test/preferencesServerTests.js b/gpii/node_modules/preferencesServer/test/preferencesServerTests.js index fffcbe30f..7dd94d969 100644 --- a/gpii/node_modules/preferencesServer/test/preferencesServerTests.js +++ b/gpii/node_modules/preferencesServer/test/preferencesServerTests.js @@ -148,11 +148,11 @@ gpii.tests.preferencesServer.get.fixtures = [ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/onScreenKeyboardEnabled": true, + "http://registry.gpii.net/common/onScreenKeyboard/enabled": true, "http://registry.gpii.net/common/initDelay": 0.120, "http://registry.gpii.net/common/cursorSpeed": 0.850, "http://registry.gpii.net/common/cursorAcceleration": 0.800, - "http://registry.gpii.net/common/mouseEmulationEnabled": true, + "http://registry.gpii.net/common/mouseEmulation/enabled": true, "http://registry.gpii.net/common/unknown": true, "http://registry.gpii.net/applications/org.alsa-project": { "volume": 14, @@ -186,11 +186,11 @@ gpii.tests.preferencesServer.get.fixtures = [ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/onScreenKeyboardEnabled": true, + "http://registry.gpii.net/common/onScreenKeyboard/enabled": true, "http://registry.gpii.net/common/initDelay": 0.120, "http://registry.gpii.net/common/cursorSpeed": 0.850, "http://registry.gpii.net/common/cursorAcceleration": 0.800, - "http://registry.gpii.net/common/mouseEmulationEnabled": true, + "http://registry.gpii.net/common/mouseEmulation/enabled": true, "http://registry.gpii.net/common/unknown": true, "http://registry.gpii.net/applications/org.alsa-project": { "volume": 14, @@ -224,11 +224,11 @@ gpii.tests.preferencesServer.get.fixtures = [ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/onScreenKeyboardEnabled": true, + "http://registry.gpii.net/common/onScreenKeyboard/enabled": true, "http://registry.gpii.net/common/initDelay": 0.120, "http://registry.gpii.net/common/cursorSpeed": 0.850, "http://registry.gpii.net/common/cursorAcceleration": 0.800, - "http://registry.gpii.net/common/mouseEmulationEnabled": true, + "http://registry.gpii.net/common/mouseEmulation/enabled": true, "http://registry.gpii.net/applications/org.alsa-project": { "volume": 14, "pitch": 100 @@ -264,7 +264,7 @@ gpii.tests.preferencesServer.get.fixtures = [ "cursorSpeed": 0.85, "cursorAcceleration": 0.8, "-provisional-initDelay": 0.12, - "-provisional-mouseEmulationEnabled": true + "-provisional-mouseEmulation/enabled": true } }, "applications": { @@ -307,7 +307,7 @@ gpii.tests.preferencesServer.get.fixtures = [ "name": "Default preferences", "preferences": { "http://registry.gpii.net/common/cursorAcceleration": 0.800, - "http://registry.gpii.net/common/mouseEmulationEnabled": true, + "http://registry.gpii.net/common/mouseEmulation/enabled": true, "http://registry.gpii.net/common/unknown": true, "http://registry.gpii.net/applications/org.alsa-project": { "volume": 14, @@ -360,7 +360,7 @@ gpii.tests.preferencesServer.get.fixtures = [ "control": { "mouseEmulation": { "cursorAcceleration": 0.8, - "-provisional-mouseEmulationEnabled": true + "-provisional-mouseEmulation/enabled": true } }, "applications": { @@ -420,11 +420,11 @@ gpii.tests.preferencesServer.get.fixtures = [ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/onScreenKeyboardEnabled": true, + "http://registry.gpii.net/common/onScreenKeyboard/enabled": true, "http://registry.gpii.net/common/initDelay": 0.120, "http://registry.gpii.net/common/cursorSpeed": 0.850, "http://registry.gpii.net/common/cursorAcceleration": 0.800, - "http://registry.gpii.net/common/mouseEmulationEnabled": true, + "http://registry.gpii.net/common/mouseEmulation/enabled": true, "http://registry.gpii.net/common/flatOnly": true, "http://registry.gpii.net/common/fontSize": 24, "http://registry.gpii.net/applications/org.alsa-project": { @@ -457,9 +457,9 @@ gpii.tests.preferencesServer.get.fixtures = [ "http://registry.gpii.net/common/initDelay": 0.120, "http://registry.gpii.net/common/cursorSpeed": 0.850, "http://registry.gpii.net/common/cursorAcceleration": 0.800, - "http://registry.gpii.net/common/mouseEmulationEnabled": true, + "http://registry.gpii.net/common/mouseEmulation/enabled": true, "http://registry.gpii.net/common/flatOnly": true, - "http://registry.gpii.net/common/onScreenKeyboardEnabled": true, + "http://registry.gpii.net/common/onScreenKeyboard/enabled": true, "http://registry.gpii.net/applications/org.alsa-project": { "volume": 14, "pitch": 100 @@ -521,7 +521,7 @@ gpii.tests.preferencesServer.get.fixtures = [ "cursorSpeed": 0.85, "cursorAcceleration": 0.8, "-provisional-initDelay": 0.12, - "-provisional-mouseEmulationEnabled": true + "-provisional-mouseEmulation/enabled": true } }, "applications": { @@ -586,42 +586,44 @@ gpii.tests.preferencesServer.get.fixtures = [ userToken: "np_ISO24751Only_singleContext_wildcardMetadata", url: "%userToken?view=flat", expected: { - "name": "ISO24751 set", "contexts": { "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/initDelay": 0.120, - "http://registry.gpii.net/common/cursorSpeed": 0.850, - "http://registry.gpii.net/common/cursorAcceleration": 0.800, - "http://registry.gpii.net/common/mouseEmulationEnabled": true, - "http://registry.gpii.net/common/onScreenKeyboardEnabled": true, + "http://registry.gpii.net/common/initDelay": 0.12, + "http://registry.gpii.net/common/cursorSpeed": 0.85, + "http://registry.gpii.net/common/cursorAcceleration": 0.8, + "http://registry.gpii.net/common/mouseEmulation/enabled": true, "http://registry.gpii.net/applications/org.alsa-project": { "volume": 14, "pitch": 100 - } + }, + "http://registry.gpii.net/common/onScreenKeyboard/enabled": true }, - "metadata": [{ - "type": "provenance", - "scope": [ - "http://registry\\.gpii\\.net/common/initDelay", - "http://registry\\.gpii\\.net/common/stickyKeys", - "http://registry\\.gpii\\.net/common/cursorSpeed", - "http://registry\\.gpii\\.net/common/speechControl", - "http://registry\\.gpii\\.net/common/hapticFeedback", - "http://registry\\.gpii\\.net/common/slowKeysEnabled", - "http://registry\\.gpii\\.net/common/debounceEnabled", - "http://registry\\.gpii\\.net/common/tableOfContents", - "http://registry\\.gpii\\.net/common/slowKeysInterval", - "http://registry\\.gpii\\.net/common/debounceInterval", - "http://registry\\.gpii\\.net/common/cursorAcceleration", - "http://registry\\.gpii\\.net/common/mouseEmulationEnabled", - "http://registry\\.gpii\\.net/common/onScreenKeyboardEnabled" - ], - "source": "snapshotter" - }] + "metadata": [ + { + "type": "provenance", + "scope": [ + "http://registry\\.gpii\\.net/common/initDelay", + "http://registry\\.gpii\\.net/common/stickyKeys", + "http://registry\\.gpii\\.net/common/cursorSpeed", + "http://registry\\.gpii\\.net/common/speechControl", + "http://registry\\.gpii\\.net/common/hapticFeedback", + "http://registry\\.gpii\\.net/common/tableOfContents", + "http://registry\\.gpii\\.net/common/slowKeysInterval", + "http://registry\\.gpii\\.net/common/slowKeys/enabled", + "http://registry\\.gpii\\.net/common/debounce/enabled", + "http://registry\\.gpii\\.net/common/debounceInterval", + "http://registry\\.gpii\\.net/common/cursorAcceleration", + "http://registry\\.gpii\\.net/common/mouseEmulation/enabled", + "http://registry\\.gpii\\.net/common/onScreenKeyboard/enabled" + ], + "source": "snapshotter" + } + ] } }, + "name": "ISO24751 set", "metadata": [ { "type": "doNotShare", @@ -641,11 +643,11 @@ gpii.tests.preferencesServer.get.fixtures = [ "http://registry\\.gpii\\.net/common/foregroundColor", "http://registry\\.gpii\\.net/common/backgroundColor", "http://registry\\.gpii\\.net/common/fontFaceFontName", - "http://registry\\.gpii\\.net/common/magnifierEnabled", "http://registry\\.gpii\\.net/common/magnifierPosition", "http://registry\\.gpii\\.net/common/highContrastTheme", - "http://registry\\.gpii\\.net/common/inputsLargerEnabled", - "http://registry\\.gpii\\.net/common/highContrastEnabled", + "http://registry\\.gpii\\.net/common/inputsLarger/enabled", + "http://registry\\.gpii\\.net/common/highContrast/enabled", + "http://registry\\.gpii\\.net/common/magnification/enabled", "http://registry\\.gpii\\.net/common/fontFaceGenericFontFace" ] } @@ -708,11 +710,11 @@ gpii.tests.preferencesServer.post.fixtures = [ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/onScreenKeyboardEnabled": true, + "http://registry.gpii.net/common/onScreenKeyboard/enabled": true, "http://registry.gpii.net/common/initDelay": 0.120, "http://registry.gpii.net/common/cursorSpeed": 0.850, "http://registry.gpii.net/common/cursorAcceleration": 0.800, - "http://registry.gpii.net/common/mouseEmulationEnabled": true, + "http://registry.gpii.net/common/mouseEmulation/enabled": true, "http://registry.gpii.net/common/unknown": true, "http://registry.gpii.net/applications/org.alsa-project": { "volume": 14, @@ -737,11 +739,11 @@ gpii.tests.preferencesServer.post.fixtures = [ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/onScreenKeyboardEnabled": true, + "http://registry.gpii.net/common/onScreenKeyboard/enabled": true, "http://registry.gpii.net/common/initDelay": 0.120, "http://registry.gpii.net/common/cursorSpeed": 0.850, "http://registry.gpii.net/common/cursorAcceleration": 0.800, - "http://registry.gpii.net/common/mouseEmulationEnabled": true, + "http://registry.gpii.net/common/mouseEmulation/enabled": true, "http://registry.gpii.net/common/unknown": true, "http://registry.gpii.net/applications/org.alsa-project": { "volume": 14, @@ -820,7 +822,7 @@ gpii.tests.preferencesServer.put.copyNPSet = function (toToken, fromToken) { if (!toToken) { return; } - if (fromToken === undefined) { // if fromToken is undefined, it means we dont want to copy anything + if (fromToken === undefined) { // if fromToken is undefined, it means we don't want to copy anything return; } var rawPrefs = fs.readFileSync(__dirname + "/data/" + fromToken + ".json"); @@ -851,7 +853,7 @@ gpii.tests.preferencesServer.put.fixtures = [ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/onScreenKeyboardEnabled": false + "http://registry.gpii.net/common/onScreenKeyboard/enabled": false }, "metadata": [ { @@ -874,7 +876,7 @@ gpii.tests.preferencesServer.put.fixtures = [ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/onScreenKeyboardEnabled": false + "http://registry.gpii.net/common/onScreenKeyboard/enabled": false }, "metadata": [ { @@ -959,10 +961,10 @@ gpii.tests.preferencesServer.put.fixtures = [ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/onScreenKeyboardEnabled": true, + "http://registry.gpii.net/common/onScreenKeyboard/enabled": true, "http://registry.gpii.net/common/initDelay": 0.120, "http://registry.gpii.net/common/cursorAcceleration": 0.800, - "http://registry.gpii.net/common/mouseEmulationEnabled": true, + "http://registry.gpii.net/common/mouseEmulation/enabled": true, "http://registry.gpii.net/common/flatOnly": true, "http://registry.gpii.net/applications/org.alsa-project": { "volume": 14 @@ -1027,11 +1029,11 @@ gpii.tests.preferencesServer.put.fixtures = [ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/onScreenKeyboardEnabled": true, + "http://registry.gpii.net/common/onScreenKeyboard/enabled": true, "http://registry.gpii.net/common/initDelay": 0.120, "http://registry.gpii.net/common/cursorSpeed": 0.850, "http://registry.gpii.net/common/cursorAcceleration": 0.800, - "http://registry.gpii.net/common/mouseEmulationEnabled": true, + "http://registry.gpii.net/common/mouseEmulation/enabled": true, "http://registry.gpii.net/common/flatOnly": true, "http://registry.gpii.net/applications/org.alsa-project": { "volume": 14 @@ -1080,7 +1082,7 @@ gpii.tests.preferencesServer.put.fixtures = [ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/onScreenKeyboardEnabled": true + "http://registry.gpii.net/common/onScreenKeyboard/enabled": true } } } @@ -1091,7 +1093,7 @@ gpii.tests.preferencesServer.put.fixtures = [ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/onScreenKeyboardEnabled": true + "http://registry.gpii.net/common/onScreenKeyboard/enabled": true } } } @@ -1128,7 +1130,7 @@ gpii.tests.preferencesServer.put.fixtures = [ "http://registry.gpii.net/common/initDelay": 0.120, "http://registry.gpii.net/common/cursorSpeed": 0.850, "http://registry.gpii.net/common/cursorAcceleration": 0.800, - "http://registry.gpii.net/common/mouseEmulationEnabled": true, + "http://registry.gpii.net/common/mouseEmulation/enabled": true, "http://registry.gpii.net/common/unknown": true, "http://registry.gpii.net/applications/org.alsa-project": { "volume": 14, diff --git a/gpii/node_modules/processReporter/README.md b/gpii/node_modules/processReporter/README.md index d305fa449..0370f4e82 100644 --- a/gpii/node_modules/processReporter/README.md +++ b/gpii/node_modules/processReporter/README.md @@ -1,12 +1,16 @@ Process Reporter === +<<<<<<< HEAD +The Process Reporter uses the information stored in the `isRunning` block of a solutions registry entry to decide whether a solution is running. For example, the `isRunning` block for the Linux screen reader Orca (the solution entry `org.gnome.orca`) is as follows: +======= A fluid component that can be used to acquire information about the processes associated with a GPII solution. In particular, it can determine the running status of a solution. ### Process Reporter API Given a solutions registry entry, the Process Reporter uses the information stored in the `isRunning` block to determine whether a solution has been launched and is currently running. For example, the `isRunning` block for the Orca screen reader (the solution entry `org.gnome.orca`) is as follows: + ``` "isRunning": [ { @@ -25,6 +29,7 @@ The Process Reporter's invoker `handleIsRunning(entry)` uses the `type` property If the solutions registry entry does not have an `isRunning` block, then its run-state is not defined, and `handleIsRunning()` returns `undefined`. Most solutions run-state is based on a corresponding entry in the underlying OS's process or tasklist table. For example, the Linux/GNOME solution `org.gnome.orca` is running if the `orca` screen reader process is running. Similarly, on Windows, `org.nvda-project` is running if there is an `nvda` process in the tasklist. +>>>>>>> 701e0260df860ee1339fc8bb0b686ecf78c97c12 Some solutions, however, are not strictly process-oriented. An example is the GNOME Shell screen magnifier (solution `org.gnome.desktop.a11y.magnifier`). The magnifier is not a separate process, but is built into GNOME Shell. The magnifier is running if (1) the `gnome-shell` process is running and (2) the `org.gnome.desktop.a11y.applications screen-magnifier-enabled` GSetting is `true`. diff --git a/gpii/node_modules/processReporter/index.js b/gpii/node_modules/processReporter/index.js index 5c534537c..2839dbc9a 100644 --- a/gpii/node_modules/processReporter/index.js +++ b/gpii/node_modules/processReporter/index.js @@ -6,5 +6,3 @@ fluid.module.register("processReporter", __dirname, require); require("./src/processesBridge.js"); require("./src/ProcessReporter.js"); - - diff --git a/gpii/node_modules/processReporter/src/ProcessReporter.js b/gpii/node_modules/processReporter/src/ProcessReporter.js index 06182adf3..2ad3a4dac 100644 --- a/gpii/node_modules/processReporter/src/ProcessReporter.js +++ b/gpii/node_modules/processReporter/src/ProcessReporter.js @@ -54,7 +54,7 @@ gpii.processReporter.neverRunning = function () { }; /** - * Runs the 'isRunning' entries of the 'entry' argument. If no 'isRunning' block is not present + * Runs the 'isRunning' entries of the 'entry' argument. If no 'isRunning' block is present * undefined is returned */ gpii.processReporter.handleIsRunning = function (entry) { diff --git a/gpii/node_modules/rawPreferencesServer/test/RawPreferencesTest.js b/gpii/node_modules/rawPreferencesServer/test/RawPreferencesTest.js index c07aba064..f4ac6de20 100644 --- a/gpii/node_modules/rawPreferencesServer/test/RawPreferencesTest.js +++ b/gpii/node_modules/rawPreferencesServer/test/RawPreferencesTest.js @@ -169,11 +169,11 @@ gpii.tests.rawPreferencesServer.post.fixtures = [ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/onScreenKeyboardEnabled": [{ "value": true }], + "http://registry.gpii.net/common/onScreenKeyboard/enabled": [{ "value": true }], "http://registry.gpii.net/common/initDelay": [{ "value": 0.120 }], "http://registry.gpii.net/common/cursorSpeed": [{ "value": 0.850 }], "http://registry.gpii.net/common/cursorAcceleration": [{ "value": 0.800 }], - "http://registry.gpii.net/common/mouseEmulationEnabled": [{ "value": true }], + "http://registry.gpii.net/common/mouseEmulation/enabled": [{ "value": true }], "http://registry.gpii.net/common/unknown": [{ "value": true }] } } @@ -259,8 +259,8 @@ gpii.tests.rawPreferencesServer.put.fixtures = [ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/onScreenKeyboardEnabled": [{ "value": true }], - "http://registry.gpii.net/common/mouseEmulationEnabled": [{ "value": true }], + "http://registry.gpii.net/common/onScreenKeyboard/enabled": [{ "value": true }], + "http://registry.gpii.net/common/mouseEmulation/enabled": [{ "value": true }], "http://registry.gpii.net/common/unknown": [{ "value": true }] } } @@ -277,11 +277,11 @@ gpii.tests.rawPreferencesServer.put.fixtures = [ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/onScreenKeyboardEnabled": [{ "value": true }], + "http://registry.gpii.net/common/onScreenKeyboard/enabled": [{ "value": true }], "http://registry.gpii.net/common/initDelay": [{ "value": 0.120 }], "http://registry.gpii.net/common/cursorSpeed": [{ "value": 0.850 }], "http://registry.gpii.net/common/cursorAcceleration": [{ "value": 0.800 }], - "http://registry.gpii.net/common/mouseEmulationEnabled": [{ "value": true }], + "http://registry.gpii.net/common/mouseEmulation/enabled": [{ "value": true }], "http://registry.gpii.net/common/unknown": [{ "value": true }] } } diff --git a/gpii/node_modules/settingsHandlers/index.js b/gpii/node_modules/settingsHandlers/index.js index 9b3e1ebe1..0d0199a92 100644 --- a/gpii/node_modules/settingsHandlers/index.js +++ b/gpii/node_modules/settingsHandlers/index.js @@ -9,3 +9,4 @@ require("./src/XMLSettingsHandler.js"); require("./src/JSONSettingsHandler.js"); require("./src/WebSocketsSettingsHandler.js"); require("./src/NoSettingsHandler.js"); +require("./src/LaunchHandlers.js"); diff --git a/gpii/node_modules/settingsHandlers/src/LaunchHandlers.js b/gpii/node_modules/settingsHandlers/src/LaunchHandlers.js new file mode 100644 index 000000000..aab4720b1 --- /dev/null +++ b/gpii/node_modules/settingsHandlers/src/LaunchHandlers.js @@ -0,0 +1,79 @@ +/* + * GPII Launch Handlers + * + * Copyright 2017 Raising the Floor - International + * + * Licensed under the New BSD license. You may not use this file except in + * compliance with this License. + * + * You may obtain a copy of the License at + * https://github.com/GPII/universal/blob/master/LICENSE.txt + */ + +"use strict"; + +var fluid = fluid || require("infusion"), + gpii = fluid.registerNamespace("gpii"); + +/** + * The flexibleHandler is a highly customizable launch handler that is implemented to handle all + * the cases in which a solutions launch-cycle is too complex or specific to efficiently be handled + * in one of the standard launchHandlers. + * + * Besides the normal launch handler options like retryOptions and verifySettings, the flexible handler + * supports three directives: `getState`, `setTrue` and `setFalse`. + * + * `getState`: equals the launchHandlers "get" functionality, and should return a boolean value indicating + * whether the application is running or not. The content of this directive will be sent to the + * processReporters' handleIsRunning function + * `setTrue`: Is run when a "true" value is sent to the launch handler. The content of this block should + * be an array of objects that can be run as graded functions in infusion. The result of runnings these + * blocks should be that the application is running + * `setFalse`: Identical to `setTrue` but is run when a "false" is sent to the launch handler. The result from + * running the blocks in this directive should be that the application is closed/not running. + */ +fluid.registerNamespace("gpii.launchHandlers.flexibleHandler"); + +gpii.launchHandlers.flexibleHandler.set = function (payload) { + return fluid.transform(payload, function (allSettingsBlocks, solutionId) { + return fluid.transform(allSettingsBlocks, function (handlerData) { + // find desire state { running: X } + var desiredState = handlerData.settings.running; + if (desiredState !== true && desiredState !== false) { + fluid.fail("Unable to set the launch state of ", solutionId, " to ", desiredState); + } + + // get current state + var currentState = gpii.launchHandlers.flexibleHandler.executeGetBlock(handlerData.options, solutionId); + + // if not in desired state + if (currentState !== desiredState) { + desiredState === true ? + gpii.launchHandlers.flexibleHandler.executeSetBlock(handlerData, "setTrue") : + gpii.launchHandlers.flexibleHandler.executeSetBlock(handlerData, "setFalse"); + } + + return gpii.settingsHandlers.setSettings(handlerData, { running: currentState }); + }); + }); +}; + +gpii.launchHandlers.flexibleHandler.get = function (payload) { + return fluid.transform(payload, function (allSettingsBlocks, solutionId) { + return fluid.transform(allSettingsBlocks, function (handlerData) { + var currentState = gpii.launchHandlers.flexibleHandler.executeGetBlock(handlerData.options, solutionId); + return { settings: { running: currentState }}; + }); + }); +}; + +gpii.launchHandlers.flexibleHandler.executeSetBlock = function (mainEntry, blockName) { + var setBlocks = fluid.get(mainEntry, [ "options", blockName ]); + fluid.each(fluid.makeArray(setBlocks), function (setBlock) { + fluid.invokeGradedFunction(setBlock.type, setBlock); + }); +}; + +gpii.launchHandlers.flexibleHandler.executeGetBlock = function (options) { + return gpii.processReporter.handleIsRunning({ isRunning: options.getState }); +}; diff --git a/gpii/node_modules/settingsHandlers/src/settingsHandlerUtilities.js b/gpii/node_modules/settingsHandlers/src/settingsHandlerUtilities.js index 50fa0a4d2..8dbc85354 100644 --- a/gpii/node_modules/settingsHandlers/src/settingsHandlerUtilities.js +++ b/gpii/node_modules/settingsHandlers/src/settingsHandlerUtilities.js @@ -55,6 +55,32 @@ gpii.toPromise = function (value) { fluid.registerNamespace("gpii.settingsHandlers"); +/** + * Filters out all the settings from the `settings` argument which are + * not in the `supportedSettings` argument + * + * @param settings {Object} Object in which each key is a setting name that is to be filtered. This + * object will be modified. + * @param supportedSettings {Object} Object in which each key is a setting name that will be filtered by + * @return {Object} the `settings`, filtered by the `supportedSettings` entries, meaning that + * any setting that is not in supportedSettings will not be in the return object. + */ +gpii.settingsHandlers.filterSupportedSettings = function (settings, supportedSettings) { + if (supportedSettings === undefined || settings === undefined) { + return settings; + } else { + var filteredSettings = {}; + // we cant simply use fluid.filterKeys because that wont handle the cases where + // there are 'undefined' values for the keys in handlerSpec.settings + for (var settingName in supportedSettings) { + if (settingName in settings) { + filteredSettings[settingName] = settings[settingName]; + } + } + return filteredSettings; + } +}; + // TODO: These utilities all clearly form part of some wider idiom of "payload handling" without some underpinnings // for which they are rather hard to follow. For example, they could benefit from some form of "JSON type system" // (whether provided via JSON schema or otherwise) in order to provide landmarks within the payloads, as well @@ -72,9 +98,9 @@ fluid.registerNamespace("gpii.settingsHandlers"); * @return The transformed payload-structured value */ gpii.settingsHandlers.transformPayload = function (payload, handler) { - return fluid.transform(payload, function (oneSolution, solutionPath) { + return fluid.transform(payload, function (oneSolution, solutionId) { return fluid.transform(oneSolution, function (oneSetting, settingPath) { - var path = [solutionPath, settingPath]; + var path = [solutionId, settingPath]; return handler(oneSetting, path, oneSolution); }); }); @@ -89,10 +115,14 @@ gpii.settingsHandlers.transformPayload = function (payload, handler) { gpii.settingsHandlers.transformOneSolutionSettings = function (oneSolution, handler, path) { path = path || []; var togo = fluid.censorKeys(oneSolution, "settings"); - togo.settings = fluid.transform(oneSolution.settings, function (oneSetting, settingKey) { + var newSettings = fluid.transform(oneSolution.settings, function (oneSetting, settingKey) { var innerPath = path.concat(["settings", settingKey]); return handler(oneSetting, innerPath, oneSolution); }); + if (newSettings !== undefined) { // ignore undefined settings blocks + togo.settings = newSettings; + } + return togo; }; @@ -109,7 +139,6 @@ gpii.settingsHandlers.transformPayloadSettings = function (payload, handler) { /** Extract just the settings (eliminating "options") from the nested settingsHandler blocks for a full payload (top-level keys are solution ids) * - this is used from gpii.settingsHandlers.comparePayloads and gpii.test.checkConfiguration */ - gpii.settingsHandlers.extractSettingsBlocks = function (payload) { return gpii.settingsHandlers.transformPayload(payload, function (oneSolution) { return fluid.filterKeys(oneSolution, "settings"); @@ -138,16 +167,16 @@ gpii.settingsHandlers.numberify = function (payload) { * @return A promise yielding the combined payload expected from a top-level settings handler - this * will resolve synchronously if the supplied handler function is synchronous ("ZALGO" notwithstanding) **/ - gpii.settingsHandlers.invokeSettingsHandler = function (handler, payload) { var worklist = []; var response = gpii.settingsHandlers.transformPayload(payload, function (element, path) { + var solutionId = path[0]; // first entry of path will always be solution ID // Note shallow copy performed within filterKeys var directLoad = fluid.filterKeys(element, ["settings", "options"]); var others = fluid.censorKeys(element, ["settings", "options"]); worklist.push({ path: path, - result: handler(directLoad), + result: handler(directLoad, solutionId), others: others }); return {}; // construct isomorphic skeleton of response @@ -262,8 +291,43 @@ gpii.settingsHandlers.checkRereadSettings = function (that) { } }; +gpii.settingsHandlers.dispatchSettingsHandler = function (resolvedName, payload, operation, retryOptions) { + return (operation === "get") ? + gpii.settingsHandlers.dispatchSettingsHandlerGet(resolvedName, payload) : + gpii.settingsHandlers.dispatchSettingsHandlerSet(resolvedName, payload, retryOptions); +}; + /** - * Called to invoke settings handlers. Based on the first verifySettings option found in the payload, + * Called to invoke settings handlers' get functionality. + + * Structure of 'payload' argument is: + * { + * "some.app.id": [{ + * "settings": { ... }, + * "options": { + * ... + * } + * }] + * } + * @param resolvedName {String} The resolved "trunk name" of the settings handler to be invoked - e.g. gpii.windows.registrySettingsHandler + * @param payload {Object} The full payload that would be sent to the SET method of the settings handler + * @return a promise that will yield the original payload of the invoked GET method + */ +gpii.settingsHandlers.dispatchSettingsHandlerGet = function (resolvedName, payload) { + // TODO "gpii.lifecycleManager.specToSettingsHandler" is the one responsible for this awkward + // layout of the settings handler payload - all of this infrastructure will have to be updated + // and cleaned up at some point + try { + return gpii.settingsHandlers.invokeGetHandler(resolvedName, payload); + } catch (e) { + fluid.log(fluid.logLevel.WARN, "Error received when dispatching settingsHandler.get " + resolvedName + " with payload ", + payload, ": " + e); + return fluid.promise().reject(e); + } +}; + +/** + * Called to invoke settings handlers' set function. Based on the first verifySettings option found in the payload, * the settingshandler will be invoked with retrying enabled (if true) or without it (false). * Structure of 'payload' argument is: * { @@ -283,7 +347,7 @@ gpii.settingsHandlers.checkRereadSettings = function (that) { * @return a promise that will yield the original payload of the invoked SET method. In the case * that retrying is enabled, a rejection occurs if the GET payloads never match after the end of the nominated retry period */ -gpii.settingsHandlers.dispatchSettingsHandler = function (resolvedName, payload, retryOptions) { +gpii.settingsHandlers.dispatchSettingsHandlerSet = function (resolvedName, payload, retryOptions) { // TODO "gpii.lifecycleManager.specToSettingsHandler" is the one responsible for this awkward // layout of the settings handler payload - all of this infrastructure will have to be updated // and cleaned up at some point @@ -295,12 +359,16 @@ gpii.settingsHandlers.dispatchSettingsHandler = function (resolvedName, payload, gpii.settingsHandlers.invokeRetryingHandler(resolvedName, payload, retryOptions) : gpii.settingsHandlers.invokeSetHandler(resolvedName, payload); } catch (e) { - fluid.log(fluid.logLevel.WARN, "Error received when dispatching settingsHandler " + resolvedName + " with payload ", + fluid.log(fluid.logLevel.WARN, "Error received when dispatching settingsHandler.set " + resolvedName + " with payload ", payload, ": " + e); return fluid.promise().reject(e); } }; +gpii.settingsHandlers.invokeGetHandler = function (resolvedName, payload) { + return gpii.toPromise(fluid.invokeGlobalFunction(resolvedName + ".get", [payload])); +}; + gpii.settingsHandlers.invokeSetHandler = function (resolvedName, payload) { return gpii.toPromise(fluid.invokeGlobalFunction(resolvedName + ".set", [payload])); }; @@ -315,8 +383,12 @@ gpii.settingsHandlers.invokeSetHandler = function (resolvedName, payload) { * that matches, or else a rejection if the GET payloads never match after the end of the nominated retry period */ gpii.settingsHandlers.invokeRetryingHandler = function (resolvedName, payload, retryOptions) { + // solution entry options overwrites any component options on retrying + var solutionIds = fluid.keys(payload); + var solutionRetryOptions = fluid.get(payload, [solutionIds[0], 0, "options", "retryOptions"]); + var mergedRetryOptions = fluid.extend(true, {}, retryOptions, solutionRetryOptions); var that = { - retryOptions: retryOptions, + retryOptions: mergedRetryOptions, retries: 1, payload: payload, resolvedName: resolvedName, diff --git a/gpii/node_modules/settingsHandlers/test/web/html/LaunchHandlerTest.html b/gpii/node_modules/settingsHandlers/test/web/html/LaunchHandlerTest.html new file mode 100644 index 000000000..4e66b8577 --- /dev/null +++ b/gpii/node_modules/settingsHandlers/test/web/html/LaunchHandlerTest.html @@ -0,0 +1,36 @@ + + + + + GPII Launch Handler Tests + + + + + + + + + + + + + + + + + + + + + +

GPII Launch Handlers Tests

+

+
+

+
    + + + + diff --git a/gpii/node_modules/settingsHandlers/test/web/js/LaunchHandlerTests.js b/gpii/node_modules/settingsHandlers/test/web/js/LaunchHandlerTests.js new file mode 100644 index 000000000..9e9c9f6a1 --- /dev/null +++ b/gpii/node_modules/settingsHandlers/test/web/js/LaunchHandlerTests.js @@ -0,0 +1,347 @@ +/* + * Launch Handler Tests + * + * Copyright 2017 Raising the Floor - International + * + * Licensed under the New BSD license. You may not use this file except in + * compliance with this License. + * + * You may obtain a copy of the License at + * https://github.com/GPII/universal/blob/master/LICENSE.txt + */ + +/* global fluid, jqUnit, gpii */ + +"use strict"; + +(function () { + // TODO: Rewrite all these tests into browser-style jqUnit tests, leaving just + // a stub tester here to test filesystem integration + + fluid.registerNamespace("gpii.tests"); + fluid.registerNamespace("gpii.tests.flexibleHandler"); + + + fluid.defaults("gpii.tests.flexibleHandler.assertDirective", { + gradeNames: "fluid.function", + argumentMap: {} + }); + + gpii.tests.flexibleHandler.assertDirective = function () { + jqUnit.assertTrue("Assertion block", true); + }; + + fluid.defaults("gpii.tests.flexibleHandler.failBlock", { + gradeNames: "fluid.function", + argumentMap: {} + }); + + gpii.tests.flexibleHandler.failBlock = function () { + jqUnit.assertTrue("Asserted that this block should not be called", false); + }; + + fluid.defaults("gpii.tests.flexibleHandler.returnTrue", { + gradeNames: "fluid.function", + argumentMap: {} + }); + + gpii.tests.flexibleHandler.returnTrue = function () { + return true; + }; + + fluid.defaults("gpii.tests.flexibleHandler.returnFalse", { + gradeNames: "fluid.function", + argumentMap: {} + }); + + gpii.tests.flexibleHandler.returnFalse = function () { + return false; + }; + + gpii.tests.flexibleHandler.assertBlock = { + "type": "gpii.tests.flexibleHandler.assertDirective" + }; + + gpii.tests.flexibleHandler.reportRunning = { + "type": "gpii.tests.flexibleHandler.returnTrue" + }; + + gpii.tests.flexibleHandler.reportNotRunning = { + "type": "gpii.tests.flexibleHandler.returnFalse" + }; + + gpii.tests.flexibleHandler.basicTestDefs = [ + { + description: "Passing true to handler if already running should not execute start block", + expect: 1, + input: { + settings: { + "running": true + }, + options: { + "setTrue": gpii.tests.flexibleHandler.failBlock, + "setFalse": gpii.tests.flexibleHandler.failBlock, + "getState": gpii.tests.flexibleHandler.reportRunning + } + }, + expectedSettings: { + "running": { + "newValue": true, + "oldValue": true + } + } + }, { + description: "Passing false to handler if already not running should not execute stop block", + expect: 1, + input: { + settings: { + "running": false + }, + options: { + "setTrue": gpii.tests.flexibleHandler.failBlock, + "setFalse": gpii.tests.flexibleHandler.failBlock, + "getState": gpii.tests.flexibleHandler.reportNotRunning + } + }, + expectedSettings: { + "running": { + "newValue": false, + "oldValue": false + } + } + }, { + description: "Passing true to handler if solution is not running should execute start block", + expect: 2, + input: { + settings: { + "running": true + }, + options: { + "setTrue": gpii.tests.flexibleHandler.assertBlock, + "setFalse": gpii.tests.flexibleHandler.failBlock, + "getState": gpii.tests.flexibleHandler.reportNotRunning + } + }, + expectedSettings: { + "running": { + "newValue": true, + "oldValue": false + } + } + }, { + description: "Passing false to handler if solution is running should execute stop block", + expect: 2, + input: { + settings: { + "running": false + }, + options: { + "setTrue": gpii.tests.flexibleHandler.failBlock, + "setFalse": gpii.tests.flexibleHandler.assertBlock, + "getState": gpii.tests.flexibleHandler.reportRunning + } + }, + expectedSettings: { + "running": { + "newValue": false, + "oldValue": true + } + } + }, { + description: "Testing for multiple start blocks", + expect: 3, + input: { + settings: { + "running": true + }, + options: { + "setTrue": [ + gpii.tests.flexibleHandler.assertBlock, + gpii.tests.flexibleHandler.assertBlock + ], + "setFalse": gpii.tests.flexibleHandler.failBlock, + "getState": gpii.tests.flexibleHandler.reportNotRunning + } + }, + expectedSettings: { + "running": { + "newValue": true, + "oldValue": false + } + } + }, { + description: "Testing for multiple stop blocks", + expect: 3, + input: { + settings: { + "running": false + }, + options: { + "setTrue": gpii.tests.flexibleHandler.failBlock, + "setFalse": [ + gpii.tests.flexibleHandler.assertBlock, + gpii.tests.flexibleHandler.assertBlock + ], + "getState": gpii.tests.flexibleHandler.reportRunning + } + }, + expectedSettings: { + "running": { + "newValue": false, + "oldValue": true + } + } + } + ]; + + fluid.each(gpii.tests.flexibleHandler.basicTestDefs, function (spec) { + jqUnit.test(spec.description, function () { + jqUnit.expect(spec.expect); + var actual = gpii.launchHandlers.flexibleHandler.set({ + "my.solution1": [ + spec.input + ] + }); + // build expected return payload: + jqUnit.assertDeepEq("Return payload is correct", spec.expectedSettings, actual["my.solution1"][0].settings); + }); + }); + + gpii.tests.flexibleHandler.extraTestDefs = [ + { + description: "Multiple solution entries sent - both should attempt to start", + expect: 3, + input: { + "my.solution1": [ + { + settings: { + "running": true + }, + options: { + "setTrue": gpii.tests.flexibleHandler.assertBlock, + "setFalse": gpii.tests.flexibleHandler.failBlock, + "getState": gpii.tests.flexibleHandler.reportNotRunning + } + } + ], + "my.solution2": [ + { + settings: { + "running": true + }, + options: { + "setTrue": gpii.tests.flexibleHandler.assertBlock, + "setFalse": gpii.tests.flexibleHandler.failBlock, + "getState": gpii.tests.flexibleHandler.reportNotRunning + } + } + ] + }, + expected: { + "my.solution1": [ + { + settings: { + running: { + "newValue": true, + "oldValue": false + } + }, + options: { + "setTrue": gpii.tests.flexibleHandler.assertBlock, + "setFalse": gpii.tests.flexibleHandler.failBlock, + "getState": gpii.tests.flexibleHandler.reportNotRunning + } + } + ], + "my.solution2": [ + { + settings: { + running: { + "newValue": true, + "oldValue": false + } + }, + options: { + "setTrue": gpii.tests.flexibleHandler.assertBlock, + "setFalse": gpii.tests.flexibleHandler.failBlock, + "getState": gpii.tests.flexibleHandler.reportNotRunning + } + } + ] + } + }, + { + description: "Multiple solution entries sent - different actions", + expect: 2, + input: { + "my.solution1": [ + { + settings: { + "running": false + }, + options: { + "setTrue": gpii.tests.flexibleHandler.failBlock, + "setFalse": gpii.tests.flexibleHandler.assertBlock, + "getState": gpii.tests.flexibleHandler.reportRunning + } + } + ], + "my.solution2": [ + { + settings: { + "running": false + }, + options: { + "setTrue": gpii.tests.flexibleHandler.failBlock, + "setFalse": gpii.tests.flexibleHandler.failBlock, + "getState": gpii.tests.flexibleHandler.reportNotRunning + } + } + ] + }, + expected: { + "my.solution1": [ + { + settings: { + running: { + "newValue": false, + "oldValue": true + } + }, + options: { + "setTrue": gpii.tests.flexibleHandler.failBlock, + "setFalse": gpii.tests.flexibleHandler.assertBlock, + "getState": gpii.tests.flexibleHandler.reportRunning + } + } + ], + "my.solution2": [ + { + settings: { + running: { + "newValue": false, + "oldValue": false + } + }, + options: { + "setTrue": gpii.tests.flexibleHandler.failBlock, + "setFalse": gpii.tests.flexibleHandler.failBlock, + "getState": gpii.tests.flexibleHandler.reportNotRunning + } + } + ] + } + } + ]; + + fluid.each(gpii.tests.flexibleHandler.extraTestDefs, function (spec) { + jqUnit.test(spec.description, function () { + jqUnit.expect(spec.expect); + var actual = gpii.launchHandlers.flexibleHandler.set(spec.input); + // build expected return payload: + jqUnit.assertDeepEq("Return payload is correct", spec.expected, actual); + }); + }); + + +})(); diff --git a/gpii/node_modules/settingsHandlers/test/web/js/SettingsHandlerUtilitiesTests.js b/gpii/node_modules/settingsHandlers/test/web/js/SettingsHandlerUtilitiesTests.js index d88a96cbe..d41c32833 100644 --- a/gpii/node_modules/settingsHandlers/test/web/js/SettingsHandlerUtilitiesTests.js +++ b/gpii/node_modules/settingsHandlers/test/web/js/SettingsHandlerUtilitiesTests.js @@ -26,6 +26,67 @@ fluid.registerNamespace("gpii.tests"); fluid.registerNamespace("gpii.tests.settingsHandlersUtilitiesTests"); + gpii.tests.settingsHandlersUtilitiesTests.filterSupportedSettingsSpecs = { + "If supportedSettings is undefined, return settings": { + settings: { + "weirdSetting": "foo" + }, + supportedSettings: undefined, + expected: { + "weirdSetting": "foo" + } + }, + "If settings is undefined, return undefined": { + settings: undefined, + supportedSettings: { + "weirdSetting": {} + }, + expected: undefined + }, + "Filter by supportedSettings": { + settings: { + "weirdSetting": "foo", + "otherSetting": "bar" + }, + supportedSettings: { + "weirdSetting": {} + }, + expected: { + "weirdSetting": "foo" + } + }, + "If supportedSettings directive is present - test no matching": { + settings: { + "weirdSetting": "foo", + "otherSetting": "bar" + }, + supportedSettings: { + "thirdSetting": {} + }, + expected: {} + }, + "Works with `undefined` values for settings (required when restoring)": { + settings: { + "weirdSetting": undefined, + "otherSetting": undefined + }, + supportedSettings: { + "weirdSetting": {} + }, + expected: { + "weirdSetting": undefined + } + } + }; + + jqUnit.test("filterSupportedSettings tests", function () { + fluid.each(gpii.tests.settingsHandlersUtilitiesTests, function (test, name) { + var result = gpii.settingsHandlers.filterSupportedSettings(test.settings, test.supportedSettings); + jqUnit.assertDeepEq(name, test.expected, result); + }); + }); + + jqUnit.test("settingsHandlers.setSettings", function () { // check simple json structure var result = gpii.settingsHandlers.setSettings( diff --git a/gpii/node_modules/testing/src/Mocks.js b/gpii/node_modules/testing/src/Mocks.js index 43dd690b6..99b36b209 100644 --- a/gpii/node_modules/testing/src/Mocks.js +++ b/gpii/node_modules/testing/src/Mocks.js @@ -216,7 +216,8 @@ fluid.defaults("gpii.test.integration.mockSettingsHandler", { }, setImpl: { funcName: "gpii.test.integration.mockSettingsHandler.setImpl", - args: ["{that}", "{arguments}.0"] + args: ["{that}", "{arguments}.0", "{arguments}.1"] + // set payload, solutionId }, get: { funcName: "gpii.test.integration.mockSettingsHandler.get", @@ -224,17 +225,18 @@ fluid.defaults("gpii.test.integration.mockSettingsHandler", { }, getImpl: { funcName: "gpii.test.integration.mockSettingsHandler.getImpl", - args: ["{that}", "{arguments}.0"] + args: ["{that}", "{arguments}.0", "{arguments}.1"] + // get payload, solutionId } } }); -gpii.test.integration.resolveHandlerKey = function (that, payload) { +gpii.test.integration.resolveHandlerKey = function (that, payload, solutionId) { var pathKey = that.options.optionsPathKey; if (typeof(pathKey) === "string") { return fluid.get(payload.options, pathKey); } else if (typeof(pathKey) === "function") { - return pathKey(payload.options); + return pathKey(payload.options, solutionId); } }; @@ -269,9 +271,9 @@ gpii.test.integration.mockSettingsHandler.returnAsyncResponse = function (value, } }; -gpii.test.integration.mockSettingsHandler.setImpl = function (that, payload) { +gpii.test.integration.mockSettingsHandler.setImpl = function (that, payload, solutionId) { var setSettings = function () { - var key = gpii.test.integration.resolveHandlerKey(that, payload); + var key = gpii.test.integration.resolveHandlerKey(that, payload, solutionId); var oldStore = fluid.copy(that.settingsStore[key]) || {}; var store = (that.settingsStore[key] = that.settingsStore[key] || {}); var applySettings = function () { @@ -293,8 +295,8 @@ gpii.test.integration.mockSettingsHandler.set = function (that, payload) { return gpii.settingsHandlers.invokeSettingsHandler(that.setImpl, payload); }; -gpii.test.integration.mockSettingsHandler.getImpl = function (that, payload) { - var key = gpii.test.integration.resolveHandlerKey(that, payload); +gpii.test.integration.mockSettingsHandler.getImpl = function (that, payload, solutionId) { + var key = gpii.test.integration.resolveHandlerKey(that, payload, solutionId); var store = that.settingsStore[key] || {}; var response = fluid.transform(payload.settings, function (value, key) { return store[key]; @@ -313,6 +315,14 @@ gpii.test.integration.registrySettingsHandlerKey = function (options) { return options.hKey + "|" + options.path; }; +gpii.test.integration.flexibleHandlerKey = function (options, solutionId) { + return solutionId + ".flexibleHandler"; +}; + +gpii.test.integration.gsettingsLaunchKey = function (options) { + return options.schema + "|" + options.key; +}; + fluid.defaults("gpii.test.integration.mockSettingsHandlerRegistry", { gradeNames: ["fluid.component"], rootPath: "gpii.test.integration.mockSettingsHandlers", // the global names for mocks will be deposited in here @@ -370,7 +380,11 @@ fluid.defaults("gpii.test.integration.mockSettingsHandlerRegistry.universal", { "gpii.settingsHandlers.JSONSettingsHandler": { optionsPathKey: "filename" }, - "gpii.settingsHandlers.webSockets" : {} + "gpii.launchHandlers.flexibleHandler": { + optionsPathKey: gpii.test.integration.flexibleHandlerKey + }, + "gpii.settingsHandlers.webSockets" : {}, + "gpii.settingsHandlers.noSettings": {} } }); @@ -384,7 +398,10 @@ fluid.defaults("gpii.test.integration.mockSettingsHandlerRegistry.windows", { // delaying: true, optionsPathKey: "setAction" }, - "gpii.windows.displaySettingsHandler": {} + "gpii.windows.displaySettingsHandler": {}, + "gpii.windows.enableRegisteredAT": { + optionsPathKey: "registryName" + } } }); @@ -404,6 +421,9 @@ fluid.defaults("gpii.test.integration.mockSettingsHandlerRegistry.linux", { }, "gpii.xrandr": { optionsPathKey: "NONE" + }, + "gpii.gsettings.launch": { + optionsPathKey: gpii.test.integration.gsettingsLaunchKey } } }); diff --git a/gpii/node_modules/testing/src/Testing.js b/gpii/node_modules/testing/src/Testing.js index 8f123b3f4..f53355467 100644 --- a/gpii/node_modules/testing/src/Testing.js +++ b/gpii/node_modules/testing/src/Testing.js @@ -133,7 +133,7 @@ gpii.test.operateSettings = function (settingsHandlers, nameResolver, method) { var ret = {}; fluid.each(settingsHandlers, function (handlerBlock, handlerID) { var resolvedName = nameResolver ? nameResolver.resolveName(handlerID, "settingsHandler") : handlerID; - var response = fluid.invokeGlobalFunction(resolvedName + "." + method, [handlerBlock]); + var response = gpii.settingsHandlers.dispatchSettingsHandler(resolvedName, handlerBlock, method); ret[handlerID] = response; }); var togo = gpii.test.settleStructure(ret); @@ -143,6 +143,15 @@ gpii.test.operateSettings = function (settingsHandlers, nameResolver, method) { return togo; }; +/** + * Used for settings the initial settings of an application. This is among other used for tests + * where an application needs to be running on user login + */ +gpii.test.setInitialSettingsState = function (settingsHandlers, nameResolver, onComplete) { + var promise = gpii.test.setSettings(settingsHandlers, nameResolver); + promise.then(onComplete); +}; + /** Snapshot the state of all settingsHandlers by stashing them in a member named `orig` on the supplied settingsStore * @param settingsHandlers {Object} A map of settings handler names to `settingsHandler` blocks as seen in the `settingsHandlers` * option of a `gpii.test.common.testCaseHolder` @@ -155,7 +164,8 @@ gpii.test.operateSettings = function (settingsHandlers, nameResolver, method) { gpii.test.snapshotSettings = function (settingsHandlers, settingsStore, nameResolver, onComplete) { var origPromise = gpii.test.getSettings(settingsHandlers, nameResolver); origPromise.then(function (origSettings) { - settingsStore.orig = origSettings; + // any settings already defined in settingsStore.org overwrites the ones read by snapshotter + settingsStore.orig = fluid.extend(true, origSettings, settingsStore.orig); onComplete(); }); }; @@ -169,19 +179,15 @@ gpii.test.extractSettingsBlocks = function (settingsHandlers) { return fluid.transform(settingsHandlers, gpii.settingsHandlers.extractSettingsBlocks); }; -gpii.test.checkConfiguration = function (settingsHandlers, nameResolver, onComplete) { +gpii.test.checkConfiguration = function (settingsHandlers, nameResolver, onComplete, customMsg) { var configPromise = gpii.test.getSettings(settingsHandlers, nameResolver); configPromise.then(function (config) { var noOptions = gpii.test.extractSettingsBlocks(settingsHandlers); - jqUnit.assertDeepEq("Checking that settings are set", noOptions, config); + jqUnit.assertDeepEq(customMsg || "Checking that settings are set", noOptions, config); onComplete(); }); }; -gpii.test.onExecExit = function (result, processSpec) { - jqUnit.assertTrue("Checking the process with command: " + processSpec, result); -}; - gpii.test.logoutRequestListen = function (data) { jqUnit.assertNotEquals("Successful logout message returned " + data, -1, data.indexOf("was successfully logged out.")); @@ -195,6 +201,19 @@ gpii.test.checkRestoredConfiguration = function (settingsHandlers, settingsStore }); }; +gpii.test.checkRestoredInitialState = function (initialSettings, nameResolver, onComplete) { + if (initialSettings === undefined) { + jqUnit.assertTrue("No initial settings defined, so not checking", true); + onComplete(); + return; + } + var currentSettingsPromise = gpii.test.getSettings(initialSettings, nameResolver); + currentSettingsPromise.then(function (currentSettings) { + jqUnit.assertDeepEq("Checking that initital settings are also properly reset", gpii.test.extractSettingsBlocks(initialSettings), currentSettings); + onComplete(); + }); +}; + gpii.test.common.receiveVariableResolver = function (testCaseHolder, variableResolver) { testCaseHolder.variableResolver = variableResolver; }; @@ -233,12 +252,16 @@ fluid.defaults("gpii.test.common.testCaseHolder", { settingsStore: {} }, mergePolicy: { - "settingsHandlers": "noexpand" + "settingsHandlers": "noexpand", + "initialState": "noexpand" }, events: { onSnapshotComplete: null, + onInitialStateSet: null, + onInitialStateConfirmed: null, onCheckConfigurationComplete: null, - onCheckRestoredConfigurationComplete: null + onCheckRestoredConfigurationComplete: null, + onCheckRestoredInitialStateComplete: null }, distributeOptions: { "common.testCaseHolder.variableResolver": { @@ -299,26 +322,6 @@ gpii.test.common.receiveComponent = function (testCaseHolder, component, name) { }; -// Will return the part of a test sequence that tests for the process state based on the -// 'expectedKey' parameter -gpii.test.createProcessChecks = function (processList, expectedKey) { - var sequence = []; - // For each process, run the command, then check that we get the expected output - fluid.each(processList, function (process, pindex) { - sequence.push({ - func: "{exec}.exec", - args: [ - fluid.model.composeSegments("{tests}.options.processes", pindex), - fluid.model.composeSegments("{tests}.options.processes", pindex, expectedKey) - ] - }, { - event: "{exec}.events.onExecExit", - listener: "gpii.test.onExecExit" - }); - }); - return sequence; -}; - /** Expand material in a `gpii.test.common.testCaseHolder` fixture's options using the variableResolver fished out of the real implementation, * and place it at a public member for the assertions to use * @param testCaseHolder {gpii.test.common.testCaseHolder} a testCaseHolder with some expandable material in its options @@ -334,7 +337,26 @@ gpii.test.expandSettings = function (testCaseHolder, members) { }; // TODO: remove these clumsy constants once https://issues.fluidproject.org/browse/FLUID-5903 is implemented -gpii.test.initialSequence = fluid.freezeRecursive([ +gpii.test.initalStateSequence = fluid.freezeRecursive([ + { + func: "gpii.test.expandSettings", + args: [ "{tests}", "initialState" ] + }, { + func: "gpii.test.setInitialSettingsState", + args: [ "{tests}.initialState", "{nameResolver}", "{testCaseHolder}.events.onInitialStateSet.fire"] + }, { + event: "{testCaseHolder}.events.onInitialStateSet", + listener: "fluid.identity" + }, { + func: "gpii.test.checkConfiguration", + args: ["{tests}.initialState", "{nameResolver}", "{testCaseHolder}.events.onInitialStateConfirmed.fire", "Confirming initial state"] + }, { + event: "{testCaseHolder}.events.onInitialStateConfirmed", + listener: "fluid.identity" + } +]); + +gpii.test.snapshotSequence = fluid.freezeRecursive([ { func: "gpii.test.expandSettings", args: [ "{tests}", "settingsHandlers" ] @@ -378,6 +400,12 @@ gpii.test.checkSequence = fluid.freezeRecursive([ }, { event: "{testCaseHolder}.events.onCheckRestoredConfigurationComplete", listener: "fluid.identity" + }, { // anything in the intial state should also be restored upon logout + func: "gpii.test.checkRestoredInitialState", + args: [ "{tests}.initialState", "{nameResolver}", "{testCaseHolder}.events.onCheckRestoredInitialStateComplete.fire"] + }, { + event: "{testCaseHolder}.events.onCheckRestoredInitialStateComplete", + listener: "fluid.identity" } ]); @@ -393,25 +421,21 @@ gpii.test.push = function (array, elements) { /** Build a test fixture for integration/acceptance tests operating the stereotypical workflow - * snapshot, login, expectConfigured, logout and expectRestored */ - gpii.test.buildSingleTestFixture = function (testDef, rootGrades) { - var processes = testDef.processes || []; testDef.gradeNames = fluid.makeArray(testDef.gradeNames).concat(fluid.makeArray(rootGrades)); - testDef.expect = 4 + processes.length * 2; + testDef.expect = 5; testDef.sequence = fluid.makeArray(testDef.sequence); gpii.test.unshift(testDef.sequence, gpii.test.loginSequence); - gpii.test.unshift(testDef.sequence, gpii.test.initialSequence); - - // For each process, run the command, then check that we get the expected output - testDef.sequence = testDef.sequence.concat(gpii.test.createProcessChecks(processes, "expectConfigured")); + gpii.test.unshift(testDef.sequence, gpii.test.snapshotSequence); + if (testDef.initialState) { + gpii.test.unshift(testDef.sequence, gpii.test.initalStateSequence); + testDef.expect++; + } gpii.test.push(testDef.sequence, gpii.test.logoutSequence); - // Check that the processes are in the expected state after logout - testDef.sequence = testDef.sequence.concat(gpii.test.createProcessChecks(processes, "expectRestored")); - gpii.test.push(testDef.sequence, gpii.test.checkSequence); return testDef; @@ -443,8 +467,8 @@ gpii.test.recordToTestDefs = function (record) { var testDefs = fluid.copy(fluid.getGlobalValue(record.testDefs)); fluid.each(testDefs, function (testDef) { testDef.config = { - configName: record.configName, - configPath: record.configPath + configName: testDef.configName || record.configName, + configPath: testDef.configPath || record.configPath }; }); return testDefs; diff --git a/gpii/node_modules/transformer/src/js/Transformer.js b/gpii/node_modules/transformer/src/js/Transformer.js index e2816e49f..ce5c4dc09 100644 --- a/gpii/node_modules/transformer/src/js/Transformer.js +++ b/gpii/node_modules/transformer/src/js/Transformer.js @@ -37,8 +37,8 @@ fluid.registerNamespace("gpii.transformer"); * @return {Object} - the modified settingshandler object - ready to be passed to the lifecycle manager */ gpii.transformer.transformOneSettingsHandler = function (settingsHandler, oneUserSolution, solutionId) { - // TODO GPII-1223: throw app specific settings in the correct locations if there are multiple handlers var settings = fluid.copy(oneUserSolution.settings["http://registry.gpii.net/applications/" + solutionId]); + // extract any common terms that were defined in the application block and delete them from the settings block var scopedCommon = {}; fluid.each(settings, function (val, key) { @@ -48,13 +48,16 @@ fluid.registerNamespace("gpii.transformer"); } }); + // filter to only keep relevant application specific settings + settings = gpii.settingsHandlers.filterSupportedSettings(settings, settingsHandler.supportedSettings); + if (settingsHandler.capabilitiesTransformations) { var inferred = fluid.model.transformWithRules(oneUserSolution.settings, settingsHandler.capabilitiesTransformations); var inferredScoped = (scopedCommon === undefined || $.isEmptyObject(scopedCommon)) ? {} : fluid.model.transformWithRules(scopedCommon, settingsHandler.capabilitiesTransformations); settings = fluid.extend(true, {}, inferred, inferredScoped, settings); } - settingsHandler.settings = settings; + settingsHandler.settings = settings || {}; delete settingsHandler.capabilitiesTransformations; delete settingsHandler.capabilities; return settingsHandler; @@ -83,7 +86,7 @@ fluid.registerNamespace("gpii.transformer"); var oneSolution = fluid.copy(solutionsRegistryEntries[solutionId]); if (oneSolution === undefined) { fluid.log("The configuration to be applied contains an entry for " + solutionId + - " which was not found in the solutionRegistry. Aborting configuration"); + " which was not found in the solutionsRegistry. Aborting configuration"); return undefined; } delete oneSolution.contexts; // solutions registry entries should include this as "old device reporter context info" diff --git a/gpii/node_modules/transformer/test/html/TransformerTests.html b/gpii/node_modules/transformer/test/html/TransformerTests.html index fa0cb2373..89f60b398 100644 --- a/gpii/node_modules/transformer/test/html/TransformerTests.html +++ b/gpii/node_modules/transformer/test/html/TransformerTests.html @@ -19,6 +19,7 @@ + diff --git a/gpii/node_modules/transformer/test/js/TransformerTests.js b/gpii/node_modules/transformer/test/js/TransformerTests.js index a90d94969..e32316c77 100644 --- a/gpii/node_modules/transformer/test/js/TransformerTests.js +++ b/gpii/node_modules/transformer/test/js/TransformerTests.js @@ -53,7 +53,14 @@ fluid.setLogging(true); "ZoomIncrement": "REG_DWORD" } }, - "capabilities": [], + "supportedSettings": { + "Invert": {}, + "Magnification": {}, + "FollowMouse": {}, + "FollowCaret": {}, + "FollowFocus": {}, + "MagnificationMode": {} + }, "capabilitiesTransformations": { "Invert": "http://registry\\.gpii\\.net/common/invertColours", "Magnification": { @@ -138,7 +145,6 @@ fluid.setLogging(true); "encoding": "utf-8", "xml-tag": "" }, - "capabilities": [], "capabilitiesTransformations": { "user.$t": { "literalValue": 1 @@ -149,11 +155,11 @@ fluid.setLogging(true); "careCenter.$t": { "literalValue": 1 }, - "screenReaderTTSEnabled": { - "value": "http://registry\\.gpii\\.net/common/screenReaderTTSEnabled" + "screenReaderTTS/enabled": { + "value": "http://registry\\.gpii\\.net/common/screenReaderTTS/enabled" }, - "highContrastEnabled": { - "value": "http://registry\\.gpii\\.net/common/highContrastEnabled" + "highContrast/enabled": { + "value": "http://registry\\.gpii\\.net/common/highContrast/enabled" }, "fontSize": { "value": { @@ -196,7 +202,7 @@ fluid.setLogging(true); } }; - var testFixtures = [ + gpii.tests.transformer.configurationToSettingsTestSpecs = [ { name: "Application specific settings for the same application", input: { @@ -243,10 +249,64 @@ fluid.setLogging(true); "FollowFocus": 0, "FollowMouse": 1, "Invert": false + }, + "supportedSettings": testSolutionsEntry["com.microsoft.windows.magnifier"].settingsHandlers.conf.supportedSettings + } + } + } + } + }, { + name: "Application specific settings filtered by supported settings", + input: { + "applications": { + "com.microsoft.windows.magnifier": { + "active": true, + "settings": { + "http://registry.gpii.net/applications/com.microsoft.windows.magnifier": { + "FollowFocus": 0, + "FollowCaret": 1, + "FollowMouse": 1, + "Invert": false, + "wrongSetting": 200 } } } } + }, + expected: { + "com.microsoft.windows.magnifier": { + "active": true, + "name": testSolutionsEntry["com.microsoft.windows.magnifier"].name, + "start": testSolutionsEntry["com.microsoft.windows.magnifier"].start, + "stop": testSolutionsEntry["com.microsoft.windows.magnifier"].stop, + "configure": testSolutionsEntry["com.microsoft.windows.magnifier"].configure, + "restore": testSolutionsEntry["com.microsoft.windows.magnifier"].restore, + "settingsHandlers": { + "conf": { + "type": "gpii.windows.registrySettingsHandler.set", + "options": { + "dataTypes": { + "FollowCaret": "REG_DWORD", + "FollowFocus": "REG_DWORD", + "FollowMouse": "REG_DWORD", + "Invert": "REG_DWORD", + "Magnification": "REG_DWORD", + "MagnificationMode": "REG_DWORD", + "ZoomIncrement": "REG_DWORD" + }, + "hKey": "HKEY_CURRENT_USER", + "path": "Software\\Microsoft\\ScreenMagnifier" + }, + "settings": { + "FollowCaret": 1, + "FollowFocus": 0, + "FollowMouse": 1, + "Invert": false + }, + "supportedSettings": testSolutionsEntry["com.microsoft.windows.magnifier"].settingsHandlers.conf.supportedSettings + } + } + } } }, { name: "Common terms only", @@ -288,13 +348,14 @@ fluid.setLogging(true); "FollowCaret": 1, "FollowFocus": 0, "FollowMouse": 1 - } + }, + "supportedSettings": testSolutionsEntry["com.microsoft.windows.magnifier"].settingsHandlers.conf.supportedSettings } } } } }, { - name: "Application scoped common terms are converted to application specific files", + name: "Application scoped common terms are converted to application specific settings", input: { "applications": { "com.microsoft.windows.magnifier": { @@ -331,6 +392,7 @@ fluid.setLogging(true); "hKey": "HKEY_CURRENT_USER", "path": "Software\\Microsoft\\ScreenMagnifier" }, + "supportedSettings": testSolutionsEntry["com.microsoft.windows.magnifier"].settingsHandlers.conf.supportedSettings, "settings": { "Invert": true } @@ -377,6 +439,7 @@ fluid.setLogging(true); "hKey": "HKEY_CURRENT_USER", "path": "Software\\Microsoft\\ScreenMagnifier" }, + "supportedSettings": testSolutionsEntry["com.microsoft.windows.magnifier"].settingsHandlers.conf.supportedSettings, "settings": { "Invert": true } @@ -427,7 +490,8 @@ fluid.setLogging(true); "settings": { "Invert": false, "FollowFocus": 0 - } + }, + "supportedSettings": testSolutionsEntry["com.microsoft.windows.magnifier"].settingsHandlers.conf.supportedSettings } } } @@ -475,7 +539,8 @@ fluid.setLogging(true); "settings": { "Invert": false, "FollowFocus": 0 - } + }, + "supportedSettings": testSolutionsEntry["com.microsoft.windows.magnifier"].settingsHandlers.conf.supportedSettings } } } @@ -521,7 +586,8 @@ fluid.setLogging(true); }, "settings": { "Invert": false - } + }, + "supportedSettings": testSolutionsEntry["com.microsoft.windows.magnifier"].settingsHandlers.conf.supportedSettings } } } @@ -572,7 +638,8 @@ fluid.setLogging(true); }, "settings": { "Invert": false - } + }, + "supportedSettings": testSolutionsEntry["com.microsoft.windows.magnifier"].settingsHandlers.conf.supportedSettings } } }, @@ -632,7 +699,7 @@ fluid.setLogging(true); jqUnit.module("Tester"); jqUnit.test("Transformation tests", function () { - fluid.each(testFixtures, function (test) { + fluid.each(gpii.tests.transformer.configurationToSettingsTestSpecs, function (test) { var result = gpii.transformer.configurationToSettings(test.input, testSolutionsEntry); jqUnit.assertDeepEq(test.name, test.expected, result); }); diff --git a/testData/deviceReporter/acceptanceTests/linux_builtIn.json b/testData/deviceReporter/acceptanceTests/linux_builtIn.json index e0fbf462b..23b554fb1 100644 --- a/testData/deviceReporter/acceptanceTests/linux_builtIn.json +++ b/testData/deviceReporter/acceptanceTests/linux_builtIn.json @@ -10,5 +10,8 @@ }, { "id": "org.gnome.desktop.a11y.keyboard" + }, + { + "id": "org.gnome.desktop.a11y.applications.onscreen-keyboard" } ] diff --git a/testData/deviceReporter/installedSolutions.json b/testData/deviceReporter/installedSolutions.json index 661255cba..3718082dc 100644 --- a/testData/deviceReporter/installedSolutions.json +++ b/testData/deviceReporter/installedSolutions.json @@ -8,11 +8,11 @@ }, { - "id": "org.gnome.shell.overrides" + "id": "fakemag2" }, { - "id": "org.gnome.desktop.wm.preferences" + "id": "fakescreenreader1" }, { diff --git a/testData/ontologies/flat.json5 b/testData/ontologies/flat.json5 index 9100d70d3..760f1f9bc 100644 --- a/testData/ontologies/flat.json5 +++ b/testData/ontologies/flat.json5 @@ -88,7 +88,7 @@ // TODO: We should present the value to the user in a human readable format. // i.e.: "English (US)" instead of "en-US" or "Mandarin" instead of "zh-cmn" }, - "http://registry.gpii.net/common/screenReaderTTSEnabled": { + "http://registry.gpii.net/common/screenReaderTTS/enabled": { "title": "TTS enabled", "description": "Whether to enable/disable text to speech from screen reader", "type": "boolean", @@ -111,13 +111,13 @@ "max": 1, "divisibleBy": 0.1 }, - "http://registry.gpii.net/common/selfVoicingEnabled": { + "http://registry.gpii.net/common/selfVoicing/enabled": { "title": "Self Voicing", "description": "Whether to enable/disable self voicing", "type": "boolean", "default": false }, - "http://registry.gpii.net/common/highContrastEnabled": { + "http://registry.gpii.net/common/highContrast/enabled": { "title": "High Contrast", "description": "Whether to enable/disable High Contrast", "type": "boolean", @@ -164,7 +164,7 @@ "max": 100, "divisibleBy": 1 }, - "http://registry.gpii.net/common/magnifierEnabled": { + "http://registry.gpii.net/common/magnification/enabled": { "title": "Magnifier Enabled", "description": "Whether to enable/disable magnification", "type": "boolean", @@ -232,13 +232,13 @@ "default": "normal", "enum": ["high", "normal", "low", "very low"] }, - "http://registry.gpii.net/common/onScreenKeyboardEnabled": { + "http://registry.gpii.net/common/onScreenKeyboard/enabled": { "title": "On-Screen keyboard", "description": "Whether to enable/disable the on-screen keyboard", "type": "boolean", "default": "false" }, - "http://registry.gpii.net/common/mouseEmulationEnabled": { + "http://registry.gpii.net/common/mouseEmulation/enabled": { "title": "Mouse emulation", "description": "Whether to enable/disable the mouse emulation", "type": "boolean", @@ -288,19 +288,19 @@ "type": "boolean", "default": "false" }, - "http://registry.gpii.net/common/captionsEnabled": { + "http://registry.gpii.net/common/captions/enabled": { "title": "Captions", "description": "Whether to enable/disable captions on videos", "type": "boolean", "default": "false" }, - "http://registry.gpii.net/common/subtitlesEnabled": { + "http://registry.gpii.net/common/subtitles/enabled": { "title": "Subtitles", "description": "Whether to enable/disable subtitles on videos", "type": "boolean", "default": "false" }, - "http://registry.gpii.net/common/audioDescriptionEnabled": { + "http://registry.gpii.net/common/audioDescription/enabled": { "title": "Audio Description", "description": "Whether to enable/disable audio description on videos", "type": "boolean", diff --git a/testData/ontologies/mappings/ISO24751-flat.json5 b/testData/ontologies/mappings/ISO24751-flat.json5 index 17511b5a3..f7797a834 100644 --- a/testData/ontologies/mappings/ISO24751-flat.json5 +++ b/testData/ontologies/mappings/ISO24751-flat.json5 @@ -2,13 +2,13 @@ "http://registry\\.gpii\\.net/common/fontSize": "display.screenEnhancement.fontSize", "http://registry\\.gpii\\.net/common/lineSpace": "display.screenEnhancement.-provisional-lineSpace", "http://registry\\.gpii\\.net/common/characterSpace": "display.screenEnhancement.-provisional-characterSpace", - "http://registry\\.gpii\\.net/common/inputsLargerEnabled": "display.screenEnhancement.-provisional-inputsLargerEnabled", + "http://registry\\.gpii\\.net/common/inputsLarger/enabled": "display.screenEnhancement.-provisional-inputsLarger/enabled", "http://registry\\.gpii\\.net/common/foregroundColor": "display.screenEnhancement.foregroundColor", "http://registry\\.gpii\\.net/common/backgroundColor": "display.screenEnhancement.backgroundColor", "http://registry\\.gpii\\.net/common/highlightColor": "display.screenEnhancement.highlightColor", "http://registry\\.gpii\\.net/common/fontFaceFontName": "display.screenEnhancement.fontFaceFontName", "http://registry\\.gpii\\.net/common/fontFaceGenericFontFace": "display.screenEnhancement.fontFaceGenericFontFace", - "http://registry\\.gpii\\.net/common/magnifierEnabled": "display.screenEnhancement.-provisional-magnifierEnabled", + "http://registry\\.gpii\\.net/common/magnification/enabled": "display.screenEnhancement.-provisional-magnification/enabled", "http://registry\\.gpii\\.net/common/magnification": "display.screenEnhancement.magnification", "http://registry\\.gpii\\.net/common/magnifierPosition": "display.screenEnhancement.-provisional-magnifierPosition", "http://registry\\.gpii\\.net/common/tracking": "display.screenEnhancement.tracking", @@ -16,7 +16,7 @@ "http://registry\\.gpii\\.net/common/invertImages": "display.screenEnhancement.invertImages", "http://registry\\.gpii\\.net/common/invertColours": "display.screenEnhancement.-provisional-invertColours", "http://registry\\.gpii\\.net/common/cursorSize": "display.screenEnhancement.cursorSize", - "http://registry\\.gpii\\.net/common/highContrastEnabled": "display.screenEnhancement.-provisional-highContrastEnabled", + "http://registry\\.gpii\\.net/common/highContrast/enabled": "display.screenEnhancement.-provisional-highContrast/enabled", "http://registry\\.gpii\\.net/common/highContrastTheme": "display.screenEnhancement.-provisional-highContrastTheme", "http://registry\\.gpii\\.net/common/mouseTrailing": "display.screenEnhancement.mouseTrailing", "http://registry\\.gpii\\.net/common/screenReaderBrailleOutput": "display.screenReader.-provisional-screenReaderBrailleOutput", @@ -27,32 +27,32 @@ "http://registry\\.gpii\\.net/common/wordEcho": "display.screenReader.-provisional-wordEcho", "http://registry\\.gpii\\.net/common/announceCapitals": "display.screenReader.-provisional-announceCapitals", "http://registry\\.gpii\\.net/common/punctuationVerbosity": "display.screenReader.-provisional-punctuationVerbosity", - "http://registry\\.gpii\\.net/common/screenReaderTTSEnabled": "display.screenReader.-provisional-screenReaderTTSEnabled", + "http://registry\\.gpii\\.net/common/screenReaderTTS/enabled": "display.screenReader.-provisional-screenReaderTTS/enabled", "http://registry\\.gpii\\.net/common/pitch": "display.textReadingHighlight.pitch", "http://registry\\.gpii\\.net/common/readingUnit": "display.textReadingHighlight.readingUnit", "http://registry\\.gpii\\.net/common/volumeTTS": "display.textReadingHighlight.-provisional-volumeTTS", - "http://registry\\.gpii\\.net/common/selfVoicingEnabled": "display.textReadingHighlight.-provisional-selfVoicingEnabled", + "http://registry\\.gpii\\.net/common/selfVoicing/enabled": "display.textReadingHighlight.-provisional-selfVoicing/enabled", "http://registry\\.gpii\\.net/common/brailleMode": "display.braille.-provisional-brailleMode", "http://registry\\.gpii\\.net/common/screenOffTime": "display.-provisional-screenOffTime", "http://registry\\.gpii\\.net/common/screenRotation": "display.-provisional-screenRotation", "http://registry\\.gpii\\.net/common/screenDefaultRotation": "display.-provisional-screenDefaultRotation", "http://registry\\.gpii\\.net/common/screenDim": "display.-provisional-screenDim", - "http://registry\\.gpii\\.net/common/onScreenKeyboardEnabled": "control.onscreenKeyboard", + "http://registry\\.gpii\\.net/common/onScreenKeyboard/enabled": "control.onscreenKeyboard", "http://registry\\.gpii\\.net/common/initDelay": "control.mouseEmulation.-provisional-initDelay", "http://registry\\.gpii\\.net/common/cursorSpeed": "control.mouseEmulation.cursorSpeed", "http://registry\\.gpii\\.net/common/cursorAcceleration": "control.mouseEmulation.cursorAcceleration", - "http://registry\\.gpii\\.net/common/mouseEmulationEnabled": "control.mouseEmulation.-provisional-mouseEmulationEnabled", + "http://registry\\.gpii\\.net/common/mouseEmulation/enabled": "control.mouseEmulation.-provisional-mouseEmulation/enabled", "http://registry\\.gpii\\.net/common/stickyKeys": "control.keyboardEnhancement.stickyKeys", "http://registry\\.gpii\\.net/common/slowKeysInterval": "control.keyboardEnhancement.slowKeys.slowKeysInterval", - "http://registry\\.gpii\\.net/common/slowKeysEnabled": "control.keyboardEnhancement.slowKeys.-provisional-slowKeysEnabled", - "http://registry\\.gpii\\.net/common/debounceEnabled": "control.keyboardEnhancement.debounceKeys.-provisional-debounceEnabled", + "http://registry\\.gpii\\.net/common/slowKeys/enabled": "control.keyboardEnhancement.slowKeys.-provisional-slowKeys/enabled", + "http://registry\\.gpii\\.net/common/debounce/enabled": "control.keyboardEnhancement.debounceKeys.-provisional-debounce/enabled", "http://registry\\.gpii\\.net/common/debounceInterval": "control.keyboardEnhancement.debounceKeys.debounceInterval", "http://registry\\.gpii\\.net/common/hapticFeedback": "control.-provisional-hapticFeedback", "http://registry\\.gpii\\.net/common/tableOfContents": "control.structuralNavigation.tableOfContents", "http://registry\\.gpii\\.net/common/adaptationPreference": "content.adaptationPreference", "http://registry\\.gpii\\.net/common/supportTool": "content.supportTool", - "http://registry\\.gpii\\.net/common/simplifiedUiEnabled": "-provisional-cognitiveSupport.-provisional-simplifiedUiEnabled", - "http://registry\\.gpii\\.net/common/syllabificationEnabled": "-provisional-cognitiveSupport.-provisional-syllabificationEnabled", + "http://registry\\.gpii\\.net/common/simplifiedUi/enabled": "-provisional-cognitiveSupport.-provisional-simplifiedUi/enabled", + "http://registry\\.gpii\\.net/common/syllabification/enabled": "-provisional-cognitiveSupport.-provisional-syllabification/enabled", "http://registry\\.gpii\\.net/common/volume": "-provisional-general.-provisional-volume", "http://registry\\.gpii\\.net/common/language": "language", "http://registry\\.gpii\\.net/common/DPIScale": "display.screenEnhancement.-provisional-DPIScale", diff --git a/testData/ontologies/mappings/flat-apptology.json5 b/testData/ontologies/mappings/flat-apptology.json5 index 7e0c1a6b3..1b1d086ba 100644 --- a/testData/ontologies/mappings/flat-apptology.json5 +++ b/testData/ontologies/mappings/flat-apptology.json5 @@ -2,7 +2,7 @@ "transform": [ { "type": "fluid.transforms.value", - "inputPath": "http://registry\\.gpii\\.net/common/magnifierEnabled", + "inputPath": "http://registry\\.gpii\\.net/common/magnification/enabled", "outputPath": "http://registry\\.gpii\\.net/common/magnifierApplication" }, { "type": "fluid.transforms.value", @@ -10,9 +10,9 @@ "outputPath": "http://registry\\.gpii\\.net/common/magnifierApplication" } ], - "http://registry\\.gpii\\.net/common/screenReaderApplication": "http://registry\\.gpii\\.net/common/screenReaderTTSEnabled", + "http://registry\\.gpii\\.net/common/screenReaderApplication": "http://registry\\.gpii\\.net/common/screenReaderTTS/enabled", "http://registry\\.gpii\\.net/common/stickyKeysApplication": "http://registry\\.gpii\\.net/common/stickyKeys", - "http://registry\\.gpii\\.net/common/slowKeysApplication": "http://registry\\.gpii\\.net/common/slowKeysEnabled", - "http://registry\\.gpii\\.net/common/debounceKeysApplication": "http://registry\\.gpii\\.net/common/debounceEnabled", - "http://registry\\.gpii\\.net/common/onScreenKeyboardApplication": "http://registry\\.gpii\\.net/common/onScreenKeyboardEnabled" + "http://registry\\.gpii\\.net/common/slowKeysApplication": "http://registry\\.gpii\\.net/common/slowKeys/enabled", + "http://registry\\.gpii\\.net/common/debounceKeysApplication": "http://registry\\.gpii\\.net/common/debounce/enabled", + "http://registry\\.gpii\\.net/common/onScreenKeyboardApplication": "http://registry\\.gpii\\.net/common/onScreenKeyboard/enabled" } \ No newline at end of file diff --git a/testData/preferences/GPII-270-rbmm-demo.json b/testData/preferences/GPII-270-rbmm-demo.json index 2c9977f9d..80601226f 100644 --- a/testData/preferences/GPII-270-rbmm-demo.json +++ b/testData/preferences/GPII-270-rbmm-demo.json @@ -23,7 +23,7 @@ "http://registry.gpii.net/common/punctuationVerbosity": "some", "http://registry.gpii.net/common/readingUnit": "word", "http://registry.gpii.net/common/auditoryOutLanguage": "GR", - "http://registry.gpii.net/common/screenReaderTTSEnabled": true, + "http://registry.gpii.net/common/screenReaderTTS/enabled": true, "http://registry.gpii.net/common/pitch": 0.4, "http://registry.gpii.net/common/volumeTTS": 0.5, diff --git a/testData/preferences/MikelVargas.json b/testData/preferences/MikelVargas.json index 8d5a45862..5b7c73873 100644 --- a/testData/preferences/MikelVargas.json +++ b/testData/preferences/MikelVargas.json @@ -5,15 +5,15 @@ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/onScreenKeyboardEnabled": true, + "http://registry.gpii.net/common/onScreenKeyboard/enabled": true, "http://registry.gpii.net/common/initDelay": 0.120, "http://registry.gpii.net/common/cursorSpeed": 0.850, "http://registry.gpii.net/common/cursorAcceleration": 0.800, - "http://registry.gpii.net/common/mouseEmulationEnabled": true, + "http://registry.gpii.net/common/mouseEmulation/enabled": true, "http://registry.gpii.net/common/stickyKeys": true, - "http://registry.gpii.net/common/slowKeysEnabled": true, + "http://registry.gpii.net/common/slowKeys/enabled": true, "http://registry.gpii.net/common/slowKeysInterval": 0.4, - "http://registry.gpii.net/common/debounceEnabled": true, + "http://registry.gpii.net/common/debounce/enabled": true, "http://registry.gpii.net/common/debounceInterval": 0.20 } } diff --git a/testData/preferences/acceptanceTests/chrome_font_size.json b/testData/preferences/acceptanceTests/chrome_font_size.json index a2d1a9930..d8b5cb244 100644 --- a/testData/preferences/acceptanceTests/chrome_font_size.json +++ b/testData/preferences/acceptanceTests/chrome_font_size.json @@ -5,10 +5,10 @@ "name": "Default preferences", "preferences": { "http://registry.gpii.net/common/fontSize": 16, - "http://registry.gpii.net/common/screenReaderTTSEnabled": false, - "http://registry.gpii.net/common/magnifierEnabled": false, + "http://registry.gpii.net/common/screenReaderTTS/enabled": false, + "http://registry.gpii.net/common/magnification/enabled": false, "http://registry.gpii.net/common/magnification": 1, - "http://registry.gpii.net/common/highContrastEnabled": false, + "http://registry.gpii.net/common/highContrast/enabled": false, "http://registry.gpii.net/common/invertColours": false } } diff --git a/testData/preferences/acceptanceTests/chrome_high_contrast.json b/testData/preferences/acceptanceTests/chrome_high_contrast.json index 69ddcbe38..2d7a3452d 100644 --- a/testData/preferences/acceptanceTests/chrome_high_contrast.json +++ b/testData/preferences/acceptanceTests/chrome_high_contrast.json @@ -5,10 +5,10 @@ "name": "Default preferences", "preferences": { "http://registry.gpii.net/common/fontSize": 12, - "http://registry.gpii.net/common/screenReaderTTSEnabled": false, - "http://registry.gpii.net/common/magnifierEnabled": false, + "http://registry.gpii.net/common/screenReaderTTS/enabled": false, + "http://registry.gpii.net/common/magnification/enabled": false, "http://registry.gpii.net/common/magnification": 1, - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/highContrastTheme": "white-black", "http://registry.gpii.net/common/invertColours": false } diff --git a/testData/preferences/acceptanceTests/chrome_magnification.json b/testData/preferences/acceptanceTests/chrome_magnification.json index 54f0ac3c4..aeff7d679 100644 --- a/testData/preferences/acceptanceTests/chrome_magnification.json +++ b/testData/preferences/acceptanceTests/chrome_magnification.json @@ -5,10 +5,10 @@ "name": "Default preferences", "preferences": { "http://registry.gpii.net/common/fontSize": 12, - "http://registry.gpii.net/common/screenReaderTTSEnabled": false, - "http://registry.gpii.net/common/magnifierEnabled": true, + "http://registry.gpii.net/common/screenReaderTTS/enabled": false, + "http://registry.gpii.net/common/magnification/enabled": true, "http://registry.gpii.net/common/magnification": 1.5, - "http://registry.gpii.net/common/highContrastEnabled": false, + "http://registry.gpii.net/common/highContrast/enabled": false, "http://registry.gpii.net/common/invertColours": false } } diff --git a/testData/preferences/acceptanceTests/fm_gnome_keyboard.json b/testData/preferences/acceptanceTests/fm_gnome_keyboard.json index 6805d1e6f..7d3133fdf 100644 --- a/testData/preferences/acceptanceTests/fm_gnome_keyboard.json +++ b/testData/preferences/acceptanceTests/fm_gnome_keyboard.json @@ -4,15 +4,15 @@ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/onScreenKeyboardEnabled": true, + "http://registry.gpii.net/common/onScreenKeyboard/enabled": true, "http://registry.gpii.net/common/initDelay": 0.120, "http://registry.gpii.net/common/cursorSpeed": 0.850, "http://registry.gpii.net/common/cursorAcceleration": 0.800, - "http://registry.gpii.net/common/mouseEmulationEnabled": true, + "http://registry.gpii.net/common/mouseEmulation/enabled": true, "http://registry.gpii.net/common/stickyKeys": true, - "http://registry.gpii.net/common/slowKeysEnabled": true, + "http://registry.gpii.net/common/slowKeys/enabled": true, "http://registry.gpii.net/common/slowKeysInterval": 0.4, - "http://registry.gpii.net/common/debounceEnabled": true, + "http://registry.gpii.net/common/debounce/enabled": true, "http://registry.gpii.net/common/debounceInterval": 0.20 } } diff --git a/testData/preferences/acceptanceTests/maavis_highcontrast.json b/testData/preferences/acceptanceTests/maavis_highcontrast.json index e0c5f4582..6dde61761 100644 --- a/testData/preferences/acceptanceTests/maavis_highcontrast.json +++ b/testData/preferences/acceptanceTests/maavis_highcontrast.json @@ -4,7 +4,7 @@ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/highContrastTheme": "yellow-black" } } diff --git a/testData/preferences/acceptanceTests/maavis_selfvoicing.json b/testData/preferences/acceptanceTests/maavis_selfvoicing.json index a042e7d24..c14336a29 100644 --- a/testData/preferences/acceptanceTests/maavis_selfvoicing.json +++ b/testData/preferences/acceptanceTests/maavis_selfvoicing.json @@ -4,7 +4,7 @@ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/selfVoicingEnabled": true + "http://registry.gpii.net/common/selfVoicing/enabled": true } } } diff --git a/testData/preferences/acceptanceTests/olb_Alicia_cmn.json b/testData/preferences/acceptanceTests/olb_Alicia_cmn.json index 4c943790e..5c1e6743c 100644 --- a/testData/preferences/acceptanceTests/olb_Alicia_cmn.json +++ b/testData/preferences/acceptanceTests/olb_Alicia_cmn.json @@ -5,9 +5,9 @@ "name": "Default preferences", "preferences": { "http://registry.gpii.net/common/language": "en-GB", - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/highContrastTheme": "white-black", - "http://registry.gpii.net/common/simplifiedUiEnabled": true + "http://registry.gpii.net/common/simplifiedUi/enabled": true } } } diff --git a/testData/preferences/acceptanceTests/olb_Carla.json b/testData/preferences/acceptanceTests/olb_Carla.json index fcb3447f1..442d20836 100644 --- a/testData/preferences/acceptanceTests/olb_Carla.json +++ b/testData/preferences/acceptanceTests/olb_Carla.json @@ -7,9 +7,9 @@ "http://registry.gpii.net/common/language": "en-GB", "http://registry.gpii.net/common/fontSize": 24, "http://registry.gpii.net/common/linkAdaptation": "emphasizeLinks", - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/highContrastTheme": "white-black", - "http://registry.gpii.net/common/signLanguageEnabled": false, + "http://registry.gpii.net/common/signLanguage/enabled": false, "http://registry.gpii.net/applications/eu.gpii.olb": { "lineSpacing": 2, "inputsLarger": true diff --git a/testData/preferences/acceptanceTests/olb_KimCallahan.json b/testData/preferences/acceptanceTests/olb_KimCallahan.json index 9e7731769..a8ac9ecdd 100644 --- a/testData/preferences/acceptanceTests/olb_KimCallahan.json +++ b/testData/preferences/acceptanceTests/olb_KimCallahan.json @@ -5,7 +5,7 @@ "name": "Default preferences", "preferences": { "http://registry.gpii.net/common/language": "en-US", - "http://registry.gpii.net/common/signLanguageEnabled": true, + "http://registry.gpii.net/common/signLanguage/enabled": true, "http://registry.gpii.net/common/signLanguage": "ase", "http://registry.gpii.net/common/signLanguageInterpreterType": "avatar", "http://registry.gpii.net/applications/eu.gpii.olb": { diff --git a/testData/preferences/acceptanceTests/olb_Lara.json b/testData/preferences/acceptanceTests/olb_Lara.json index d79dea92d..bf4f9db3b 100644 --- a/testData/preferences/acceptanceTests/olb_Lara.json +++ b/testData/preferences/acceptanceTests/olb_Lara.json @@ -5,7 +5,7 @@ "name": "Default preferences", "preferences": { "http://registry.gpii.net/common/language": "de-DE", - "http://registry.gpii.net/common/signLanguageEnabled": true, + "http://registry.gpii.net/common/signLanguage/enabled": true, "http://registry.gpii.net/common/signLanguage": "gsg", "http://registry.gpii.net/common/signLanguageInterpreterType": "human", "http://registry.gpii.net/applications/eu.gpii.olb": { diff --git a/testData/preferences/acceptanceTests/olb_QinKesheng.json b/testData/preferences/acceptanceTests/olb_QinKesheng.json index be951574d..ea8fe83be 100644 --- a/testData/preferences/acceptanceTests/olb_QinKesheng.json +++ b/testData/preferences/acceptanceTests/olb_QinKesheng.json @@ -5,7 +5,7 @@ "name": "Default preferences", "preferences": { "http://registry.gpii.net/common/language": "zho", - "http://registry.gpii.net/common/signLanguageEnabled": true, + "http://registry.gpii.net/common/signLanguage/enabled": true, "http://registry.gpii.net/common/signLanguage": "csl", "http://registry.gpii.net/common/signLanguageInterpreterType": "avatar" } diff --git a/testData/preferences/acceptanceTests/os_common.json b/testData/preferences/acceptanceTests/os_common.json index ce069a2cc..a3bf53e72 100644 --- a/testData/preferences/acceptanceTests/os_common.json +++ b/testData/preferences/acceptanceTests/os_common.json @@ -11,13 +11,14 @@ "http://registry.gpii.net/common/cursorSize": 0.9, "http://registry.gpii.net/common/fontSize": 9, "http://registry.gpii.net/common/mouseTrailing": 10, - "http://registry.gpii.net/common/highContrastEnabled": true, - "http://registry.gpii.net/common/mouseEmulationEnabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, + "http://registry.gpii.net/common/mouseEmulation/enabled": true, "http://registry.gpii.net/common/cursorAcceleration": 1, "http://registry.gpii.net/common/cursorSpeed": 1, "http://registry.gpii.net/common/stickyKeys": true, - "http://registry.gpii.net/common/debounceEnabled": true, - "http://registry.gpii.net/common/debounceInterval": 1 + "http://registry.gpii.net/common/debounceEnable": true, + "http://registry.gpii.net/common/debounceInterval": 1, + "http://registry.gpii.net/common/onScreenKeyboard/enabled": true } } } diff --git a/testData/preferences/acceptanceTests/os_common2.json b/testData/preferences/acceptanceTests/os_common2.json index 378dbae51..3a910e0bd 100644 --- a/testData/preferences/acceptanceTests/os_common2.json +++ b/testData/preferences/acceptanceTests/os_common2.json @@ -4,7 +4,7 @@ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/highContrastEnabled": false + "http://registry.gpii.net/common/highContrast/enabled": false } } } diff --git a/testData/preferences/acceptanceTests/os_common2.txt b/testData/preferences/acceptanceTests/os_common2.txt index 2a0ad106b..ee30fbab2 100644 --- a/testData/preferences/acceptanceTests/os_common2.txt +++ b/testData/preferences/acceptanceTests/os_common2.txt @@ -1,7 +1,7 @@ os_common2.json =============== -This NP set is used to check the behaviour under GNU/Linux when highContrastEnabled is set to false. +This NP set is used to check the behaviour under GNU/Linux when highContrast/enabled is set to false. When logging in with this NP set, GNOME should use its default values for gtk-theme and icon-theme. So if you want to see this in action: diff --git a/testData/preferences/acceptanceTests/screenreader_common.json b/testData/preferences/acceptanceTests/screenreader_common.json index 2455b703b..9246a037c 100644 --- a/testData/preferences/acceptanceTests/screenreader_common.json +++ b/testData/preferences/acceptanceTests/screenreader_common.json @@ -10,7 +10,7 @@ "http://registry.gpii.net/common/announceCapitals": true , "http://registry.gpii.net/common/readingUnit": "word" , "http://registry.gpii.net/common/punctuationVerbosity": "all" , - "http://registry.gpii.net/common/screenReaderTTSEnabled": true , + "http://registry.gpii.net/common/screenReaderTTS/enabled": true , "http://registry.gpii.net/common/trackingTTS": ["mouse", "caret"], "http://registry.gpii.net/common/speechRate": 400 , "http://registry.gpii.net/common/auditoryOutLanguage": "en-BS", diff --git a/testData/preferences/acceptanceTests/tvm_lara.json b/testData/preferences/acceptanceTests/tvm_lara.json index 97e8071cd..4befc46e9 100644 --- a/testData/preferences/acceptanceTests/tvm_lara.json +++ b/testData/preferences/acceptanceTests/tvm_lara.json @@ -5,7 +5,7 @@ "name": "Default preferences", "preferences": { "http://registry.gpii.net/common/language": "el", - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/highContrastTheme": "white-black", "http://registry.gpii.net/common/fontSize": 24, "http://registry.gpii.net/common/sessionTimeout": 60 diff --git a/testData/preferences/acceptanceTests/uioPlus_character_space.json b/testData/preferences/acceptanceTests/uioPlus_character_space.json index 2b54a94a7..5f263d51b 100644 --- a/testData/preferences/acceptanceTests/uioPlus_character_space.json +++ b/testData/preferences/acceptanceTests/uioPlus_character_space.json @@ -7,14 +7,14 @@ "http://registry.gpii.net/common/lineSpace": 1, "http://registry.gpii.net/common/fontSize": 12, "http://registry.gpii.net/common/characterSpace": 1, - "http://registry.gpii.net/common/selfVoicingEnabled": false, - "http://registry.gpii.net/common/inputsLargerEnabled": false, - "http://registry.gpii.net/common/highContrastEnabled": false, + "http://registry.gpii.net/common/selfVoicing/enabled": false, + "http://registry.gpii.net/common/inputsLarger/enabled": false, + "http://registry.gpii.net/common/highContrast/enabled": false, "http://registry.gpii.net/common/highlightColor": "default", "http://registry.gpii.net/common/tableOfContents": false, "http://registry.gpii.net/common/supportTool": [], - "http://registry.gpii.net/common/simplifiedUiEnabled": false, - "http://registry.gpii.net/common/syllabificationEnabled": false + "http://registry.gpii.net/common/simplifiedUi/enabled": false, + "http://registry.gpii.net/common/syllabification/enabled": false } } } diff --git a/testData/preferences/acceptanceTests/uioPlus_defaults.json b/testData/preferences/acceptanceTests/uioPlus_defaults.json index e7e4d2b69..ba1b096a7 100644 --- a/testData/preferences/acceptanceTests/uioPlus_defaults.json +++ b/testData/preferences/acceptanceTests/uioPlus_defaults.json @@ -7,14 +7,14 @@ "http://registry.gpii.net/common/lineSpace": 1, "http://registry.gpii.net/common/fontSize": 12, "http://registry.gpii.net/common/characterSpace": 0, - "http://registry.gpii.net/common/selfVoicingEnabled": false, - "http://registry.gpii.net/common/inputsLargerEnabled": false, - "http://registry.gpii.net/common/highContrastEnabled": false, + "http://registry.gpii.net/common/selfVoicing/enabled": false, + "http://registry.gpii.net/common/inputsLarger/enabled": false, + "http://registry.gpii.net/common/highContrast/enabled": false, "http://registry.gpii.net/common/highlightColor": "default", "http://registry.gpii.net/common/tableOfContents": false, "http://registry.gpii.net/common/supportTool": [], - "http://registry.gpii.net/common/simplifiedUiEnabled": false, - "http://registry.gpii.net/common/syllabificationEnabled": false + "http://registry.gpii.net/common/simplifiedUi/enabled": false, + "http://registry.gpii.net/common/syllabification/enabled": false } } } diff --git a/testData/preferences/acceptanceTests/uioPlus_font_size.json b/testData/preferences/acceptanceTests/uioPlus_font_size.json index 9356f7cf3..5b666aa9d 100644 --- a/testData/preferences/acceptanceTests/uioPlus_font_size.json +++ b/testData/preferences/acceptanceTests/uioPlus_font_size.json @@ -7,14 +7,14 @@ "http://registry.gpii.net/common/lineSpace": 1, "http://registry.gpii.net/common/fontSize": 24, "http://registry.gpii.net/common/characterSpace": 0, - "http://registry.gpii.net/common/selfVoicingEnabled": false, - "http://registry.gpii.net/common/inputsLargerEnabled": false, - "http://registry.gpii.net/common/highContrastEnabled": false, + "http://registry.gpii.net/common/selfVoicing/enabled": false, + "http://registry.gpii.net/common/inputsLarger/enabled": false, + "http://registry.gpii.net/common/highContrast/enabled": false, "http://registry.gpii.net/common/highlightColor": "default", "http://registry.gpii.net/common/tableOfContents": false, "http://registry.gpii.net/common/supportTool": [], - "http://registry.gpii.net/common/simplifiedUiEnabled": false, - "http://registry.gpii.net/common/syllabificationEnabled": false + "http://registry.gpii.net/common/simplifiedUi/enabled": false, + "http://registry.gpii.net/common/syllabification/enabled": false } } } diff --git a/testData/preferences/acceptanceTests/uioPlus_high_contrast.json b/testData/preferences/acceptanceTests/uioPlus_high_contrast.json index 3e229da55..dda680380 100644 --- a/testData/preferences/acceptanceTests/uioPlus_high_contrast.json +++ b/testData/preferences/acceptanceTests/uioPlus_high_contrast.json @@ -7,15 +7,15 @@ "http://registry.gpii.net/common/lineSpace": 1, "http://registry.gpii.net/common/fontSize": 12, "http://registry.gpii.net/common/characterSpace": 0, - "http://registry.gpii.net/common/selfVoicingEnabled": false, - "http://registry.gpii.net/common/inputsLargerEnabled": false, - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/selfVoicing/enabled": false, + "http://registry.gpii.net/common/inputsLarger/enabled": false, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/highContrastTheme": "white-black", "http://registry.gpii.net/common/highlightColor": "default", "http://registry.gpii.net/common/tableOfContents": false, "http://registry.gpii.net/common/supportTool": [], - "http://registry.gpii.net/common/simplifiedUiEnabled": false, - "http://registry.gpii.net/common/syllabificationEnabled": false + "http://registry.gpii.net/common/simplifiedUi/enabled": false, + "http://registry.gpii.net/common/syllabification/enabled": false } } } diff --git a/testData/preferences/acceptanceTests/uioPlus_highlight_colour.json b/testData/preferences/acceptanceTests/uioPlus_highlight_colour.json index 677c28e92..8c97751fc 100644 --- a/testData/preferences/acceptanceTests/uioPlus_highlight_colour.json +++ b/testData/preferences/acceptanceTests/uioPlus_highlight_colour.json @@ -7,14 +7,14 @@ "http://registry.gpii.net/common/lineSpace": 1, "http://registry.gpii.net/common/fontSize": 12, "http://registry.gpii.net/common/characterSpace": 0, - "http://registry.gpii.net/common/selfVoicingEnabled": false, - "http://registry.gpii.net/common/inputsLargerEnabled": false, - "http://registry.gpii.net/common/highContrastEnabled": false, + "http://registry.gpii.net/common/selfVoicing/enabled": false, + "http://registry.gpii.net/common/inputsLarger/enabled": false, + "http://registry.gpii.net/common/highContrast/enabled": false, "http://registry.gpii.net/common/highlightColor": "yellow", "http://registry.gpii.net/common/tableOfContents": false, "http://registry.gpii.net/common/supportTool": [], - "http://registry.gpii.net/common/simplifiedUiEnabled": false, - "http://registry.gpii.net/common/syllabificationEnabled": false + "http://registry.gpii.net/common/simplifiedUi/enabled": false, + "http://registry.gpii.net/common/syllabification/enabled": false } } } diff --git a/testData/preferences/acceptanceTests/uioPlus_inputs_larger.json b/testData/preferences/acceptanceTests/uioPlus_inputs_larger.json index f08c1dab1..53d086544 100644 --- a/testData/preferences/acceptanceTests/uioPlus_inputs_larger.json +++ b/testData/preferences/acceptanceTests/uioPlus_inputs_larger.json @@ -7,14 +7,14 @@ "http://registry.gpii.net/common/lineSpace": 1, "http://registry.gpii.net/common/fontSize": 12, "http://registry.gpii.net/common/characterSpace": 0, - "http://registry.gpii.net/common/selfVoicingEnabled": false, - "http://registry.gpii.net/common/inputsLargerEnabled": true, - "http://registry.gpii.net/common/highContrastEnabled": false, + "http://registry.gpii.net/common/selfVoicing/enabled": false, + "http://registry.gpii.net/common/inputsLarger/enabled": true, + "http://registry.gpii.net/common/highContrast/enabled": false, "http://registry.gpii.net/common/highlightColor": "default", "http://registry.gpii.net/common/tableOfContents": false, "http://registry.gpii.net/common/supportTool": [], - "http://registry.gpii.net/common/simplifiedUiEnabled": false, - "http://registry.gpii.net/common/syllabificationEnabled": false + "http://registry.gpii.net/common/simplifiedUi/enabled": false, + "http://registry.gpii.net/common/syllabification/enabled": false } } } diff --git a/testData/preferences/acceptanceTests/uioPlus_line_space.json b/testData/preferences/acceptanceTests/uioPlus_line_space.json index 1e7edb6b0..2415297bf 100644 --- a/testData/preferences/acceptanceTests/uioPlus_line_space.json +++ b/testData/preferences/acceptanceTests/uioPlus_line_space.json @@ -7,14 +7,14 @@ "http://registry.gpii.net/common/lineSpace": 2, "http://registry.gpii.net/common/fontSize": 12, "http://registry.gpii.net/common/characterSpace": 0, - "http://registry.gpii.net/common/selfVoicingEnabled": false, - "http://registry.gpii.net/common/inputsLargerEnabled": false, - "http://registry.gpii.net/common/highContrastEnabled": false, + "http://registry.gpii.net/common/selfVoicing/enabled": false, + "http://registry.gpii.net/common/inputsLarger/enabled": false, + "http://registry.gpii.net/common/highContrast/enabled": false, "http://registry.gpii.net/common/highlightColor": "default", "http://registry.gpii.net/common/tableOfContents": false, "http://registry.gpii.net/common/supportTool": [], - "http://registry.gpii.net/common/simplifiedUiEnabled": false, - "http://registry.gpii.net/common/syllabificationEnabled": false + "http://registry.gpii.net/common/simplifiedUi/enabled": false, + "http://registry.gpii.net/common/syllabification/enabled": false } } } diff --git a/testData/preferences/acceptanceTests/uioPlus_multiple_settings.json b/testData/preferences/acceptanceTests/uioPlus_multiple_settings.json index ee3406cb3..cc9720baa 100644 --- a/testData/preferences/acceptanceTests/uioPlus_multiple_settings.json +++ b/testData/preferences/acceptanceTests/uioPlus_multiple_settings.json @@ -7,15 +7,15 @@ "http://registry.gpii.net/common/lineSpace": 1.3, "http://registry.gpii.net/common/fontSize": 16, "http://registry.gpii.net/common/characterSpace": 2, - "http://registry.gpii.net/common/selfVoicingEnabled": true, - "http://registry.gpii.net/common/inputsLargerEnabled": true, - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/selfVoicing/enabled": true, + "http://registry.gpii.net/common/inputsLarger/enabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/highContrastTheme": "yellow-black", "http://registry.gpii.net/common/highlightColor": "green", "http://registry.gpii.net/common/tableOfContents": true, "http://registry.gpii.net/common/supportTool": ["dictionary"], - "http://registry.gpii.net/common/simplifiedUiEnabled": true, - "http://registry.gpii.net/common/syllabificationEnabled": true + "http://registry.gpii.net/common/simplifiedUi/enabled": true, + "http://registry.gpii.net/common/syllabification/enabled": true } } } diff --git a/testData/preferences/acceptanceTests/uioPlus_multiple_support_tool.json b/testData/preferences/acceptanceTests/uioPlus_multiple_support_tool.json index 80d345cb4..f5a1b74ff 100644 --- a/testData/preferences/acceptanceTests/uioPlus_multiple_support_tool.json +++ b/testData/preferences/acceptanceTests/uioPlus_multiple_support_tool.json @@ -7,14 +7,14 @@ "http://registry.gpii.net/common/lineSpace": 1, "http://registry.gpii.net/common/fontSize": 12, "http://registry.gpii.net/common/characterSpace": 0, - "http://registry.gpii.net/common/selfVoicingEnabled": false, - "http://registry.gpii.net/common/inputsLargerEnabled": false, - "http://registry.gpii.net/common/highContrastEnabled": false, + "http://registry.gpii.net/common/selfVoicing/enabled": false, + "http://registry.gpii.net/common/inputsLarger/enabled": false, + "http://registry.gpii.net/common/highContrast/enabled": false, "http://registry.gpii.net/common/highlightColor": "default", "http://registry.gpii.net/common/tableOfContents": false, "http://registry.gpii.net/common/supportTool": ["dictionary", "thesaurus"], - "http://registry.gpii.net/common/simplifiedUiEnabled": false, - "http://registry.gpii.net/common/syllabificationEnabled": false + "http://registry.gpii.net/common/simplifiedUi/enabled": false, + "http://registry.gpii.net/common/syllabification/enabled": false } } } diff --git a/testData/preferences/acceptanceTests/uioPlus_self_voicing.json b/testData/preferences/acceptanceTests/uioPlus_self_voicing.json index 707aad3e9..41979fe7b 100644 --- a/testData/preferences/acceptanceTests/uioPlus_self_voicing.json +++ b/testData/preferences/acceptanceTests/uioPlus_self_voicing.json @@ -7,14 +7,14 @@ "http://registry.gpii.net/common/lineSpace": 1, "http://registry.gpii.net/common/fontSize": 12, "http://registry.gpii.net/common/characterSpace": 0, - "http://registry.gpii.net/common/selfVoicingEnabled": true, - "http://registry.gpii.net/common/inputsLargerEnabled": false, - "http://registry.gpii.net/common/highContrastEnabled": false, + "http://registry.gpii.net/common/selfVoicing/enabled": true, + "http://registry.gpii.net/common/inputsLarger/enabled": false, + "http://registry.gpii.net/common/highContrast/enabled": false, "http://registry.gpii.net/common/highlightColor": "default", "http://registry.gpii.net/common/tableOfContents": false, "http://registry.gpii.net/common/supportTool": [], - "http://registry.gpii.net/common/simplifiedUiEnabled": false, - "http://registry.gpii.net/common/syllabificationEnabled": false + "http://registry.gpii.net/common/simplifiedUi/enabled": false, + "http://registry.gpii.net/common/syllabification/enabled": false } } } diff --git a/testData/preferences/acceptanceTests/uioPlus_simplified.json b/testData/preferences/acceptanceTests/uioPlus_simplified.json index c1c11cc6f..500d329f8 100644 --- a/testData/preferences/acceptanceTests/uioPlus_simplified.json +++ b/testData/preferences/acceptanceTests/uioPlus_simplified.json @@ -7,14 +7,14 @@ "http://registry.gpii.net/common/lineSpace": 1, "http://registry.gpii.net/common/fontSize": 12, "http://registry.gpii.net/common/characterSpace": 0, - "http://registry.gpii.net/common/selfVoicingEnabled": false, - "http://registry.gpii.net/common/inputsLargerEnabled": false, - "http://registry.gpii.net/common/highContrastEnabled": false, + "http://registry.gpii.net/common/selfVoicing/enabled": false, + "http://registry.gpii.net/common/inputsLarger/enabled": false, + "http://registry.gpii.net/common/highContrast/enabled": false, "http://registry.gpii.net/common/highlightColor": "default", "http://registry.gpii.net/common/tableOfContents": false, "http://registry.gpii.net/common/supportTool": [], - "http://registry.gpii.net/common/simplifiedUiEnabled": true, - "http://registry.gpii.net/common/syllabificationEnabled": false + "http://registry.gpii.net/common/simplifiedUi/enabled": true, + "http://registry.gpii.net/common/syllabification/enabled": false } } } diff --git a/testData/preferences/acceptanceTests/uioPlus_support_tool.json b/testData/preferences/acceptanceTests/uioPlus_support_tool.json index 048cc213f..02dd218fe 100644 --- a/testData/preferences/acceptanceTests/uioPlus_support_tool.json +++ b/testData/preferences/acceptanceTests/uioPlus_support_tool.json @@ -7,14 +7,14 @@ "http://registry.gpii.net/common/lineSpace": 1, "http://registry.gpii.net/common/fontSize": 12, "http://registry.gpii.net/common/characterSpace": 0, - "http://registry.gpii.net/common/selfVoicingEnabled": false, - "http://registry.gpii.net/common/inputsLargerEnabled": false, - "http://registry.gpii.net/common/highContrastEnabled": false, + "http://registry.gpii.net/common/selfVoicing/enabled": false, + "http://registry.gpii.net/common/inputsLarger/enabled": false, + "http://registry.gpii.net/common/highContrast/enabled": false, "http://registry.gpii.net/common/highlightColor": "default", "http://registry.gpii.net/common/tableOfContents": false, "http://registry.gpii.net/common/supportTool": ["dictionary"], - "http://registry.gpii.net/common/simplifiedUiEnabled": false, - "http://registry.gpii.net/common/syllabificationEnabled": false + "http://registry.gpii.net/common/simplifiedUi/enabled": false, + "http://registry.gpii.net/common/syllabification/enabled": false } } } diff --git a/testData/preferences/acceptanceTests/uioPlus_syllabification.json b/testData/preferences/acceptanceTests/uioPlus_syllabification.json index edd27c201..291fa9fdb 100644 --- a/testData/preferences/acceptanceTests/uioPlus_syllabification.json +++ b/testData/preferences/acceptanceTests/uioPlus_syllabification.json @@ -7,14 +7,14 @@ "http://registry.gpii.net/common/lineSpace": 1, "http://registry.gpii.net/common/fontSize": 12, "http://registry.gpii.net/common/characterSpace": 0, - "http://registry.gpii.net/common/selfVoicingEnabled": false, - "http://registry.gpii.net/common/inputsLargerEnabled": false, - "http://registry.gpii.net/common/highContrastEnabled": false, + "http://registry.gpii.net/common/selfVoicing/enabled": false, + "http://registry.gpii.net/common/inputsLarger/enabled": false, + "http://registry.gpii.net/common/highContrast/enabled": false, "http://registry.gpii.net/common/highlightColor": "default", "http://registry.gpii.net/common/tableOfContents": false, "http://registry.gpii.net/common/supportTool": [], - "http://registry.gpii.net/common/simplifiedUiEnabled": false, - "http://registry.gpii.net/common/syllabificationEnabled": true + "http://registry.gpii.net/common/simplifiedUi/enabled": false, + "http://registry.gpii.net/common/syllabification/enabled": true } } } diff --git a/testData/preferences/acceptanceTests/uioPlus_toc.json b/testData/preferences/acceptanceTests/uioPlus_toc.json index 73fbbbd96..b8432969f 100644 --- a/testData/preferences/acceptanceTests/uioPlus_toc.json +++ b/testData/preferences/acceptanceTests/uioPlus_toc.json @@ -7,14 +7,14 @@ "http://registry.gpii.net/common/lineSpace": 1, "http://registry.gpii.net/common/fontSize": 12, "http://registry.gpii.net/common/characterSpace": 0, - "http://registry.gpii.net/common/selfVoicingEnabled": false, - "http://registry.gpii.net/common/inputsLargerEnabled": false, - "http://registry.gpii.net/common/highContrastEnabled": false, + "http://registry.gpii.net/common/selfVoicing/enabled": false, + "http://registry.gpii.net/common/inputsLarger/enabled": false, + "http://registry.gpii.net/common/highContrast/enabled": false, "http://registry.gpii.net/common/highlightColor": "default", "http://registry.gpii.net/common/tableOfContents": true, "http://registry.gpii.net/common/supportTool": [], - "http://registry.gpii.net/common/simplifiedUiEnabled": false, - "http://registry.gpii.net/common/syllabificationEnabled": false + "http://registry.gpii.net/common/simplifiedUi/enabled": false, + "http://registry.gpii.net/common/syllabification/enabled": false } } } diff --git a/testData/preferences/acceptanceTests/uioPlus_unhandled_support_tool.json b/testData/preferences/acceptanceTests/uioPlus_unhandled_support_tool.json index 2d457ce62..ea213b2b0 100644 --- a/testData/preferences/acceptanceTests/uioPlus_unhandled_support_tool.json +++ b/testData/preferences/acceptanceTests/uioPlus_unhandled_support_tool.json @@ -7,14 +7,14 @@ "http://registry.gpii.net/common/lineSpace": 1, "http://registry.gpii.net/common/fontSize": 12, "http://registry.gpii.net/common/characterSpace": 0, - "http://registry.gpii.net/common/selfVoicingEnabled": false, - "http://registry.gpii.net/common/inputsLargerEnabled": false, - "http://registry.gpii.net/common/highContrastEnabled": false, + "http://registry.gpii.net/common/selfVoicing/enabled": false, + "http://registry.gpii.net/common/inputsLarger/enabled": false, + "http://registry.gpii.net/common/highContrast/enabled": false, "http://registry.gpii.net/common/highlightColor": "default", "http://registry.gpii.net/common/tableOfContents": false, "http://registry.gpii.net/common/supportTool": ["thesaurus"], - "http://registry.gpii.net/common/simplifiedUiEnabled": false, - "http://registry.gpii.net/common/syllabificationEnabled": false + "http://registry.gpii.net/common/simplifiedUi/enabled": false, + "http://registry.gpii.net/common/syllabification/enabled": false } } } diff --git a/testData/preferences/chris.json b/testData/preferences/chris.json index 99b447ab6..7a3483714 100644 --- a/testData/preferences/chris.json +++ b/testData/preferences/chris.json @@ -5,7 +5,7 @@ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/screenReaderTTSEnabled": true, + "http://registry.gpii.net/common/screenReaderTTS/enabled": true, "http://registry.gpii.net/common/screenReaderBrailleOutput": true, "http://registry.gpii.net/common/speechRate": 350, "http://registry.gpii.net/applications/com.microsoft.windows.displaySettings": { diff --git a/testData/preferences/chromeDefault.json b/testData/preferences/chromeDefault.json index b563521de..ba48b431e 100644 --- a/testData/preferences/chromeDefault.json +++ b/testData/preferences/chromeDefault.json @@ -5,7 +5,7 @@ "name": "Default preferences", "preferences": { "http://registry.gpii.net/applications/org.chrome.cloud4chrome": { - "screenReaderTTSEnabled": false, + "screenReaderTTS/enabled": false, "highContrast": "none", "magnification": 1, "fontSize": "medium", diff --git a/testData/preferences/li.json b/testData/preferences/li.json index ae6a28928..bd03d54fc 100644 --- a/testData/preferences/li.json +++ b/testData/preferences/li.json @@ -5,9 +5,9 @@ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/screenReaderTTSEnabled": true, + "http://registry.gpii.net/common/screenReaderTTS/enabled": true, "http://registry.gpii.net/common/speechRate": 200, - "http://registry.gpii.net/common/magnifierEnabled": true, + "http://registry.gpii.net/common/magnification/enabled": true, "http://registry.gpii.net/common/magnification": 1.5, "http://registry.gpii.net/common/matchMakerType": "RuleBased" }, @@ -25,11 +25,11 @@ "turn-down-light": { "name": "turn down light", "preferences": { - "http://registry.gpii.net/common/screenReaderTTSEnabled": true, + "http://registry.gpii.net/common/screenReaderTTS/enabled": true, "http://registry.gpii.net/common/speechRate": 200, - "http://registry.gpii.net/common/magnifierEnabled": true, + "http://registry.gpii.net/common/magnification/enabled": true, "http://registry.gpii.net/common/magnification": 2, - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/matchMakerType": "RuleBased" }, "metadata": [ diff --git a/testData/preferences/manuel.json b/testData/preferences/manuel.json index 9c9631659..12660478a 100644 --- a/testData/preferences/manuel.json +++ b/testData/preferences/manuel.json @@ -6,7 +6,7 @@ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/magnifierEnabled": true, + "http://registry.gpii.net/common/magnification/enabled": true, "http://registry.gpii.net/common/magnification": 2, "http://registry.gpii.net/common/magnifierPosition": "TopHalf", "http://registry.gpii.net/applications/org.chrome.cloud4chrome": { @@ -27,7 +27,7 @@ "light-lim": { "name": "turn down light", "preferences": { - "http://registry.gpii.net/common/magnifierEnabled": true, + "http://registry.gpii.net/common/magnification/enabled": true, "http://registry.gpii.net/common/magnification": 2, "http://registry.gpii.net/common/magnifierPosition": "TopHalf", "http://registry.gpii.net/applications/org.chrome.cloud4chrome": { diff --git a/testData/preferences/mary.json b/testData/preferences/mary.json index 018b8ea19..2c1f84aa1 100644 --- a/testData/preferences/mary.json +++ b/testData/preferences/mary.json @@ -5,7 +5,7 @@ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/onScreenKeyboardEnabled": true, + "http://registry.gpii.net/common/onScreenKeyboard/enabled": true, "http://registry.gpii.net/common/matchMakerType": "RuleBased" } } diff --git a/testData/preferences/mickey.json b/testData/preferences/mickey.json index c3e34ad09..756ff61a7 100644 --- a/testData/preferences/mickey.json +++ b/testData/preferences/mickey.json @@ -5,7 +5,7 @@ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/mouseEmulationEnabled": true, + "http://registry.gpii.net/common/mouseEmulation/enabled": true, "http://registry.gpii.net/common/initDelay": 0.120, "http://registry.gpii.net/common/cursorSpeed": 0.850, "http://registry.gpii.net/common/cursorAcceleration": 0.800 diff --git a/testData/preferences/olb_Alicia_app.json b/testData/preferences/olb_Alicia_app.json index 0d4fc3a73..0ca38f522 100644 --- a/testData/preferences/olb_Alicia_app.json +++ b/testData/preferences/olb_Alicia_app.json @@ -5,7 +5,7 @@ "name": "Default preferences", "preferences": { "http://registry.gpii.net/common/language": "en-GB", - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/highContrastTheme": "white-black", "http://registry.gpii.net/applications/eu.gpii.olb": { "simplifiedUiEnabled": true diff --git a/testData/preferences/olb_Alicia_cmn.json b/testData/preferences/olb_Alicia_cmn.json index 4c943790e..5c1e6743c 100644 --- a/testData/preferences/olb_Alicia_cmn.json +++ b/testData/preferences/olb_Alicia_cmn.json @@ -5,9 +5,9 @@ "name": "Default preferences", "preferences": { "http://registry.gpii.net/common/language": "en-GB", - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/highContrastTheme": "white-black", - "http://registry.gpii.net/common/simplifiedUiEnabled": true + "http://registry.gpii.net/common/simplifiedUi/enabled": true } } } diff --git a/testData/preferences/olb_Carla.json b/testData/preferences/olb_Carla.json index fcb3447f1..442d20836 100644 --- a/testData/preferences/olb_Carla.json +++ b/testData/preferences/olb_Carla.json @@ -7,9 +7,9 @@ "http://registry.gpii.net/common/language": "en-GB", "http://registry.gpii.net/common/fontSize": 24, "http://registry.gpii.net/common/linkAdaptation": "emphasizeLinks", - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/highContrastTheme": "white-black", - "http://registry.gpii.net/common/signLanguageEnabled": false, + "http://registry.gpii.net/common/signLanguage/enabled": false, "http://registry.gpii.net/applications/eu.gpii.olb": { "lineSpacing": 2, "inputsLarger": true diff --git a/testData/preferences/olb_KimCallahan.json b/testData/preferences/olb_KimCallahan.json index 9e7731769..a8ac9ecdd 100644 --- a/testData/preferences/olb_KimCallahan.json +++ b/testData/preferences/olb_KimCallahan.json @@ -5,7 +5,7 @@ "name": "Default preferences", "preferences": { "http://registry.gpii.net/common/language": "en-US", - "http://registry.gpii.net/common/signLanguageEnabled": true, + "http://registry.gpii.net/common/signLanguage/enabled": true, "http://registry.gpii.net/common/signLanguage": "ase", "http://registry.gpii.net/common/signLanguageInterpreterType": "avatar", "http://registry.gpii.net/applications/eu.gpii.olb": { diff --git a/testData/preferences/olb_Lara.json b/testData/preferences/olb_Lara.json index d79dea92d..bf4f9db3b 100644 --- a/testData/preferences/olb_Lara.json +++ b/testData/preferences/olb_Lara.json @@ -5,7 +5,7 @@ "name": "Default preferences", "preferences": { "http://registry.gpii.net/common/language": "de-DE", - "http://registry.gpii.net/common/signLanguageEnabled": true, + "http://registry.gpii.net/common/signLanguage/enabled": true, "http://registry.gpii.net/common/signLanguage": "gsg", "http://registry.gpii.net/common/signLanguageInterpreterType": "human", "http://registry.gpii.net/applications/eu.gpii.olb": { diff --git a/testData/preferences/omnitor1.json b/testData/preferences/omnitor1.json index a6c6ff5e9..10daf83e0 100644 --- a/testData/preferences/omnitor1.json +++ b/testData/preferences/omnitor1.json @@ -5,7 +5,7 @@ "name": "Default preferences", "preferences": { "http://registry.gpii.net/common/fontSize": 12, - "http://registry.gpii.net/common/highContrastEnabled": false + "http://registry.gpii.net/common/highContrast/enabled": false } } } diff --git a/testData/preferences/omnitor2.json b/testData/preferences/omnitor2.json index 759931b34..59ee79d2a 100644 --- a/testData/preferences/omnitor2.json +++ b/testData/preferences/omnitor2.json @@ -5,7 +5,7 @@ "name": "Default preferences", "preferences": { "http://registry.gpii.net/common/fontSize": 25, - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/highContrastTheme": "yellow-black" } } diff --git a/testData/preferences/review3/chris.json b/testData/preferences/review3/chris.json index 2dc683ea1..6f8879536 100644 --- a/testData/preferences/review3/chris.json +++ b/testData/preferences/review3/chris.json @@ -4,7 +4,7 @@ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/screenReaderTTSEnabled": true, + "http://registry.gpii.net/common/screenReaderTTS/enabled": true, "http://registry.gpii.net/common/screenReaderBrailleOutput": true, "http://registry.gpii.net/common/speechRate": 350, "http://registry.gpii.net/applications/com.microsoft.windows.displaySettings": { diff --git a/testData/preferences/review3/li.json b/testData/preferences/review3/li.json index f0e19d86f..27e1f7d70 100644 --- a/testData/preferences/review3/li.json +++ b/testData/preferences/review3/li.json @@ -4,9 +4,9 @@ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/screenReaderTTSEnabled": true, + "http://registry.gpii.net/common/screenReaderTTS/enabled": true, "http://registry.gpii.net/common/speechRate": 200, - "http://registry.gpii.net/common/magnifierEnabled": true, + "http://registry.gpii.net/common/magnification/enabled": true, "http://registry.gpii.net/common/magnification": 1.5, "http://registry.gpii.net/common/matchMakerType": "RuleBased" }, @@ -24,11 +24,11 @@ "turn-down-light": { "name": "turn down light", "preferences": { - "http://registry.gpii.net/common/screenReaderTTSEnabled": true, + "http://registry.gpii.net/common/screenReaderTTS/enabled": true, "http://registry.gpii.net/common/speechRate": 200, - "http://registry.gpii.net/common/magnifierEnabled": true, + "http://registry.gpii.net/common/magnification/enabled": true, "http://registry.gpii.net/common/magnification": 2, - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/matchMakerType": "RuleBased" }, "metadata": [ diff --git a/testData/preferences/review3/manuel.json b/testData/preferences/review3/manuel.json index 085e098f8..8a2af7f76 100644 --- a/testData/preferences/review3/manuel.json +++ b/testData/preferences/review3/manuel.json @@ -3,7 +3,7 @@ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/magnifierEnabled": true, + "http://registry.gpii.net/common/magnification/enabled": true, "http://registry.gpii.net/common/magnification": 2, "http://registry.gpii.net/common/magnifierPosition": "TopHalf", "http://registry.gpii.net/applications/org.chrome.cloud4chrome": { @@ -24,7 +24,7 @@ "light-lim": { "name": "turn down light", "preferences": { - "http://registry.gpii.net/common/magnifierEnabled": true, + "http://registry.gpii.net/common/magnification/enabled": true, "http://registry.gpii.net/common/magnification": 2, "http://registry.gpii.net/common/magnifierPosition": "TopHalf", "http://registry.gpii.net/applications/org.chrome.cloud4chrome": { diff --git a/testData/preferences/review3/mary.json b/testData/preferences/review3/mary.json index ca72002b2..8b61c0843 100644 --- a/testData/preferences/review3/mary.json +++ b/testData/preferences/review3/mary.json @@ -4,7 +4,7 @@ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/onScreenKeyboardEnabled": true, + "http://registry.gpii.net/common/onScreenKeyboard/enabled": true, "http://registry.gpii.net/common/matchMakerType": "RuleBased" } } diff --git a/testData/preferences/review3/vladimir.json b/testData/preferences/review3/vladimir.json index 99ed44bae..259d3ab03 100644 --- a/testData/preferences/review3/vladimir.json +++ b/testData/preferences/review3/vladimir.json @@ -4,15 +4,15 @@ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/highContrastTheme": "white-black", "http://registry.gpii.net/common/cursorSize": 0.5, "http://registry.gpii.net/common/mouseTrailing": 5, - "http://registry.gpii.net/common/screenReaderTTSEnabled": true, + "http://registry.gpii.net/common/screenReaderTTS/enabled": true, "http://registry.gpii.net/common/speechRate": 300, "http://registry.gpii.net/applications/org.chrome.cloud4chrome": { "fontSize": "medium", - "highContrastEnabled": true + "highContrast/enabled": true }, "http://registry.gpii.net/common/matchMakerType": "RuleBased" }, @@ -20,7 +20,7 @@ { "type": "required", "scope": [ - "http://registry.gpii.net/common/screenReaderTTSEnabled" + "http://registry.gpii.net/common/screenReaderTTS/enabled" ], "value": 1024 }, @@ -36,16 +36,16 @@ "subway": { "name": "subway", "preferences": { - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/highContrastTheme": "white-black", "http://registry.gpii.net/common/cursorSize": 0.5, "http://registry.gpii.net/common/mouseTrailing": 5, - "http://registry.gpii.net/common/screenReaderTTSEnabled": true, + "http://registry.gpii.net/common/screenReaderTTS/enabled": true, "http://registry.gpii.net/common/speechRate": 300, "http://registry.gpii.net/common/volumeTTS": 0.9, "http://registry.gpii.net/applications/org.chrome.cloud4chrome": { "fontSize": "medium", - "highContrastEnabled": true + "highContrast/enabled": true }, "http://registry.gpii.net/common/matchMakerType": "RuleBased" }, @@ -53,7 +53,7 @@ { "type": "required", "scope": [ - "http://registry.gpii.net/common/screenReaderTTSEnabled" + "http://registry.gpii.net/common/screenReaderTTS/enabled" ], "value": 1024 }, diff --git a/testData/preferences/review3/vladimir_smm.json b/testData/preferences/review3/vladimir_smm.json index 06a8b747b..e55337f36 100644 --- a/testData/preferences/review3/vladimir_smm.json +++ b/testData/preferences/review3/vladimir_smm.json @@ -4,15 +4,15 @@ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/highContrastTheme": "white-black", "http://registry.gpii.net/common/cursorSize": 0.5, "http://registry.gpii.net/common/mouseTrailing": 5, - "http://registry.gpii.net/common/screenReaderTTSEnabled": true, + "http://registry.gpii.net/common/screenReaderTTS/enabled": true, "http://registry.gpii.net/common/speechRate": 300, "http://registry.gpii.net/applications/org.chrome.cloud4chrome": { "fontSize": "medium", - "highContrastEnabled": true + "highContrast/enabled": true }, "http://registry.gpii.net/common/matchMakerType": "Statistical" }, @@ -20,7 +20,7 @@ { "type": "required", "scope": [ - "http://registry.gpii.net/common/screenReaderTTSEnabled" + "http://registry.gpii.net/common/screenReaderTTS/enabled" ], "value": 1024 }, @@ -36,16 +36,16 @@ "subway": { "name": "subway", "preferences": { - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/highContrastTheme": "white-black", "http://registry.gpii.net/common/cursorSize": 0.5, "http://registry.gpii.net/common/mouseTrailing": 5, - "http://registry.gpii.net/common/screenReaderTTSEnabled": true, + "http://registry.gpii.net/common/screenReaderTTS/enabled": true, "http://registry.gpii.net/common/speechRate": 300, "http://registry.gpii.net/common/volumeTTS": 0.9, "http://registry.gpii.net/applications/org.chrome.cloud4chrome": { "fontSize": "medium", - "highContrastEnabled": true + "highContrast/enabled": true }, "http://registry.gpii.net/common/matchMakerType": "Statistical" }, @@ -53,7 +53,7 @@ { "type": "required", "scope": [ - "http://registry.gpii.net/common/screenReaderTTSEnabled" + "http://registry.gpii.net/common/screenReaderTTS/enabled" ], "value": 1024 }, diff --git a/testData/preferences/review3_chrome_high_contrast.json b/testData/preferences/review3_chrome_high_contrast.json index 69ddcbe38..2d7a3452d 100644 --- a/testData/preferences/review3_chrome_high_contrast.json +++ b/testData/preferences/review3_chrome_high_contrast.json @@ -5,10 +5,10 @@ "name": "Default preferences", "preferences": { "http://registry.gpii.net/common/fontSize": 12, - "http://registry.gpii.net/common/screenReaderTTSEnabled": false, - "http://registry.gpii.net/common/magnifierEnabled": false, + "http://registry.gpii.net/common/screenReaderTTS/enabled": false, + "http://registry.gpii.net/common/magnification/enabled": false, "http://registry.gpii.net/common/magnification": 1, - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/highContrastTheme": "white-black", "http://registry.gpii.net/common/invertColours": false } diff --git a/testData/preferences/review4/Alicia.json b/testData/preferences/review4/Alicia.json index ed75d13e8..8c0af2cc7 100644 --- a/testData/preferences/review4/Alicia.json +++ b/testData/preferences/review4/Alicia.json @@ -4,15 +4,15 @@ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/screenReaderTTSEnabled": true, + "http://registry.gpii.net/common/screenReaderTTS/enabled": true, "http://registry.gpii.net/common/speechRate": 350, "http://registry.gpii.net/common/volumeTTS": 0.6, - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/highContrastTheme": "white-black", "http://registry.gpii.net/common/auditoryOutLanguage": "en", "http://registry.gpii.net/common/language": "en", "http://registry.gpii.net/common/screenResolution": "low", - "http://registry.gpii.net/common/simplifiedUiEnabled": true, + "http://registry.gpii.net/common/simplifiedUi/enabled": true, "http://registry.gpii.net/common/matchMakerType": "RuleBased" } } diff --git a/testData/preferences/slater.json b/testData/preferences/slater.json index 5b898ee25..5630c93d5 100644 --- a/testData/preferences/slater.json +++ b/testData/preferences/slater.json @@ -5,7 +5,7 @@ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/screenReaderTTSEnabled": true, + "http://registry.gpii.net/common/screenReaderTTS/enabled": true, "http://registry.gpii.net/common/speechRate": 140, "http://registry.gpii.net/common/trackingTTS": ["focus"], "http://registry.gpii.net/common/keyEcho": true, diff --git a/testData/preferences/snapset_2a.json b/testData/preferences/snapset_2a.json index 9c55ece27..7c849a8e3 100644 --- a/testData/preferences/snapset_2a.json +++ b/testData/preferences/snapset_2a.json @@ -8,11 +8,11 @@ "http://registry.gpii.net/common/cursorSize": 1.0, "http://registry.gpii.net/common/DPIScale": 1.25, "http://registry.gpii.net/applications/com.microsoft.windows.highContrast": { - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/highContrastTheme": "white-black" }, "http://registry.gpii.net/applications/net.gpii.uioPlus": { - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/highContrastTheme": "white-black", "http://registry.gpii.net/common/supportTool": ["dictionary"] } diff --git a/testData/preferences/snapset_2b.json b/testData/preferences/snapset_2b.json index 23befe738..255c881c5 100644 --- a/testData/preferences/snapset_2b.json +++ b/testData/preferences/snapset_2b.json @@ -8,11 +8,11 @@ "http://registry.gpii.net/common/cursorSize": 1.0, "http://registry.gpii.net/common/DPIScale": 1.50, "http://registry.gpii.net/applications/com.microsoft.windows.highContrast": { - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/highContrastTheme": "white-black" }, "http://registry.gpii.net/applications/net.gpii.uioPlus": { - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/highContrastTheme": "white-black", "http://registry.gpii.net/common/supportTool": ["dictionary"] } diff --git a/testData/preferences/snapset_2c.json b/testData/preferences/snapset_2c.json index dd5ece941..9a39129ff 100644 --- a/testData/preferences/snapset_2c.json +++ b/testData/preferences/snapset_2c.json @@ -8,11 +8,11 @@ "http://registry.gpii.net/common/cursorSize": 1.0, "http://registry.gpii.net/common/DPIScale": 1.75, "http://registry.gpii.net/applications/com.microsoft.windows.highContrast": { - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/highContrastTheme": "white-black" }, "http://registry.gpii.net/applications/net.gpii.uioPlus": { - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/highContrastTheme": "white-black", "http://registry.gpii.net/common/supportTool": ["dictionary"] } diff --git a/testData/preferences/snapset_3.json b/testData/preferences/snapset_3.json index 60bac4be2..5a9e2ebc4 100644 --- a/testData/preferences/snapset_3.json +++ b/testData/preferences/snapset_3.json @@ -7,7 +7,7 @@ "preferences": { "http://registry.gpii.net/common/DPIScale": 1.50, "http://registry.gpii.net/common/cursorSize": 1.0, - "http://registry.gpii.net/common/selfVoicingEnabled": true, + "http://registry.gpii.net/common/selfVoicing/enabled": true, "http://registry.gpii.net/common/supportTool": ["dictionary"] } } diff --git a/testData/preferences/snapset_4a.json b/testData/preferences/snapset_4a.json index ffd91320a..d792ca518 100644 --- a/testData/preferences/snapset_4a.json +++ b/testData/preferences/snapset_4a.json @@ -6,8 +6,7 @@ "name": "Default preferences", "preferences": { "http://registry.gpii.net/common/magnification": 2, - "http://registry.gpii.net/common/magnifierPosition": "Lens", - "http://registry.gpii.net/common/supportTool": ["dictionary"] + "http://registry.gpii.net/common/magnifier/enabled": false } } } diff --git a/testData/preferences/snapset_4d.json b/testData/preferences/snapset_4d.json index fe1ccaa3f..c8be8bbe9 100644 --- a/testData/preferences/snapset_4d.json +++ b/testData/preferences/snapset_4d.json @@ -8,12 +8,12 @@ "http://registry.gpii.net/common/magnification": 2, "http://registry.gpii.net/common/magnifierPosition": "Lens", "http://registry.gpii.net/applications/com.microsoft.windows.highContrast": { - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/highContrastTheme": "white-black" }, "http://registry.gpii.net/applications/net.gpii.uioPlus": { "http://registry.gpii.net/common/supportTool": ["dictionary"], - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/highContrastTheme": "white-black" } } diff --git a/testData/preferences/sociable1.json b/testData/preferences/sociable1.json index 1bac55e6f..4c56b99cc 100644 --- a/testData/preferences/sociable1.json +++ b/testData/preferences/sociable1.json @@ -5,7 +5,7 @@ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/screenReaderTTSEnabled": true + "http://registry.gpii.net/common/screenReaderTTS/enabled": true } } } diff --git a/testData/preferences/sociable2.json b/testData/preferences/sociable2.json index c95212fa1..e7ce3b65f 100644 --- a/testData/preferences/sociable2.json +++ b/testData/preferences/sociable2.json @@ -6,8 +6,8 @@ "name": "Default preferences", "preferences": { "http://registry.gpii.net/common/fontSize": 24, - "http://registry.gpii.net/common/highContrastEnabled": true, - "http://registry.gpii.net/common/screenReaderTTSEnabled": true + "http://registry.gpii.net/common/highContrast/enabled": true, + "http://registry.gpii.net/common/screenReaderTTS/enabled": true } } } diff --git a/testData/preferences/uioPlusCommon.json b/testData/preferences/uioPlusCommon.json index 55e78176a..aba51ae27 100644 --- a/testData/preferences/uioPlusCommon.json +++ b/testData/preferences/uioPlusCommon.json @@ -7,15 +7,15 @@ "http://registry.gpii.net/common/lineSpace": 2, "http://registry.gpii.net/common/fontSize": 24, "http://registry.gpii.net/common/characterSpace": 0, - "http://registry.gpii.net/common/selfVoicingEnabled": true, - "http://registry.gpii.net/common/inputsLargerEnabled": true, - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/selfVoicing/enabled": true, + "http://registry.gpii.net/common/inputsLarger/enabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/highContrastTheme": "white-black", "http://registry.gpii.net/common/highlightColor": "green", "http://registry.gpii.net/common/tableOfContents": true, "http://registry.gpii.net/common/supportTool": ["dictionary"], - "http://registry.gpii.net/common/simplifiedUiEnabled": true, - "http://registry.gpii.net/common/syllabificationEnabled": false + "http://registry.gpii.net/common/simplifiedUi/enabled": true, + "http://registry.gpii.net/common/syllabification/enabled": false } } } diff --git a/testData/preferences/uioPlus_character_space.json b/testData/preferences/uioPlus_character_space.json index 2b54a94a7..5f263d51b 100644 --- a/testData/preferences/uioPlus_character_space.json +++ b/testData/preferences/uioPlus_character_space.json @@ -7,14 +7,14 @@ "http://registry.gpii.net/common/lineSpace": 1, "http://registry.gpii.net/common/fontSize": 12, "http://registry.gpii.net/common/characterSpace": 1, - "http://registry.gpii.net/common/selfVoicingEnabled": false, - "http://registry.gpii.net/common/inputsLargerEnabled": false, - "http://registry.gpii.net/common/highContrastEnabled": false, + "http://registry.gpii.net/common/selfVoicing/enabled": false, + "http://registry.gpii.net/common/inputsLarger/enabled": false, + "http://registry.gpii.net/common/highContrast/enabled": false, "http://registry.gpii.net/common/highlightColor": "default", "http://registry.gpii.net/common/tableOfContents": false, "http://registry.gpii.net/common/supportTool": [], - "http://registry.gpii.net/common/simplifiedUiEnabled": false, - "http://registry.gpii.net/common/syllabificationEnabled": false + "http://registry.gpii.net/common/simplifiedUi/enabled": false, + "http://registry.gpii.net/common/syllabification/enabled": false } } } diff --git a/testData/preferences/uioPlus_defaults.json b/testData/preferences/uioPlus_defaults.json index e7e4d2b69..ba1b096a7 100644 --- a/testData/preferences/uioPlus_defaults.json +++ b/testData/preferences/uioPlus_defaults.json @@ -7,14 +7,14 @@ "http://registry.gpii.net/common/lineSpace": 1, "http://registry.gpii.net/common/fontSize": 12, "http://registry.gpii.net/common/characterSpace": 0, - "http://registry.gpii.net/common/selfVoicingEnabled": false, - "http://registry.gpii.net/common/inputsLargerEnabled": false, - "http://registry.gpii.net/common/highContrastEnabled": false, + "http://registry.gpii.net/common/selfVoicing/enabled": false, + "http://registry.gpii.net/common/inputsLarger/enabled": false, + "http://registry.gpii.net/common/highContrast/enabled": false, "http://registry.gpii.net/common/highlightColor": "default", "http://registry.gpii.net/common/tableOfContents": false, "http://registry.gpii.net/common/supportTool": [], - "http://registry.gpii.net/common/simplifiedUiEnabled": false, - "http://registry.gpii.net/common/syllabificationEnabled": false + "http://registry.gpii.net/common/simplifiedUi/enabled": false, + "http://registry.gpii.net/common/syllabification/enabled": false } } } diff --git a/testData/preferences/uioPlus_font_size.json b/testData/preferences/uioPlus_font_size.json index 9356f7cf3..5b666aa9d 100644 --- a/testData/preferences/uioPlus_font_size.json +++ b/testData/preferences/uioPlus_font_size.json @@ -7,14 +7,14 @@ "http://registry.gpii.net/common/lineSpace": 1, "http://registry.gpii.net/common/fontSize": 24, "http://registry.gpii.net/common/characterSpace": 0, - "http://registry.gpii.net/common/selfVoicingEnabled": false, - "http://registry.gpii.net/common/inputsLargerEnabled": false, - "http://registry.gpii.net/common/highContrastEnabled": false, + "http://registry.gpii.net/common/selfVoicing/enabled": false, + "http://registry.gpii.net/common/inputsLarger/enabled": false, + "http://registry.gpii.net/common/highContrast/enabled": false, "http://registry.gpii.net/common/highlightColor": "default", "http://registry.gpii.net/common/tableOfContents": false, "http://registry.gpii.net/common/supportTool": [], - "http://registry.gpii.net/common/simplifiedUiEnabled": false, - "http://registry.gpii.net/common/syllabificationEnabled": false + "http://registry.gpii.net/common/simplifiedUi/enabled": false, + "http://registry.gpii.net/common/syllabification/enabled": false } } } diff --git a/testData/preferences/uioPlus_high_contrast.json b/testData/preferences/uioPlus_high_contrast.json index 3e229da55..dda680380 100644 --- a/testData/preferences/uioPlus_high_contrast.json +++ b/testData/preferences/uioPlus_high_contrast.json @@ -7,15 +7,15 @@ "http://registry.gpii.net/common/lineSpace": 1, "http://registry.gpii.net/common/fontSize": 12, "http://registry.gpii.net/common/characterSpace": 0, - "http://registry.gpii.net/common/selfVoicingEnabled": false, - "http://registry.gpii.net/common/inputsLargerEnabled": false, - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/selfVoicing/enabled": false, + "http://registry.gpii.net/common/inputsLarger/enabled": false, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/highContrastTheme": "white-black", "http://registry.gpii.net/common/highlightColor": "default", "http://registry.gpii.net/common/tableOfContents": false, "http://registry.gpii.net/common/supportTool": [], - "http://registry.gpii.net/common/simplifiedUiEnabled": false, - "http://registry.gpii.net/common/syllabificationEnabled": false + "http://registry.gpii.net/common/simplifiedUi/enabled": false, + "http://registry.gpii.net/common/syllabification/enabled": false } } } diff --git a/testData/preferences/uioPlus_highlight_colour.json b/testData/preferences/uioPlus_highlight_colour.json index 677c28e92..8c97751fc 100644 --- a/testData/preferences/uioPlus_highlight_colour.json +++ b/testData/preferences/uioPlus_highlight_colour.json @@ -7,14 +7,14 @@ "http://registry.gpii.net/common/lineSpace": 1, "http://registry.gpii.net/common/fontSize": 12, "http://registry.gpii.net/common/characterSpace": 0, - "http://registry.gpii.net/common/selfVoicingEnabled": false, - "http://registry.gpii.net/common/inputsLargerEnabled": false, - "http://registry.gpii.net/common/highContrastEnabled": false, + "http://registry.gpii.net/common/selfVoicing/enabled": false, + "http://registry.gpii.net/common/inputsLarger/enabled": false, + "http://registry.gpii.net/common/highContrast/enabled": false, "http://registry.gpii.net/common/highlightColor": "yellow", "http://registry.gpii.net/common/tableOfContents": false, "http://registry.gpii.net/common/supportTool": [], - "http://registry.gpii.net/common/simplifiedUiEnabled": false, - "http://registry.gpii.net/common/syllabificationEnabled": false + "http://registry.gpii.net/common/simplifiedUi/enabled": false, + "http://registry.gpii.net/common/syllabification/enabled": false } } } diff --git a/testData/preferences/uioPlus_inputs_larger.json b/testData/preferences/uioPlus_inputs_larger.json index f08c1dab1..53d086544 100644 --- a/testData/preferences/uioPlus_inputs_larger.json +++ b/testData/preferences/uioPlus_inputs_larger.json @@ -7,14 +7,14 @@ "http://registry.gpii.net/common/lineSpace": 1, "http://registry.gpii.net/common/fontSize": 12, "http://registry.gpii.net/common/characterSpace": 0, - "http://registry.gpii.net/common/selfVoicingEnabled": false, - "http://registry.gpii.net/common/inputsLargerEnabled": true, - "http://registry.gpii.net/common/highContrastEnabled": false, + "http://registry.gpii.net/common/selfVoicing/enabled": false, + "http://registry.gpii.net/common/inputsLarger/enabled": true, + "http://registry.gpii.net/common/highContrast/enabled": false, "http://registry.gpii.net/common/highlightColor": "default", "http://registry.gpii.net/common/tableOfContents": false, "http://registry.gpii.net/common/supportTool": [], - "http://registry.gpii.net/common/simplifiedUiEnabled": false, - "http://registry.gpii.net/common/syllabificationEnabled": false + "http://registry.gpii.net/common/simplifiedUi/enabled": false, + "http://registry.gpii.net/common/syllabification/enabled": false } } } diff --git a/testData/preferences/uioPlus_line_space.json b/testData/preferences/uioPlus_line_space.json index 1e7edb6b0..2415297bf 100644 --- a/testData/preferences/uioPlus_line_space.json +++ b/testData/preferences/uioPlus_line_space.json @@ -7,14 +7,14 @@ "http://registry.gpii.net/common/lineSpace": 2, "http://registry.gpii.net/common/fontSize": 12, "http://registry.gpii.net/common/characterSpace": 0, - "http://registry.gpii.net/common/selfVoicingEnabled": false, - "http://registry.gpii.net/common/inputsLargerEnabled": false, - "http://registry.gpii.net/common/highContrastEnabled": false, + "http://registry.gpii.net/common/selfVoicing/enabled": false, + "http://registry.gpii.net/common/inputsLarger/enabled": false, + "http://registry.gpii.net/common/highContrast/enabled": false, "http://registry.gpii.net/common/highlightColor": "default", "http://registry.gpii.net/common/tableOfContents": false, "http://registry.gpii.net/common/supportTool": [], - "http://registry.gpii.net/common/simplifiedUiEnabled": false, - "http://registry.gpii.net/common/syllabificationEnabled": false + "http://registry.gpii.net/common/simplifiedUi/enabled": false, + "http://registry.gpii.net/common/syllabification/enabled": false } } } diff --git a/testData/preferences/uioPlus_multiple_settings.json b/testData/preferences/uioPlus_multiple_settings.json index ee3406cb3..cc9720baa 100644 --- a/testData/preferences/uioPlus_multiple_settings.json +++ b/testData/preferences/uioPlus_multiple_settings.json @@ -7,15 +7,15 @@ "http://registry.gpii.net/common/lineSpace": 1.3, "http://registry.gpii.net/common/fontSize": 16, "http://registry.gpii.net/common/characterSpace": 2, - "http://registry.gpii.net/common/selfVoicingEnabled": true, - "http://registry.gpii.net/common/inputsLargerEnabled": true, - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/selfVoicing/enabled": true, + "http://registry.gpii.net/common/inputsLarger/enabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/highContrastTheme": "yellow-black", "http://registry.gpii.net/common/highlightColor": "green", "http://registry.gpii.net/common/tableOfContents": true, "http://registry.gpii.net/common/supportTool": ["dictionary"], - "http://registry.gpii.net/common/simplifiedUiEnabled": true, - "http://registry.gpii.net/common/syllabificationEnabled": true + "http://registry.gpii.net/common/simplifiedUi/enabled": true, + "http://registry.gpii.net/common/syllabification/enabled": true } } } diff --git a/testData/preferences/uioPlus_multiple_support_tool.json b/testData/preferences/uioPlus_multiple_support_tool.json index 80d345cb4..f5a1b74ff 100644 --- a/testData/preferences/uioPlus_multiple_support_tool.json +++ b/testData/preferences/uioPlus_multiple_support_tool.json @@ -7,14 +7,14 @@ "http://registry.gpii.net/common/lineSpace": 1, "http://registry.gpii.net/common/fontSize": 12, "http://registry.gpii.net/common/characterSpace": 0, - "http://registry.gpii.net/common/selfVoicingEnabled": false, - "http://registry.gpii.net/common/inputsLargerEnabled": false, - "http://registry.gpii.net/common/highContrastEnabled": false, + "http://registry.gpii.net/common/selfVoicing/enabled": false, + "http://registry.gpii.net/common/inputsLarger/enabled": false, + "http://registry.gpii.net/common/highContrast/enabled": false, "http://registry.gpii.net/common/highlightColor": "default", "http://registry.gpii.net/common/tableOfContents": false, "http://registry.gpii.net/common/supportTool": ["dictionary", "thesaurus"], - "http://registry.gpii.net/common/simplifiedUiEnabled": false, - "http://registry.gpii.net/common/syllabificationEnabled": false + "http://registry.gpii.net/common/simplifiedUi/enabled": false, + "http://registry.gpii.net/common/syllabification/enabled": false } } } diff --git a/testData/preferences/uioPlus_self_voicing.json b/testData/preferences/uioPlus_self_voicing.json index 707aad3e9..41979fe7b 100644 --- a/testData/preferences/uioPlus_self_voicing.json +++ b/testData/preferences/uioPlus_self_voicing.json @@ -7,14 +7,14 @@ "http://registry.gpii.net/common/lineSpace": 1, "http://registry.gpii.net/common/fontSize": 12, "http://registry.gpii.net/common/characterSpace": 0, - "http://registry.gpii.net/common/selfVoicingEnabled": true, - "http://registry.gpii.net/common/inputsLargerEnabled": false, - "http://registry.gpii.net/common/highContrastEnabled": false, + "http://registry.gpii.net/common/selfVoicing/enabled": true, + "http://registry.gpii.net/common/inputsLarger/enabled": false, + "http://registry.gpii.net/common/highContrast/enabled": false, "http://registry.gpii.net/common/highlightColor": "default", "http://registry.gpii.net/common/tableOfContents": false, "http://registry.gpii.net/common/supportTool": [], - "http://registry.gpii.net/common/simplifiedUiEnabled": false, - "http://registry.gpii.net/common/syllabificationEnabled": false + "http://registry.gpii.net/common/simplifiedUi/enabled": false, + "http://registry.gpii.net/common/syllabification/enabled": false } } } diff --git a/testData/preferences/uioPlus_simplified.json b/testData/preferences/uioPlus_simplified.json index c1c11cc6f..500d329f8 100644 --- a/testData/preferences/uioPlus_simplified.json +++ b/testData/preferences/uioPlus_simplified.json @@ -7,14 +7,14 @@ "http://registry.gpii.net/common/lineSpace": 1, "http://registry.gpii.net/common/fontSize": 12, "http://registry.gpii.net/common/characterSpace": 0, - "http://registry.gpii.net/common/selfVoicingEnabled": false, - "http://registry.gpii.net/common/inputsLargerEnabled": false, - "http://registry.gpii.net/common/highContrastEnabled": false, + "http://registry.gpii.net/common/selfVoicing/enabled": false, + "http://registry.gpii.net/common/inputsLarger/enabled": false, + "http://registry.gpii.net/common/highContrast/enabled": false, "http://registry.gpii.net/common/highlightColor": "default", "http://registry.gpii.net/common/tableOfContents": false, "http://registry.gpii.net/common/supportTool": [], - "http://registry.gpii.net/common/simplifiedUiEnabled": true, - "http://registry.gpii.net/common/syllabificationEnabled": false + "http://registry.gpii.net/common/simplifiedUi/enabled": true, + "http://registry.gpii.net/common/syllabification/enabled": false } } } diff --git a/testData/preferences/uioPlus_support_tool.json b/testData/preferences/uioPlus_support_tool.json index 048cc213f..02dd218fe 100644 --- a/testData/preferences/uioPlus_support_tool.json +++ b/testData/preferences/uioPlus_support_tool.json @@ -7,14 +7,14 @@ "http://registry.gpii.net/common/lineSpace": 1, "http://registry.gpii.net/common/fontSize": 12, "http://registry.gpii.net/common/characterSpace": 0, - "http://registry.gpii.net/common/selfVoicingEnabled": false, - "http://registry.gpii.net/common/inputsLargerEnabled": false, - "http://registry.gpii.net/common/highContrastEnabled": false, + "http://registry.gpii.net/common/selfVoicing/enabled": false, + "http://registry.gpii.net/common/inputsLarger/enabled": false, + "http://registry.gpii.net/common/highContrast/enabled": false, "http://registry.gpii.net/common/highlightColor": "default", "http://registry.gpii.net/common/tableOfContents": false, "http://registry.gpii.net/common/supportTool": ["dictionary"], - "http://registry.gpii.net/common/simplifiedUiEnabled": false, - "http://registry.gpii.net/common/syllabificationEnabled": false + "http://registry.gpii.net/common/simplifiedUi/enabled": false, + "http://registry.gpii.net/common/syllabification/enabled": false } } } diff --git a/testData/preferences/uioPlus_syllabification.json b/testData/preferences/uioPlus_syllabification.json index edd27c201..291fa9fdb 100644 --- a/testData/preferences/uioPlus_syllabification.json +++ b/testData/preferences/uioPlus_syllabification.json @@ -7,14 +7,14 @@ "http://registry.gpii.net/common/lineSpace": 1, "http://registry.gpii.net/common/fontSize": 12, "http://registry.gpii.net/common/characterSpace": 0, - "http://registry.gpii.net/common/selfVoicingEnabled": false, - "http://registry.gpii.net/common/inputsLargerEnabled": false, - "http://registry.gpii.net/common/highContrastEnabled": false, + "http://registry.gpii.net/common/selfVoicing/enabled": false, + "http://registry.gpii.net/common/inputsLarger/enabled": false, + "http://registry.gpii.net/common/highContrast/enabled": false, "http://registry.gpii.net/common/highlightColor": "default", "http://registry.gpii.net/common/tableOfContents": false, "http://registry.gpii.net/common/supportTool": [], - "http://registry.gpii.net/common/simplifiedUiEnabled": false, - "http://registry.gpii.net/common/syllabificationEnabled": true + "http://registry.gpii.net/common/simplifiedUi/enabled": false, + "http://registry.gpii.net/common/syllabification/enabled": true } } } diff --git a/testData/preferences/uioPlus_toc.json b/testData/preferences/uioPlus_toc.json index 73fbbbd96..b8432969f 100644 --- a/testData/preferences/uioPlus_toc.json +++ b/testData/preferences/uioPlus_toc.json @@ -7,14 +7,14 @@ "http://registry.gpii.net/common/lineSpace": 1, "http://registry.gpii.net/common/fontSize": 12, "http://registry.gpii.net/common/characterSpace": 0, - "http://registry.gpii.net/common/selfVoicingEnabled": false, - "http://registry.gpii.net/common/inputsLargerEnabled": false, - "http://registry.gpii.net/common/highContrastEnabled": false, + "http://registry.gpii.net/common/selfVoicing/enabled": false, + "http://registry.gpii.net/common/inputsLarger/enabled": false, + "http://registry.gpii.net/common/highContrast/enabled": false, "http://registry.gpii.net/common/highlightColor": "default", "http://registry.gpii.net/common/tableOfContents": true, "http://registry.gpii.net/common/supportTool": [], - "http://registry.gpii.net/common/simplifiedUiEnabled": false, - "http://registry.gpii.net/common/syllabificationEnabled": false + "http://registry.gpii.net/common/simplifiedUi/enabled": false, + "http://registry.gpii.net/common/syllabification/enabled": false } } } diff --git a/testData/preferences/uioPlus_unhandled_support_tool.json b/testData/preferences/uioPlus_unhandled_support_tool.json index 2d457ce62..ea213b2b0 100644 --- a/testData/preferences/uioPlus_unhandled_support_tool.json +++ b/testData/preferences/uioPlus_unhandled_support_tool.json @@ -7,14 +7,14 @@ "http://registry.gpii.net/common/lineSpace": 1, "http://registry.gpii.net/common/fontSize": 12, "http://registry.gpii.net/common/characterSpace": 0, - "http://registry.gpii.net/common/selfVoicingEnabled": false, - "http://registry.gpii.net/common/inputsLargerEnabled": false, - "http://registry.gpii.net/common/highContrastEnabled": false, + "http://registry.gpii.net/common/selfVoicing/enabled": false, + "http://registry.gpii.net/common/inputsLarger/enabled": false, + "http://registry.gpii.net/common/highContrast/enabled": false, "http://registry.gpii.net/common/highlightColor": "default", "http://registry.gpii.net/common/tableOfContents": false, "http://registry.gpii.net/common/supportTool": ["thesaurus"], - "http://registry.gpii.net/common/simplifiedUiEnabled": false, - "http://registry.gpii.net/common/syllabificationEnabled": false + "http://registry.gpii.net/common/simplifiedUi/enabled": false, + "http://registry.gpii.net/common/syllabification/enabled": false } } } diff --git a/testData/preferences/vladimir.json b/testData/preferences/vladimir.json index 836895063..508317c5f 100644 --- a/testData/preferences/vladimir.json +++ b/testData/preferences/vladimir.json @@ -5,15 +5,15 @@ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/highContrastTheme": "white-black", "http://registry.gpii.net/common/cursorSize": 0.5, "http://registry.gpii.net/common/mouseTrailing": 5, - "http://registry.gpii.net/common/screenReaderTTSEnabled": true, + "http://registry.gpii.net/common/screenReaderTTS/enabled": true, "http://registry.gpii.net/common/speechRate": 300, "http://registry.gpii.net/applications/org.chrome.cloud4chrome": { "fontSize": "medium", - "highContrastEnabled": true + "highContrast/enabled": true }, "http://registry.gpii.net/common/matchMakerType": "RuleBased" }, @@ -21,7 +21,7 @@ { "type": "required", "scope": [ - "http://registry.gpii.net/common/screenReaderTTSEnabled" + "http://registry.gpii.net/common/screenReaderTTS/enabled" ], "value": 1024 }, @@ -37,16 +37,16 @@ "subway": { "name": "subway", "preferences": { - "http://registry.gpii.net/common/highContrastEnabled": true, + "http://registry.gpii.net/common/highContrast/enabled": true, "http://registry.gpii.net/common/highContrastTheme": "white-black", "http://registry.gpii.net/common/cursorSize": 0.5, "http://registry.gpii.net/common/mouseTrailing": 5, - "http://registry.gpii.net/common/screenReaderTTSEnabled": true, + "http://registry.gpii.net/common/screenReaderTTS/enabled": true, "http://registry.gpii.net/common/speechRate": 300, "http://registry.gpii.net/common/volumeTTS": 0.9, "http://registry.gpii.net/applications/org.chrome.cloud4chrome": { "fontSize": "medium", - "highContrastEnabled": true + "highContrast/enabled": true }, "http://registry.gpii.net/common/matchMakerType": "RuleBased" }, @@ -54,7 +54,7 @@ { "type": "required", "scope": [ - "http://registry.gpii.net/common/screenReaderTTSEnabled" + "http://registry.gpii.net/common/screenReaderTTS/enabled" ], "value": 1024 }, diff --git a/testData/processReporter/runningSolutions.json b/testData/processReporter/runningSolutions.json deleted file mode 100644 index 8abfd8459..000000000 --- a/testData/processReporter/runningSolutions.json +++ /dev/null @@ -1,172 +0,0 @@ -[ - { - "id": "org.gnome.desktop.interface", - "runnning": true - }, - - { - "id": "org.gnome.shell.overrides", - "runnning": true - }, - - { - "id": "org.gnome.desktop.wm.preferences", - "runnning": true - }, - - { - "id": "org.gnome.nautilus", - "runnning": true - }, - - { - "id": "org.gnome.desktop.a11y.keyboard", - "runnning": true - }, - - { - "id": "org.gnome.desktop.a11y.applications.onscreen-keyboard", - "runnning": true - }, - - { - "id": "org.gnome.orca", - "runnning": true - }, - - { - "id": "org.gnome.desktop.a11y.magnifier", - "runnning": true - }, - - { - "id": "com.microsoft.windows.magnifier", - "runnning": true - }, - - { - "id": "com.microsoft.windows.onscreenKeyboard", - "runnning": true - }, - - { - "id": "org.nvda-project", - "runnning": true - }, - - { - "id": "org.gnome.desktop.interface", - "runnning": true - }, - - { - "id": "org.gnome.nautilus", - "runnning": true - }, - - { - "id": "trace.easyOne.communicator.windows", - "runnning": true - }, - - { - "id": "trace.easyOne.communicator.linux", - "runnning": true - }, - - { - "id": "trace.easyOne.sudan.windows", - "runnning": true - }, - - { - "id": "trace.easyOne.sudan.linux", - "runnning": true - }, - - { - "id": "webinsight.webAnywhere.windows", - "runnning": true - }, - - { - "id": "webinsight.webAnywhere.linux", - "runnning": true - }, - - { - "id": "com.texthelp.readWriteGold", - "runnning": true - }, - - { - "id": "net.opendirective.maavis", - "runnning": true - }, - - { - "id": "com.microsoft.windows.highContrast", - "runnning": true - }, - - { - "id": "com.microsoft.windows.mouseTrailing", - "runnning": true - }, - - { - "id": "com.microsoft.windows.cursors", - "runnning": true - }, - - { - "id": "com.android.activitymanager", - "runnning": true - }, - - { - "id": "com.android.talkback", - "runnning": true - }, - - { - "id": "com.android.freespeech", - "runnning": true - }, - - { - "id": "org.chrome.cloud4chrome", - "runnning": true - }, - - { - "id": "com.android.settings.secure", - "runnning": true - }, - - { - "id": "com.android.audioManager", - "runnning": true - }, - - { - "id": "com.android.persistentConfiguration", - "runnning": true - }, - - { - "id": "org.alsa-project", - "runnning": true - }, - - { - "id": "org.freedesktop.xrandr", - "runnning": true - }, - - { - "id": "com.android.settings.system", - "runnning": true - } - -] diff --git a/testData/solutions/android.json5 b/testData/solutions/android.json5 index 0bd3bed6c..757fa7e62 100644 --- a/testData/solutions/android.json5 +++ b/testData/solutions/android.json5 @@ -7,18 +7,27 @@ "version": ">=0.1" }] }, - "settingsHandlers": { - "configuration": { - "type": "gpii.settingsHandlers.noSettings", - "capabilities": [ - "http://registry\\.gpii\\.net/common/screenReaderTTSEnabled" - ] + "capabilities": [ + "http://registry\\.gpii\\.net/common/screenReaderTTS/enabled" + ], + "launchHandlers": { + "launcher": { + "type": "gpii.launchHandlers.flexibleHandler", + "options": { + "setTrue": { + "type": "gpii.androidActivityManager.startFreespeech" + }, + "getState": [{ + "type": "gpii.processReporter.neverRunning" + }] + } } }, "start": [ - { - "type": "gpii.androidActivityManager.startFreespeech" - } + "launchers.launcher" + ], + "isRunning": [ + "launchers.launcher" ] }, @@ -30,24 +39,25 @@ "version": ">=0.1" }] }, - "settingsHandlers": { - "configuration": { - "type": "gpii.settingsHandlers.noSettings", - "capabilities": [ - "http://registry\\.gpii\\.net/common/screenReaderTTSEnabled" - ] - } - }, - "start": [ - { - "type": "gpii.androidActivityManager.startTalkback" - } + "capabilities": [ + "http://registry\\.gpii\\.net/common/screenReaderTTS/enabled" ], - "stop": [ - { - "type": "gpii.androidActivityManager.stopTalkback" + "launchHandlers": { + "launcher": { + "type": "gpii.launchHandlers.flexibleHandler", + "options": { + "setTrue": { + "type": "gpii.androidActivityManager.startTalkback" + }, + "setFalse": { + "type": "gpii.androidActivityManager.stopTalkback" + }, + "getState": [{ + "type": "gpii.processReporter.neverRunning" + }] + } } - ] + } }, "com.android.persistentConfiguration": { @@ -67,7 +77,7 @@ "fontScale": {}, "locale": {} }, - "capabilities": [], + "liveness": "live", "capabilitiesTransformations": { "fontScale": { "transform": { @@ -145,13 +155,7 @@ }, "inverseCapabilitiesTransformations": {} } - }, - "configure": [ - "settings.configuration" - ], - "restore": [ - "settings.configuration" - ] + } }, "com.android.audioManager": { @@ -167,11 +171,11 @@ "settingsHandlers": { "configuration": { "type": "gpii.androidAudioManager.volume", + "liveness": "live", "supportedSettings": { "STREAM_MUSIC": {}, "STREAM_SYSTEM": {} }, - "capabilities": [], "capabilitiesTransformations": { "STREAM_MUSIC": { "transform": { @@ -200,13 +204,7 @@ }, "inverseCapabilitiesTransformations": {} } - }, - "configure": [ - "settings.configuration" - ], - "restore": [ - "settings.configuration" - ] + } }, "com.android.settings.system": { @@ -222,6 +220,7 @@ "settingsHandlers": { "configuration": { "type": "gpii.androidSettings", + "liveness": "live", "options": { "settingType": "System" }, @@ -232,7 +231,6 @@ "user_rotation": {}, "screen_off_timeout": {} }, - "capabilities": [], "capabilitiesTransformations": { "dim_screen": { "transform": { @@ -269,13 +267,7 @@ }, "inverseCapabilitiesTransformations": {} } - }, - "configure": [ - "settings.configuration" - ], - "restore": [ - "settings.configuration" - ] + } }, "com.android.settings.secure": { @@ -291,6 +283,7 @@ "settingsHandlers": { "configuration": { "type": "gpii.androidSettings", + "liveness": "live", "options": { "settingType": "Secure" }, @@ -298,7 +291,6 @@ "tts_default_pitch": {}, "tts_default_rate": {} }, - "capabilities": [], "capabilitiesTransformations": { "tts_default_pitch": { "transform": { @@ -356,13 +348,7 @@ }, "inverseCapabilitiesTransformations": {} } - }, - "configure": [ - "settings.configuration" - ], - "restore": [ - "settings.configuration" - ] + } }, "se.omnitor.ecmobile": { @@ -376,6 +362,7 @@ "settingsHandlers": { "configuration": { "type": "gpii.settingsHandlers.XMLHandler", + "liveness": "manualRestart", "supportedSettings": { "map.string.fontsize.$t": {}, "map.string.theme.$t": {} @@ -395,7 +382,6 @@ } } }, - "capabilities": [], "capabilitiesTransformations": { "map\\.string\\.fontsize\\.$t": { "transform": { @@ -407,7 +393,7 @@ "map\\.string\\.theme\\.$t": { "transform": { "type": "fluid.transforms.condition", - "conditionPath": "http://registry\\.gpii\\.net/common/highContrastEnabled", + "conditionPath": "http://registry\\.gpii\\.net/common/highContrast/enabled", "true": "yellow-black", "truePath": "http://registry\\.gpii\\.net/common/highContrastTheme", "false": "none" @@ -417,27 +403,29 @@ "inverseCapabilitiesTransformations": {} } }, - "configure": [ - "settings.configuration" - ], - "restore": [ - "settings.configuration" - ], - "start": [ - { - "type": "gpii.androidActivityManager.startActivityByPackageName", - "packageName": "se.omnitor.ecmobile" - } - ], - "stop": [ - { - "type": "gpii.androidActivityManager.stopActivityByPackageName", - "packageName": "se.omnitor.ecmobile" - }, - { - "type": "gpii.androidActivityManager.goToHomeScreen" + "launchHandlers": { + "launcher": { + "type": "gpii.launchHandlers.flexibleHandler", + "options": { + "setTrue": { + "type": "gpii.androidActivityManager.startActivityByPackageName", + "packageName": "se.omnitor.ecmobile" + }, + "setFalse": [ + { + "type": "gpii.androidActivityManager.stopActivityByPackageName", + "packageName": "se.omnitor.ecmobile" + }, + { + "type": "gpii.androidActivityManager.goToHomeScreen" + } + ], + "getState": [{ + "type": "gpii.processReporter.neverRunning" + }] + } } - ] + } }, "es.codefactory.android.app.ma": { @@ -460,7 +448,6 @@ "access_commonprefs_punctuation": {}, "access_commonprefs_capitalization": {} }, - "capabilities": [], "capabilitiesTransformations": { "access_commonprefs_speechrate": { "transform": { diff --git a/testData/solutions/darwin.json5 b/testData/solutions/darwin.json5 index c5117ea61..b35f8bf47 100644 --- a/testData/solutions/darwin.json5 +++ b/testData/solutions/darwin.json5 @@ -8,15 +8,15 @@ } ] }, + "capabilities": [ + "http://registry\\.gpii\\.net/common/magnification/enabled" + ], "settingsHandlers": { "configuration": { "type": "gpii.settingsHandlers.JSONSettingsHandler", "options": { "filename": "/tmp/fakemag1.settings.json" }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/magnifierEnabled" - ], "capabilitiesTransformations": { "magnification": "http://registry\\.gpii\\.net/common/magnification" } @@ -46,15 +46,15 @@ } ] }, + "capabilities": [ + "http://registry\\.gpii\\.net/common/magnification/enabled" + ], "settingsHandlers": { "configuration": { "type": "gpii.settingsHandlers.JSONSettingsHandler", "options": { "filename": "/tmp/fakemag2.settings.json" }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/magnifierEnabled" - ], "capabilitiesTransformations": { "magnification": "http://registry\\.gpii\\.net/common/magnification", "invert": "http://registry\\.gpii\\.net/common/invertColours" @@ -85,15 +85,15 @@ } ] }, + "capabilities": [ + "http://registry\\.gpii\\.net/common/screenReaderTTS/enabled" + ], "settingsHandlers": { "configuration": { "type": "gpii.settingsHandlers.JSONSettingsHandler", "options": { "filename": "/tmp/fakescreenreader1.json" }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/screenReaderTTSEnabled" - ], "capabilitiesTransformations": { "pitch": "http://registry\\.gpii\\.net/common/pitch", "volumeTTS": "http://registry\\.gpii\\.net/common/volumeTTS", diff --git a/testData/solutions/linux.json5 b/testData/solutions/linux.json5 index 348237c8b..ef0cf1bc2 100644 --- a/testData/solutions/linux.json5 +++ b/testData/solutions/linux.json5 @@ -24,7 +24,6 @@ "mouse-tracking": {}, "screen-position": {} }, - "capabilities": [], "capabilitiesTransformations": { "mag-factor": "http://registry\\.gpii\\.net/common/magnification", "show-cross-hairs": "http://registry\\.gpii\\.net/common/showCrosshairs", @@ -86,44 +85,23 @@ } } }, + "launchHandlers": { + "launcher": { + "type": "gpii.gsettings.launch", + "options": { + "schema": "org.gnome.desktop.a11y.applications", + "key": "screen-magnifier-enabled" + } + } + }, "update": [ "settings.configuration" ], - "configure": [ - "settings.configuration" - ], - "restore": [ - "settings.configuration" - ], - "start": [ - { - "type": "gpii.launch.exec", - "command": "gsettings set org.gnome.desktop.a11y.applications screen-magnifier-enabled true" - } - ], - "stop": [ - { - "type": "gpii.launch.exec", - "command": "gsettings set org.gnome.desktop.a11y.applications screen-magnifier-enabled false" - } - ], "isInstalled": [ { "type": "gpii.packageKit.find", "name": "gnome-shell" } - ], - "isRunning": [ - { - "type": "gpii.processReporter.find", - "command": "gnome-shell" - }, - { - "type": "gpii.processReporter.checkSetting", - "schema": "org.gnome.desktop.a11y.applications", - "setting": "screen-magnifier-enabled", - "value": true - } ] }, @@ -147,7 +125,6 @@ "gtk-theme": {}, "icon-theme": {} }, - "capabilities": [], "capabilitiesTransformations": { "text-scaling-factor": { "transform": { @@ -179,7 +156,7 @@ "gtk-theme": { "transform": { "type": "fluid.transforms.condition", - "conditionPath": "http://registry\\.gpii\\.net/common/highContrastEnabled", + "conditionPath": "http://registry\\.gpii\\.net/common/highContrast/enabled", "true": "HighContrast", "false": "Adwaita" } @@ -187,7 +164,7 @@ "icon-theme": { "transform": { "type": "fluid.transforms.condition", - "conditionPath": "http://registry\\.gpii\\.net/common/highContrastEnabled", + "conditionPath": "http://registry\\.gpii\\.net/common/highContrast/enabled", "true": "HighContrast", "false": "gnome" } @@ -213,7 +190,7 @@ }, { "type": "fluid.transforms.binaryOp", - "outputPath": "http://registry\\.gpii\\.net/common/highContrastEnabled", + "outputPath": "http://registry\\.gpii\\.net/common/highContrast/enabled", "left": { "transform": { "type": "fluid.transforms.binaryOp", @@ -236,23 +213,11 @@ } } }, - "configure": [ - "settings.configuration" - ], - "restore": [ - "settings.configuration" - ], "isInstalled": [ { "type": "gpii.packageKit.find", "name": "gsettings-desktop-schemas" } - ], - "isRunning": [ - { - "type": "gpii.processReporter.find", - "command": "dunno" - } ] }, @@ -272,7 +237,6 @@ "supportedSettings": { "font": {} }, - "capabilities": [], "capabilitiesTransformations": { "font": "http://registry\\.gpii\\.net/common/0" }, @@ -282,23 +246,11 @@ "inverseCapabilitiesTransformations": {} } }, - "configure": [ - "settings.configuration" - ], - "restore": [ - "settings.configuration" - ], "isInstalled": [ { "type": "gpii.packageKit.find", "name": "nautilus" } - ], - "isRunning": [ - { - "type": "gpii.processReporter.find", - "command": "nautilus" - } ] }, @@ -310,37 +262,24 @@ "version": ">=2.6.26" }] }, - "settingsHandlers": { - "configuration": { - "type": "gpii.settingsHandlers.noSettings", - "capabilities": [ - "http://registry\\.gpii\\.net/common/onScreenKeyboardEnabled" - ] - } - }, - "start": [ - { - "type": "gpii.launch.exec", - "command": "gsettings set org.gnome.desktop.a11y.applications screen-keyboard-enabled true" - } + "capabilities": [ + "http://registry\\.gpii\\.net/common/onScreenKeyboard/enabled" ], - "stop": [ - { - "type": "gpii.launch.exec", - "command": "gsettings set org.gnome.desktop.a11y.applications screen-keyboard-enabled false" + "launchHandlers": { + "launching": { + "type": "gpii.gsettings.launch", + "options": { + "schema": "org.gnome.desktop.a11y.applications", + "key": "screen-keyboard-enabled" + } } - ], + }, + "update": [], "isInstalled": [ { "type": "gpii.packageKit.find", "name": "gnome-shell" } - ], - "isRunning": [ - { - "type": "gpii.processReporter.find", - "command": "caribou" - } ] }, @@ -367,10 +306,9 @@ "mousekeys-max-speed": {}, "mousekeys-accel-time": {} }, - "capabilities": [], "capabilitiesTransformations": { "stickykeys-enable": "http://registry\\.gpii\\.net/common/stickyKeys", - "slowkeys-enable": "http://registry\\.gpii\\.net/common/slowKeysEnabled", + "slowkeys-enable": "http://registry\\.gpii\\.net/common/slowKeys/enabled", "slowkeys-delay": { "transform": { "type": "fluid.transforms.linearScale", @@ -378,7 +316,7 @@ "factor": 1000 } }, - "bouncekeys-enable": "http://registry\\.gpii\\.net/common/debounceEnabled", + "bouncekeys-enable": "http://registry\\.gpii\\.net/common/debounce/enabled", "bouncekeys-delay": { "transform": { "type": "fluid.transforms.linearScale", @@ -386,7 +324,7 @@ "factor": 1000 } }, - "mousekeys-enable": "http://registry\\.gpii\\.net/common/mouseEmulationEnabled", + "mousekeys-enable": "http://registry\\.gpii\\.net/common/mouseEmulation/enabled", "mousekeys-init-delay": { "transform": { "type": "fluid.transforms.linearScale", @@ -414,23 +352,11 @@ } } }, - "configure": [ - "settings.configuration" - ], - "restore": [ - "settings.configuration" - ], "isInstalled": [ { "type": "gpii.packageKit.find", "name": "gsettings-desktop-schemas" } - ], - "isRunning": [ - { - "type": "gpii.processReporter.find", - "command": "gnome-settings-daemon" - } ] }, @@ -447,18 +373,11 @@ "configuration": { "type": "gpii.gsettings", "liveness": "live", - "capabilities": [], "options": { "schema": "org.gnome.desktop.wm.preferences" } } }, - "configure": [ - "settings.configuration" - ], - "restore": [ - "settings.configuration" - ], "isInstalled": [ { "type": "gpii.packageKit.find", @@ -475,24 +394,15 @@ "version": ">=2.6.26" }] }, - "settingsHandlers": { "configuration": { "type": "gpii.gsettings", "liveness": "live", - "capabilities": [ - ], "options": { "schema": "org.gnome.shell.overrides" } } }, - "configure": [ - "settings.configuration" - ], - "restore": [ - "settings.configuration" - ], "isInstalled": [ { "type": "gpii.packageKit.find", @@ -509,6 +419,9 @@ "version": ">=2.6.26" }] }, + "capabilities": [ + "http://registry\\.gpii\\.net/common/screenReaderTTS/enabled" + ], "settingsHandlers": { "configuration": { "type": "gpii.orca", @@ -529,15 +442,12 @@ "voices.default.family": {}, "verbalizePunctuationStyle": {} }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/screenReaderTTSEnabled" - ], "capabilitiesTransformations": { "enableTutorialMessages": "http://registry\\.gpii\\.net/common/speakTutorialMessages", "enableEchoByCharacter": "http://registry\\.gpii\\.net/common/keyEcho", "enableEchoByWord": "http://registry\\.gpii\\.net/common/wordEcho", "enableBraille": "http://registry\\.gpii\\.net/common/screenReaderBrailleOutput", - "enableSpeech": "http://registry\\.gpii\\.net/common/screenReaderTTSEnabled", + "enableSpeech": "http://registry\\.gpii\\.net/common/screenReaderTTS/enabled", "sayAllStyle": { "transform": { "type": "fluid.transforms.valueMapper", @@ -1002,7 +912,7 @@ "http://registry\\.gpii\\.net/common/keyEcho": "enableEchoByCharacter", "http://registry\\.gpii\\.net/common/wordEcho": "enableEchoByWord", "http://registry\\.gpii\\.net/common/screenReaderBrailleOutput": "enableBraille", - "http://registry\\.gpii\\.net/common/screenReaderTTSEnabled": "enableSpeech", + "http://registry\\.gpii\\.net/common/screenReaderTTS/enabled": "enableSpeech", "transform": [ { "type": "fluid.transforms.valueMapper", @@ -1130,35 +1040,20 @@ } } }, - "configure": [ - "settings.configuration" - ], - "restore": [ - "settings.configuration" - ], - "start": [ - { - "type": "gpii.launch.exec", - "command": "gsettings set org.gnome.desktop.a11y.applications screen-reader-enabled true" - } - ], - "stop": [ - { - "type": "gpii.launch.exec", - "command": "gsettings set org.gnome.desktop.a11y.applications screen-reader-enabled false" + "launchHandlers": { + "launcher": { + "type": "gpii.gsettings.launch", + "options": { + "schema": "org.gnome.desktop.a11y.applications", + "key": "screen-reader-enabled" + } } - ], + }, "isInstalled": [ { "type": "gpii.packageKit.find", "name": "orca" } - ], - "isRunning": [ - { - "type": "gpii.processReporter.find", - "command": "orca" - } ] }, @@ -1179,7 +1074,6 @@ "supportedSettings": { "masterVolume": {} }, - "capabilities": [], "capabilitiesTransformations": { "masterVolume": { "transform": { @@ -1191,15 +1085,6 @@ } } }, - "configure": [ - "settings.configuration" - ], - "restore": [ - "settings.configuration" - ], - "update": [ - "settings.configuration" - ], "isInstalled": [ { "type": "gpii.packageKit.find", @@ -1209,12 +1094,6 @@ "type": "gpii.packageKit.find", "name": "alsa-lib" } - ], - "isRunning": [ - { - "type": "gpii.processReporter.find", - "command": "alsactl" - } ] }, @@ -1228,26 +1107,27 @@ } ] }, - "settingsHandlers": { - "configuration": { - "type": "gpii.settingsHandlers.noSettings", - "capabilities": [ - "http://registry\\.gpii\\.net/common/simplification" - ] - } - }, - "start": [ - { - "type": "gpii.launch.exec", - "command": "google-chrome http://easyone.gpii.net/user/${{userToken}}" - } + "capabilities": [ + "http://registry\\.gpii\\.net/common/simplification" ], - "stop": [ - { - "type": "gpii.launch.exec", - "command": "pkill -2 chrome" + "launchHandlers": { + "launcher": { + "type": "gpii.launchHandlers.flexibleHandler", + "options": { + "setTrue": { + "type": "gpii.launch.exec", + "command": "google-chrome http://easyone.gpii.net/user/${{userToken}}" + }, + "setFalse": { + "type": "gpii.launch.exec", + "command": "pkill -2 chrome" + }, + "getState": [{ + "type": "gpii.processReporter.neverRunning" + }] + } } - ], + }, "isInstalled": [ { "type": "gpii.packageKit.find", @@ -1261,12 +1141,6 @@ "type": "gpii.packageKit.find", "name": "google-chrome-unstable" } - ], - "isRunning": [ - { - "type": "gpii.processReporter.find", - "command": "chrome" - } ] }, @@ -1280,26 +1154,32 @@ } ] }, + "capabilities": [ + "http://registry\\.gpii\\.net/common/simplification" + ], "settingsHandlers": { "configuration": { - "type": "gpii.settingsHandlers.noSettings", - "capabilities": [ - "http://registry\\.gpii\\.net/common/simplification" - ] + "type": "gpii.settingsHandlers.noSettings" } }, - "start": [ - { - "type": "gpii.launch.exec", - "command": "google-chrome http://easyone.gpii.net/sudan" - } - ], - "stop": [ - { - "type": "gpii.launch.exec", - "command": "pkill -2 chrome" + "launchHandlers": { + "launcher": { + "type": "gpii.launchHandlers.flexibleHandler", + "options": { + "setTrue": { + "type": "gpii.launch.exec", + "command": "google-chrome http://easyone.gpii.net/sudan" + }, + "setFalse": { + "type": "gpii.launch.exec", + "command": "pkill -2 chrome" + }, + "getState": [{ + "type": "gpii.processReporter.neverRunning" + }] + } } - ], + }, "isInstalled": [ { "type": "gpii.packageKit.find", @@ -1313,12 +1193,6 @@ "type": "gpii.packageKit.find", "name": "google-chrome-unstable" } - ], - "isRunning": [ - { - "type": "gpii.processReporter.find", - "command": "chrome" - } ] }, @@ -1332,26 +1206,27 @@ } ] }, - "settingsHandlers": { - "configuration": { - "type": "gpii.settingsHandlers.noSettings", - "capabilities": [ - "http://registry\\.gpii\\.net/common/screenReaderTTSEnabled" - ] - } - }, - "start": [ - { - "type": "gpii.launch.exec", - "command": "google-chrome http://webanywhere.cs.washington.edu/beta/?starting_url=http%3A%2F%2Fcloud4all.info" - } + "capabilities": [ + "http://registry\\.gpii\\.net/common/screenReaderTTS/enabled" ], - "stop": [ - { - "type": "gpii.launch.exec", - "command": "pkill -2 chrome" + "launchHandlers": { + "launcher": { + "type": "gpii.launchHandlers.flexibleHandler", + "options": { + "setTrue": { + "type": "gpii.launch.exec", + "command": "google-chrome http://webanywhere.cs.washington.edu/beta/?starting_url=http%3A%2F%2Fcloud4all.info" + }, + "setFalse": { + "type": "gpii.launch.exec", + "command": "pkill -2 chrome" + }, + "getState": [{ + "type": "gpii.processReporter.neverRunning" + }] + } } - ], + }, "isInstalled": [ { "type": "gpii.packageKit.find", @@ -1365,12 +1240,6 @@ "type": "gpii.packageKit.find", "name": "google-chrome-unstable" } - ], - "isRunning": [ - { - "type": "gpii.processReporter.find", - "command": "chrome" - } ] }, @@ -1386,32 +1255,19 @@ "configuration": { "type": "gpii.xrandr", "liveness": "liveRestart", - "capabilities": [], "supportedSettings": { "screen-resolution": {} } } - }, - "configure": [ - "settings.configuration" - ], - "stop": [ - "settings.configuration" - ], - "isInstalled": [ - { - "type": "gpii.packageKit.find", - "name": "libXrandr" - } - ] + } }, "net.gpii.uioPlus": { "name": "UIO+", "contexts": { "OS": [{ - "id": "win32", - "version": ">=5.0" + "id": "linux", + "version": ">=5.0" }] }, "settingsHandlers": { @@ -1434,19 +1290,6 @@ "simplifiedUiEnabled": {}, "syllabificationEnabled": {} }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/lineSpace", - "http://registry\\.gpii\\.net/common/fontSize", - "http://registry\\.gpii\\.net/common/characterSpace", - "http://registry\\.gpii\\.net/common/inputsLargerEnabled", - "http://registry\\.gpii\\.net/common/highContrastEnabled", - "http://registry\\.gpii\\.net/common/highContrastTheme", - "http://registry\\.gpii\\.net/common/selfVoicingEnabled", - "http://registry\\.gpii\\.net/common/highlightColor", - "http://registry\\.gpii\\.net/common/tableOfContents", - "http://registry\\.gpii\\.net/common/supportTool", - "http://registry\\.gpii\\.net/common/simplifiedUiEnabled" - ], "capabilitiesTransformations": { "lineSpace": "http://registry\\.gpii\\.net/common/lineSpace", "fontSize": { @@ -1464,11 +1307,11 @@ } }, "characterSpace": "http://registry\\.gpii\\.net/common/characterSpace", - "inputsLargerEnabled": "http://registry\\.gpii\\.net/common/inputsLargerEnabled", + "inputsLargerEnabled": "http://registry\\.gpii\\.net/common/inputsLarger/enabled", "contrastTheme": { "transform": { "type": "fluid.transforms.condition", - "conditionPath": "http://registry\\.gpii\\.net/common/highContrastEnabled", + "conditionPath": "http://registry\\.gpii\\.net/common/highContrast/enabled", "true": { "transform": { "type": "fluid.transforms.valueMapper", @@ -1485,7 +1328,7 @@ "false": "default" } }, - "selfVoicingEnabled": "http://registry\\.gpii\\.net/common/selfVoicingEnabled", + "selfVoicingEnabled": "http://registry\\.gpii\\.net/common/selfVoicing/enabled", "selectionTheme": "http://registry\\.gpii\\.net/common/highlightColor", "tableOfContentsEnabled": "http://registry\\.gpii\\.net/common/tableOfContents", "dictionaryEnabled": { @@ -1511,23 +1354,12 @@ } } }, - "simplifiedUiEnabled": "http://registry\\.gpii\\.net/common/simplifiedUiEnabled", - "syllabificationEnabled": "http://registry\\.gpii\\.net/common/syllabificationEnabled" + "simplifiedUiEnabled": "http://registry\\.gpii\\.net/common/simplifiedUi/enabled", + "syllabificationEnabled": "http://registry\\.gpii\\.net/common/syllabification/enabled" }, "inverseCapabilitiesTransformations": {} } }, - "update": [ - "configure" - ], - "configure": [ - "settings.configuration" - ], - "restore": [ - "settings.configuration" - ], - "start": [], - "stop": [], "isInstalled": [ { "type": "gpii.deviceReporter.alwaysInstalled" diff --git a/testData/solutions/web.json5 b/testData/solutions/web.json5 index 18aac81e9..9e2070fc0 100644 --- a/testData/solutions/web.json5 +++ b/testData/solutions/web.json5 @@ -12,17 +12,16 @@ "myconf": { "type": "gpii.settingsHandlers.noSettings", "supportedSettings": { - "screenReaderTTSEnabled": {}, + "screenReaderTTS/enabled": {}, "fontSize": {}, "magnifierEnabled": {}, "magnification": {}, - "highContrastEnabled": {}, + "highContrast/enabled": {}, "highContrastTheme": {}, "invertColours": {} }, - "capabilities": [], "capabilitiesTransformations": { - "screenReaderTTSEnabled": "http://registry\\.gpii\\.net/common/screenReaderTTSEnabled", + "screenReaderTTS/enabled": "http://registry\\.gpii\\.net/common/screenReaderTTS/enabled", "fontSize": { "transform":{ "type": "fluid.transforms.quantize", @@ -42,7 +41,7 @@ ] } }, - "magnifierEnabled": "http://registry\\.gpii\\.net/common/magnifierEnabled", + "magnifierEnabled": "http://registry\\.gpii\\.net/common/magnification/enabled", "magnification": { "transform": { "type": "fluid.transforms.quantize", @@ -62,7 +61,7 @@ ] } }, - "highContrastEnabled": "http://registry\\.gpii\\.net/common/highContrastEnabled", + "highContrast/enabled": "http://registry\\.gpii\\.net/common/highContrast/enabled", "highContrastTheme": "http://registry\\.gpii\\.net/common/highContrastTheme", "invertColours": "http://registry\\.gpii\\.net/common/invertColours" }, @@ -96,7 +95,6 @@ "tracking": {}, "magnification": {} }, - "capabilities": [], "capabilitiesTransformations": { "fontSize": { "transform":{ @@ -196,12 +194,6 @@ "language": {}, "theme": {} }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/highContrastTheme", - "http://registry\\.gpii\\.net/common/fontSize", - "http://registry\\.gpii\\.net/common/volume", - "http://registry\\.gpii\\.net/common/language" - ], "capabilitiesTransformations": { "theme": { "transform": { @@ -292,11 +284,6 @@ "highContrastTheme": {}, "volume": {} }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/highContrastTheme", - "http://registry\\.gpii\\.net/common/fontSize", - "http://registry\\.gpii\\.net/common/volume" - ], "capabilitiesTransformations": { "fontSize": { "transform": { @@ -367,7 +354,6 @@ "access_commonprefs_capitalization": {}, "access_commonprefs_c4a_enable_braille": {} }, - "capabilities": [], "capabilitiesTransformations": { "access_commonprefs_speechrate": { "transform": { @@ -431,19 +417,16 @@ "language": {}, "contrastTheme": {}, "fontSize": {}, - "timeOut": {} + "timeOut": {}, + "buttonSize": {}, + "fontFace": {} }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/highContrastTheme", - "http://registry\\.gpii\\.net/common/fontSize", - "http://registry\\.gpii\\.net/common/highContrastEnabled" - ], "capabilitiesTransformations": { "language": "http://registry\\.gpii\\.net/common/language", "contrastTheme": { "transform": { "type": "fluid.transforms.condition", - "conditionPath": "http://registry\\.gpii\\.net/common/highContrastEnabled", + "conditionPath": "http://registry\\.gpii\\.net/common/highContrast/enabled", "true": { "transform": { "type": "fluid.transforms.valueMapper", @@ -511,13 +494,15 @@ "signLanguageEnabled": {}, "signLanguage": {}, "interpreterType": {}, + "interpreterName": {}, "pictogramsEnabled": {}, - "simplifiedUiEnabled": {} + "simplifiedUiEnabled": {}, + "textStyle": {}, + "lineSpacing": {}, + "contrastTheme": {}, + "inputsLarger": {} + }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/highContrastTheme", - "http://registry\\.gpii\\.net/common/highContrastEnabled" - ], "capabilitiesTransformations": { "language": "http://registry\\.gpii\\.net/common/language", "textSize": { @@ -550,7 +535,7 @@ "contrastTheme": { "transform": { "type": "fluid.transforms.condition", - "conditionPath": "http://registry\\.gpii\\.net/common/highContrastEnabled", + "conditionPath": "http://registry\\.gpii\\.net/common/highContrast/enabled", "true": { "transform": { "type": "fluid.transforms.valueMapper", @@ -565,7 +550,7 @@ } } }, - "signLanguageEnabled": "http://registry\\.gpii\\.net/common/signLanguageEnabled", + "signLanguageEnabled": "http://registry\\.gpii\\.net/common/signLanguage/enabled", "signLanguage": { "transform": { "type": "fluid.transforms.valueMapper", @@ -590,12 +575,11 @@ } } }, - "pictogramsEnabled": "http://registry\\.gpii\\.net/common/pictogramsEnabled", - "simplifiedUiEnabled": "http://registry\\.gpii\\.net/common/simplifiedUiEnabled" + "pictogramsEnabled": "http://registry\\.gpii\\.net/common/pictograms/enabled", + "simplifiedUiEnabled": "http://registry\\.gpii\\.net/common/simplifiedUi/enabled" }, "inverseCapabilitiesTransformations": {} } } } } - diff --git a/testData/solutions/win32.json5 b/testData/solutions/win32.json5 index f13a449f6..836df6fe3 100644 --- a/testData/solutions/win32.json5 +++ b/testData/solutions/win32.json5 @@ -8,6 +8,9 @@ } ] }, + "capabilities": [ + "http://registry\\.gpii\\.net/common/screenReaderTTS/enabled" + ], "settingsHandlers": { "configuration1": { "type": "gpii.settingsHandlers.INISettingsHandler", @@ -76,9 +79,6 @@ } } }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/screenReaderTTSEnabled" - ], "capabilitiesTransformations": { "Voice Profiles\\.ActiveVoiceProfileName": { "literalValue": "GPII" @@ -243,7 +243,6 @@ "ENU-Message.SynthLangString": {}, "ENU-PCCursor.SynthLangString": {} }, - "capabilities": [], "capabilitiesTransformations": { "Options\\.PrimarySynthesizer": "http://registry\\.gpii\\.net/common/speechSynthesizer", "ENU-Global\\.Rate": "http://registry\\.gpii\\.net/common/speechRate", @@ -556,11 +555,6 @@ "inverseCapabilitiesTransformations": { "http://registry\\.gpii\\.net/common/speechSynthesizer": "Options\\.PrimarySynthesizer", "http://registry\\.gpii\\.net/common/speechRate": "ENU-Global\\.Rate", - "http://registry\\.gpii\\.net/common/speechRate": "ENU-JAWSCursor\\.Rate", - "http://registry\\.gpii\\.net/common/speechRate": "ENU-Keyboard\\.Rate", - "http://registry\\.gpii\\.net/common/speechRate": "ENU-MenuAndDialog\\.Rate", - "http://registry\\.gpii\\.net/common/speechRate": "ENU-Message\\.Rate", - "http://registry\\.gpii\\.net/common/speechRate": "ENU-PCCursor\\.Rate", "http://registry\\.gpii\\.net/common/pitch": { "transform": { "type": "fluid.transforms.linearScale", @@ -616,31 +610,44 @@ } } }, - "configure": [ - "settings.configuration1", - "settings.configuration2" - ], - "restore": [ - "settings.configuration1", - "settings.configuration2" - ], - "update": [ - "stop", - "configure", - "start" - ], - "start": [ - { - "type": "gpii.launch.exec", - "command": "\"${{registry}.HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\JAWS17.exe\\}\"" - } - ], - "stop": [ - { - "type": "gpii.windows.closeProcessByName", - "filename": "jfw.exe" + "launchHandlers": { + "launcher": { + "type": "gpii.launchHandlers.flexibleHandler", + "options": { + "verifySettings": true, + retryOptions: { + rewriteEvery: 0, + numRetries: 20 + }, + "getState": [ + { + "type": "gpii.processReporter.find", + "command": "jfw" + } + ], + "setTrue": [ + { + "type": "gpii.launch.exec", + "command": "\"${{registry}.HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\JAWS17.exe\\}\"" + } + ], + "setFalse": [ + { + "type": "gpii.windows.closeProcessByName", + "filename": "jfw.exe" + }, + { + "type": "gpii.windows.closeProcessByName", + "filename": "fsSynth32.exe" + }, + { + "type": "gpii.windows.closeProcessByName", + "filename": "jhookldr.exe" + } + ] + } } - ], + }, "isInstalled": [ { "type": "gpii.deviceReporter.registryKeyExists", @@ -649,12 +656,6 @@ "subPath": "", "dataType": "REG_SZ" } - ], - "isRunning": [ - { - "type": "gpii.processReporter.find", - "command": "jaws" - } ] }, @@ -668,6 +669,9 @@ } ] }, + "capabilities": [ + "http://registry\\.gpii\\.net/common/languageAssistance" + ], "settingsHandlers": { "configuration": { "type": "gpii.settingsHandlers.XMLHandler", @@ -677,9 +681,6 @@ "encoding": "utf-8", "xml-tag": "" }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/languageAssistance" - ], "capabilitiesTransformations": { "ApplicationSettings": "ApplicationSettings" }, @@ -707,29 +708,36 @@ } } }, - "configure": [ - "settings.configuration" - ], - "restore": [ - "settings.configuration" - ], - "update": [ - "stop", - "configure", - "start" - ], - "start": [ - { - "type": "gpii.launch.exec", - "command": "\"${{registry}.HKEY_CURRENT_USER\\Software\\Texthelp\\Read&Write11\\InstallPath}\\ReadAndWrite.exe\"" - } - ], - "stop": [ - { - "type": "gpii.windows.closeProcessByName", - "filename": "ReadAndWrite.exe" + "launchHandlers": { + "launcher": { + "type": "gpii.launchHandlers.flexibleHandler", + "options": { + "verifySettings": true, + "retryOptions": { + rewriteEvery: 0, + numRetries: 40 + }, + "setTrue": [ + { + "type": "gpii.launch.exec", + "command": "\"${{registry}.HKEY_CURRENT_USER\\Software\\Texthelp\\Read&Write11\\InstallPath}\\ReadAndWrite.exe\"" + } + ], + "setFalse": [ + { + "type": "gpii.windows.closeProcessByName", + "filename": "ReadAndWrite.exe" + } + ], + "getState": [ + { + "type": "gpii.processReporter.find", + "command": "ReadAndWrite" + } + ] + } } - ], + }, "isInstalled": [ { "type": "gpii.deviceReporter.registryKeyExists", @@ -738,12 +746,6 @@ "subPath": "InstallPath", "dataType": "REG_SZ" } - ], - "isRunning": [ - { - "type": "gpii.processReporter.find", - "command": "readandwrite" - } ] }, @@ -757,6 +759,9 @@ } ] }, + "capabilities": [ + "http://registry\\.gpii\\.net/common/magnification/enabled" + ], "settingsHandlers": { "configure": { "type": "gpii.windows.registrySettingsHandler", @@ -831,7 +836,6 @@ }, "ZoomIncrement": {} }, - "capabilities": [], "capabilitiesTransformations": { "Invert": { "transform": { @@ -914,41 +918,25 @@ } } }, - "configure": [ - "settings.configure" - ], - "restore": [ - "settings.configure" - ], - "start": [ - { - "type": "gpii.windows.enableRegisteredAT", - "name": "magnifierpane", - "enable": true - } - ], - "stop": [ - { + "launchHandlers": { + "launcher": { "type": "gpii.windows.enableRegisteredAT", - "name": "magnifierpane", - "enable": false + "options": { + "verifySettings": true, + "retryOptions": { + "rewriteEvery": 0, + "numRetries": 20, + "retryInterval": 1000 + }, + "registryName": "magnifierpane", + "queryProcess": "Magnify.exe" + } } - ], - "update": [ - "stop", - "configure", - "start" - ], + }, "isInstalled": [ { "type": "gpii.deviceReporter.alwaysInstalled" } - ], - "isRunning": [ - { - "type": "gpii.processReporter.find", - "command": "Magnify" - } ] }, @@ -962,6 +950,9 @@ } ] }, + "capabilities": [ + "http://registry\\.gpii\\.net/common/onScreenKeyboard/enabled" + ], "settingsHandlers": { "configure": { "type": "gpii.windows.registrySettingsHandler", @@ -983,9 +974,6 @@ } } }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/onScreenKeyboardEnabled" - ], "capabilitiesTransformations": { "NavigationMode": { "literalValue": 0 @@ -993,36 +981,19 @@ } } }, - "configure": [ - "settings.configure" - ], - "restore": [ - "settings.configure" - ], - "start": [ - { + "launchHandlers": { + "launcher": { "type": "gpii.windows.enableRegisteredAT", - "name": "osk", - "enable": true - } - ], - "stop": [ - { - "type": "gpii.windows.enableRegisteredAT", - "name": "osk", - "enable": false + "options": { + "registryName": "osk", + "queryProcess": "osk.exe" + } } - ], + }, "isInstalled": [ { "type": "gpii.deviceReporter.alwaysInstalled" } - ], - "isRunning": [ - { - "type": "gpii.processReporter.find", - "command": "osk" - } ] }, @@ -1037,6 +1008,9 @@ } ] }, + "capabilities": [ + "http://registry\\.gpii\\.net/common/screenReaderTTS/enabled" + ], "settingsHandlers": { "configure": { "type": "gpii.windows.registrySettingsHandler", @@ -1063,14 +1037,6 @@ "EchoChars": {}, "EchoWords": {} }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/screenReaderTTSEnabled", - "http://registry\\.gpii\\.net/common/speechRate", - "http://registry\\.gpii\\.net/common/trackingTTS", - "http://registry\\.gpii\\.net/common/keyEcho", - "http://registry\\.gpii\\.net/common/wordEcho", - "http://registry\\.gpii\\.net/common/pitch" - ], "capabilitiesTransformations": { "SpeechSpeed": { "transform": { @@ -1241,9 +1207,6 @@ "ShowKeyboardIntroduction": {}, "ShowBrowserSelection": {} }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/volumeTTS" - ], "capabilitiesTransformations": { "SpeechVolume": { "transform": { @@ -1270,19 +1233,6 @@ } } }, - "configure": [ - "settings.configure", - "settings.configureNoRoam" - ], - "restore": [ - "settings.configure", - "settings.configureNoRoam" - ], - "update": [ - "stop", - "configure", - "start" - ], "start": [ { "type": "gpii.windows.enableRegisteredAT", @@ -1340,7 +1290,6 @@ "speech.symbolLevel": {}, "speech.espeak.voice": {} }, - "capabilities": [], "capabilitiesTransformations": { "speech\\.espeak\\.pitch": { "transform": { @@ -1375,7 +1324,7 @@ }, { "type": "fluid.transforms.valueMapper", - "defaultInputPath": "http://registry\\.gpii\\.net/common/screenReaderTTSEnabled", + "defaultInputPath": "http://registry\\.gpii\\.net/common/screenReaderTTS/enabled", "match": { "false": { "outputValue": { @@ -1482,7 +1431,6 @@ "grc": "test\\grc", "eo": "eo", "es": "es", - "es-ES": "es", "es-419": "es-la", "et": "et", "fi": "fi", @@ -1523,8 +1471,7 @@ "vi": "vi", "zh-cmn": "zh", "cmn": "zh", - "zh-yue": "zh-yue", - "zh-yue": "yue" + "zh-yue": "zh-yue" } } } @@ -1569,7 +1516,7 @@ }, { "type": "fluid.transforms.condition", - "outputPath": "http://registry\\.gpii\\.net/common/screenReaderTTSEnabled", + "outputPath": "http://registry\\.gpii\\.net/common/screenReaderTTS/enabled", "false": true, "true": false, "condition": { @@ -1651,7 +1598,6 @@ "test\\grc": "grc", "eo": "eo", "es": "es", - "es": "es-ES", "es-la": "es-419", "et": "et", "fi": "fi", @@ -1692,39 +1638,45 @@ "vi": "vi", "zh": "zh-cmn", "zh-yue": "zh-yue", - "yue": "zh-yue" } } ] } } }, - "configure": [ - "settings.configs" - ], - "restore": [ - "settings.configs" - ], - "update": [ - "stop", - "configure", - "start" - ], - "start": [ - { - "type": "gpii.launch.exec", - "command": "\"${{registry}.HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\nvda.exe\\}\"" - } - ], - "stop": [ - { - "type": "gpii.windows.closeProcessByName", - "filename": "nvda_service.exe" - },{ - "type": "gpii.windows.closeProcessByName", - "filename": "nvda.exe" + "launchHandlers": { + "launcher": { + "type": "gpii.launchHandlers.flexibleHandler", + "options": { + "verifySettings": true, + retryOptions: { + rewriteEvery: 0, + numRetries: 20 + }, + "getState": [ + { + "type": "gpii.processReporter.find", + "command": "nvda" + } + ], + "setTrue": [ + { + "type": "gpii.launch.exec", + "command": "\"${{registry}.HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\nvda.exe\\}\"" + } + ], + "setFalse": [ + { + "type": "gpii.windows.closeProcessByName", + "filename": "nvda_service.exe" + }, { + "type": "gpii.windows.closeProcessByName", + "filename": "nvda.exe" + } + ] + } } - ], + }, "isInstalled": [ { "type": "gpii.deviceReporter.registryKeyExists", @@ -1733,12 +1685,6 @@ "subPath": "", "dataType": "REG_SZ" } - ], - "isRunning": [ - { - "type": "gpii.processReporter.find", - "command": "nvda" - } ] }, @@ -1752,44 +1698,31 @@ } ] }, - - "settingsHandlers": { - "configure": { - "type": "gpii.settingsHandlers.noSettings", - "capabilities": [ - "http://registry\\.gpii\\.net/common/simplification" - ] - } - }, - "start": [ - { - "type": "gpii.launch.exec", - "command": "\"${{registry}.HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\firefox.exe\\}\" http://easyone.gpii.net/user/${{userToken}}" - } + "capabilities": [ + "http://registry\\.gpii\\.net/common/simplification" ], - "stop": [ - { - "type": "gpii.windows.closeProcessByName", - "filename": "firefox.exe" + "launchHandlers": { + "launcher": { + "type": "gpii.launchHandlers.flexibleHandler", + "options": { + "setTrue": { + "type": "gpii.launch.exec", + "command": "\"${{registry}.HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\firefox.exe\\}\" http://easyone.gpii.net/user/${{userToken}}" + }, + "setFalse": { + "type": "gpii.windows.closeProcessByName", + "filename": "firefox.exe" + }, + "getState": [{ + "type": "gpii.processReporter.neverRunning" + }] + } } - ], - // Although there are no settings to deal with, we need to pass through - // the "configure" action in order to proceed with the "stop" directive - // when keying out. This is a current limitation of the system, you can - // check https://issues.gpii.net/browse/GPII-2106 and - // https://issues.gpii.net/browse/GPII-1235 for more detailed information. - // - "configure": [ "settings.configure" ], + }, "isInstalled": [ { "type": "gpii.deviceReporter.alwaysInstalled" } - ], - "isRunning": [ - { - "type": "gpii.processReporter.find", - "command": "firefox" - } ] }, @@ -1803,36 +1736,31 @@ } ] }, - "settingsHandlers": { - "configure": { - "type": "gpii.settingsHandlers.noSettings", - "capabilities": [ - "http://registry\\.gpii\\.net/common/pictorialSimplification" - ] - } - }, - "start": [ - { - "type": "gpii.launch.exec", - "command": "\"${{registry}.HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\firefox.exe\\}\" http://easyone.gpii.net/sudan" - } + "capabilities": [ + "http://registry\\.gpii\\.net/common/pictorialSimplification" ], - "stop": [ - { - "type": "gpii.windows.closeProcessByName", - "filename": "firefox.exe" + "launchHandlers": { + "launcher": { + "type": "gpii.launchHandlers.flexibleHandler", + "options": { + "setTrue": { + "type": "gpii.launch.exec", + "command": "\"${{registry}.HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\firefox.exe\\}\" http://easyone.gpii.net/sudan" + }, + "setFalse": { + "type": "gpii.windows.closeProcessByName", + "filename": "firefox.exe" + }, + "getState": [{ + "type": "gpii.processReporter.neverRunning" + }] + } } - ], + }, "isInstalled": [ { "type": "gpii.deviceReporter.alwaysInstalled" } - ], - "isRunning": [ - { - "type": "gpii.processReporter.find", - "command": "firefox" - } ] }, @@ -1846,36 +1774,31 @@ } ] }, - "settingsHandlers": { - "configure": { - "type": "gpii.settingsHandlers.noSettings", - "capabilities": [ - "http://registry\\.gpii\\.net/common/screenReaderTTSEnabled" - ] - } - }, - "start": [ - { - "type": "gpii.launch.exec", - "command": "\"${{registry}.HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\firefox.exe\\}\" \"http://webanywhere.cs.washington.edu/beta/?starting_url=http%3A%2F%2Fcloud4all.info\"" - } + "capabilities": [ + "http://registry\\.gpii\\.net/common/screenReaderTTS/enabled" ], - "stop": [ - { - "type": "gpii.windows.closeProcessByName", - "filename": "firefox.exe" + "launchHandlers": { + "launcher": { + "type": "gpii.launchHandlers.flexibleHandler", + "options": { + "setTrue": { + "type": "gpii.launch.exec", + "command": "\"${{registry}.HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\firefox.exe\\}\" \"http://webanywhere.cs.washington.edu/beta/?starting_url=http%3A%2F%2Fcloud4all.info\"" + }, + "setFalse": { + "type": "gpii.windows.closeProcessByName", + "filename": "firefox.exe" + }, + "getState": [{ + "type": "gpii.processReporter.neverRunning" + }] + } } - ], + }, "isInstalled": [ { "type": "gpii.deviceReporter.alwaysInstalled" } - ], - "isRunning": [ - { - "type": "gpii.processReporter.find", - "command": "firefox" - } ] }, @@ -1889,7 +1812,6 @@ } ] }, - "settingsHandlers": { "configuration": { "type": "gpii.settingsHandlers.JSONSettingsHandler", @@ -1903,34 +1825,29 @@ "speakLabels": {}, "theme": {} }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/selfVoicingEnabled", - "http://registry\\.gpii\\.net/common/highContrastEnabled", - "http://registry\\.gpii\\.net/common/highContrastTheme" - ], "capabilitiesTransformations": { "transform": [ { "type": "fluid.transforms.condition", - "conditionPath": "http://registry\\.gpii\\.net/common/selfVoicingEnabled", + "conditionPath": "http://registry\\.gpii\\.net/common/selfVoicing/enabled", "outputPath": "speakOnActivate", "true": "yes", "false": "no" }, { "type": "fluid.transforms.condition", - "conditionPath": "http://registry\\.gpii\\.net/common/selfVoicingEnabled", + "conditionPath": "http://registry\\.gpii\\.net/common/selfVoicing/enabled", "outputPath": "speakTitles", "true": "yes", "false": "no" }, { "type": "fluid.transforms.condition", - "conditionPath": "http://registry\\.gpii\\.net/common/selfVoicingEnabled", + "conditionPath": "http://registry\\.gpii\\.net/common/selfVoicing/enabled", "outputPath": "speakLabels", "true": "yes", "false": "no" }, { "type": "fluid.transforms.condition", - "conditionPath": "http://registry\\.gpii\\.net/common/highContrastEnabled", + "conditionPath": "http://registry\\.gpii\\.net/common/highContrast/enabled", "condition": false, "outputPath": "theme", "false": "colour", @@ -1955,34 +1872,40 @@ "inverseCapabilitiesTransformations": {} } }, - "configure": [ - "settings.configuration" - ], - "restore": [ - "settings.configuration" - ], - "start": [ - { - "type": "gpii.launch.exec", - "command": "${{environment}.ComSpec} /c \"cd ${{environment}.MAAVIS_HOME} && MaavisPortable.cmd\"" - } - ], - "stop": [ - { - "type": "gpii.windows.closeProcessByName", - "filename": "firefox.exe" + "launchHandlers": { + "launcher": { + "type": "gpii.launchHandlers.flexibleHandler", + "options": { + "verifySettings": true, + "retryOptions": { + "rewriteEvery": 0, + "numRetries": 20 + }, + "setTrue": [ + { + "type": "gpii.launch.exec", + "command": "${{environment}.ComSpec} /c \"cd ${{environment}.MAAVIS_HOME} && MaavisPortable.cmd\"" + } + ], + "setFalse": [ + { + "type": "gpii.windows.closeProcessByName", + "filename": "firefox.exe" + } + ], + "getState": [ + { + "type": "gpii.processReporter.find", + "command": "MaavisPortable" + } + ] + } } - ], + }, "isInstalled": [ { "type": "gpii.deviceReporter.alwaysInstalled" } - ], - "isRunning": [ - { - "type": "gpii.processReporter.find", - "command": "MaavisPortable" - } ] }, @@ -2020,14 +1943,11 @@ } } }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/highContrastEnabled" - ], "capabilitiesTransformations": { "HighContrastOn": { "transform": { "type": "fluid.transforms.value", - "inputPath": "http://registry\\.gpii\\.net/common/highContrastEnabled", + "inputPath": "http://registry\\.gpii\\.net/common/highContrast/enabled", "outputPath": "value" }, "path": { @@ -2039,7 +1959,7 @@ } }, "inverseCapabilitiesTransformations": { - "http://registry\\.gpii\\.net/common/highContrastEnabled": "HighContrastOn.value" + "http://registry\\.gpii\\.net/common/highContrast/enabled": "HighContrastOn.value" } }, "configureTheme": { @@ -2067,9 +1987,6 @@ } } }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/highContrastTheme" - ], "capabilitiesTransformations": { "LastHighContrastTheme": { "transform": { @@ -2087,18 +2004,6 @@ } } }, - "configure": [ - "settings.configureTheme", - "settings.configure" - ], - "restore": [ - "settings.configureTheme", - "settings.configure" - ], - "update": [ - "settings.configureTheme", - "settings.configure" - ], "isInstalled": [ { "type": "gpii.deviceReporter.alwaysInstalled" @@ -2133,7 +2038,6 @@ "supportedSettings": { "StickyKeysOn": {} }, - "capabilities": [], "capabilitiesTransformations": { "StickyKeysOn": { "transform": { @@ -2154,15 +2058,6 @@ } } }, - "update": [ - "configure" - ], - "configure": [ - "settings.configure" - ], - "restore": [ - "settings.configure" - ], "isInstalled": [ { "type": "gpii.deviceReporter.alwaysInstalled" @@ -2222,14 +2117,13 @@ } } }, - "capabilities": [], "capabilitiesTransformations": { "FilterKeysEnable": { "transform": { "type": "fluid.transforms.binaryOp", - "leftPath": "http://registry\\.gpii\\.net/common/debounceEnabled", + "leftPath": "http://registry\\.gpii\\.net/common/debounce/enabled", "left": false, - "rightPath": "http://registry\\.gpii\\.net/common/slowKeysEnabled", + "rightPath": "http://registry\\.gpii\\.net/common/slowKeys/enabled", "right": false, "operator": "||", "outputPath": "value" @@ -2244,7 +2138,7 @@ "SlowKeysInterval": { "transform": { "type": "fluid.transforms.condition", - "conditionPath": "http://registry\\.gpii\\.net/common/slowKeysEnabled", + "conditionPath": "http://registry\\.gpii\\.net/common/slowKeys/enabled", "true": { "transform": { "type": "fluid.transforms.linearScale", @@ -2268,7 +2162,7 @@ "condition": { "transform": { "type": "fluid.transforms.binaryOp", - "leftPath": "http://registry\\.gpii\\.net/common/slowKeysEnabled", + "leftPath": "http://registry\\.gpii\\.net/common/slowKeys/enabled", "left": false, "right": false, "operator": "===" @@ -2277,7 +2171,7 @@ "true": { "transform": { "type": "fluid.transforms.condition", - "conditionPath": "http://registry\\.gpii\\.net/common/debounceEnabled", + "conditionPath": "http://registry\\.gpii\\.net/common/debounce/enabled", "true": { "transform": { "type": "fluid.transforms.linearScale", @@ -2301,7 +2195,7 @@ } }, "inverseCapabilitiesTransformations": { - "http://registry\\.gpii\\.net/common/slowKeysEnabled": { + "http://registry\\.gpii\\.net/common/slowKeys/enabled": { "transform": { "type": "fluid.transforms.condition", "condition": { @@ -2335,7 +2229,7 @@ } } }, - "http://registry\\.gpii\\.net/common/debounceEnabled": { + "http://registry\\.gpii\\.net/common/debounce/enabled": { "transform": { "type": "fluid.transforms.condition", "condition": { @@ -2372,15 +2266,6 @@ } } }, - "configure": [ - "settings.configure" - ], - "update": [ - "configure" - ], - "restore": [ - "settings.configure" - ], "isInstalled": [ { "type": "gpii.deviceReporter.alwaysInstalled" @@ -2439,12 +2324,11 @@ } } }, - "capabilities": [], "capabilitiesTransformations": { "MouseKeysOn": { "transform": { "type": "fluid.transforms.value", - "inputPath": "http://registry\\.gpii\\.net/common/mouseEmulationEnabled", + "inputPath": "http://registry\\.gpii\\.net/common/mouseEmulation/enabled", "outputPath": "value" }, "path": { @@ -2505,7 +2389,7 @@ } }, "inverseCapabilitiesTransformations": { - "http://registry\\.gpii\\.net/common/mouseEmulationEnabled": "MouseKeysOn.value", + "http://registry\\.gpii\\.net/common/mouseEmulation/enabled": "MouseKeysOn.value", "http://registry\\.gpii\\.net/common/cursorSpeed": { "transform": { "type": "fluid.transforms.linearScale", @@ -2518,15 +2402,6 @@ } } }, - "update": [ - "configure" - ], - "configure": [ - "settings.configure" - ], - "restore": [ - "settings.configure" - ], "isInstalled": [ { "type": "gpii.deviceReporter.alwaysInstalled" @@ -2569,9 +2444,6 @@ } } }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/mouseTrailing" - ], "capabilitiesTransformations": { "MouseTrails": { "transform": { @@ -2595,15 +2467,6 @@ } } }, - "update": [ - "configure" - ], - "configure": [ - "settings.configure" - ], - "restore": [ - "settings.configure" - ], "isInstalled": [ { "type": "gpii.deviceReporter.alwaysInstalled" @@ -2625,10 +2488,6 @@ "configuration": { "type": "gpii.windows.displaySettingsHandler", "liveness": "liveRestart", - "capabilities": [ - "display.screenEnhancement.screenResolution", - "applications.com\\.microsoft\\.windows\\.screenResolution.id" - ], "supportedSettings": { "screen-resolution": { "schema": { @@ -2641,12 +2500,6 @@ } } }, - "configure": [ - "settings.configuration" - ], - "restore": [ - "settings.configuration" - ], "isInstalled": [ { "type": "gpii.deviceReporter.alwaysInstalled" @@ -2671,10 +2524,6 @@ "supportedSettings": { "screen-dpi": {} }, - "capabilities": [ - "display.screenEnhancement.screenScale", - "applications.com\\.microsoft\\.windows\\.screenDPI.id" - ], "supportedSettings": { "screen-dpi": { "schema": { @@ -2691,15 +2540,6 @@ } } }, - "configure": [ - "settings.configure" - ], - "restore": [ - "settings.configure" - ], - "update": [ - "configure" - ], "isInstalled": [ { "type": "gpii.deviceReporter.alwaysInstalled" @@ -2756,9 +2596,6 @@ "UpArrow": {}, "Wait": {} }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/cursorSize" - ], "capabilitiesTransformations": { "Arrow": { "transform": { @@ -2998,26 +2835,39 @@ } } }, - "configure": [ - "settings.configure" - ], - "restore": [ - "settings.configure", - { - "type": "gpii.windows.spiSettingsHandler.updateCursors" + "launchHandlers": { + "launcher": { + "type": "gpii.launchHandlers.flexibleHandler", + "options": { + "setTrue": [{ + "type": "gpii.windows.spiSettingsHandler.updateCursors" + }], + "getState": [{ + "type": "gpii.processReporter.neverRunning" + }] + } } + }, + "start": [ + "launchers.launcher" ], + "stop": [], "update": [ "configure", "start" ], - "start": [ + "isRunning": [ + "launchers.launcher" + ], + "configure": [ + "settings.configure" + ], + "restore": [ + "settings.configure", { "type": "gpii.windows.spiSettingsHandler.updateCursors" } ], - "stop": [ - ], "isInstalled": [ { "type": "gpii.deviceReporter.alwaysInstalled" @@ -3052,7 +2902,6 @@ "highContrastEnabled": {}, "fontSize": {} }, - "capabilities": [], "capabilitiesTransformations": { "user.$t": { "literalValue": 1 @@ -3064,10 +2913,10 @@ "literalValue": 1 }, "screenReaderTTSEnabled": { - "value": "http://registry\\.gpii\\.net/common/screenReaderTTSEnabled" + "value": "http://registry\\.gpii\\.net/common/screenReaderTTS/enabled" }, "highContrastEnabled": { - "value": "http://registry\\.gpii\\.net/common/highContrastEnabled" + "value": "http://registry\\.gpii\\.net/common/highContrast/enabled" }, "fontSize": { "value": { @@ -3087,30 +2936,31 @@ "inverseCapabilitiesTransformations": {} } }, - "configure": [ - "settings.configuration" - ], - "restore": [ - "settings.configuration" - ], - "start": [ - { - "type": "gpii.launch.exec", - "command": "C:\\Sociable\\Cloud4All.exe" - } - ], - "stop": [ - { - "type": "gpii.launch.exec", - "command": "C:\\Sociable\\Cloud4All.exe -stop" - } - ], - "isRunning": [ - { - "type": "gpii.processReporter.find", - "command": "Cloud4Allcd " + "launchHandlers": { + "launcher": { + "type": "gpii.launchHandlers.flexibleHandler", + "options": { + "setTrue": [ + { + "type": "gpii.launch.exec", + "command": "C:\\Sociable\\Cloud4All.exe" + } + ], + "setFalse": [ + { + "type": "gpii.launch.exec", + "command": "C:\\Sociable\\Cloud4All.exe -stop" + } + ], + "getState": [ + { + "type": "gpii.processReporter.find", + "command": "Cloud4Allcd " + } + ] + } } - ] + } }, "net.gpii.uioPlus": { @@ -3141,19 +2991,6 @@ "simplifiedUiEnabled": {}, "syllabificationEnabled": {} }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/lineSpace", - "http://registry\\.gpii\\.net/common/fontSize", - "http://registry\\.gpii\\.net/common/characterSpace", - "http://registry\\.gpii\\.net/common/inputsLargerEnabled", - "http://registry\\.gpii\\.net/common/highContrastEnabled", - "http://registry\\.gpii\\.net/common/highContrastTheme", - "http://registry\\.gpii\\.net/common/selfVoicingEnabled", - "http://registry\\.gpii\\.net/common/highlightColor", - "http://registry\\.gpii\\.net/common/tableOfContents", - "http://registry\\.gpii\\.net/common/supportTool", - "http://registry\\.gpii\\.net/common/simplifiedUiEnabled" - ], "capabilitiesTransformations": { "lineSpace": "http://registry\\.gpii\\.net/common/lineSpace", "fontSize": { @@ -3171,11 +3008,11 @@ } }, "characterSpace": "http://registry\\.gpii\\.net/common/characterSpace", - "inputsLargerEnabled": "http://registry\\.gpii\\.net/common/inputsLargerEnabled", + "inputsLargerEnabled": "http://registry\\.gpii\\.net/common/inputsLarger/enabled", "contrastTheme": { "transform": { "type": "fluid.transforms.condition", - "conditionPath": "http://registry\\.gpii\\.net/common/highContrastEnabled", + "conditionPath": "http://registry\\.gpii\\.net/common/highContrast/enabled", "true": { "transform": { "type": "fluid.transforms.valueMapper", @@ -3192,7 +3029,7 @@ "false": "default" } }, - "selfVoicingEnabled": "http://registry\\.gpii\\.net/common/selfVoicingEnabled", + "selfVoicingEnabled": "http://registry\\.gpii\\.net/common/selfVoicing/enabled", "selectionTheme": "http://registry\\.gpii\\.net/common/highlightColor", "tableOfContentsEnabled": "http://registry\\.gpii\\.net/common/tableOfContents", "dictionaryEnabled": { @@ -3218,23 +3055,12 @@ } } }, - "simplifiedUiEnabled": "http://registry\\.gpii\\.net/common/simplifiedUiEnabled", - "syllabificationEnabled": "http://registry\\.gpii\\.net/common/syllabificationEnabled" + "simplifiedUiEnabled": "http://registry\\.gpii\\.net/common/simplifiedUi/enabled", + "syllabificationEnabled": "http://registry\\.gpii\\.net/common/syllabification/enabled" }, "inverseCapabilitiesTransformations": {} } }, - "configure": [ - "settings.configuration" - ], - "restore": [ - "settings.configuration" - ], - "update": [ - "configure" - ], - "start": [], - "stop": [], "isInstalled": [ { "type": "gpii.deviceReporter.alwaysInstalled" @@ -3255,10 +3081,12 @@ "configure": { "type": "gpii.settingsHandlers.noSettings", "liveness": "OSRestart", - "capabilities": [ - "http://registry\\.gpii\\.net/common/speechControl" - ], - "supportedSettings": {} + "capabilitiesTransformations": { + "sc": "http://registry\\.gpii\\.net/common/speechControl" + }, + "supportedSettings": { + "sc": {} + } } }, "configure": [], diff --git a/tests/CloseConflictingAppsTests.js b/tests/CloseConflictingAppsTests.js new file mode 100644 index 000000000..89238fcd0 --- /dev/null +++ b/tests/CloseConflictingAppsTests.js @@ -0,0 +1,265 @@ +/* + * GPII Tests for ensuring that two conflicting apps will not be launched + * + * These are integration tests for ensuring that eg. two screenreaders will not be active at the same time on + * the system. Besides the obvious case of checking that the MM doesn't launch two screenreaders on login, + * it is also tested that an already running screenreader will be closed if the matchmaker finds that another + * (conflicting) matchmaker should be launched. + * + * Copyright 2016 Raising The Floor - International + * + * Licensed under the New BSD license. You may not use this file except in + * compliance with this License. + * + * You may obtain a copy of the License at + * https://github.com/GPII/universal/blob/master/LICENSE.txt + */ +"use strict"; + +var fluid = require("infusion"), + gpii = fluid.registerNamespace("gpii"); + +fluid.require("%gpii-universal"); + +gpii.loadTestingSupport(); + +fluid.registerNamespace("gpii.tests.conflictingApps"); + +gpii.tests.conflictingApps.jawsHandlerEntry = function (running) { + return { + "com.freedomscientific.jaws": [{ + "settings": { + "running": running + }, + "options": { + "verifySettings": true, + "getState": [ + { + "type": "gpii.processReporter.find", + "command": "jfw" + } + ], + "setTrue": [ + { + "type": "gpii.launch.exec", + "command": "\"${{registry}.HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\JAWS17.exe\\}\"" + } + ], + "setFalse": [ + { + "type": "gpii.windows.closeProcessByName", + "filename": "jfw.exe" + }, + { + "type": "gpii.windows.closeProcessByName", + "filename": "fsSynth32.exe" + }, + { + "type": "gpii.windows.closeProcessByName", + "filename": "jhookldr.exe" + } + ] + } + }] + }; +}; + +gpii.tests.conflictingApps.NVDAHandlerEntry = function (running) { + return { + "org.nvda-project": [{ + "settings": { + "running": running + }, + "options": { + "verifySettings": true, + "getState": [ + { + "type": "gpii.processReporter.find", + "command": "nvda" + } + ], + "setTrue": [ + { + "type": "gpii.launch.exec", + "command": "\"${{registry}.HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\nvda.exe\\}\"" + } + ], + "setFalse": [ + { + "type": "gpii.windows.closeProcessByName", + "filename": "nvda_service.exe" + },{ + "type": "gpii.windows.closeProcessByName", + "filename": "nvda.exe" + } + ] + } + }] + }; +}; + +gpii.tests.conflictingApps.testDefs = [ + { + name: "Only one screenreader is launched", + userToken: "screenreader_common", + initialState: { + "gpii.launchHandlers.flexibleHandler": fluid.extend({}, + gpii.tests.conflictingApps.jawsHandlerEntry(false), + gpii.tests.conflictingApps.NVDAHandlerEntry(false)) + }, + settingsHandlers: { + "gpii.settingsHandlers.INISettingsHandler": { + "org.nvda-project": [ + { + "settings": { + "speech.espeak.rate": 17, + "speech.espeak.volume": 75, + "speech.espeak.pitch": 15, + "speech.espeak.rateBoost": true, + "speech.symbolLevel": 300, + "speech.espeak.voice": "en\\en-wi", + "reviewCursor.followFocus": false, + "reviewCursor.followCaret": true, + "reviewCursor.followMouse": true, + "keyboard.speakTypedWords": true, + "keyboard.speakTypedCharacters": false, + "presentation.reportHelpBalloons": false, + "speech.espeak.sayCapForCapitals": true + }, + "options": { + "filename": "${{environment}.APPDATA}\\nvda\\nvda.ini", + "allowNumberSignComments": true, + "allowSubSections": true + } + } + ], + "com.freedomscientific.jaws": [ + { + "settings": { + "Voice Profiles.ActiveVoiceProfileName": "GPII", + "options.SayAllIndicateCaps": true, + "options.TypingEcho": 2 + }, + "options": { + "filename": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\17.0\\Settings\\enu\\DEFAULT.JCF" + } + }, + + { + "settings": { + "ENU-Global.Rate": 400, + "ENU-Global.Punctuation": 3, + "ENU-Global.Pitch": 16, + "ENU-Message.Rate": 400, + "ENU-Message.Punctuation": 3, + "ENU-Message.Pitch": 16, + "ENU-Keyboard.Rate": 400, + "ENU-Keyboard.Punctuation": 3, + "ENU-Keyboard.Pitch": 16, + "ENU-PCCursor.Rate": 400, + "ENU-PCCursor.Punctuation": 3, + "ENU-PCCursor.Pitch": 16, + "ENU-JAWSCursor.Rate": 400, + "ENU-JAWSCursor.Punctuation": 3, + "ENU-JAWSCursor.Pitch": 16, + "ENU-MenuAndDialog.Rate": 400, + "ENU-MenuAndDialog.Punctuation": 3, + "ENU-MenuAndDialog.Pitch": 16 + }, + "options": { + "filename": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\17.0\\Settings\\VoiceProfiles\\GPII.VPF" + } + } + ] + }, + "gpii.launchHandlers.flexibleHandler": fluid.extend({}, + gpii.tests.conflictingApps.jawsHandlerEntry(false), + gpii.tests.conflictingApps.NVDAHandlerEntry(true)) + } + }, { + name: "Conflicting screenreader (jaws) is closed is Only one screenreader is launched", + userToken: "screenreader_common", + initialState: { + "gpii.launchHandlers.flexibleHandler": fluid.extend({}, + gpii.tests.conflictingApps.jawsHandlerEntry(true), + gpii.tests.conflictingApps.NVDAHandlerEntry(false)) + }, + settingsHandlers: { + + "gpii.settingsHandlers.INISettingsHandler": { + "org.nvda-project": [ + { + "settings": { + "speech.espeak.rate": 17, + "speech.espeak.volume": 75, + "speech.espeak.pitch": 15, + "speech.espeak.rateBoost": true, + "speech.symbolLevel": 300, + "speech.espeak.voice": "en\\en-wi", + "reviewCursor.followFocus": false, + "reviewCursor.followCaret": true, + "reviewCursor.followMouse": true, + "keyboard.speakTypedWords": true, + "keyboard.speakTypedCharacters": false, + "presentation.reportHelpBalloons": false, + "speech.espeak.sayCapForCapitals": true + }, + "options": { + "filename": "${{environment}.APPDATA}\\nvda\\nvda.ini", + "allowNumberSignComments": true, + "allowSubSections": true + } + } + ], + "com.freedomscientific.jaws": [ + { + "settings": { + "Voice Profiles.ActiveVoiceProfileName": "GPII", + "options.SayAllIndicateCaps": true, + "options.TypingEcho": 2 + }, + "options": { + "filename": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\17.0\\Settings\\enu\\DEFAULT.JCF" + } + }, + + { + "settings": { + "ENU-Global.Rate": 400, + "ENU-Global.Punctuation": 3, + "ENU-Global.Pitch": 16, + "ENU-Message.Rate": 400, + "ENU-Message.Punctuation": 3, + "ENU-Message.Pitch": 16, + "ENU-Keyboard.Rate": 400, + "ENU-Keyboard.Punctuation": 3, + "ENU-Keyboard.Pitch": 16, + "ENU-PCCursor.Rate": 400, + "ENU-PCCursor.Punctuation": 3, + "ENU-PCCursor.Pitch": 16, + "ENU-JAWSCursor.Rate": 400, + "ENU-JAWSCursor.Punctuation": 3, + "ENU-JAWSCursor.Pitch": 16, + "ENU-MenuAndDialog.Rate": 400, + "ENU-MenuAndDialog.Punctuation": 3, + "ENU-MenuAndDialog.Pitch": 16 + }, + "options": { + "filename": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\17.0\\Settings\\VoiceProfiles\\GPII.VPF" + } + } + ] + }, + "gpii.launchHandlers.flexibleHandler": fluid.extend({}, + gpii.tests.conflictingApps.jawsHandlerEntry(false), + gpii.tests.conflictingApps.NVDAHandlerEntry(true)) + } + } +]; + +module.exports = gpii.test.runTests({ + testDefs: "gpii.tests.conflictingApps.testDefs", + configName: "gpii.tests.multiScreenreader.config", + configPath: "%gpii-universal/tests/configs" +}, ["gpii.test.integration.testCaseHolder.windows"], + module, require, __dirname); diff --git a/tests/ContextIntegrationTests.js b/tests/ContextIntegrationTests.js index 409557a2e..578c9456d 100644 --- a/tests/ContextIntegrationTests.js +++ b/tests/ContextIntegrationTests.js @@ -34,4 +34,3 @@ gpii.tests.contextIntegration.baseTestDef = { kettle.test.bootstrapServer(gpii.test.buildSegmentedFixtures( gpii.tests.contextIntegration.fixtures, gpii.tests.contextIntegration.baseTestDef)); - diff --git a/tests/JournalIntegrationTests.js b/tests/JournalIntegrationTests.js index c2998ad26..522164fcd 100644 --- a/tests/JournalIntegrationTests.js +++ b/tests/JournalIntegrationTests.js @@ -36,7 +36,7 @@ gpii.tests.journal.testDef = gpii.tests.windows.builtIn[0]; gpii.tests.journal.initialSettings = { "gpii.windows.spiSettingsHandler": { - "some.app.id": [{ + "com.microsoft.windows.mouseTrailing": [{ "settings": { "MouseTrails": { "value": 20 @@ -50,7 +50,7 @@ gpii.tests.journal.initialSettings = { }] }, "gpii.windows.registrySettingsHandler": { - "some.app.id": [{ // magnifier stuff + "com.microsoft.windows.magnifier": [{ // magnifier stuff "settings": { "Invert": 1, "Magnification": 200, @@ -76,7 +76,7 @@ gpii.tests.journal.initialSettings = { ] }, "gpii.windows.displaySettingsHandler": { - "some.app.id": [{ + "com.microsoft.windows.screenResolution": [{ "settings": { "screen-resolution": { "width": 800, @@ -85,6 +85,31 @@ gpii.tests.journal.initialSettings = { "screen-dpi": 1 } }] + }, + "gpii.windows.enableRegisteredAT": { + "com.microsoft.windows.magnifier": [{ + "settings": { + "running": false + }, + "options": { + "registryName": "magnifierpane", + "queryProcess": "Magnify.exe" + } + }] + } +}; + +gpii.tests.journal.settingsAfterCrash = { + "gpii.windows.enableRegisteredAT": { + "com.microsoft.windows.magnifier": [{ + "settings": { + "running": false + }, + "options": { + "registryName": "magnifierpane", + "queryProcess": "Magnify.exe" + } + }] } }; @@ -324,8 +349,8 @@ gpii.tests.journal.stashInitial = function (settingsHandlersPayload, settingsSto var settingsHandlers = fluid.copy(testCaseHolder.options.settingsHandlers); // We eliminate the last blocks since our initial settings state does not include them, and the blocks // with values all `undefined` will confuse jqUnit.assertDeepEq in gpii.test.checkConfiguration - settingsHandlers["gpii.windows.spiSettingsHandler"]["some.app.id"].length = 1; - settingsHandlers["gpii.windows.registrySettingsHandler"]["some.app.id"].length = 1; + settingsHandlers["gpii.windows.spiSettingsHandler"] = fluid.filterKeys(settingsHandlers["gpii.windows.spiSettingsHandler"], "com.microsoft.windows.mouseTrailing"); + settingsHandlers["gpii.windows.registrySettingsHandler"] = fluid.filterKeys(settingsHandlers["gpii.windows.registrySettingsHandler"], "com.microsoft.windows.magnifier"); testCaseHolder.settingsHandlers = settingsHandlers; }; @@ -354,7 +379,7 @@ gpii.tests.journal.normalLoginFixtures = [ gpii.tests.journal.fixtures = [ { name: "Journal state and restoration", - expect: 10, + expect: 11, sequenceSegments: [ { func: "gpii.tests.journal.stashJournalId", args: "{testCaseHolder}" @@ -391,6 +416,12 @@ gpii.tests.journal.fixtures = [ }, kettle.test.startServerSequence, { + func: "gpii.test.setSettings", + args: [gpii.tests.journal.settingsAfterCrash, "{nameResolver}", "{testCaseHolder}.events.onInitialSettingsComplete.fire"] + }, { + event: "{tests}.events.onInitialSettingsComplete", + listener: "fluid.identity" + }, { func: "{listJournalsRequest}.send" }, { event: "{listJournalsRequest}.events.onComplete", diff --git a/tests/MultiSettingsHandlerTests.js b/tests/MultiSettingsHandlerTests.js index edd1d6fd3..84a029dd0 100644 --- a/tests/MultiSettingsHandlerTests.js +++ b/tests/MultiSettingsHandlerTests.js @@ -56,8 +56,7 @@ gpii.tests.multiSHSupport.testDefs = [ } ] } - }, - processes: [] + } } ]; diff --git a/tests/all-tests.js b/tests/all-tests.js index 03418a1b6..bc564c920 100644 --- a/tests/all-tests.js +++ b/tests/all-tests.js @@ -57,6 +57,7 @@ var testIncludes = [ "./UserLogonStateChangeTests.js", "./MultiSettingsHandlerTests.js", "./IntegrationTests.js", + "./CloseConflictingAppsTests.js", "./ContextIntegrationTests.js", "./JournalIntegrationTests.js", "./DeviceReporterErrorTests.js", diff --git a/tests/configs/gpii.tests.multiSH.config.json b/tests/configs/gpii.tests.multiSH.config.json index 35345e8df..601cb36f3 100644 --- a/tests/configs/gpii.tests.multiSH.config.json +++ b/tests/configs/gpii.tests.multiSH.config.json @@ -12,8 +12,8 @@ "target": "{that deviceReporter installedSolutionsDataSource}.options.path", "priority": "after:development.installedSolutionsPath" }, - "multiSH.solutionRegistry": { - "record": "%gpii-universal/tests/data/multiSHSolutionRegistry.json", + "multiSH.solutionsRegistry": { + "record": "%gpii-universal/tests/data/multiSHsolutionsRegistry.json", "target": "{that flowManager solutionsRegistryDataSource}.options.path", "priority": "after:flowManager.development.solutions" } diff --git a/tests/configs/gpii.tests.multiScreenreader.config.json b/tests/configs/gpii.tests.multiScreenreader.config.json new file mode 100644 index 000000000..161580933 --- /dev/null +++ b/tests/configs/gpii.tests.multiScreenreader.config.json @@ -0,0 +1,18 @@ +{ + "type": "gpii.tests.multiScreenreader.config", + "options": { + "distributeOptions": { + "multiSH.rawPreferencesDataSource": { + "record": "%gpii-universal/testData/preferences/acceptanceTests/%userToken.json", + "target": "{that rawPreferencesServer rawPreferencesDataSource}.options.path", + "priority": "after:development.rawPreferencesDataSource" + }, + "multiSH.deviceReporter": { + "record": "%gpii-universal/tests/data/multiScreenreaderDeviceReporter.json", + "target": "{that deviceReporter installedSolutionsDataSource}.options.path", + "priority": "after:development.installedSolutionsPath" + } + } + }, + "mergeConfigs": "%gpii-universal/gpii/configs/gpii.config.development.all.local.json" +} diff --git a/tests/configs/gpii.tests.multiScreenreader.config.txt b/tests/configs/gpii.tests.multiScreenreader.config.txt new file mode 100644 index 000000000..4e792098a --- /dev/null +++ b/tests/configs/gpii.tests.multiScreenreader.config.txt @@ -0,0 +1,4 @@ +gpii.tests.multiScreenreader.config.json + +Is used for the integration test CloseConflictingAppsTest. It uses the NP sets of the testData's acceptanceTests folder and a device reporter that reports only two screenreaders (Jaws and NVDA) installed. + diff --git a/tests/data/multiSHSolutionRegistry.json b/tests/data/multiSHSolutionRegistry.json deleted file mode 100644 index a1d593921..000000000 --- a/tests/data/multiSHSolutionRegistry.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "fakemag1": { - "name": "Fake Magnifier 1", - "contexts": { - "OS": [ - { - "id": "win32" - } - ] - }, - "settingsHandlers": { - "configuration": { - "type": "gpii.settingsHandlers.JSONSettingsHandler", - "options": { - "filename": "/tmp/fakemag1.settings.json" - }, - "supportedSettings": { - "tilingMagnifiers": {}, - "magnification": {}, - "tracking": {} - }, - "capabilities": [ - "http://registry\\.gpii\\.net/common/magnifierEnabled" - ], - "capabilitiesTransformations": { - "magnification": "http://registry\\.gpii\\.net/common/magnification", - "tracking": "http://registry\\.gpii\\.net/common/tracking" - } - }, - "configuration1": { - "type": "gpii.settingsHandlers.JSONSettingsHandler", - "options": { - "filename": "/tmp/fakemag2.settings.json" - }, - "supportedSettings": { - "weirdSetting": {}, - "crazyColor": {} - }, - "capabilities": [], - "capabilitiesTransformations": { - "crazyColor": "http://registry\\.gpii\\.net/common/invertColours" - } - } - }, - "configure": [ - "settings.configuration", - "settings.configuration1" - ], - "restore": [ - "settings.configuration", - "settings.configuration1" - ], - "start": [ ], - "stop": [ ], - "isInstalled": [ - { - "type": "gpii.deviceReporter.alwaysInstalled" - } - ] - } -} diff --git a/tests/data/multiSHSolutionsRegistry.json b/tests/data/multiSHSolutionsRegistry.json new file mode 100644 index 000000000..8afe67c11 --- /dev/null +++ b/tests/data/multiSHSolutionsRegistry.json @@ -0,0 +1,63 @@ +{ + "win32": { + "fakemag1": { + "name": "Fake Magnifier 1", + "contexts": { + "OS": [ + { + "id": "win32", + "version": ">=5.0" + } + ] + }, + "capabilities": [ + "http://registry\\.gpii\\.net/common/magnification/enabled" + ], + "settingsHandlers": { + "configuration": { + "type": "gpii.settingsHandlers.JSONSettingsHandler", + "options": { + "filename": "/tmp/fakemag1.settings.json" + }, + "supportedSettings": { + "tilingMagnifiers": {}, + "magnification": {}, + "tracking": {} + }, + "capabilitiesTransformations": { + "magnification": "http://registry\\.gpii\\.net/common/magnification", + "tracking": "http://registry\\.gpii\\.net/common/tracking" + } + }, + "configuration1": { + "type": "gpii.settingsHandlers.JSONSettingsHandler", + "options": { + "filename": "/tmp/fakemag2.settings.json" + }, + "supportedSettings": { + "weirdSetting": {}, + "crazyColor": {} + }, + "capabilitiesTransformations": { + "crazyColor": "http://registry\\.gpii\\.net/common/invertColours" + } + } + }, + "configure": [ + "settings.configuration", + "settings.configuration1" + ], + "restore": [ + "settings.configuration", + "settings.configuration1" + ], + "start": [ ], + "stop": [ ], + "isInstalled": [ + { + "type": "gpii.deviceReporter.alwaysInstalled" + } + ] + } + } +} diff --git a/tests/data/multiScreenreaderDeviceReporter.json b/tests/data/multiScreenreaderDeviceReporter.json new file mode 100644 index 000000000..5e9147038 --- /dev/null +++ b/tests/data/multiScreenreaderDeviceReporter.json @@ -0,0 +1,9 @@ +[ + { + "id": "com.freedomscientific.jaws" + }, + + { + "id": "org.nvda-project" + } +] diff --git a/tests/platform/cloud/AcceptanceTests_chrome_testDefs.json b/tests/platform/cloud/AcceptanceTests_chrome_testDefs.json index 5499dada8..94b5e1bc9 100644 --- a/tests/platform/cloud/AcceptanceTests_chrome_testDefs.json +++ b/tests/platform/cloud/AcceptanceTests_chrome_testDefs.json @@ -19,8 +19,8 @@ "magnifierEnabled": false, "magnification": 1, "highContrastTheme": "white-black", - "highContrastEnabled": true, - "screenReaderTTSEnabled": false + "highContrast/enabled": true, + "screenReaderTTS/enabled": false } } }, @@ -34,8 +34,8 @@ "invertColours": false, "magnifierEnabled": false, "magnification": 1, - "highContrastEnabled": false, - "screenReaderTTSEnabled": false + "highContrast/enabled": false, + "screenReaderTTS/enabled": false } } }, @@ -49,8 +49,8 @@ "invertColours": false, "magnifierEnabled": true, "magnification": 2, - "highContrastEnabled": false, - "screenReaderTTSEnabled": false + "highContrast/enabled": false, + "screenReaderTTS/enabled": false } } } diff --git a/tests/platform/linux/linux-builtIn-testSpec.js b/tests/platform/linux/linux-builtIn-testSpec.js index 22dbce0da..01e72c742 100644 --- a/tests/platform/linux/linux-builtIn-testSpec.js +++ b/tests/platform/linux/linux-builtIn-testSpec.js @@ -15,6 +15,7 @@ Seventh Framework Programme (FP7/2007-2013) under grant agreement no. 289016. "use strict"; + var fluid = require("infusion"), gpii = fluid.registerNamespace("gpii"); @@ -28,9 +29,31 @@ gpii.tests.linux.builtIn.testDefs = fluid.freezeRecursive([ { name: "Testing os_common using default matchmaker", userToken: "os_common", + initialState: { + "gpii.gsettings.launch": { + "org.gnome.desktop.a11y.magnifier": [{ + "settings": { + "running": false + }, + "options": { + "schema": "org.gnome.desktop.a11y.applications", + "key": "screen-magnifier-enabled" + } + }], + "org.gnome.desktop.a11y.applications.onscreen-keyboard": [{ + "settings": { + "running": false + }, + "options": { + "schema": "org.gnome.desktop.a11y.applications", + "key": "screen-keyboard-enabled" + } + }] + } + }, settingsHandlers: { "gpii.gsettings": { - "some.app.id": [{ + "org.gnome.desktop.a11y.magnifier": [{ "settings": { "mag-factor": 1.5, "screen-position": "full-screen", @@ -41,7 +64,8 @@ gpii.tests.linux.builtIn.testDefs = fluid.freezeRecursive([ "options": { "schema": "org.gnome.desktop.a11y.magnifier" } - }, { + }], + "org.gnome.desktop.interface": [{ "settings": { "gtk-theme": "HighContrast", "icon-theme": "HighContrast", @@ -52,15 +76,172 @@ gpii.tests.linux.builtIn.testDefs = fluid.freezeRecursive([ "schema": "org.gnome.desktop.interface" } }] + }, + "gpii.gsettings.launch": { + "org.gnome.desktop.a11y.magnifier": [{ + "settings": { + "running": true + }, + "options": { + "schema": "org.gnome.desktop.a11y.applications", + "key": "screen-magnifier-enabled" + } + }], + "org.gnome.desktop.a11y.applications.onscreen-keyboard": [{ + "settings": { + "running": true + }, + "options": { + "schema": "org.gnome.desktop.a11y.applications", + "key": "screen-keyboard-enabled" + } + }] + } + } + }, { + name: "Testing os_common - magnifier running on startup", + userToken: "os_common", + initialState: { + "gpii.gsettings.launch": { + "org.gnome.desktop.a11y.magnifier": [{ + "settings": { + "running": true + }, + "options": { + "schema": "org.gnome.desktop.a11y.applications", + "key": "screen-magnifier-enabled" + } + }], + "org.gnome.desktop.a11y.applications.onscreen-keyboard": [{ + "settings": { + "running": false + }, + "options": { + "schema": "org.gnome.desktop.a11y.applications", + "key": "screen-keyboard-enabled" + } + }] + } + }, + settingsHandlers: { + "gpii.gsettings": { + "org.gnome.desktop.a11y.magnifier": [{ + "settings": { + "mag-factor": 1.5, + "screen-position": "full-screen", + "mouse-tracking": "proportional", + "caret-tracking": "proportional", + "focus-tracking": "none" + }, + "options": { + "schema": "org.gnome.desktop.a11y.magnifier" + } + }], + "org.gnome.desktop.interface": [{ + "settings": { + "gtk-theme": "HighContrast", + "icon-theme": "HighContrast", + "text-scaling-factor": 0.75, + "cursor-size": 41 + }, + "options": { + "schema": "org.gnome.desktop.interface" + } + }] + }, + "gpii.gsettings.launch": { + "org.gnome.desktop.a11y.magnifier": [{ + "settings": { + "running": true + }, + "options": { + "schema": "org.gnome.desktop.a11y.applications", + "key": "screen-magnifier-enabled" + } + }], + "org.gnome.desktop.a11y.applications.onscreen-keyboard": [{ + "settings": { + "running": true + }, + "options": { + "schema": "org.gnome.desktop.a11y.applications", + "key": "screen-keyboard-enabled" + } + }] + } + } + }, { + name: "Testing os_common - magnifier and keyboard running on startup", + userToken: "os_common", + initialState: { + "gpii.gsettings.launch": { + "org.gnome.desktop.a11y.magnifier": [{ + "settings": { + "running": true + }, + "options": { + "schema": "org.gnome.desktop.a11y.applications", + "key": "screen-magnifier-enabled" + } + }], + "org.gnome.desktop.a11y.applications.onscreen-keyboard": [{ + "settings": { + "running": true + }, + "options": { + "schema": "org.gnome.desktop.a11y.applications", + "key": "screen-keyboard-enabled" + } + }] } }, - processes: [ - { - "command": "gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled", - "expectConfigured": "true", - "expectRestored": "false" + settingsHandlers: { + "gpii.gsettings": { + "org.gnome.desktop.a11y.magnifier": [{ + "settings": { + "mag-factor": 1.5, + "screen-position": "full-screen", + "mouse-tracking": "proportional", + "caret-tracking": "proportional", + "focus-tracking": "none" + }, + "options": { + "schema": "org.gnome.desktop.a11y.magnifier" + } + }], + "org.gnome.desktop.interface": [{ + "settings": { + "gtk-theme": "HighContrast", + "icon-theme": "HighContrast", + "text-scaling-factor": 0.75, + "cursor-size": 41 + }, + "options": { + "schema": "org.gnome.desktop.interface" + } + }] + }, + "gpii.gsettings.launch": { + "org.gnome.desktop.a11y.magnifier": [{ + "settings": { + "running": true + }, + "options": { + "schema": "org.gnome.desktop.a11y.applications", + "key": "screen-magnifier-enabled" + } + }], + "org.gnome.desktop.a11y.applications.onscreen-keyboard": [{ + "settings": { + "running": true + }, + "options": { + "schema": "org.gnome.desktop.a11y.applications", + "key": "screen-keyboard-enabled" + } + }] } - ] + } }, { name: "Testing os_common2 using default matchmaker", @@ -77,15 +258,27 @@ gpii.tests.linux.builtIn.testDefs = fluid.freezeRecursive([ } }] } - }, - processes: [] + } }, { name: "Testing os_gnome using default matchmaker", userToken: "os_gnome", + initialState: { + "gpii.gsettings.launch": { + "org.gnome.desktop.a11y.magnifier": [{ + "settings": { + "running": false + }, + "options": { + "schema": "org.gnome.desktop.a11y.applications", + "key": "screen-magnifier-enabled" + } + }] + } + }, settingsHandlers: { "gpii.gsettings": { - "some.app.id": [{ + "org.gnome.desktop.a11y.magnifier": [{ "settings": { "mag-factor": 1.5, "screen-position": "full-screen" @@ -93,7 +286,8 @@ gpii.tests.linux.builtIn.testDefs = fluid.freezeRecursive([ "options": { "schema": "org.gnome.desktop.a11y.magnifier" } - }, { + }], + "org.gnome.desktop.interface": [{ "settings": { "text-scaling-factor": 0.75, "cursor-size": 90 @@ -104,24 +298,41 @@ gpii.tests.linux.builtIn.testDefs = fluid.freezeRecursive([ }] }, "gpii.alsa": { - "some.app.id": [{ + "org.alsa-project": [{ "settings": { "masterVolume": 50 } }] + }, + "gpii.gsettings.launch": { + "org.gnome.desktop.a11y.magnifier": [{ + "settings": { + "running": true + }, + "options": { + "schema": "org.gnome.desktop.a11y.applications", + "key": "screen-magnifier-enabled" + } + }] } - }, - processes: [ - { - "command": "gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled", - "expectConfigured": "true", - "expectRestored": "false" - } - ] + } }, { name: "Testing os_win7 using default matchmaker", userToken: "os_win7", + initialState: { + "gpii.gsettings.launch": { + "org.gnome.desktop.a11y.magnifier": [{ + "settings": { + "running": false + }, + "options": { + "schema": "org.gnome.desktop.a11y.applications", + "key": "screen-magnifier-enabled" + } + }] + } + }, settingsHandlers: { "gpii.gsettings": { "some.app.id": [{ @@ -145,15 +356,19 @@ gpii.tests.linux.builtIn.testDefs = fluid.freezeRecursive([ "schema": "org.gnome.desktop.interface" } }] + }, + "gpii.gsettings.launch": { + "org.gnome.desktop.a11y.magnifier": [{ + "settings": { + "running": true + }, + "options": { + "schema": "org.gnome.desktop.a11y.applications", + "key": "screen-magnifier-enabled" + } + }] } - }, - processes: [ - { - "command": "gsettings get org.gnome.desktop.a11y.applications screen-magnifier-enabled", - "expectConfigured": "true", - "expectRestored": "false" - } - ] + } } ]); diff --git a/tests/platform/linux/linux-builtIn-testSpec.txt b/tests/platform/linux/linux-builtIn-testSpec.txt index 3e22fe2d8..99f2097da 100644 --- a/tests/platform/linux/linux-builtIn-testSpec.txt +++ b/tests/platform/linux/linux-builtIn-testSpec.txt @@ -7,5 +7,5 @@ onscreen keyboard, etc. It tests the system using four NP sets: (1) os_common: common terms compatible with linux built in settings (2) os_win7: application specific windows settings (3) os_gnome: application specific gnome settings - (4) os_common2: this is only used to check when highContrastEnabled=false + (4) os_common2: this is only used to check when highContrast/enabled=false diff --git a/tests/platform/linux/linux-dynamicDeviceReporter-testSpec.js b/tests/platform/linux/linux-dynamicDeviceReporter-testSpec.js index cbe5d2d93..df3586071 100644 --- a/tests/platform/linux/linux-dynamicDeviceReporter-testSpec.js +++ b/tests/platform/linux/linux-dynamicDeviceReporter-testSpec.js @@ -29,6 +29,19 @@ gpii.tests.deviceReporterAware.linux.orca.testDefs = [ name: "Testing screenreader_common using Flat matchmaker", gradeNames: "gpii.test.integration.deviceReporterAware.linux", userToken: "screenreader_common", + initialState: { + "gpii.gsettings.launch": { + "org.gnome.orca": [{ + "settings": { + "running": false + }, + "options": { + "schema": "org.gnome.desktop.a11y.applications", + "key": "screen-reader-enabled" + } + }] + } + }, settingsHandlers: { "gpii.orca": { "data": [ @@ -53,15 +66,19 @@ gpii.tests.deviceReporterAware.linux.orca.testDefs = [ } } ] + }, + "gpii.gsettings.launch": { + "org.gnome.orca": [{ + "settings": { + "running": true + }, + "options": { + "schema": "org.gnome.desktop.a11y.applications", + "key": "screen-reader-enabled" + } + }] } }, - processes: [ - { - "command": "gsettings get org.gnome.desktop.a11y.applications screen-reader-enabled", - "expectConfigured": "true", - "expectRestored": "false" - } - ], deviceReporters: { "gpii.packageKit.find": { "expectInstalled": ["orca"] @@ -72,6 +89,19 @@ gpii.tests.deviceReporterAware.linux.orca.testDefs = [ name: "Testing screenreader_orca using Flat matchmaker", gradeNames: "gpii.test.integration.deviceReporterAware.linux", userToken: "screenreader_orca", + initialState: { + "gpii.gsettings.launch": { + "org.gnome.orca": [{ + "settings": { + "running": false + }, + "options": { + "schema": "org.gnome.desktop.a11y.applications", + "key": "screen-reader-enabled" + } + }] + } + }, settingsHandlers: { "gpii.orca": { "some.app.id": [ @@ -95,15 +125,19 @@ gpii.tests.deviceReporterAware.linux.orca.testDefs = [ } } ] + }, + "gpii.gsettings.launch": { + "org.gnome.orca": [{ + "settings": { + "running": true + }, + "options": { + "schema": "org.gnome.desktop.a11y.applications", + "key": "screen-reader-enabled" + } + }] } }, - processes: [ - { - "command": "gsettings get org.gnome.desktop.a11y.applications screen-reader-enabled", - "expectConfigured": "true", - "expectRestored": "false" - } - ], deviceReporters: { "gpii.packageKit.find": { "expectInstalled": ["orca"] @@ -114,6 +148,19 @@ gpii.tests.deviceReporterAware.linux.orca.testDefs = [ name: "Testing screenreader_nvda using Flat matchmaker", gradeNames: "gpii.test.integration.deviceReporterAware.linux", userToken: "screenreader_nvda", + initialState: { + "gpii.gsettings.launch": { + "org.gnome.orca": [{ + "settings": { + "running": false + }, + "options": { + "schema": "org.gnome.desktop.a11y.applications", + "key": "screen-reader-enabled" + } + }] + } + }, settingsHandlers: { "gpii.orca": { "some.app.id": [ @@ -136,15 +183,19 @@ gpii.tests.deviceReporterAware.linux.orca.testDefs = [ } } ] + }, + "gpii.gsettings.launch": { + "org.gnome.orca": [{ + "settings": { + "running": true + }, + "options": { + "schema": "org.gnome.desktop.a11y.applications", + "key": "screen-reader-enabled" + } + }] } }, - processes: [ - { - "command": "gsettings get org.gnome.desktop.a11y.applications screen-reader-enabled", - "expectConfigured": "true", - "expectRestored": "false" - } - ], deviceReporters: { "gpii.packageKit.find": { "expectInstalled": ["orca"] diff --git a/tests/platform/linux/linux-dynamicDeviceReporter-testSpec.txt b/tests/platform/linux/linux-dynamicDeviceReporter-testSpec.txt index 979e68516..6ea62ad4e 100644 --- a/tests/platform/linux/linux-dynamicDeviceReporter-testSpec.txt +++ b/tests/platform/linux/linux-dynamicDeviceReporter-testSpec.txt @@ -3,4 +3,4 @@ linux-dynamicDeviceReporter-testSpec.js Descriptions: This will run the acceptance tests with dynamic device reporting. -It uses 1 NP set: screenreader_common (but more will be added) +It uses 3 NP sets: screenreader_common, screenreader_orca and screenreader_nvda diff --git a/tests/platform/linux/linux-orca-testSpec.js b/tests/platform/linux/linux-orca-testSpec.js index 32d02f8f7..dd57793f5 100644 --- a/tests/platform/linux/linux-orca-testSpec.js +++ b/tests/platform/linux/linux-orca-testSpec.js @@ -26,11 +26,24 @@ fluid.registerNamespace("gpii.tests.linux.orca"); gpii.tests.linux.orca.testDefs = [ { - name: "Testing screenreader_common using Flat matchmaker", + name: "Testing screenreader_common", userToken: "screenreader_common", + initialState: { + "gpii.gsettings.launch": { + "org.gnome.orca": [{ + "settings": { + "running": false + }, + "options": { + "schema": "org.gnome.desktop.a11y.applications", + "key": "screen-reader-enabled" + } + }] + } + }, settingsHandlers: { "gpii.orca": { - "some.app.id": [ + "org.gnome.orca": [ { "settings": { "sayAllStyle": 1, @@ -52,22 +65,92 @@ gpii.tests.linux.orca.testDefs = [ } } ] + }, + "gpii.gsettings.launch": { + "org.gnome.orca": [{ + "settings": { + "running": true + }, + "options": { + "schema": "org.gnome.desktop.a11y.applications", + "key": "screen-reader-enabled" + } + }] + } + } + }, { + name: "Testing screenreader_common with orca running on login", + userToken: "screenreader_common", + initialState: { + "gpii.gsettings.launch": { + "org.gnome.orca": [{ + "settings": { + "running": true + }, + "options": { + "schema": "org.gnome.desktop.a11y.applications", + "key": "screen-reader-enabled" + } + }] } }, - processes: [ - { - "command": "gsettings get org.gnome.desktop.a11y.applications screen-reader-enabled", - "expectConfigured": "true", - "expectRestored": "false" + settingsHandlers: { + "gpii.orca": { + "org.gnome.orca": [ + { + "settings": { + "sayAllStyle": 1, + "enableSpeech": true, + "enableEchoByWord": true, + "enableEchoByCharacter": false, + "voices.default.rate": 102.27272727272727, + "voices.default.gain": 7.5, + "enableTutorialMessages": false, + "voices.default.family": { + "locale": "en", + "name": "en-westindies" + }, + "verbalizePunctuationStyle": 0, + "voices.default.average-pitch": 1.5 + }, + "options": { + "user": "screenreader_common" + } + } + ] + }, + "gpii.gsettings.launch": { + "org.gnome.orca": [{ + "settings": { + "running": true + }, + "options": { + "schema": "org.gnome.desktop.a11y.applications", + "key": "screen-reader-enabled" + } + }] } - ] + } }, { - name: "Testing screenreader_orca using Flat matchmaker", + name: "Testing screenreader_orca", userToken: "screenreader_orca", + initialState: { + "gpii.gsettings.launch": { + "org.gnome.orca": [{ + "settings": { + "running": false + }, + "options": { + "schema": "org.gnome.desktop.a11y.applications", + "key": "screen-reader-enabled" + } + }] + } + }, settingsHandlers: { "gpii.orca": { - "some.app.id": [ + "org.gnome.orca": [ { "settings": { "sayAllStyle": 1, @@ -88,22 +171,39 @@ gpii.tests.linux.orca.testDefs = [ } } ] + }, + "gpii.gsettings.launch": { + "org.gnome.orca": [{ + "settings": { + "running": true + }, + "options": { + "schema": "org.gnome.desktop.a11y.applications", + "key": "screen-reader-enabled" + } + }] } - }, - processes: [ - { - "command": "gsettings get org.gnome.desktop.a11y.applications screen-reader-enabled", - "expectConfigured": "true", - "expectRestored": "false" - } - ] + } }, { - name: "Testing screenreader_nvda using Flat matchmaker", + name: "Testing screenreader_nvda", userToken: "screenreader_nvda", + initialState: { + "gpii.gsettings.launch": { + "org.gnome.orca": [{ + "settings": { + "running": false + }, + "options": { + "schema": "org.gnome.desktop.a11y.applications", + "key": "screen-reader-enabled" + } + }] + } + }, settingsHandlers: { "gpii.orca": { - "some.app.id": [ + "org.gnome.orca": [ { "settings": { "sayAllStyle": 1, @@ -123,15 +223,19 @@ gpii.tests.linux.orca.testDefs = [ } } ] + }, + "gpii.gsettings.launch": { + "org.gnome.orca": [{ + "settings": { + "running": true + }, + "options": { + "schema": "org.gnome.desktop.a11y.applications", + "key": "screen-reader-enabled" + } + }] } - }, - processes: [ - { - "command": "gsettings get org.gnome.desktop.a11y.applications screen-reader-enabled", - "expectConfigured": "true", - "expectRestored": "false" - } - ] + } } ]; diff --git a/tests/platform/shared/uioPlusTestDefs.js b/tests/platform/shared/uioPlusTestDefs.js index 1261152cd..966489333 100644 --- a/tests/platform/shared/uioPlusTestDefs.js +++ b/tests/platform/shared/uioPlusTestDefs.js @@ -47,8 +47,7 @@ gpii.tests.uioPlus.testDefs = [ } ] } - }, - processes: [] + } }, { name: "Acceptance test for background color change for UIO+", @@ -76,8 +75,7 @@ gpii.tests.uioPlus.testDefs = [ } ] } - }, - processes: [] + } }, { name: "Acceptance test for font size transformation for UIO+", @@ -105,8 +103,7 @@ gpii.tests.uioPlus.testDefs = [ } ] } - }, - processes: [] + } }, { name: "Acceptance test for line space transformation for UIO+", @@ -134,8 +131,7 @@ gpii.tests.uioPlus.testDefs = [ } ] } - }, - processes: [] + } }, { name: "Acceptance test for highlight color transformation for UIO+", @@ -163,8 +159,7 @@ gpii.tests.uioPlus.testDefs = [ } ] } - }, - processes: [] + } }, { name: "Acceptance test for character space transformation for UIO+", @@ -192,8 +187,7 @@ gpii.tests.uioPlus.testDefs = [ } ] } - }, - processes: [] + } }, { name: "Acceptance test for inputs larger transformation for UIO+", @@ -221,8 +215,7 @@ gpii.tests.uioPlus.testDefs = [ } ] } - }, - processes: [] + } }, { name: "Acceptance test for self voicing transformation for UIO+", @@ -250,8 +243,7 @@ gpii.tests.uioPlus.testDefs = [ } ] } - }, - processes: [] + } }, { name: "Acceptance test for table of contents transformation for UIO+", @@ -279,8 +271,7 @@ gpii.tests.uioPlus.testDefs = [ } ] } - }, - processes: [] + } }, { name: "Acceptance test for dictionary transformation for UIO+", @@ -308,8 +299,7 @@ gpii.tests.uioPlus.testDefs = [ } ] } - }, - processes: [] + } }, { name: "Acceptance test for support tool transformation for UIO+ - multiple values", @@ -337,8 +327,7 @@ gpii.tests.uioPlus.testDefs = [ } ] } - }, - processes: [] + } }, { name: "Acceptance test for support tool transformation for UIO+ - unsupported values", @@ -366,8 +355,7 @@ gpii.tests.uioPlus.testDefs = [ } ] } - }, - processes: [] + } }, { name: "Acceptance test for simplified UI transformation for UIO+", @@ -395,8 +383,7 @@ gpii.tests.uioPlus.testDefs = [ } ] } - }, - processes: [] + } }, { name: "Acceptance test for syllabification UI transformation for UIO+", @@ -424,8 +411,7 @@ gpii.tests.uioPlus.testDefs = [ } ] } - }, - processes: [] + } }, { name: "Acceptance test for multiple transformations for UIO+", @@ -453,7 +439,6 @@ gpii.tests.uioPlus.testDefs = [ } ] } - }, - processes: [] + } } ]; diff --git a/tests/platform/windows/configs/gpii.tests.acceptance.windows.builtIn.config.json b/tests/platform/windows/configs/gpii.tests.acceptance.windows.builtIn.config.json index 551964de6..2f13cd532 100644 --- a/tests/platform/windows/configs/gpii.tests.acceptance.windows.builtIn.config.json +++ b/tests/platform/windows/configs/gpii.tests.acceptance.windows.builtIn.config.json @@ -8,6 +8,6 @@ "priority": "after:development.installedSolutionsPath" } } - }, + }, "mergeConfigs": "%gpii-universal/tests/configs/gpii.tests.acceptance.localInstall.config.json" } diff --git a/tests/platform/windows/windows-builtIn-testSpec.js b/tests/platform/windows/windows-builtIn-testSpec.js index de5b6b43f..8b6463b04 100644 --- a/tests/platform/windows/windows-builtIn-testSpec.js +++ b/tests/platform/windows/windows-builtIn-testSpec.js @@ -28,9 +28,28 @@ gpii.tests.windows.builtIn = [ { name: "Testing os_win7 using default matchmaker", userToken: "os_win7", + initialState: { + "gpii.windows.enableRegisteredAT": { + "com.microsoft.windows.magnifier": [{ + "settings": { + "running": false + }, + "options": { + "verifySettings": true, + retryOptions: { + rewriteEvery: 0, + numRetries: 20, + retryInterval: 1000 + }, + "registryName": "magnifierpane", + "queryProcess": "Magnify.exe" + } + }] + } + }, settingsHandlers: { "gpii.windows.spiSettingsHandler": { - "some.app.id": [ + "com.microsoft.windows.mouseTrailing": [ { "settings": { "MouseTrails": { @@ -49,7 +68,10 @@ gpii.tests.windows.builtIn = [ "type": "BOOL" } } - }, { + } + ], + "com.microsoft.windows.mouseKeys": [ + { "settings": { "MouseKeysOn": { "path": "pvParam.dwFlags.MKF_MOUSEKEYSON", @@ -73,7 +95,10 @@ gpii.tests.windows.builtIn = [ "name": "MOUSEKEYS" } } - }, { + } + ], + "com.microsoft.windows.stickyKeys": [ + { "settings": { "StickyKeysOn": { "path": "pvParam.dwFlags.SKF_STICKYKEYSON", @@ -89,7 +114,10 @@ gpii.tests.windows.builtIn = [ "name": "STICKYKEYS" } } - }, { + } + ], + "com.microsoft.windows.filterKeys": [ + { "settings": { "FilterKeysEnable": { "path": "pvParam.dwFlags.FKF_FILTERKEYSON", @@ -109,7 +137,10 @@ gpii.tests.windows.builtIn = [ "name": "FILTERKEYS" } } - }, { // high contrast settings + } + ], + "com.microsoft.windows.highContrast": [ + { // high contrast settings "settings": { "HighContrastOn": { "path": "pvParam.dwFlags.HCF_HIGHCONTRASTON", @@ -129,7 +160,7 @@ gpii.tests.windows.builtIn = [ ] }, "gpii.windows.registrySettingsHandler": { - "some.app.id": [{ // magnifier stuff + "com.microsoft.windows.magnifier": [{ // magnifier stuff "settings": { "Invert": 1, "Magnification": 150, @@ -150,7 +181,8 @@ gpii.tests.windows.builtIn = [ "MagnificationMode": "REG_DWORD" } } - }, { // cursor size stuff + }], + "com.microsoft.windows.cursors": [{ // cursor size stuff "settings": { "No": "%SystemRoot%\\cursors\\aero_unavail_xl.cur", "Hand": "%SystemRoot%\\cursors\\aero_link_xl.cur", @@ -211,7 +243,7 @@ gpii.tests.windows.builtIn = [ }] }, "gpii.windows.displaySettingsHandler": { - "some.app.id": [{ + "com.microsoft.windows.screenResolution": [{ "settings": { "screen-resolution": { "width": 800, @@ -220,21 +252,59 @@ gpii.tests.windows.builtIn = [ "screen-dpi": 1 } }] + }, + "gpii.windows.enableRegisteredAT": { + "com.microsoft.windows.magnifier": [{ + "settings": { + "running": true + }, + "options": { + "verifySettings": true, + retryOptions: { + rewriteEvery: 0, + numRetries: 20, + retryInterval: 1000 + }, + "registryName": "magnifierpane", + "queryProcess": "Magnify.exe" + } + }] } - }, - processes: [ - { - "command": "tasklist /fi \"STATUS eq RUNNING\" /FI \"IMAGENAME eq Magnify.exe\" | find /I \"Magnify.exe\" /C", - "expectConfigured": "1", - "expectRestored": "0" - } - ] + } }, { name: "Testing os_common using default matchmaker", userToken: "os_common", + initialState: { + "gpii.windows.enableRegisteredAT": { + "com.microsoft.windows.magnifier": [{ + "settings": { + "running": false + }, + "options": { + "verifySettings": true, + retryOptions: { + rewriteEvery: 0, + numRetries: 20, + retryInterval: 1000 + }, + "registryName": "magnifierpane", + "queryProcess": "Magnify.exe" + } + }], + "com.microsoft.windows.onscreenKeyboard": [{ + "settings": { + "running": false + }, + "options": { + "registryName": "osk", + "queryProcess": "osk.exe" + } + }] + } + }, settingsHandlers: { "gpii.windows.spiSettingsHandler": { - "some.app.id": [ + "com.microsoft.windows.mouseTrailing": [ { "settings": { "MouseTrails": { @@ -253,7 +323,10 @@ gpii.tests.windows.builtIn = [ "type": "BOOL" } } - }, { + } + ], + "com.microsoft.windows.mouseKeys": [ + { "settings": { "MouseKeysOn": { "path": "pvParam.dwFlags.MKF_MOUSEKEYSON", @@ -269,7 +342,10 @@ gpii.tests.windows.builtIn = [ "name": "MOUSEKEYS" } } - }, { + } + ], + "com.microsoft.windows.stickyKeys": [ + { "settings": { "StickyKeysOn": { "path": "pvParam.dwFlags.SKF_STICKYKEYSON", @@ -285,15 +361,240 @@ gpii.tests.windows.builtIn = [ "name": "STICKYKEYS" } } - }, { + } + ], + "com.microsoft.windows.filterKeys": [ + { "settings": { "FilterKeysEnable": { "path": "pvParam.dwFlags.FKF_FILTERKEYSON", + "value": false + }, + "BounceKeysInterval": { + "path": "pvParam.iBounceMSec", + "value": 0 + } + }, + "options": { + "getAction": "SPI_GETFILTERKEYS", + "setAction": "SPI_SETFILTERKEYS", + "uiParam": "struct_size", + "pvParam": { + "type": "struct", + "name": "FILTERKEYS" + } + } + } + ], + "com.microsoft.windows.highContrast": [ + { // high contrast settings + "settings": { + "HighContrastOn": { + "path": "pvParam.dwFlags.HCF_HIGHCONTRASTON", "value": true + } + }, + "options": { + "getAction": "SPI_GETHIGHCONTRAST", + "setAction": "SPI_SETHIGHCONTRAST", + "uiParam": "struct_size", + "pvParam": { + "type": "struct", + "name": "HIGHCONTRAST" + } + } + } + ] + }, + "gpii.windows.registrySettingsHandler": { + "com.microsoft.windows.magnifier": [{ // magnifier stuff + "settings": { + "Invert": 1, + "Magnification": 150, + "MagnificationMode": 3, + "FollowFocus": 0, + "FollowCaret": 1, + "FollowMouse": 1 + }, + "options": { + "hKey": "HKEY_CURRENT_USER", + "path": "Software\\Microsoft\\ScreenMagnifier", + "dataTypes": { + "Magnification": "REG_DWORD", + "Invert": "REG_DWORD", + "FollowFocus": "REG_DWORD", + "FollowCaret": "REG_DWORD", + "FollowMouse": "REG_DWORD", + "MagnificationMode": "REG_DWORD" + } + } + }], + "com.microsoft.windows.cursors": [{ // cursor size stuff + "settings": { + "No": "%SystemRoot%\\cursors\\aero_unavail_xl.cur", + "Hand": "%SystemRoot%\\cursors\\aero_link_xl.cur", + "Help": "%SystemRoot%\\cursors\\aero_helpsel_xl.cur", + "Wait": "%SystemRoot%\\cursors\\aero_busy_xl.ani", + "Arrow": "%SystemRoot%\\cursors\\aero_arrow_xl.cur", + "NWPen": "%SystemRoot%\\cursors\\aero_pen_xl.cur", + "SizeNS": "%SystemRoot%\\cursors\\aero_ns_xl.cur", + "SizeWE": "%SystemRoot%\\cursors\\aero_ew_xl.cur", + "SizeAll": "%SystemRoot%\\cursors\\aero_move_xl.cur", + "UpArrow": "%SystemRoot%\\cursors\\aero_up_xl.cur", + "SizeNESW": "%SystemRoot%\\cursors\\aero_nesw_xl.cur", + "SizeNWSE": "%SystemRoot%\\cursors\\aero_nwse_xl.cur", + "AppStarting": "%SystemRoot%\\cursors\\aero_working_xl.ani" + }, + "options": { + "hKey": "HKEY_CURRENT_USER", + "path": "Control Panel\\Cursors", + "dataTypes": { + "Arrow": "REG_SZ", + "Hand": "REG_SZ", + "Help": "REG_SZ", + "AppStarting": "REG_SZ", + "No": "REG_SZ", + "NWPen": "REG_SZ", + "SizeAll": "REG_SZ", + "SizeNESW": "REG_SZ", + "SizeNS": "REG_SZ", + "SizeNWSE": "REG_SZ", + "SizeWE": "REG_SZ", + "UpArrow": "REG_SZ", + "Wait": "REG_SZ" + } + } + }] + }, + "gpii.windows.enableRegisteredAT": { + "com.microsoft.windows.magnifier": [{ + "settings": { + "running": true + }, + "options": { + "verifySettings": true, + retryOptions: { + rewriteEvery: 0, + numRetries: 20, + retryInterval: 1000 + }, + "registryName": "magnifierpane", + "queryProcess": "Magnify.exe" + } + }], + "com.microsoft.windows.onscreenKeyboard": [{ + "settings": { + "running": true + }, + "options": { + "registryName": "osk", + "queryProcess": "osk.exe" + } + }] + } + } + }, { + name: "Testing os_common - magnifier running on startup", + userToken: "os_common", + initialState: { + "gpii.windows.enableRegisteredAT": { + "com.microsoft.windows.magnifier": [{ + "settings": { + "running": true + }, + "options": { + "verifySettings": true, + retryOptions: { + rewriteEvery: 0, + numRetries: 20, + retryInterval: 1000 + }, + "registryName": "magnifierpane", + "queryProcess": "Magnify.exe" + } + }], + "com.microsoft.windows.onscreenKeyboard": [{ + "settings": { + "running": false + }, + "options": { + "registryName": "osk", + "queryProcess": "osk.exe" + } + }] + } + }, + settingsHandlers: { + "gpii.windows.spiSettingsHandler": { + "com.microsoft.windows.mouseTrailing": [ + { + "settings": { + "MouseTrails": { + "path": { + "get": "pvParam", + "set": "uiParam" + }, + "value": 10 + } + }, + "options": { + "getAction": "SPI_GETMOUSETRAILS", + "setAction": "SPI_SETMOUSETRAILS", + "uiParam": 0, + "pvParam": { + "type": "BOOL" + } + } + } + ], + "com.microsoft.windows.mouseKeys": [ + { + "settings": { + "MouseKeysOn": { + "path": "pvParam.dwFlags.MKF_MOUSEKEYSON", + "value": true + } + }, + "options": { + "getAction": "SPI_GETMOUSEKEYS", + "setAction": "SPI_SETMOUSEKEYS", + "uiParam": "struct_size", + "pvParam": { + "type": "struct", + "name": "MOUSEKEYS" + } + } + } + ], + "com.microsoft.windows.stickyKeys": [ + { + "settings": { + "StickyKeysOn": { + "path": "pvParam.dwFlags.SKF_STICKYKEYSON", + "value": true + } + }, + "options": { + "getAction": "SPI_GETSTICKYKEYS", + "setAction": "SPI_SETSTICKYKEYS", + "uiParam": "struct_size", + "pvParam": { + "type": "struct", + "name": "STICKYKEYS" + } + } + } + ], + "com.microsoft.windows.filterKeys": [ + { + "settings": { + "FilterKeysEnable": { + "path": "pvParam.dwFlags.FKF_FILTERKEYSON", + "value": false }, "BounceKeysInterval": { "path": "pvParam.iBounceMSec", - "value": 1000 + "value": 0 } }, "options": { @@ -305,7 +606,10 @@ gpii.tests.windows.builtIn = [ "name": "FILTERKEYS" } } - }, { // high contrast settings + } + ], + "com.microsoft.windows.highContrast": [ + { // high contrast settings "settings": { "HighContrastOn": { "path": "pvParam.dwFlags.HCF_HIGHCONTRASTON", @@ -325,7 +629,7 @@ gpii.tests.windows.builtIn = [ ] }, "gpii.windows.registrySettingsHandler": { - "some.app.id": [{ // magnifier stuff + "com.microsoft.windows.magnifier": [{ // magnifier stuff "settings": { "Invert": 1, "Magnification": 150, @@ -346,7 +650,8 @@ gpii.tests.windows.builtIn = [ "MagnificationMode": "REG_DWORD" } } - }, { // cursor size stuff + }], + "com.microsoft.windows.cursors": [{ // cursor size stuff "settings": { "No": "%SystemRoot%\\cursors\\aero_unavail_xl.cur", "Hand": "%SystemRoot%\\cursors\\aero_link_xl.cur", @@ -382,21 +687,290 @@ gpii.tests.windows.builtIn = [ } } }] + }, + "gpii.windows.enableRegisteredAT": { + "com.microsoft.windows.magnifier": [{ + "settings": { + "running": true + }, + "options": { + "verifySettings": true, + retryOptions: { + rewriteEvery: 0, + numRetries: 20, + retryInterval: 1000 + }, + "registryName": "magnifierpane", + "queryProcess": "Magnify.exe" + } + }], + "com.microsoft.windows.onscreenKeyboard": [{ + "settings": { + "running": true + }, + "options": { + "registryName": "osk", + "queryProcess": "osk.exe" + } + }] + } + } + }, { + name: "Testing os_common - magnifier and keyboard both running on startup", + userToken: "os_common", + initialState: { + "gpii.windows.enableRegisteredAT": { + "com.microsoft.windows.magnifier": [{ + "settings": { + "running": true + }, + "options": { + "verifySettings": true, + retryOptions: { + rewriteEvery: 0, + numRetries: 20, + retryInterval: 1000 + }, + "registryName": "magnifierpane", + "queryProcess": "Magnify.exe" + } + }], + "com.microsoft.windows.onscreenKeyboard": [{ + "settings": { + "running": true + }, + "options": { + "registryName": "osk", + "queryProcess": "osk.exe" + } + }] } }, - processes: [ - { - "command": "tasklist /fi \"STATUS eq RUNNING\" /FI \"IMAGENAME eq Magnify.exe\" | find /I \"Magnify.exe\" /C", - "expectConfigured": "1", - "expectRestored": "0" + settingsHandlers: { + "gpii.windows.spiSettingsHandler": { + "com.microsoft.windows.mouseTrailing": [ + { + "settings": { + "MouseTrails": { + "path": { + "get": "pvParam", + "set": "uiParam" + }, + "value": 10 + } + }, + "options": { + "getAction": "SPI_GETMOUSETRAILS", + "setAction": "SPI_SETMOUSETRAILS", + "uiParam": 0, + "pvParam": { + "type": "BOOL" + } + } + } + ], + "com.microsoft.windows.mouseKeys": [ + { + "settings": { + "MouseKeysOn": { + "path": "pvParam.dwFlags.MKF_MOUSEKEYSON", + "value": true + } + }, + "options": { + "getAction": "SPI_GETMOUSEKEYS", + "setAction": "SPI_SETMOUSEKEYS", + "uiParam": "struct_size", + "pvParam": { + "type": "struct", + "name": "MOUSEKEYS" + } + } + } + ], + "com.microsoft.windows.stickyKeys": [ + { + "settings": { + "StickyKeysOn": { + "path": "pvParam.dwFlags.SKF_STICKYKEYSON", + "value": true + } + }, + "options": { + "getAction": "SPI_GETSTICKYKEYS", + "setAction": "SPI_SETSTICKYKEYS", + "uiParam": "struct_size", + "pvParam": { + "type": "struct", + "name": "STICKYKEYS" + } + } + } + ], + "com.microsoft.windows.filterKeys": [ + { + "settings": { + "FilterKeysEnable": { + "path": "pvParam.dwFlags.FKF_FILTERKEYSON", + "value": false + }, + "BounceKeysInterval": { + "path": "pvParam.iBounceMSec", + "value": 0 + } + }, + "options": { + "getAction": "SPI_GETFILTERKEYS", + "setAction": "SPI_SETFILTERKEYS", + "uiParam": "struct_size", + "pvParam": { + "type": "struct", + "name": "FILTERKEYS" + } + } + } + ], + "com.microsoft.windows.highContrast": [ + { // high contrast settings + "settings": { + "HighContrastOn": { + "path": "pvParam.dwFlags.HCF_HIGHCONTRASTON", + "value": true + } + }, + "options": { + "getAction": "SPI_GETHIGHCONTRAST", + "setAction": "SPI_SETHIGHCONTRAST", + "uiParam": "struct_size", + "pvParam": { + "type": "struct", + "name": "HIGHCONTRAST" + } + } + } + ] + }, + "gpii.windows.registrySettingsHandler": { + "com.microsoft.windows.magnifier": [{ // magnifier stuff + "settings": { + "Invert": 1, + "Magnification": 150, + "MagnificationMode": 3, + "FollowFocus": 0, + "FollowCaret": 1, + "FollowMouse": 1 + }, + "options": { + "hKey": "HKEY_CURRENT_USER", + "path": "Software\\Microsoft\\ScreenMagnifier", + "dataTypes": { + "Magnification": "REG_DWORD", + "Invert": "REG_DWORD", + "FollowFocus": "REG_DWORD", + "FollowCaret": "REG_DWORD", + "FollowMouse": "REG_DWORD", + "MagnificationMode": "REG_DWORD" + } + } + }], + "com.microsoft.windows.cursors": [{ // cursor size stuff + "settings": { + "No": "%SystemRoot%\\cursors\\aero_unavail_xl.cur", + "Hand": "%SystemRoot%\\cursors\\aero_link_xl.cur", + "Help": "%SystemRoot%\\cursors\\aero_helpsel_xl.cur", + "Wait": "%SystemRoot%\\cursors\\aero_busy_xl.ani", + "Arrow": "%SystemRoot%\\cursors\\aero_arrow_xl.cur", + "NWPen": "%SystemRoot%\\cursors\\aero_pen_xl.cur", + "SizeNS": "%SystemRoot%\\cursors\\aero_ns_xl.cur", + "SizeWE": "%SystemRoot%\\cursors\\aero_ew_xl.cur", + "SizeAll": "%SystemRoot%\\cursors\\aero_move_xl.cur", + "UpArrow": "%SystemRoot%\\cursors\\aero_up_xl.cur", + "SizeNESW": "%SystemRoot%\\cursors\\aero_nesw_xl.cur", + "SizeNWSE": "%SystemRoot%\\cursors\\aero_nwse_xl.cur", + "AppStarting": "%SystemRoot%\\cursors\\aero_working_xl.ani" + }, + "options": { + "hKey": "HKEY_CURRENT_USER", + "path": "Control Panel\\Cursors", + "dataTypes": { + "Arrow": "REG_SZ", + "Hand": "REG_SZ", + "Help": "REG_SZ", + "AppStarting": "REG_SZ", + "No": "REG_SZ", + "NWPen": "REG_SZ", + "SizeAll": "REG_SZ", + "SizeNESW": "REG_SZ", + "SizeNS": "REG_SZ", + "SizeNWSE": "REG_SZ", + "SizeWE": "REG_SZ", + "UpArrow": "REG_SZ", + "Wait": "REG_SZ" + } + } + }] + }, + "gpii.windows.enableRegisteredAT": { + "com.microsoft.windows.magnifier": [{ + "settings": { + "running": true + }, + "options": { + "verifySettings": true, + retryOptions: { + rewriteEvery: 0, + numRetries: 20, + retryInterval: 1000 + }, + "registryName": "magnifierpane", + "queryProcess": "Magnify.exe" + } + }], + "com.microsoft.windows.onscreenKeyboard": [{ + "settings": { + "running": true + }, + "options": { + "registryName": "osk", + "queryProcess": "osk.exe" + } + }] } - ] + } }, { name: "Testing os_gnome using default matchmaker", userToken: "os_gnome", + initialState: { + "gpii.windows.enableRegisteredAT": { + "com.microsoft.windows.magnifier": [{ + "settings": { + "running": false + }, + "options": { + "verifySettings": true, + retryOptions: { + rewriteEvery: 0, + numRetries: 20, + retryInterval: 1000 + }, + "registryName": "magnifierpane", + "queryProcess": "Magnify.exe" + } + }], + "com.microsoft.windows.onscreenKeyboard": [{ + "settings": { + "running": false + }, + "options": { + "registryName": "osk", + "queryProcess": "osk.exe" + } + }] + } + }, settingsHandlers: { "gpii.windows.registrySettingsHandler": { - "some.app.id": [{ // magnifier stuff + "com.microsoft.windows.magnifier": [{ // magnifier stuff "settings": { "Magnification": 150, "MagnificationMode": 2 @@ -413,7 +987,8 @@ gpii.tests.windows.builtIn = [ "MagnificationMode": "REG_DWORD" } } - }, { // cursor size stuff + }], + "com.microsoft.windows.cursors": [{ // cursor size stuff "settings": { "No": "%SystemRoot%\\cursors\\aero_unavail_xl.cur", "Hand": "%SystemRoot%\\cursors\\aero_link_xl.cur", @@ -449,15 +1024,25 @@ gpii.tests.windows.builtIn = [ } } }] + }, + "gpii.windows.enableRegisteredAT": { + "com.microsoft.windows.magnifier": [{ + "settings": { + "running": true + }, + "options": { + "verifySettings": true, + retryOptions: { + rewriteEvery: 0, + numRetries: 20, + retryInterval: 1000 + }, + "registryName": "magnifierpane", + "queryProcess": "Magnify.exe" + } + }] } - }, - processes: [ - { - "command": "tasklist /fi \"STATUS eq RUNNING\" /FI \"IMAGENAME eq Magnify.exe\" | find /I \"Magnify.exe\" /C", - "expectConfigured": "1", - "expectRestored": "0" - } - ] + } } ]; diff --git a/tests/platform/windows/windows-dynamicDeviceReporter-testSpec.js b/tests/platform/windows/windows-dynamicDeviceReporter-testSpec.js index d5f38368e..807201dd0 100644 --- a/tests/platform/windows/windows-dynamicDeviceReporter-testSpec.js +++ b/tests/platform/windows/windows-dynamicDeviceReporter-testSpec.js @@ -24,10 +24,90 @@ gpii.loadTestingSupport(); fluid.registerNamespace("gpii.tests.deviceReporterAware.windows"); -gpii.tests.deviceReporterAware.windows = [ +gpii.tests.deviceReporterAware.windows.flexibleHandlerEntries = { + nvda: function (running) { + return { + "org.nvda-project": [{ + "settings": { + "running": running + }, + "options": { + "verifySettings": true, + retryOptions: { + rewriteEvery: 0, + numRetries: 20, + retryInterval: 1000 + }, + "getState": [ + { + "type": "gpii.processReporter.find", + "command": "nvda" + } + ], + "setTrue": [ + { + "type": "gpii.launch.exec", + "command": "\"${{registry}.HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\nvda.exe\\}\"" + } + ], + "setFalse": [ + { + "type": "gpii.windows.closeProcessByName", + "filename": "nvda_service.exe" + },{ + "type": "gpii.windows.closeProcessByName", + "filename": "nvda.exe" + } + ] + } + }] + }; + }, + readwrite: function (running) { + return { + "com.texthelp.readWriteGold": [{ + "settings": { + "running": running + }, + "options": { + "verifySettings": true, + retryOptions: { + rewriteEvery: 0, + numRetries: 40, + retryInterval: 1000 + }, + "setTrue": [ + { + "type": "gpii.launch.exec", + "command": "\"${{registry}.HKEY_CURRENT_USER\\Software\\Texthelp\\Read&Write11\\InstallPath}\\ReadAndWrite.exe\"" + } + ], + "setFalse": [ + { + "type": "gpii.windows.closeProcessByName", + "filename": "ReadAndWrite.exe" + } + ], + "getState": [ + { + "type": "gpii.processReporter.find", + "command": "ReadAndWrite" + } + ] + } + }] + }; + } +}; + + +gpii.tests.deviceReporterAware.windows.testDefs = [ { name: "Testing screenreader_nvda using Flat matchmaker", userToken: "screenreader_nvda", + initialState: { + "gpii.launchHandlers.flexibleHandler": gpii.tests.deviceReporterAware.windows.flexibleHandlerEntries.nvda(false) + }, gradeNames: "gpii.test.integration.deviceReporterAware.windows", settingsHandlers: { "gpii.settingsHandlers.INISettingsHandler": { @@ -57,15 +137,9 @@ gpii.tests.deviceReporterAware.windows = [ } } ] - } + }, + "gpii.launchHandlers.flexibleHandler": gpii.tests.deviceReporterAware.windows.flexibleHandlerEntries.nvda(true) }, - processes: [ - { - "command": "tasklist /fi \"STATUS eq RUNNING\" /FI \"IMAGENAME eq nvda.exe\" | find /I \"nvda.exe\" /C", - "expectConfigured": "1", - "expectRestored": "0" - } - ], deviceReporters: { "gpii.deviceReporter.registryKeyExists": { "expectInstalled": [{ @@ -80,14 +154,12 @@ gpii.tests.deviceReporterAware.windows = [ name: "Testing readwritegold_application1 using Flat matchmaker", userToken: "readwritegold_application1", gradeNames: "gpii.test.integration.deviceReporterAware.windows", - settingsHandlers: {}, - processes: [ - { - "command": "tasklist /fi \"STATUS eq RUNNING\" /FI \"IMAGENAME eq ReadAndWrite.exe\" | find /I \"ReadAndWrite.exe\" /C", - "expectConfigured": "1", - "expectRestored": "0" - } - ], + initialState: { + "gpii.launchHandlers.flexibleHandler": gpii.tests.deviceReporterAware.windows.flexibleHandlerEntries.readwrite(false) + }, + settingsHandlers: { + "gpii.launchHandlers.flexibleHandler": gpii.tests.deviceReporterAware.windows.flexibleHandlerEntries.readwrite(true) + }, deviceReporters: { "gpii.deviceReporter.registryKeyExists": { "expectInstalled": [{ @@ -101,7 +173,7 @@ gpii.tests.deviceReporterAware.windows = [ ]; module.exports = gpii.test.bootstrap({ - testDefs: "gpii.tests.deviceReporterAware.windows", + testDefs: "gpii.tests.deviceReporterAware.windows.testDefs", configName: "windows-dynamicDeviceReporter-config", configPath: "%gpii-universal/tests/platform/windows/configs" }, ["gpii.test.integration.testCaseHolder.windows", "gpii.test.integration.deviceReporterAware.windows"], diff --git a/tests/platform/windows/windows-jaws-testSpec.js b/tests/platform/windows/windows-jaws-testSpec.js index 60d9e23f6..a2f42695f 100644 --- a/tests/platform/windows/windows-jaws-testSpec.js +++ b/tests/platform/windows/windows-jaws-testSpec.js @@ -22,15 +22,66 @@ fluid.require("%gpii-universal"); gpii.loadTestingSupport(); -fluid.registerNamespace("gpii.tests.windows"); +fluid.registerNamespace("gpii.tests.windows.jaws"); -gpii.tests.windows.jaws = [ +// To avoid duplicating this entire piece in each test. Given a true or false value +// as input, this will return a settingshandler entry, containing all the options from +// the solutions registry entry for NVDAs launchHandler, with a settings block with +// running: X - where X is replaced with the input parameter +gpii.tests.windows.jaws.flexibleHandlerEntry = function (running) { + return { + "com.freedomscientific.jaws": [{ + "settings": { + "running": running + }, + "options": { + "verifySettings": true, + retryOptions: { + rewriteEvery: 0, + numRetries: 20, + retryInterval: 1000 + }, + "getState": [ + { + "type": "gpii.processReporter.find", + "command": "jfw" + } + ], + "setTrue": [ + { + "type": "gpii.launch.exec", + "command": "\"${{registry}.HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\JAWS17.exe\\}\"" + } + ], + "setFalse": [ + { + "type": "gpii.windows.closeProcessByName", + "filename": "jfw.exe" + }, + { + "type": "gpii.windows.closeProcessByName", + "filename": "fsSynth32.exe" + }, + { + "type": "gpii.windows.closeProcessByName", + "filename": "jhookldr.exe" + } + ] + } + }] + }; +}; + +gpii.tests.windows.jaws.testDefs = [ { - name: "Testing NP set \"jaws_application\" using Flat matchmaker", + name: "Testing NP set \"jaws_application\"", userToken: "jaws_application", + initialState: { + "gpii.launchHandlers.flexibleHandler": gpii.tests.windows.jaws.flexibleHandlerEntry(false) + }, settingsHandlers: { "gpii.settingsHandlers.INISettingsHandler": { - "some.app.id": [ + "com.freedomscientific.jaws": [ { "settings": { "Voice Profiles.ActiveVoiceProfileName" : "GPII", @@ -84,23 +135,85 @@ gpii.tests.windows.jaws = [ } } ] - } + }, + "gpii.launchHandlers.flexibleHandler": gpii.tests.windows.jaws.flexibleHandlerEntry(true) + } + }, + { + name: "Testing NP set \"jaws_application\" - where jaws is running on startup", + userToken: "jaws_application", + initialState: { + "gpii.launchHandlers.flexibleHandler": gpii.tests.windows.jaws.flexibleHandlerEntry(true) }, - processes: [ - { - "command": "tasklist /fi \"STATUS eq RUNNING\" /FI \"IMAGENAME eq jfw.exe\" | find /I \"jfw.exe\" /C", - "expectConfigured": "1", - "expectRestored": "0", - "maxTimeouts": "40" - } - ] + settingsHandlers: { + "gpii.settingsHandlers.INISettingsHandler": { + "com.freedomscientific.jaws": [ + { + "settings": { + "Voice Profiles.ActiveVoiceProfileName" : "GPII", + "options.SayAllIndicateCaps" : false, + "options.TypingEcho": 3, + "options.SayAllMode": 0, + "Braille.BrailleMode": 0, + "options.SayAllIgnoreShiftKeys": true + }, + "options": { + "filename": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\17.0\\Settings\\enu\\DEFAULT.JCF" + } + }, + + { + "settings": { + "Options.PrimarySynthesizer" : "eloq", + "ENU-Global.Rate": 100, + "ENU-JAWSCursor.Rate": 100, + "ENU-Keyboard.Rate": 100, + "ENU-MenuAndDialog.Rate": 100, + "ENU-Message.Rate": 100, + "ENU-PCCursor.Rate": 100, + "ENU-Global.Pitch": 75, + "ENU-JAWSCursor.Pitch": 75, + "ENU-Keyboard.Pitch": 75, + "ENU-MenuAndDialog.Pitch": 75, + "ENU-Message.Pitch": 75, + "ENU-PCCursor.Pitch": 75, + "ENU-Global.Volume": 100, + "ENU-JAWSCursor.Volume": 100, + "ENU-Keyboard.Volume": 100, + "ENU-MenuAndDialog.Volume": 100, + "ENU-Message.Volume": 100, + "ENU-PCCursor.Volume": 100, + "ENU-Global.Punctuation": 2, + "ENU-JAWSCursor.Punctuation": 2, + "ENU-Keyboard.Punctuation": 2, + "ENU-MenuAndDialog.Punctuation": 2, + "ENU-Message.Punctuation": 2, + "ENU-PCCursor.Punctuation": 2, + "ENU-Global.SynthLangString": "Italian", + "ENU-JAWSCursor.SynthLangString": "Italian", + "ENU-Keyboard.SynthLangString": "Italian", + "ENU-MenuAndDialog.SynthLangString": "Italian", + "ENU-Message.SynthLangString": "Italian", + "ENU-PCCursor.SynthLangString": "Italian" + }, + "options": { + "filename": "${{environment}.APPDATA}\\Freedom Scientific\\JAWS\\17.0\\Settings\\VoiceProfiles\\GPII.VPF" + } + } + ] + }, + "gpii.launchHandlers.flexibleHandler": gpii.tests.windows.jaws.flexibleHandlerEntry(true) + } }, { - name: "Testing NP set \"jaws_common\" using Flat matchmaker", + name: "Testing NP set \"jaws_common\"", userToken: "jaws_common", + initialState: { + "gpii.launchHandlers.flexibleHandler": gpii.tests.windows.jaws.flexibleHandlerEntry(false) + }, settingsHandlers: { "gpii.settingsHandlers.INISettingsHandler": { - "some.app.id": [ + "com.freedomscientific.jaws": [ { "settings": { "Options.PrimarySynthesizer": "eloq", @@ -154,23 +267,19 @@ gpii.tests.windows.jaws = [ } } ] - } - }, - processes: [ - { - "command": "tasklist /fi \"STATUS eq RUNNING\" /FI \"IMAGENAME eq jfw.exe\" | find /I \"jfw.exe\" /C", - "expectConfigured": "1", - "expectRestored": "0", - "maxTimeouts": "40" - } - ] + }, + "gpii.launchHandlers.flexibleHandler": gpii.tests.windows.jaws.flexibleHandlerEntry(true) + } }, { - name: "Testing NP set \"jaws_common2\" using Flat matchmaker", + name: "Testing NP set \"jaws_common2\"", userToken: "jaws_common2", + initialState: { + "gpii.launchHandlers.flexibleHandler": gpii.tests.windows.jaws.flexibleHandlerEntry(false) + }, settingsHandlers: { "gpii.settingsHandlers.INISettingsHandler": { - "some.app.id": [ + "com.freedomscientific.jaws": [ { "settings": { "Options.PrimarySynthesizer": "eloq", @@ -223,23 +332,19 @@ gpii.tests.windows.jaws = [ } } ] - } - }, - processes: [ - { - "command": "tasklist /fi \"STATUS eq RUNNING\" /FI \"IMAGENAME eq jfw.exe\" | find /I \"jfw.exe\" /C", - "expectConfigured": "1", - "expectRestored": "0", - "maxTimeouts": "40" - } - ] + }, + "gpii.launchHandlers.flexibleHandler": gpii.tests.windows.jaws.flexibleHandlerEntry(true) + } }, { - name: "Testing NP set \"jaws_common3\" using Flat matchmaker", + name: "Testing NP set \"jaws_common3\"", userToken: "jaws_common3", + initialState: { + "gpii.launchHandlers.flexibleHandler": gpii.tests.windows.jaws.flexibleHandlerEntry(false) + }, settingsHandlers: { "gpii.settingsHandlers.INISettingsHandler": { - "some.app.id": [ + "com.freedomscientific.jaws": [ { "settings": { "Options.PrimarySynthesizer": "eloq", @@ -293,21 +398,14 @@ gpii.tests.windows.jaws = [ } } ] - } - }, - processes: [ - { - "command": "tasklist /fi \"STATUS eq RUNNING\" /FI \"IMAGENAME eq jfw.exe\" | find /I \"jfw.exe\" /C", - "expectConfigured": "1", - "expectRestored": "0", - "maxTimeouts": "40" - } - ] + }, + "gpii.launchHandlers.flexibleHandler": gpii.tests.windows.jaws.flexibleHandlerEntry(true) + } } ]; module.exports = gpii.test.bootstrap({ - testDefs: "gpii.tests.windows.jaws", + testDefs: "gpii.tests.windows.jaws.testDefs", configName: "gpii.tests.acceptance.windows.jaws.config", configPath: "%gpii-universal/tests/platform/windows/configs" }, ["gpii.test.integration.testCaseHolder.windows"], diff --git a/tests/platform/windows/windows-maavis-testSpec.js b/tests/platform/windows/windows-maavis-testSpec.js index 887dc8ea9..ef98999c0 100644 --- a/tests/platform/windows/windows-maavis-testSpec.js +++ b/tests/platform/windows/windows-maavis-testSpec.js @@ -22,15 +22,57 @@ fluid.require("%gpii-universal"); gpii.loadTestingSupport(); -fluid.registerNamespace("gpii.tests.windows"); +fluid.registerNamespace("gpii.tests.windows.maavis"); -gpii.tests.windows.maavis = [ +// To avoid duplicating this entire piece in each test. Given a true or false value +// as input, this will return a settingshandler entry, containing all the options from +// the solutions registry entry for NVDAs launchHandler, with a settings block with +// running: X - where X is replaced with the input parameter +gpii.tests.windows.maavis.flexibleHandlerEntry = function (running) { + return { + "net.opendirective.maavis": [{ + "settings": { + "running": running + }, + "options": { + "verifySettings": true, + "retryOptions": { + "rewriteEvery": 0, + "numRetries": 20 + }, + "setTrue": [ + { + "type": "gpii.launch.exec", + "command": "${{environment}.ComSpec} /c \"cd ${{environment}.MAAVIS_HOME} && MaavisPortable.cmd\"" + } + ], + "setFalse": [ + { + "type": "gpii.windows.closeProcessByName", + "filename": "firefox.exe" + } + ], + "getState": [ + { + "type": "gpii.processReporter.find", + "command": "MaavisPortable" + } + ] + } + }] + }; +}; + +gpii.tests.windows.maavis.testDefs = [ { - name: "Testing maavis_highcontrast using Flat matchmaker", + name: "Testing maavis_highcontrast - when maavis is running on login", userToken: "maavis_highcontrast", + initialState: { + "gpii.launchHandlers.flexibleHandler": gpii.tests.windows.maavis.flexibleHandlerEntry(true) + }, settingsHandlers: { "gpii.settingsHandlers.JSONSettingsHandler": { - "data": [ + "net.opendirective.maavis": [ { "settings": { "theme": "hc", @@ -43,21 +85,42 @@ gpii.tests.windows.maavis = [ } } ] - } + }, + "gpii.launchHandlers.flexibleHandler": gpii.tests.windows.maavis.flexibleHandlerEntry(true) + } + }, { + name: "Testing maavis_highcontrast", + userToken: "maavis_highcontrast", + initialState: { + "gpii.launchHandlers.flexibleHandler": gpii.tests.windows.maavis.flexibleHandlerEntry(false) }, - processes: [ - { - "command": "tasklist /fi \"STATUS eq RUNNING\" /FI \"IMAGENAME eq MaavisPortable.exe\" | find /I \"MaavisPortable.exe\" /C", - "expectConfigured": "1", - "expectRestored": "0" - } - ] + settingsHandlers: { + "gpii.settingsHandlers.JSONSettingsHandler": { + "net.opendirective.maavis": [ + { + "settings": { + "theme": "hc", + "speakTitles": "no", + "speakLabels": "no", + "speakOnActivate": "no" + }, + "options": { + "filename": "${{environment}.MAAVIS_HOME}\\MaavisMedia\\Users\\Default\\userconfig.json" + } + } + ] + }, + "gpii.launchHandlers.flexibleHandler": gpii.tests.windows.maavis.flexibleHandlerEntry(true) + } }, { - name: "Testing maavis_selfvoicing using Flat matchmaker", + name: "Testing maavis_selfvoicing", userToken: "maavis_selfvoicing", + initialState: { + "gpii.launchHandlers.flexibleHandler": gpii.tests.windows.maavis.flexibleHandlerEntry(false) + }, settingsHandlers: { "gpii.settingsHandlers.JSONSettingsHandler": { - "data": [ + "net.opendirective.maavis": [ { "settings": { "theme": "colour", @@ -70,20 +133,14 @@ gpii.tests.windows.maavis = [ } } ] - } - }, - processes: [ - { - "command": "tasklist /fi \"STATUS eq RUNNING\" /FI \"IMAGENAME eq MaavisPortable.exe\" | find /I \"MaavisPortable.exe\" /C", - "expectConfigured": "1", - "expectRestored": "0" - } - ] + }, + "gpii.launchHandlers.flexibleHandler": gpii.tests.windows.maavis.flexibleHandlerEntry(true) + } } ]; module.exports = gpii.test.bootstrap({ - testDefs: "gpii.tests.windows.maavis", + testDefs: "gpii.tests.windows.maavis.testDefs", configName: "gpii.tests.acceptance.windows.maavis.config", configPath: "%gpii-universal/tests/platform/windows/configs" }, ["gpii.test.integration.testCaseHolder.windows"], diff --git a/tests/platform/windows/windows-nvda-testSpec.js b/tests/platform/windows/windows-nvda-testSpec.js index 283ad1162..b57d2254e 100644 --- a/tests/platform/windows/windows-nvda-testSpec.js +++ b/tests/platform/windows/windows-nvda-testSpec.js @@ -22,15 +22,61 @@ fluid.require("%gpii-universal"); gpii.loadTestingSupport(); -fluid.registerNamespace("gpii.tests.windows"); +fluid.registerNamespace("gpii.tests.windows.nvda"); -gpii.tests.windows.nvda = [ +// To avoid duplicating this entire piece in each test. Given a true or false value +// as input, this will return a settingshandler entry, containing all the options from +// the solutions registry entry for NVDAs launchHandler, with a settings block with +// running: X - where X is replaced with the input parameter +gpii.tests.windows.nvda.flexibleHandlerEntry = function (running) { + return { + "org.nvda-project": [{ + "settings": { + "running": running + }, + "options": { + "verifySettings": true, + retryOptions: { + rewriteEvery: 0, + numRetries: 20, + retryInterval: 1000 + }, + "getState": [ + { + "type": "gpii.processReporter.find", + "command": "nvda" + } + ], + "setTrue": [ + { + "type": "gpii.launch.exec", + "command": "\"${{registry}.HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\nvda.exe\\}\"" + } + ], + "setFalse": [ + { + "type": "gpii.windows.closeProcessByName", + "filename": "nvda_service.exe" + },{ + "type": "gpii.windows.closeProcessByName", + "filename": "nvda.exe" + } + ] + } + }] + }; +}; + +gpii.tests.windows.nvda.testDef = [ { - name: "Testing screenreader_nvda using Flat matchmaker", + name: "Testing screenreader_nvda - When running on start", userToken: "screenreader_nvda", + initialState: { + "gpii.launchHandlers.flexibleHandler": gpii.tests.windows.nvda.flexibleHandlerEntry(true) + }, settingsHandlers: { "gpii.settingsHandlers.INISettingsHandler": { - "some.app.id": [ + "org.nvda-project": [ { "settings": { "speech.espeak.rate": 17, @@ -56,21 +102,55 @@ gpii.tests.windows.nvda = [ } } ] - } + }, + "gpii.launchHandlers.flexibleHandler": gpii.tests.windows.nvda.flexibleHandlerEntry(true) + } + }, { + name: "Testing screenreader_nvda", + userToken: "screenreader_nvda", + initialState: { + "gpii.launchHandlers.flexibleHandler": gpii.tests.windows.nvda.flexibleHandlerEntry(false) }, - processes: [ - { - "command": "tasklist /fi \"STATUS eq RUNNING\" /FI \"IMAGENAME eq nvda.exe\" | find /I \"nvda.exe\" /C", - "expectConfigured": "1", - "expectRestored": "0" - } - ] + settingsHandlers: { + "gpii.settingsHandlers.INISettingsHandler": { + "org.nvda-project": [ + { + "settings": { + "speech.espeak.rate": 17, + "speech.espeak.volume": 80, + "speech.espeak.pitch": 60, + "speech.espeak.rateBoost": true, + "speech.synth": "espeak", + "speech.outputDevice": "Microsoft Sound Mapper", + "speech.symbolLevel": 300, + "speech.espeak.voice": "en\\en-wi", + "reviewCursor.followFocus": false, + "reviewCursor.followCaret": true, + "reviewCursor.followMouse": true, + "keyboard.speakTypedWords": true, + "keyboard.speakTypedCharacters": false, + "presentation.reportHelpBalloons": false, + "speech.espeak.sayCapForCapitals": true + }, + "options": { + "filename": "${{environment}.APPDATA}\\nvda\\nvda.ini", + "allowNumberSignComments": true, + "allowSubSections": true + } + } + ] + }, + "gpii.launchHandlers.flexibleHandler": gpii.tests.windows.nvda.flexibleHandlerEntry(true) + } }, { - name: "Testing screenreader_common using Flat matchmaker", + name: "Testing screenreader_common", userToken: "screenreader_common", + initialState: { + "gpii.launchHandlers.flexibleHandler": gpii.tests.windows.nvda.flexibleHandlerEntry(false) + }, settingsHandlers: { "gpii.settingsHandlers.INISettingsHandler": { - "some.app.id": [ + "org.nvda-project": [ { "settings": { "speech.espeak.rate": 17, @@ -94,21 +174,18 @@ gpii.tests.windows.nvda = [ } } ] - } - }, - processes: [ - { - "command": "tasklist /fi \"STATUS eq RUNNING\" /FI \"IMAGENAME eq nvda.exe\" | find /I \"nvda.exe\" /C", - "expectConfigured": "1", - "expectRestored": "0" - } - ] + }, + "gpii.launchHandlers.flexibleHandler": gpii.tests.windows.nvda.flexibleHandlerEntry(true) + } }, { - name: "Testing screenreader_orca using Flat matchmaker", + name: "Testing screenreader_orca", userToken: "screenreader_orca", + initialState: { + "gpii.launchHandlers.flexibleHandler": gpii.tests.windows.nvda.flexibleHandlerEntry(false) + }, settingsHandlers: { "gpii.settingsHandlers.INISettingsHandler": { - "some.app.id": [ + "org.nvda-project": [ { "settings": { "speech.symbolLevel": 300, @@ -126,20 +203,14 @@ gpii.tests.windows.nvda = [ } } ] - } - }, - processes: [ - { - "command": "tasklist /fi \"STATUS eq RUNNING\" /FI \"IMAGENAME eq nvda.exe\" | find /I \"nvda.exe\" /C", - "expectConfigured": "1", - "expectRestored": "0" - } - ] + }, + "gpii.launchHandlers.flexibleHandler": gpii.tests.windows.nvda.flexibleHandlerEntry(true) + } } ]; module.exports = gpii.test.bootstrap({ - testDefs: "gpii.tests.windows.nvda", + testDefs: "gpii.tests.windows.nvda.testDef", configName: "gpii.tests.acceptance.windows.nvda.config", configPath: "%gpii-universal/tests/platform/windows/configs" }, ["gpii.test.integration.testCaseHolder.windows"], diff --git a/tests/platform/windows/windows-readWrite-testSpec.js b/tests/platform/windows/windows-readWrite-testSpec.js index 82aff8782..73e59f88b 100644 --- a/tests/platform/windows/windows-readWrite-testSpec.js +++ b/tests/platform/windows/windows-readWrite-testSpec.js @@ -19,15 +19,59 @@ fluid.require("%gpii-universal"); gpii.loadTestingSupport(); -fluid.registerNamespace("gpii.tests.windows"); +fluid.registerNamespace("gpii.tests.windows.readwrite"); -gpii.tests.windows.readWrite = [ +// To avoid duplicating this entire piece in each test. Given a true or false value +// as input, this will return a settingshandler entry, containing all the options from +// the solutions registry entry for NVDAs launchHandler, with a settings block with +// running: X - where X is replaced with the input parameter +gpii.tests.windows.readwrite.flexibleHandlerEntry = function (running) { + return { + "com.texthelp.readWriteGold": [{ + "settings": { + "running": running + }, + "options": { + "verifySettings": true, + retryOptions: { + rewriteEvery: 0, + numRetries: 40, + retryInterval: 1000 + }, + "setTrue": [ + { + "type": "gpii.launch.exec", + "command": "\"${{registry}.HKEY_CURRENT_USER\\Software\\Texthelp\\Read&Write11\\InstallPath}\\ReadAndWrite.exe\"" + } + ], + "setFalse": [ + { + "type": "gpii.windows.closeProcessByName", + "filename": "ReadAndWrite.exe" + } + ], + "getState": [ + { + "type": "gpii.processReporter.find", + "command": "ReadAndWrite" + } + ] + } + }] + }; +}; + + +gpii.tests.windows.readwrite.testDefs = [ { - name: "Testing rwg1", + name: "Testing rwg1 - running on login", userToken: "rwg1", + initialState: { + "gpii.launchHandlers.flexibleHandler": gpii.tests.windows.readwrite.flexibleHandlerEntry(true) + }, settingsHandlers: { "gpii.settingsHandlers.XMLHandler": { - "some.app.id": [ + "com.texthelp.readWriteGold": [ { "settings": { "ApplicationSettings.AppBar.optToolbarIconSet.$t": "Fun", @@ -56,21 +100,58 @@ gpii.tests.windows.readWrite = [ } } ] - } + }, + "gpii.launchHandlers.flexibleHandler": gpii.tests.windows.readwrite.flexibleHandlerEntry(true) + } + }, { + name: "Testing rwg1", + userToken: "rwg1", + initialState: { + "gpii.launchHandlers.flexibleHandler": gpii.tests.windows.readwrite.flexibleHandlerEntry(false) }, - processes: [ - { - "command": "tasklist /fi \"STATUS eq RUNNING\" /FI \"IMAGENAME eq ReadAndWrite.exe\" | find /I \"ReadAndWrite.exe\" /C", - "expectConfigured": "1", - "expectRestored": "0" - } - ] + settingsHandlers: { + "gpii.settingsHandlers.XMLHandler": { + "com.texthelp.readWriteGold": [ + { + "settings": { + "ApplicationSettings.AppBar.optToolbarIconSet.$t": "Fun", + "ApplicationSettings.AppBar.optToolbarButtonGroupNameCurrent.$t": "Writing Features", + "ApplicationSettings.AppBar.DocType.$t": "1", + "ApplicationSettings.AppBar.ShowText.$t": "true", + "ApplicationSettings.AppBar.optToolbarShowText.$t": "true", + "ApplicationSettings.AppBar.LargeIcons.$t": "true", + "ApplicationSettings.AppBar.optToolbarLargeIcons.$t": "true", + "ApplicationSettings.Speech.optSAPI5Pitch.$t": "36", + "ApplicationSettings.Speech.optSAPI5Speed.$t": "38", + "ApplicationSettings.Speech.optSAPI5Volume.$t": "72", + "ApplicationSettings.Speech.optSAPI5PauseBetweenWords.$t": "0", + "ApplicationSettings.Speech.optSAPI5Voice.$t": "ScanSoft UK English Daniel", + "ApplicationSettings.Speech.WebHighlighting.$t": "false", + "ApplicationSettings.Translation.ToLanguage.$t": "fr", + "ApplicationSettings.Speech.optSAPI5SpeechHighlightContext.$t": "2", + "ApplicationSettings.Scanning.ScanDestination.$t": "PDF", + "ApplicationSettings.Scanning.ScanToFile.$t": "false", + "ApplicationSettings.Spelling.SpellAsIType.$t": "true" + }, + "options": { + "filename": "${{environment}.APPDATA}\\Texthelp\\ReadAndWrite\\11\\RWSettings11.xml", + "encoding": "utf-8", + "xml-tag": "" + } + } + ] + }, + "gpii.launchHandlers.flexibleHandler": gpii.tests.windows.readwrite.flexibleHandlerEntry(true) + } }, { name: "Testing rwg2", userToken: "rwg2", + initialState: { + "gpii.launchHandlers.flexibleHandler": gpii.tests.windows.readwrite.flexibleHandlerEntry(false) + }, settingsHandlers: { "gpii.settingsHandlers.XMLHandler": { - "some.app.id": [ + "com.texthelp.readWriteGold": [ { "settings": { "ApplicationSettings.AppBar.optToolbarIconSet.$t": "Professional", @@ -101,20 +182,14 @@ gpii.tests.windows.readWrite = [ } } ] - } - }, - processes: [ - { - "command": "tasklist /fi \"STATUS eq RUNNING\" /FI \"IMAGENAME eq ReadAndWrite.exe\" | find /I \"ReadAndWrite.exe\" /C", - "expectConfigured": "1", - "expectRestored": "0" - } - ] + }, + "gpii.launchHandlers.flexibleHandler": gpii.tests.windows.readwrite.flexibleHandlerEntry(true) + } } ]; module.exports = gpii.test.bootstrap({ - testDefs: "gpii.tests.windows.readWrite", + testDefs: "gpii.tests.windows.readwrite.testDefs", configName: "gpii.tests.acceptance.windows.readWrite.config", configPath: "%gpii-universal/tests/platform/windows/configs" }, ["gpii.test.integration.testCaseHolder.windows"], diff --git a/tests/shared/ContextIntegrationTestDefs.js b/tests/shared/ContextIntegrationTestDefs.js index d2f3537dc..060b9f9ce 100644 --- a/tests/shared/ContextIntegrationTestDefs.js +++ b/tests/shared/ContextIntegrationTestDefs.js @@ -207,7 +207,7 @@ gpii.tests.contextIntegration.data = { gpii.tests.contextIntegration.fixtures = [ { name: "Simple context change after login", - expect: 9, + expect: 7, sequenceSegments: [ [ { @@ -235,7 +235,6 @@ gpii.tests.contextIntegration.fixtures = [ args: ["{lifecycleManager}", "context1", "gpii-default"] } ], - gpii.test.createProcessChecks(gpii.tests.contextIntegration.data.processes, "expectConfigured"), gpii.tests.contextIntegration.changeEnvironmentAndCheck("bright"), [ { @@ -243,11 +242,7 @@ gpii.tests.contextIntegration.fixtures = [ }, { event: "{logoutRequest}.events.onComplete", listener: "gpii.test.logoutRequestListen" - } - ], - gpii.test.createProcessChecks(gpii.tests.contextIntegration.data.processes, "expectRestored"), - [ - { + }, { func: "gpii.test.checkRestoredConfiguration", args: ["{tests}.contexts.gpii-default.settingsHandlers", "{tests}.settingsStore", "{nameResolver}", "{testCaseHolder}.events.onCheckRestoredConfigurationComplete.fire"] }, { @@ -259,7 +254,7 @@ gpii.tests.contextIntegration.fixtures = [ }, { name: "Context changed before login", - expect: 6, + expect: 5, sequenceSegments: [ [ { @@ -297,11 +292,7 @@ gpii.tests.contextIntegration.fixtures = [ }, { event: "{logoutRequest}.events.onComplete", listener: "gpii.test.logoutRequestListen" - } - ], - gpii.test.createProcessChecks(gpii.tests.contextIntegration.data.processes, "expectRestored"), - [ - { + }, { func: "gpii.test.checkRestoredConfiguration", args: ["{tests}.contexts.gpii-default.settingsHandlers", "{tests}.settingsStore", "{nameResolver}", "{testCaseHolder}.events.onCheckRestoredConfigurationComplete.fire"] }, { @@ -312,7 +303,7 @@ gpii.tests.contextIntegration.fixtures = [ ] }, { name: "Multiple context changes", - expect: 15, + expect: 13, sequenceSegments: [ [ { @@ -340,7 +331,6 @@ gpii.tests.contextIntegration.fixtures = [ args: ["{lifecycleManager}", "context1", "gpii-default"] } ], - gpii.test.createProcessChecks(gpii.tests.contextIntegration.data.processes, "expectConfigured"), gpii.tests.contextIntegration.changeEnvironmentAndCheck("bright"), gpii.tests.contextIntegration.changeEnvironmentAndCheck("gpii-default"), gpii.tests.contextIntegration.changeEnvironmentAndCheck("noise"), @@ -351,11 +341,7 @@ gpii.tests.contextIntegration.fixtures = [ }, { event: "{logoutRequest}.events.onComplete", listener: "gpii.test.logoutRequestListen" - } - ], - gpii.test.createProcessChecks(gpii.tests.contextIntegration.data.processes, "expectRestored"), - [ - { + }, { func: "gpii.test.checkRestoredConfiguration", args: ["{tests}.contexts.gpii-default.settingsHandlers", "{tests}.settingsStore", "{nameResolver}", "{testCaseHolder}.events.onCheckRestoredConfigurationComplete.fire"] }, {