Permalink
Browse files

GPII-177: Updated tracking entries in tests and examples to be in the…

… proper array'ed format.
  • Loading branch information...
1 parent 3881b58 commit cda14c41f54684b9123bab8d8efbcc00e91abba8 @kaspermarkus kaspermarkus committed Sep 17, 2013
View
14 examples/preferences/accessforall-with-application-specific.json
@@ -4,37 +4,37 @@
"value": 24
}
],
-
+
"http://registry.gpii.net/common/magnification": [
{
"value": 2.0
}
],
-
+
"http://registry.gpii.net/common/tracking": [
{
- "value": "mouse"
+ "value": ["mouse"]
}
],
-
+
"http://registry.gpii.net/common/invertImages": [
{
"value": true
}
],
-
+
"http://registry.gpii.net/common/showCrosshairs": [
{
"value": true
}
],
-
+
"http://registry.gpii.net/common/stickyKeys": [
{
"value": true
}
],
-
+
"http://registry.gpii.net/applications/com.texthelp.readWriteGold": [
{
"value": {
View
2 gpii/node_modules/matchMaker/src/CanopyMatchMaker.js
@@ -12,7 +12,7 @@ https://github.com/gpii/universal/LICENSE.txt
*/
var fluid = fluid || require("infusion");
-
+
var matchMaker = fluid.registerNamespace("gpii.matchMaker");
var canopy = fluid.registerNamespace("gpii.matchMaker.canopy");
View
10 gpii/node_modules/matchMaker/test/js/AsynchronousMatchMakerTest.js
@@ -23,14 +23,14 @@ var gpii = fluid.registerNamespace("gpii");
fluid.registerNamespace("gpii.tests.asyncMatchMaker");
var solutions = [{
"settingsHandlers": [{
- "type": "gpii.integrationTesting.mockSettingsHandler",
+ "type": "gpii.integrationTesting.mockSettingsHandler",
"capabilities": ["display.screenEnhancement"],
"capabilitiesTransformations": {
"mag-factor": "display.screenEnhancement.magnification",
"show-cross-hairs": "display.screenEnhancement.-provisional-showCrosshairs",
"mouse-tracking": {
- "expander": {
- "type": "fluid.model.transform.valueMapper",
+ "transform": {
+ "type": "fluid.transforms.valueMapper",
"inputPath": "display.screenEnhancement.tracking",
"options": {
"mouse": {
@@ -53,15 +53,15 @@ var gpii = fluid.registerNamespace("gpii");
"genericFontFace": "sans serif"
},
"magnification": 2.0,
- "tracking": "mouse",
+ "tracking": ["mouse"],
"invertImages": true,
"-provisional-showCrosshairs": true
}
}
};
var matchMaker = gpii.matchMaker;
var async = fluid.registerNamespace("gpii.matchMaker.async");
-
+
// This is a sample strategy that runs asynchronously.
// It does nothing but tries to load a non-existent file
// asynchronously and regardless of outcome, returns an
View
60 gpii/node_modules/matchMaker/test/js/CanopyMatchMakerTests.js
@@ -23,14 +23,14 @@ var gpii = fluid.registerNamespace("gpii");
fluid.registerNamespace("gpii.tests.canopyMatchMaker");
var magnifier = {"settingsHandlers": [{
- "type": "gpii.integrationTesting.mockSettingsHandler",
+ "type": "gpii.integrationTesting.mockSettingsHandler",
"capabilities": ["display.screenEnhancement"],
"capabilitiesTransformations": {
"mag-factor": "display.screenEnhancement.magnification",
"show-cross-hairs": "display.screenEnhancement.-provisional-showCrosshairs",
"mouse-tracking": {
- "expander": {
- "type": "fluid.model.transform.valueMapper",
+ "transform": {
+ "type": "fluid.transforms.valueMapper",
"inputPath": "display.screenEnhancement.tracking",
"options": {
"mouse": {
@@ -42,25 +42,25 @@ var gpii = fluid.registerNamespace("gpii");
}
}]
};
-
+
var lesserMagnifier = {"settingsHandlers": [{
- "type": "gpii.integrationTesting.mockSettingsHandler",
+ "type": "gpii.integrationTesting.mockSettingsHandler",
"capabilitiesTransformations": {
"mag-factor": "display.screenEnhancement.magnification"
}
}, {
- "type": "gpii.integrationTesting.mockSettingsHandler",
+ "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: {
@@ -70,11 +70,11 @@ var gpii = fluid.registerNamespace("gpii");
}
}
};
-
+
var escapedLeaves = [
"display.screenReader.applications.nvda\\.screenReader"
];
-
+
var escapedSkeleton = {
display: {
screenReader: {
@@ -84,7 +84,7 @@ var gpii = fluid.registerNamespace("gpii");
}
}
};
-
+
var sammyProfile = {
"display": {
"screenEnhancement": {
@@ -96,25 +96,25 @@ var gpii = fluid.registerNamespace("gpii");
"genericFontFace": "sans serif"
},
"magnification": 2.0,
- "tracking": "mouse",
+ "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.invertImages",
"display.screenEnhancement.magnification",
- "display.screenEnhancement.tracking"
+ "display.screenEnhancement.tracking.0"
];
-
+
var expandFitness = function (fitnesses) {
return fluid.transform(fitnesses, function(fit, index) {
return {
@@ -123,50 +123,50 @@ var gpii = fluid.registerNamespace("gpii");
};
})
};
-
+
var extractIndices = function (solns) {
return fluid.transform(solns, function (soln) {
return soln.index;
});
};
-
+
var extractDispositions = function (solns) {
var togo = [];
fluid.each(solns, function(soln) {
togo[soln.index] = soln.disposition;
});
return togo;
};
-
+
var canopy = gpii.matchMaker.canopy;
-
+
gpii.tests.canopyMatchMaker.runTests = function () {
jqUnit.module("Utilities");
-
+
jqUnit.test("Compute Leaves", function () {
var leaves = gpii.matchMaker.computeLeaves(sammyProfile);
jqUnit.assertDeepEq("Computed Leaves", sammyLeaves, leaves.sort());
});
-
+
jqUnit.test("Path Utilities", function() {
jqUnit.assertEquals("Exact depth", 0, gpii.matchMaker.prefixLength("display.screenEnhancement.fontSize", sammyProfile));
jqUnit.assertEquals("Near depth", 0, gpii.matchMaker.prefixLength("display.screenEnhancement.fontSize", sammyProfile));
jqUnit.assertEquals("Mid depth", -1, gpii.matchMaker.prefixLength("display.unrecognizable", sammyProfile));
jqUnit.assertEquals("Far depth", -2, gpii.matchMaker.prefixLength("display.unrecognizable.thing", sammyProfile));
var skeleton = gpii.matchMaker.pathsToSkeleton(magnifierLeaves);
jqUnit.assertDeepEq("Computed model skeleton", magnifierSkeleton, skeleton);
-
+
var skeleton2 = gpii.matchMaker.pathsToSkeleton(escapedLeaves);
jqUnit.assertDeepEq("Computed model escaped skeleton", escapedSkeleton, skeleton2);
-
+
});
-
-
+
+
jqUnit.test("Fitness computation", function() {
var fitness = canopy.computeFitness(sammyLeaves, magnifierSkeleton);
- var expected = [0, 0, 0, -1, -1, -1, -1, -2, -3];
+ 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],
@@ -179,7 +179,7 @@ var gpii = fluid.registerNamespace("gpii");
var expected = [3, 1, 2, 0, 4];
jqUnit.assertDeepEq("Ranked fitnesses", expected, indices);
});
-
+
jqUnit.module("MatchMaker");
jqUnit.test("Rank and dispose solutions", function() {
var solutions = [lesserMagnifier, magnifier];
@@ -188,7 +188,7 @@ var gpii = fluid.registerNamespace("gpii");
var indices = extractIndices(ranked);
var expected = [1, 0];
jqUnit.assertDeepEq("Ranked solutions", expected, indices);
-
+
matchMaker.disposeSolutions(sammyProfile, solutions, canopy.disposeStrategy).then(function (disposed) {
var itions = matchMaker.extractDispositions(disposed);
var expected = ["reject", "accept"];
View
28 gpii/node_modules/matchMaker/test/js/FlatMatchMakerTests.js
@@ -23,14 +23,14 @@ var gpii = fluid.registerNamespace("gpii");
fluid.registerNamespace("gpii.tests.flatMatchMaker");
var magnifier = {"settingsHandlers": [{
- "type": "gpii.integrationTesting.mockSettingsHandler",
+ "type": "gpii.integrationTesting.mockSettingsHandler",
"capabilities": ["display.screenEnhancement"],
"capabilitiesTransformations": {
"mag-factor": "display.screenEnhancement.magnification",
"show-cross-hairs": "display.screenEnhancement.-provisional-showCrosshairs",
"mouse-tracking": {
- "expander": {
- "type": "fluid.model.transform.valueMapper",
+ "transform": {
+ "type": "fluid.transforms.valueMapper",
"inputPath": "display.screenEnhancement.tracking",
"options": {
"mouse": {
@@ -42,15 +42,15 @@ var gpii = fluid.registerNamespace("gpii");
}
}]
};
-
+
var lesserMagnifier = {"settingsHandlers": [{
- "type": "gpii.integrationTesting.mockSettingsHandler",
+ "type": "gpii.integrationTesting.mockSettingsHandler",
"capabilitiesTransformations": {
"mag-factor": "display.screenEnhancement.magnification"
}
}]
};
-
+
var sammyProfile = {
"display": {
"screenEnhancement": {
@@ -62,13 +62,13 @@ var gpii = fluid.registerNamespace("gpii");
"genericFontFace": "sans serif"
},
"magnification": 2.0,
- "tracking": "mouse",
+ "tracking": ["mouse"],
"invertImages": true,
"-provisional-showCrosshairs": true
}
}
};
-
+
var carlaBit = {
"content": {
"adaptationPreference": [
@@ -80,7 +80,7 @@ var gpii = fluid.registerNamespace("gpii");
]
}
};
-
+
var carlaBit2 = {
"display": {
"applications": [{
@@ -89,15 +89,15 @@ var gpii = fluid.registerNamespace("gpii");
}]
}
};
-
+
var matchMaker = gpii.matchMaker;
-
+
var runFlat = function(profile, solutions) {
- return matchMaker.disposeSolutions(profile, solutions, matchMaker.flat.disposeStrategy);
+ return matchMaker.disposeSolutions(profile, solutions, matchMaker.flat.disposeStrategy);
};
-
+
gpii.tests.flatMatchMaker.runTests = function() {
-
+
jqUnit.module("MatchMaker");
jqUnit.test("Rank and dispose solutions", function() {
runFlat(sammyProfile, [magnifier]).then(function (disposed) {
View
6 gpii/node_modules/ontologyServer/test/js/OntologyServerTests.js
@@ -24,7 +24,7 @@ var gpii = fluid.registerNamespace("gpii");
var preferences = {
"flat": {
"http://registry.gpii.org/common/magnification": [{value: 2.0}],
- "http://registry.gpii.org/common/tracking": [{value: "mouse"}],
+ "http://registry.gpii.org/common/tracking": [{value: ["mouse"]}],
"http://registry.gpii.org/common/invertImages": [{value: true}],
"http://registry.gpii.org/applications/some.application.id": [{
"value": {
@@ -56,7 +56,7 @@ var gpii = fluid.registerNamespace("gpii");
gpii.tests.ontologyServer.runTests = function () {
jqUnit.module("Utilities");
-
+
jqUnit.test("ontologyServer.parsePreferences", function () {
var expected = {
"flat": {
@@ -123,7 +123,7 @@ var gpii = fluid.registerNamespace("gpii");
display: {
screenEnhancement: {
magnification: 2.0,
- tracking: "mouse",
+ tracking: ["mouse"],
invertImages: true
}
}
View
10 gpii/node_modules/transformer/test/js/TransformerTests.js
@@ -115,7 +115,7 @@ var fluid = fluid || require("infusion");
"display": {
"screenEnhancement": {
"magnification": 2.0,
- "tracking": "mouse"
+ "tracking": ["mouse"]
}
}
};
@@ -130,7 +130,7 @@ var fluid = fluid || require("infusion");
"display": {
"screenEnhancement": {
"magnification": 2.0,
- "tracking": "mouse",
+ "tracking": ["mouse"],
"applications": {
"org.gnome.desktop.a11y.magnifier": {
"name": "GNOME Shell Magnifier",
@@ -156,7 +156,7 @@ var fluid = fluid || require("infusion");
var noMagnificationPreferences = {
"display": {
"screenEnhancement": {
- "tracking": "mouse"
+ "tracking": ["mouse"]
}
}
};
@@ -178,7 +178,7 @@ var fluid = fluid || require("infusion");
"display": {
"screenEnhancement": {
- "tracking": "mouse",
+ "tracking": ["mouse"],
"applications": {
"org.gnome.desktop.a11y.magnifier": {
"name": "GNOME Shell Magnifier",
@@ -204,7 +204,7 @@ var fluid = fluid || require("infusion");
}
},
"screenEnhancement": {
- "tracking": "mouse",
+ "tracking": ["mouse"],
"applications": {
"org.gnome.desktop.a11y.magnifier": {
"name": "GNOME Shell Magnifier",

0 comments on commit cda14c4

Please sign in to comment.