diff --git a/testData/preferences/brenda.json5 b/testData/preferences/brenda.json5 new file mode 100644 index 000000000..3f31f290d --- /dev/null +++ b/testData/preferences/brenda.json5 @@ -0,0 +1,23 @@ +// # Brenda.json5 +// +// This preference sets changes the desktop wallpaper with another default Windows 10 one. +// +// ## Testing +// +// Windows desktop background should be replaced by with other one. +// +{ + "flat": { + "name": "Brenda", + "contexts": { + "gpii-default": { + "name": "Default preferences", + "preferences": { + "http://registry.gpii.net/applications/com.microsoft.windows.desktopBackground": { + "Image": "C:\\Windows\\Web\\Wallpaper\\Theme1\\img2.jpg" + } + } + } + } + } +} diff --git a/testData/preferences/bryan.json5 b/testData/preferences/bryan.json5 new file mode 100644 index 000000000..f206d410f --- /dev/null +++ b/testData/preferences/bryan.json5 @@ -0,0 +1,25 @@ +// # Bryan.json5 +// +// This preference sets changes the desktop wallpaper with another default Windows 10 one, +// at sets the Scaling to "Fill". +// +// ## Testing +// +// Windows desktop background should be replaced by with other one, and scaling set to "Fit". +// +{ + "flat": { + "name": "Bryan", + "contexts": { + "gpii-default": { + "name": "Default preferences", + "preferences": { + "http://registry.gpii.net/applications/com.microsoft.windows.desktopBackground": { + "Scaling": "Fill", + "Image": "C:\\Windows\\Web\\Wallpaper\\Theme1\\img3.jpg" + } + } + } + } + } +} diff --git a/testData/preferences/daniel-raw.json5 b/testData/preferences/daniel-raw.json5 new file mode 100644 index 000000000..95e0c4eea --- /dev/null +++ b/testData/preferences/daniel-raw.json5 @@ -0,0 +1,30 @@ +// # Daniel-raw.json5 +// +// This preference sets the desktop background to a solid color. This is the same +// preference set as Daniels one, but without using the convenience transforms. +// +// ## Testing +// +// Windows desktop background should be replace by a green image. +// +{ + "flat": { + "name": "Daniel-raw", + "contexts": { + "gpii-default": { + "name": "Default preferences", + "preferences": { + "http://registry.gpii.net/applications/com.microsoft.windows.desktopBackgroundColor": { + "ImageConfig": { + "path": "pvParam", + "value": "" + }, + "SolidColorConfig": { + "value": { "r": 67, "g": 187, "b": 19 } + } + } + } + } + } + } +} diff --git a/testData/preferences/daniel.json5 b/testData/preferences/daniel.json5 index 6f34ec8a0..2b47eb224 100644 --- a/testData/preferences/daniel.json5 +++ b/testData/preferences/daniel.json5 @@ -13,11 +13,8 @@ "gpii-default": { "name": "Default preferences", "preferences": { - "http://registry.gpii.net/applications/com.microsoft.windows.desktopBackground": { - "BackgroundTypeVal": "SolidColor", - "InputVal": { - "Color": {"r": 67, "g": 187, "b": 19} - } + "http://registry.gpii.net/applications/com.microsoft.windows.desktopBackgroundColor": { + "SolidColor": { "r": 67, "g": 187, "b": 19 } } } } diff --git a/testData/solutions/win32.json5 b/testData/solutions/win32.json5 index 85002b310..a7eb2bb0e 100644 --- a/testData/solutions/win32.json5 +++ b/testData/solutions/win32.json5 @@ -4816,7 +4816,8 @@ "path": "Control Panel\\Desktop", "dataTypes": { "TileWallpaper": "REG_SZ", - "WallpaperStyle": "REG_SZ" + "WallpaperStyle": "REG_SZ", + "Scaling": "REG_SZ" } }, "supportedSettings": { @@ -4900,15 +4901,15 @@ "type": "fluid.transforms.valueMapper", "defaultInputPath": "http://registry\\.gpii\\.net/applications/com\\.microsoft\\.windows\\.desktopBackground.Scaling", "match": { - "Fill": "6", - "Fit": "10", + "Fill": "10", + "Fit": "6", "Stretch": "2", "Tile": "0", "Center": "0", "Span": "22" }, "noMatch": { - "outputValue": "6" + "outputValue": "10" } } } @@ -4919,8 +4920,8 @@ "type": "fluid.transforms.valueMapper", "defaultInputPath": "WallpaperStyle", "match": { - "6": "Fill", - "10": "Fit", + "10": "Fill", + "6": "Fit", "2": "Stretch", "0": { "outputValue": { @@ -5042,6 +5043,9 @@ } } }, + "capabilities": [ + "http://registry\\.gpii\\.net/applications/com\\.microsoft\\.windows\\.desktopBackgroundColor.SolidColor" + ], "capabilitiesTransformations": { "ImageConfig": { "transform": { @@ -5056,9 +5060,6 @@ } } } - }, - "inverseCapabilitiesTransformations": { - "http://registry\\.gpii\\.net/applications/com\\.microsoft\\.windows\\.desktopBackgroundColor.Image": "ImageConfig.value" } }, "configureSolidColor": { @@ -5114,6 +5115,14 @@ } } }, + "configure": [ + "settings.configureImage", + "settings.configureSolidColor" + ], + "restore": [ + "settings.configureImage", + "settings.configureSolidColor" + ], "isInstalled": [ { "type": "gpii.deviceReporter.alwaysInstalled" diff --git a/tests/data/preferences/os_win_2.json5 b/tests/data/preferences/os_win_solidColor.json5 similarity index 100% rename from tests/data/preferences/os_win_2.json5 rename to tests/data/preferences/os_win_solidColor.json5 diff --git a/tests/data/preferences/os_win_solidColor_tf.json5 b/tests/data/preferences/os_win_solidColor_tf.json5 new file mode 100644 index 000000000..d9d572c71 --- /dev/null +++ b/tests/data/preferences/os_win_solidColor_tf.json5 @@ -0,0 +1,14 @@ +{ + "flat": { + "contexts": { + "gpii-default": { + "name": "Default preferences", + "preferences": { + "http://registry.gpii.net/applications/com.microsoft.windows.desktopBackgroundColor": { + "SolidColor": { "r": 67, "g": 187, "b": 19 } + } + } + } + } + } +} diff --git a/tests/data/preferences/os_win_wallpaper_fill.json5 b/tests/data/preferences/os_win_wallpaper_fill.json5 new file mode 100644 index 000000000..c1017bf77 --- /dev/null +++ b/tests/data/preferences/os_win_wallpaper_fill.json5 @@ -0,0 +1,15 @@ +{ + "flat": { + "contexts": { + "gpii-default": { + "name": "Default preferences", + "preferences": { + "http://registry.gpii.net/applications/com.microsoft.windows.desktopBackground": { + "Scaling": "Fill", + "Image": "C:\\Windows\\Web\\Wallpaper\\Theme1\\img3.jpg" + } + } + } + } + } +} diff --git a/tests/data/preferences/os_win_wallpaper_fit.json5 b/tests/data/preferences/os_win_wallpaper_fit.json5 new file mode 100644 index 000000000..0fe76f136 --- /dev/null +++ b/tests/data/preferences/os_win_wallpaper_fit.json5 @@ -0,0 +1,15 @@ +{ + "flat": { + "contexts": { + "gpii-default": { + "name": "Default preferences", + "preferences": { + "http://registry.gpii.net/applications/com.microsoft.windows.desktopBackground": { + "Scaling": "Fit", + "Image": "C:\\Windows\\Web\\Wallpaper\\Theme1\\img2.jpg" + } + } + } + } + } +} diff --git a/tests/data/preferences/os_win_wallpaper_tile.json5 b/tests/data/preferences/os_win_wallpaper_tile.json5 new file mode 100644 index 000000000..38cf5cfad --- /dev/null +++ b/tests/data/preferences/os_win_wallpaper_tile.json5 @@ -0,0 +1,15 @@ +{ + "flat": { + "contexts": { + "gpii-default": { + "name": "Default preferences", + "preferences": { + "http://registry.gpii.net/applications/com.microsoft.windows.desktopBackground": { + "Scaling": "Tile", + "Image": "C:\\Windows\\Web\\Wallpaper\\Theme1\\img4.jpg" + } + } + } + } + } +} diff --git a/tests/platform/windows/windows-builtIn-testSpec.js b/tests/platform/windows/windows-builtIn-testSpec.js index 384ded868..28dd256ce 100644 --- a/tests/platform/windows/windows-builtIn-testSpec.js +++ b/tests/platform/windows/windows-builtIn-testSpec.js @@ -720,8 +720,8 @@ gpii.tests.windows.builtIn = [ }, gradeNames: "gpii.test.integration.actionHandlersAware.windows" }, { - name: "Testing os_win_2 using default matchmaker", - gpiiKey: "os_win_2", + name: "Testing os_win_solidColor using default matchmaker", + gpiiKey: "os_win_solidColor", initialState: {}, settingsHandlers: { "gpii.windows.spiSettingsHandler": { @@ -759,7 +759,178 @@ gpii.tests.windows.builtIn = [ }] } } - }, { + }, + { + name: "Testing os_win_solidColor_tf using default matchmaker", + gpiiKey: "os_win_solidColor_tf", + initialState: {}, + settingsHandlers: { + "gpii.windows.spiSettingsHandler": { + "com.microsoft.windows.desktopBackgroundColor": [{ + "settings": { + "ImageConfig": { + "path": "pvParam", + "value": "" + } + }, + "options": { + "getAction": "SPI_GETDESKWALLPAPER", + "setAction": "SPI_SETDESKWALLPAPER", + "uiParam": 260, + "pvParam": { + "type": "array", + "valueType": "TCHAR", + "length": 260 + } + } + }] + }, + "gpii.windows.nativeSettingsHandler": { + "com.microsoft.windows.desktopBackgroundColor": [{ + "settings": { + "SolidColorConfig": { + "value": { + "r": 67, "g": 187, "b": 19 + } + } + }, + "options": { + "functionName": "SolidColor" + } + }] + } + } + }, + { + name: "Testing os_win_wallpaper_fill using default matchmaker", + gpiiKey: "os_win_wallpaper_fill", + initialState: {}, + settingsHandlers: { + "gpii.windows.registrySettingsHandler": { + "com.microsoft.windows.desktopBackground": [{ + "settings": { + "TileWallpaper": "0", + "WallpaperStyle": "10" + }, + "options": { + "hKey": "HKEY_CURRENT_USER", + "path": "Control Panel\\Desktop", + "dataTypes": { + "TileWallpaper": "REG_SZ", + "WallpaperStyle": "REG_SZ" + } + } + }] + }, + "gpii.windows.spiSettingsHandler": { + "com.microsoft.windows.desktopBackground": [{ + "settings": { + "ImageConfig": { + "path": "pvParam", + "value": "C:\\Windows\\Web\\Wallpaper\\Theme1\\img3.jpg" + } + }, + "options": { + "getAction": "SPI_GETDESKWALLPAPER", + "setAction": "SPI_SETDESKWALLPAPER", + "uiParam": 260, + "pvParam": { + "type": "array", + "valueType": "TCHAR", + "length": 260 + } + } + }] + } + } + }, + { + name: "Testing os_win_wallpaper_fit using default matchmaker", + gpiiKey: "os_win_wallpaper_fit", + initialState: {}, + settingsHandlers: { + "gpii.windows.registrySettingsHandler": { + "com.microsoft.windows.desktopBackground": [{ + "settings": { + "TileWallpaper": "0", + "WallpaperStyle": "6" + }, + "options": { + "hKey": "HKEY_CURRENT_USER", + "path": "Control Panel\\Desktop", + "dataTypes": { + "TileWallpaper": "REG_SZ", + "WallpaperStyle": "REG_SZ" + } + } + }] + }, + "gpii.windows.spiSettingsHandler": { + "com.microsoft.windows.desktopBackground": [{ + "settings": { + "ImageConfig": { + "path": "pvParam", + "value": "C:\\Windows\\Web\\Wallpaper\\Theme1\\img2.jpg" + } + }, + "options": { + "getAction": "SPI_GETDESKWALLPAPER", + "setAction": "SPI_SETDESKWALLPAPER", + "uiParam": 260, + "pvParam": { + "type": "array", + "valueType": "TCHAR", + "length": 260 + } + } + }] + } + } + }, + { + name: "Testing os_win_wallpaper_tile using default matchmaker", + gpiiKey: "os_win_wallpaper_tile", + initialState: {}, + settingsHandlers: { + "gpii.windows.registrySettingsHandler": { + "com.microsoft.windows.desktopBackground": [{ + "settings": { + "TileWallpaper": "1", + "WallpaperStyle": "0" + }, + "options": { + "hKey": "HKEY_CURRENT_USER", + "path": "Control Panel\\Desktop", + "dataTypes": { + "TileWallpaper": "REG_SZ", + "WallpaperStyle": "REG_SZ" + } + } + }] + }, + "gpii.windows.spiSettingsHandler": { + "com.microsoft.windows.desktopBackground": [{ + "settings": { + "ImageConfig": { + "path": "pvParam", + "value": "C:\\Windows\\Web\\Wallpaper\\Theme1\\img4.jpg" + } + }, + "options": { + "getAction": "SPI_GETDESKWALLPAPER", + "setAction": "SPI_SETDESKWALLPAPER", + "uiParam": 260, + "pvParam": { + "type": "array", + "valueType": "TCHAR", + "length": 260 + } + } + }] + } + } + }, + { name: "Testing os_common using default matchmaker", gpiiKey: "os_common", initialState: {