VulpesOS/gaia/apps/homescreen/test/marionette/localization_test.js
OverSu b38dea0597 Publish Vulpes Preview 15 sources for desktop, Android and Tundra
Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
2026-09-30 23:13:03 +02:00

39 lines
1.1 KiB
JavaScript
Executable file

'use strict';
var assert = require('assert');
marionette('Homescreen - Localization', function() {
var client = marionette.client({
profile: require(__dirname + '/client_options.js')
});
var actions, home, system;
setup(function() {
actions = client.loader.getActions();
home = client.loader.getAppClass('homescreen');
system = client.loader.getAppClass('system');
system.waitForFullyLoaded();
home.waitForLaunch();
});
test('Localization updates icon names', function() {
var settingsIcon = home.getIconByName('Settings');
assert.equal(
home.getIconText(settingsIcon),
home.localizedAppName('settings', 'en-US'));
client.switchToFrame();
client.executeScript(function() {
navigator.mozSettings.createLock().set({
'language.current': 'fr-x-psaccent'
});
});
client.switchToFrame(system.getHomescreenIframe());
// Localization can be async, wait for the content to update
var newIconName = home.localizedAppName('settings', 'fr-x-psaccent');
client.waitFor(function() {
return !!home.getIconByName(newIconName);
});
});
});