test_default-browsers.js (793B)
1 /* Any copyright is dedicated to the Public Domain. 2 http://creativecommons.org/publicdomain/zero/1.0/ */ 3 "use strict"; 4 5 // Test for the default browsers of user settings. 6 7 const { 8 getBrowsersList, 9 } = require("resource://devtools/shared/compatibility/compatibility-user-settings.js"); 10 11 add_task(async () => { 12 info("Check whether each default browsers data are unique by id and status"); 13 14 const defaultBrowsers = await getBrowsersList(); 15 16 for (const target of defaultBrowsers) { 17 const count = defaultBrowsers.reduce( 18 (currentCount, browser) => 19 target.id === browser.id && target.status === browser.status 20 ? currentCount + 1 21 : currentCount, 22 0 23 ); 24 25 equal(count, 1, `This browser (${target.id} - ${target.status}) is unique`); 26 } 27 });