Add a test to stocks for changing the locale
I had to add a setLocale method to WidgetTester and split the code in FlutterBinding which handled locale changes to allow me to dispatch a locale change w/o actually changing what the c++ code reports as the locale. Also added the test to Travis. @abarth @jason-simmons
This commit is contained in:
@@ -32,6 +32,12 @@ class WidgetTester {
|
||||
pump(duration);
|
||||
}
|
||||
|
||||
void setLocale(String languageCode, String countryCode) {
|
||||
ui.Locale locale = new ui.Locale(languageCode, countryCode);
|
||||
FlutterBinding.instance.dispatchLocaleChanged(locale);
|
||||
async.flushMicrotasks();
|
||||
}
|
||||
|
||||
void pump([ Duration duration ]) {
|
||||
if (duration != null)
|
||||
async.elapse(duration);
|
||||
|
||||
Reference in New Issue
Block a user