[settings] Migrate back to watch
This a step in the process to rename Watch2 to Watch. A previous api
change required us to add a version of Watch that didn't return a
result/error, so it had to be renamed Watch2 so that both could
exist for a soft-transition. This change is to migrate back to the name
Watch.
Bug: 55719
Test: fx run-host-tests ermine_settings_unittests
Change-Id: I5e48f8eca20200c351325b0cb693c8a74c097d79
Reviewed-on: https://fuchsia-review.googlesource.com/c/experiences/+/414055
Reviewed-by: William Leshner <wleshner@google.com>
Testability-Review: Chip Fukuhara <cfukuhara@google.com>
Commit-Queue: Chip Fukuhara <cfukuhara@google.com>
diff --git a/session_shells/ermine/settings/lib/src/timezone.dart b/session_shells/ermine/settings/lib/src/timezone.dart
index 11b1a26..133e2cc 100644
--- a/session_shells/ermine/settings/lib/src/timezone.dart
+++ b/session_shells/ermine/settings/lib/src/timezone.dart
@@ -112,7 +112,7 @@
_TimeZoneModel({this.intlSettingsService, this.onChange}) {
// Get current timezone and watch it for changes.
- intlSettingsService.watch2().then(_onIntlSettingsChange);
+ intlSettingsService.watch().then(_onIntlSettingsChange);
}
Future<void> _onIntlSettingsChange(IntlSettings intlSettings) async {
@@ -124,7 +124,7 @@
}
// Use the FIDL "hanging get" pattern to request the next update.
if (intlSettingsService != null) {
- await intlSettingsService.watch2().then(_onIntlSettingsChange);
+ await intlSettingsService.watch().then(_onIntlSettingsChange);
}
}
diff --git a/session_shells/ermine/settings/test/timezone_test.dart b/session_shells/ermine/settings/test/timezone_test.dart
index e47ea84..4bee210 100644
--- a/session_shells/ermine/settings/test/timezone_test.dart
+++ b/session_shells/ermine/settings/test/timezone_test.dart
@@ -25,7 +25,7 @@
});
test('Timezone', () async {
- when(intlSettingsProxy.watch2())
+ when(intlSettingsProxy.watch())
.thenAnswer((_) => Future<IntlSettings>.value(IntlSettings(
timeZoneId: TimeZoneId(id: 'Foo'),
)));
@@ -42,7 +42,7 @@
test('Change Timezone', () async {
var response = 'tz1';
- when(intlSettingsProxy.watch2()).thenAnswer((_) {
+ when(intlSettingsProxy.watch()).thenAnswer((_) {
return Future<IntlSettings>.value(IntlSettings(
timeZoneId: TimeZoneId(id: response),
));