This repository has been archived by the owner on Nov 3, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19482 from davehunt/bug_921939
Bug 921939 - Support launching localised apps by name
- Loading branch information
Showing
5 changed files
with
96 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
tests/python/gaia-ui-tests/gaiatest/tests/unit/test_launch_l10n.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
from gaiatest import GaiaTestCase | ||
|
||
|
||
class TestLaunchL10n(GaiaTestCase): | ||
|
||
default_locale = 'en-US' | ||
alternate_locale = 'fr' | ||
test_apps = {'Clock': 'Horloge', | ||
'Phone': u'Téléphone'} | ||
|
||
def _test_launch_by_english_name_in_alternate_locale(self): | ||
''' | ||
Launch apps by English name in a different locale | ||
''' | ||
|
||
# set language to non-English | ||
self.data_layer.set_setting('language.current', self.alternate_locale) | ||
|
||
for app in self.test_apps.keys(): | ||
self.apps.launch(app) | ||
|
||
for app in self.test_apps.values(): | ||
self.assertIn(app.lower(), [a.name.lower() for a in self.apps.running_apps]) | ||
|
||
def test_launch_by_localised_name(self): | ||
''' | ||
Launch apps by (non-English) localised name | ||
''' | ||
|
||
# set language to non-English | ||
self.data_layer.set_setting('language.current', self.alternate_locale) | ||
|
||
for app in self.test_apps.values(): | ||
self.apps.launch(app) | ||
|
||
for app in self.test_apps.values(): | ||
self.assertIn(app.lower(), [a.name.lower() for a in self.apps.running_apps]) | ||
|
||
def tearDown(self): | ||
# switch back to the default locale | ||
self.data_layer.set_setting('language.current', self.default_locale) |