Skip to content

Commit b36b8da

Browse files
notif [nfc]: Remove unused test harness for flutter_local_notification
1 parent 2af238b commit b36b8da

File tree

2 files changed

+0
-49
lines changed

2 files changed

+0
-49
lines changed

test/model/binding.dart

-44
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import 'package:firebase_core/firebase_core.dart';
44
import 'package:firebase_messaging/firebase_messaging.dart';
55
import 'package:flutter/foundation.dart';
66
import 'package:flutter_local_notifications/flutter_local_notifications.dart' hide Person;
7-
import 'package:flutter_local_notifications_platform_interface/flutter_local_notifications_platform_interface.dart';
87
import 'package:test/fake.dart';
98
import 'package:url_launcher/url_launcher.dart' as url_launcher;
109
import 'package:zulip/host/android_notifications.dart';
@@ -513,34 +512,6 @@ class FakeFlutterLocalNotificationsPlugin extends Fake implements FlutterLocalNo
513512
return true;
514513
}
515514

516-
FlutterLocalNotificationsPlatform? _platform;
517-
518-
@override
519-
T? resolvePlatformSpecificImplementation<T extends FlutterLocalNotificationsPlatform>() {
520-
// This follows the logic of the base class's implementation,
521-
// but supplies our fakes for the per-platform classes.
522-
assert(initializationSettings != null);
523-
assert(T != FlutterLocalNotificationsPlatform);
524-
if (kIsWeb) return null;
525-
switch (defaultTargetPlatform) {
526-
case TargetPlatform.android:
527-
assert(_platform == null || _platform is FakeAndroidFlutterLocalNotificationsPlugin);
528-
if (T != AndroidFlutterLocalNotificationsPlugin) return null;
529-
return (_platform ??= FakeAndroidFlutterLocalNotificationsPlugin()) as T?;
530-
531-
case TargetPlatform.iOS:
532-
assert(_platform == null || _platform is FakeIOSFlutterLocalNotificationsPlugin);
533-
if (T != IOSFlutterLocalNotificationsPlugin) return null;
534-
return (_platform ??= FakeIOSFlutterLocalNotificationsPlugin()) as T?;
535-
536-
case TargetPlatform.linux:
537-
case TargetPlatform.macOS:
538-
case TargetPlatform.windows:
539-
case TargetPlatform.fuchsia:
540-
return null;
541-
}
542-
}
543-
544515
/// The value to be returned by [getNotificationAppLaunchDetails].
545516
NotificationAppLaunchDetails? appLaunchDetails;
546517

@@ -557,21 +528,6 @@ class FakeFlutterLocalNotificationsPlugin extends Fake implements FlutterLocalNo
557528
}
558529

559530
class FakeAndroidFlutterLocalNotificationsPlugin extends Fake implements AndroidFlutterLocalNotificationsPlugin {
560-
/// Consume the log of calls made to [createNotificationChannel].
561-
///
562-
/// This returns a list of the arguments to all calls made
563-
/// to [createNotificationChannel] since the last call to this method.
564-
List<AndroidNotificationChannel> takeCreatedChannels() {
565-
final result = _createdChannels;
566-
_createdChannels = [];
567-
return result;
568-
}
569-
List<AndroidNotificationChannel> _createdChannels = [];
570-
571-
@override
572-
Future<void> createNotificationChannel(AndroidNotificationChannel notificationChannel) async {
573-
_createdChannels.add(notificationChannel);
574-
}
575531
}
576532

577533
class FakeIOSFlutterLocalNotificationsPlugin extends Fake implements IOSFlutterLocalNotificationsPlugin {

test/notifications/display_test.dart

-5
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ import '../test_navigation.dart';
2929
import '../widgets/message_list_checks.dart';
3030
import '../widgets/page_checks.dart';
3131

32-
FakeAndroidFlutterLocalNotificationsPlugin get notifAndroid =>
33-
testBinding.notifications
34-
.resolvePlatformSpecificImplementation<AndroidFlutterLocalNotificationsPlugin>()
35-
as FakeAndroidFlutterLocalNotificationsPlugin;
36-
3732
MessageFcmMessage messageFcmMessage(
3833
Message zulipMessage, {
3934
String? streamName,

0 commit comments

Comments
 (0)