未验证 提交 396402f5 编写于 作者: D Dan Field 提交者: GitHub

Flush UserSettings to window (#6850)

上级 1e7e676e
......@@ -68,6 +68,9 @@ void _updateLocales(List<String> locales) {
@pragma('vm:entry-point')
void _updateUserSettingsData(String jsonData) {
final Map<String, dynamic> data = json.decode(jsonData);
if (data.isEmpty) {
return;
}
_updateTextScaleFactor(data['textScaleFactor'].toDouble());
_updateAlwaysUse24HourFormat(data['alwaysUse24HourFormat']);
}
......
......@@ -128,7 +128,8 @@ bool RuntimeController::FlushRuntimeStateToIsolate() {
return SetViewportMetrics(window_data_.viewport_metrics) &&
SetLocales(window_data_.locale_data) &&
SetSemanticsEnabled(window_data_.semantics_enabled) &&
SetAccessibilityFeatures(window_data_.accessibility_feature_flags_);
SetAccessibilityFeatures(window_data_.accessibility_feature_flags_) &&
SetUserSettingsData(window_data_.user_settings_data);
}
bool RuntimeController::SetViewportMetrics(const ViewportMetrics& metrics) {
......
......@@ -67,6 +67,12 @@ void main() {
window.onTextScaleFactorChanged = originalOnTextScaleFactorChanged;
});
test('updateUserSettings can handle an empty object', () {
// this should now throw.
_updateUserSettingsData('{}');
expect(true, equals(true));
});
test('onMetricsChanged preserves callback zone', () {
Zone innerZone;
Zone runZone;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册