From c200219fa2bd3616bf4f7d6d8be0561797899a96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Velad=20Galv=C3=A1n?= Date: Thu, 5 Feb 2026 07:09:13 +0100 Subject: [PATCH] test: Fix UI tests on SmartTVs (#9660) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tests fixed: ``` UI Customization ✗ big buttons only created when configured [Safari 3.0 (Tizen 3.0)] Error: Expected 1 to be 0. at at Function.confirmElementMissing (test/test/util/ui_utils.js:70:29 <- test/test/util/ui_utils.js:139:31) at _callee6$ (test/ui/ui_customization_unit.js:86:13 <- test/ui/ui_customization_unit.js:152:21) at tryCatch (node_modules/@babel/polyfill/dist/polyfill.js:6473:40) UI controls controls-button-panel ✗ has default elements [Safari 3.0 (Tizen 3.0)] Error: Expected 1 to be 0. at at Function.confirmElementMissing (test/test/util/ui_utils.js:70:29 <- test/test/util/ui_utils.js:139:31) at _callee15$ (test/ui/ui_unit.js:425:19 <- test/ui/ui_unit.js:506:27) at tryCatch (node_modules/@babel/polyfill/dist/polyfill.js:6473:40) ``` --- lib/util/config_utils.js | 8 +------- test/ui/ui_unit.js | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/util/config_utils.js b/lib/util/config_utils.js index bc6120d2e..223d022c2 100644 --- a/lib/util/config_utils.js +++ b/lib/util/config_utils.js @@ -187,10 +187,6 @@ shaka.util.ConfigUtils = class { return obj && typeof obj === 'object' && !Array.isArray(obj); }; - const isArrayEmpty = (array) => { - return Array.isArray(array) && array.length === 0; - }; - const changes = (object, base) => { return Object.keys(object).reduce((acc, key) => { const value = object[key]; @@ -208,7 +204,7 @@ shaka.util.ConfigUtils = class { acc[key] = diff; } } else if (Array.isArray(value) && Array.isArray(base[key])) { - if (!shaka.util.ArrayUtils.hasSameElements(value, base[key])) { + if (!shaka.util.ArrayUtils.equal(value, base[key])) { acc[key] = value; } } else if (Number.isNaN(value) && Number.isNaN(base[key])) { @@ -228,8 +224,6 @@ shaka.util.ConfigUtils = class { // Do nothing if it's a HTMLElement } else if (isObject(obj[key]) && Object.keys(obj[key]).length === 0) { delete obj[key]; - } else if (isArrayEmpty(obj[key])) { - delete obj[key]; } else if (typeof obj[key] == 'function') { delete obj[key]; } else if (isObject(obj[key])) { diff --git a/test/ui/ui_unit.js b/test/ui/ui_unit.js index d7f6663ea..adefa3ff3 100644 --- a/test/ui/ui_unit.js +++ b/test/ui/ui_unit.js @@ -422,7 +422,7 @@ describe('UI', () => { UiUtils.confirmElementFound(videoContainer, 'shaka-big-buttons-container'); // Small play button - UiUtils.confirmElementMissing(videoContainer, + UiUtils.confirmElementFound(videoContainer, 'shaka-play-button'); // Volume bar UiUtils.confirmElementMissing(controlsButtonPanel,