From 4888c7b463ab816a67cf284238339972ad44f220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jaramago=20Fern=C3=A1ndez?= Date: Fri, 8 Mar 2019 22:21:03 +0100 Subject: [PATCH 1/8] GPII-3780: Fixed 'com.microsoft.windows.desktopBackgroundColor' and 'com.microsoft.windows.desktopBackground' transformations --- testData/solutions/win32.json5 | 45 ++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/testData/solutions/win32.json5 b/testData/solutions/win32.json5 index 2ceae7690..24740907f 100644 --- a/testData/solutions/win32.json5 +++ b/testData/solutions/win32.json5 @@ -4811,7 +4811,8 @@ "path": "Control Panel\\Desktop", "dataTypes": { "TileWallpaper": "REG_SZ", - "WallpaperStyle": "REG_SZ" + "WallpaperStyle": "REG_SZ", + "Scaling": "REG_SZ" } }, "supportedSettings": { @@ -4897,15 +4898,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" } } } @@ -4916,8 +4917,8 @@ "type": "fluid.transforms.valueMapper", "defaultInputPath": "WallpaperStyle", "match": { - "6": "Fill", - "10": "Fit", + "10": "Fill", + "6": "Fit", "2": "Stretch", "0": { "outputValue": { @@ -5028,9 +5029,12 @@ }, "capabilitiesTransformations": { "ImageConfig": { + // This transform is necessary due to issue GPII-3784. "transform": { - "type": "fluid.transforms.literalValue", - "input": "", + "type": "fluid.transforms.condition", + "conditionPath": "http://registry\\.gpii\\.net/applications/com\\.microsoft\\.windows\\.desktopBackgroundColor.SolidColor.r", + "true": "", + "false": "", "outputPath": "value" }, "path": { @@ -5040,9 +5044,6 @@ } } } - }, - "inverseCapabilitiesTransformations": { - "http://registry\\.gpii\\.net/applications/com\\.microsoft\\.windows\\.desktopBackgroundColor.Image": "ImageConfig.value" } }, "configureSolidColor": { @@ -5086,9 +5087,23 @@ }, "capabilitiesTransformations": { "SolidColorConfig": { + // This transform is necessary due to issue GPII-3784. "transform": { - "type": "fluid.transforms.value", - "inputPath": "http://registry\\.gpii\\.net/applications/com\\.microsoft\\.windows\\.desktopBackgroundColor.SolidColor", + "type": "fluid.transforms.condition", + "conditionPath": "SolidColor", + "condition": true, + "true": { + "transform": { + "type": "fluid.transforms.value", + "inputPath": "http://registry\\.gpii\\.net/applications/com\\.microsoft\\.windows\\.desktopBackgroundColor.SolidColor" + } + }, + "false": { + "transform": { + "type": "fluid.transforms.value", + "inputPath": "http://registry\\.gpii\\.net/applications/com\\.microsoft\\.windows\\.desktopBackgroundColor.SolidColor" + } + }, "outputPath": "value" } } @@ -5102,6 +5117,10 @@ "settings.configureImage", "settings.configureSolidColor" ], + "restore": [ + "settings.configureImage", + "settings.configureSolidColor" + ], "isInstalled": [ { "type": "gpii.deviceReporter.alwaysInstalled" From e008b49fe40fe74214c88722887b93cae53d33b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jaramago=20Fern=C3=A1ndez?= Date: Fri, 8 Mar 2019 22:22:33 +0100 Subject: [PATCH 2/8] GPII-3780: Improved tests for 'windows.desktopBackground' and 'windows.desktopBackgroundColor' solutions --- ...os_win_2.json5 => os_win_solidColor.json5} | 0 .../preferences/os_win_solidColor_tf.json5 | 14 ++ .../preferences/os_win_wallpaper_fill.json5 | 15 ++ .../preferences/os_win_wallpaper_fit.json5 | 15 ++ .../preferences/os_win_wallpaper_tile.json5 | 15 ++ .../windows/windows-builtIn-testSpec.js | 177 +++++++++++++++++- 6 files changed, 233 insertions(+), 3 deletions(-) rename tests/data/preferences/{os_win_2.json5 => os_win_solidColor.json5} (100%) create mode 100644 tests/data/preferences/os_win_solidColor_tf.json5 create mode 100644 tests/data/preferences/os_win_wallpaper_fill.json5 create mode 100644 tests/data/preferences/os_win_wallpaper_fit.json5 create mode 100644 tests/data/preferences/os_win_wallpaper_tile.json5 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..3a4d1548c --- /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" + } + } + } + } + } +} \ No newline at end of file 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..6cbaf934a --- /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" + } + } + } + } + } +} \ No newline at end of file diff --git a/tests/platform/windows/windows-builtIn-testSpec.js b/tests/platform/windows/windows-builtIn-testSpec.js index eefdb633c..d68db0bcc 100644 --- a/tests/platform/windows/windows-builtIn-testSpec.js +++ b/tests/platform/windows/windows-builtIn-testSpec.js @@ -730,8 +730,8 @@ gpii.tests.windows.builtIn = [ } } }, { - 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": { @@ -769,7 +769,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: { From 20306069d84a4ab08e4b78821bbfbd9acef32132 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jaramago=20Fern=C3=A1ndez?= Date: Fri, 8 Mar 2019 22:26:05 +0100 Subject: [PATCH 3/8] GPII-3780: Added new preference sets for 'windows.desktopBackgroundColor' and 'windows.desktopBackground' --- testData/preferences/brenda.json5 | 23 ++++++++++++++++++++ testData/preferences/bryan.json5 | 25 ++++++++++++++++++++++ testData/preferences/daniel-raw.json5 | 30 +++++++++++++++++++++++++++ testData/preferences/daniel.json5 | 7 ++----- 4 files changed, 80 insertions(+), 5 deletions(-) create mode 100644 testData/preferences/brenda.json5 create mode 100644 testData/preferences/bryan.json5 create mode 100644 testData/preferences/daniel-raw.json5 diff --git a/testData/preferences/brenda.json5 b/testData/preferences/brenda.json5 new file mode 100644 index 000000000..f19cfbc6a --- /dev/null +++ b/testData/preferences/brenda.json5 @@ -0,0 +1,23 @@ +// # Bryan.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": "Bryan", + "contexts": { + "gpii-default": { + "name": "Default preferences", + "preferences": { + "http://registry.gpii.net/applications/com.microsoft.windows.desktopBackground": { + "Image": "C:\\Windows\\Web\\Wallpaper\\Theme1\\img3.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..8f9df37e7 --- /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 } + } + } + } + } + } + } +} \ No newline at end of file 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 } } } } From 4f910c6c4fa11f70b4119e911e218215f0263f7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jaramago=20Fern=C3=A1ndez?= Date: Fri, 8 Mar 2019 22:28:26 +0100 Subject: [PATCH 4/8] GPII-3780: Solved linter issues --- testData/preferences/daniel-raw.json5 | 2 +- tests/data/preferences/os_win_wallpaper_fit.json5 | 2 +- tests/data/preferences/os_win_wallpaper_tile.json5 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/testData/preferences/daniel-raw.json5 b/testData/preferences/daniel-raw.json5 index 8f9df37e7..95e0c4eea 100644 --- a/testData/preferences/daniel-raw.json5 +++ b/testData/preferences/daniel-raw.json5 @@ -27,4 +27,4 @@ } } } -} \ No newline at end of file +} diff --git a/tests/data/preferences/os_win_wallpaper_fit.json5 b/tests/data/preferences/os_win_wallpaper_fit.json5 index 3a4d1548c..0fe76f136 100644 --- a/tests/data/preferences/os_win_wallpaper_fit.json5 +++ b/tests/data/preferences/os_win_wallpaper_fit.json5 @@ -12,4 +12,4 @@ } } } -} \ No newline at end of file +} diff --git a/tests/data/preferences/os_win_wallpaper_tile.json5 b/tests/data/preferences/os_win_wallpaper_tile.json5 index 6cbaf934a..38cf5cfad 100644 --- a/tests/data/preferences/os_win_wallpaper_tile.json5 +++ b/tests/data/preferences/os_win_wallpaper_tile.json5 @@ -12,4 +12,4 @@ } } } -} \ No newline at end of file +} From 13d4b5a324b7d09dea1769c2418b9088ac365330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jaramago=20Fern=C3=A1ndez?= Date: Fri, 26 Jul 2019 18:29:01 +0200 Subject: [PATCH 5/8] GPII-3780: Simplified transformation due to GPII-3784 being solve --- testData/solutions/win32.json5 | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/testData/solutions/win32.json5 b/testData/solutions/win32.json5 index 3b722b263..508fc09d1 100644 --- a/testData/solutions/win32.json5 +++ b/testData/solutions/win32.json5 @@ -5045,13 +5045,9 @@ }, "capabilitiesTransformations": { "ImageConfig": { - // This transform is necessary due to issue GPII-3784. "transform": { - "type": "fluid.transforms.condition", - "conditionPath": "http://registry\\.gpii\\.net/applications/com\\.microsoft\\.windows\\.desktopBackgroundColor.SolidColor.r", - "true": "", - "false": "", - "outputPath": "value" + "type": "fluid.transforms.literalValue", + "input": "" }, "path": { "transform": { From a9d702e637edcb7e1fa0265a4a710e95cbe8533d Mon Sep 17 00:00:00 2001 From: Cindy Qi Li Date: Fri, 26 Jul 2019 14:23:05 -0400 Subject: [PATCH 6/8] GPII-3780: Improve the tranformation for "ImageConfig" in win32.json5. --- testData/solutions/win32.json5 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/testData/solutions/win32.json5 b/testData/solutions/win32.json5 index 508fc09d1..84edb3306 100644 --- a/testData/solutions/win32.json5 +++ b/testData/solutions/win32.json5 @@ -5043,11 +5043,15 @@ } } }, + "capabilities": [ + "http://registry\\.gpii\\.net/applications/com\\.microsoft\\.windows\\.desktopBackgroundColor.SolidColor" + ], "capabilitiesTransformations": { "ImageConfig": { "transform": { "type": "fluid.transforms.literalValue", - "input": "" + "input": "", + "outputPath": "value" }, "path": { "transform": { From 0b705aad2454a4e37f36e086ab1e9e4d1fa89efe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jaramago=20Fern=C3=A1ndez?= Date: Tue, 6 Aug 2019 11:15:50 +0100 Subject: [PATCH 7/8] GPII-3780: Removed unnecessary transform due to GPII-3784 being already solved --- testData/solutions/win32.json5 | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/testData/solutions/win32.json5 b/testData/solutions/win32.json5 index 84edb3306..a7eb2bb0e 100644 --- a/testData/solutions/win32.json5 +++ b/testData/solutions/win32.json5 @@ -5103,23 +5103,9 @@ }, "capabilitiesTransformations": { "SolidColorConfig": { - // This transform is necessary due to issue GPII-3784. "transform": { - "type": "fluid.transforms.condition", - "conditionPath": "SolidColor", - "condition": true, - "true": { - "transform": { - "type": "fluid.transforms.value", - "inputPath": "http://registry\\.gpii\\.net/applications/com\\.microsoft\\.windows\\.desktopBackgroundColor.SolidColor" - } - }, - "false": { - "transform": { - "type": "fluid.transforms.value", - "inputPath": "http://registry\\.gpii\\.net/applications/com\\.microsoft\\.windows\\.desktopBackgroundColor.SolidColor" - } - }, + "type": "fluid.transforms.value", + "inputPath": "http://registry\\.gpii\\.net/applications/com\\.microsoft\\.windows\\.desktopBackgroundColor.SolidColor", "outputPath": "value" } } From 664fce8a64500a0d0c23ce7248f0685365e023b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jaramago=20Fern=C3=A1ndez?= Date: Wed, 14 Aug 2019 19:52:17 +0200 Subject: [PATCH 8/8] GPII-3780: Changed preferences for 'test-user' to change to different wallpaper --- testData/preferences/brenda.json5 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testData/preferences/brenda.json5 b/testData/preferences/brenda.json5 index f19cfbc6a..3f31f290d 100644 --- a/testData/preferences/brenda.json5 +++ b/testData/preferences/brenda.json5 @@ -1,4 +1,4 @@ -// # Bryan.json5 +// # Brenda.json5 // // This preference sets changes the desktop wallpaper with another default Windows 10 one. // @@ -8,13 +8,13 @@ // { "flat": { - "name": "Bryan", + "name": "Brenda", "contexts": { "gpii-default": { "name": "Default preferences", "preferences": { "http://registry.gpii.net/applications/com.microsoft.windows.desktopBackground": { - "Image": "C:\\Windows\\Web\\Wallpaper\\Theme1\\img3.jpg" + "Image": "C:\\Windows\\Web\\Wallpaper\\Theme1\\img2.jpg" } } }