diff options
Diffstat (limited to 'toolkit/modules/tests/xpcshell/RegionTestUtils.jsm')
-rw-r--r-- | toolkit/modules/tests/xpcshell/RegionTestUtils.jsm | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/toolkit/modules/tests/xpcshell/RegionTestUtils.jsm b/toolkit/modules/tests/xpcshell/RegionTestUtils.jsm new file mode 100644 index 0000000000..6f3811fe45 --- /dev/null +++ b/toolkit/modules/tests/xpcshell/RegionTestUtils.jsm @@ -0,0 +1,16 @@ +"use strict"; + +const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); + +const EXPORTED_SYMBOLS = ["RegionTestUtils"]; + +const RegionTestUtils = Object.freeze({ + REGION_URL_PREF: "browser.region.network.url", + + setNetworkRegion(region) { + Services.prefs.setCharPref( + this.REGION_URL_PREF, + `data:application/json,{"country_code": "${region}"}` + ); + }, +}); |