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.
This commit is contained in:
parent
93e3a48004
commit
b38dea0597
25901 changed files with 9982925 additions and 369 deletions
67
gaia/apps/verticalhome/test/marionette/localization_test.js
Executable file
67
gaia/apps/verticalhome/test/marionette/localization_test.js
Executable file
|
|
@ -0,0 +1,67 @@
|
|||
'use strict';
|
||||
var assert = require('assert');
|
||||
|
||||
marionette('Vertical - 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('verticalhome');
|
||||
system = client.loader.getAppClass('system');
|
||||
system.waitForFullyLoaded();
|
||||
home.waitForLaunch();
|
||||
});
|
||||
|
||||
test('Localization updates icon names', function() {
|
||||
var settingsManifestUrl = 'app://settings.gaiamobile.org/manifest.webapp';
|
||||
var settingsIcon = home.getIcon(settingsManifestUrl);
|
||||
assert.equal(
|
||||
settingsIcon.text(),
|
||||
home.localizedAppName('settings', 'en-US'));
|
||||
|
||||
client.executeScript(function() {
|
||||
navigator.mozSettings.createLock().set({
|
||||
'language.current': 'fr-x-psaccent'
|
||||
});
|
||||
});
|
||||
|
||||
// Localization can be async, wait for the content to update
|
||||
client.waitFor(function() {
|
||||
settingsIcon = home.getIcon(settingsManifestUrl);
|
||||
return settingsIcon.text() ===
|
||||
home.localizedAppName('settings', 'fr-x-psaccent');
|
||||
});
|
||||
});
|
||||
|
||||
test('Menu option localization', function() {
|
||||
var selectors = home.Selectors;
|
||||
|
||||
// Change the language to french
|
||||
client.executeAsyncScript(function() {
|
||||
var req = navigator.mozSettings.createLock().set({
|
||||
'language.current': 'fr-x-psaccent'
|
||||
});
|
||||
|
||||
req.onsuccess = function() {
|
||||
marionetteScriptFinished();
|
||||
};
|
||||
});
|
||||
|
||||
home.openContextMenu();
|
||||
|
||||
// Element.text() does not return the content of the shadow dom,
|
||||
// so enter the shadow dom manually for now to get the text.
|
||||
var expected = home.l10n('cancel');
|
||||
client.waitFor(function(){
|
||||
var menu = client.helper.waitForElement(selectors.contextmenu);
|
||||
var content = menu.scriptWith(function(menu) {
|
||||
return menu.shadowRoot.querySelector('button').innerHTML;
|
||||
});
|
||||
return content === expected;
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue