Skip to content

Commit 711bc69

Browse files
committed
notif test: Cut now-disused test fakes for old plugin's show
1 parent d412a04 commit 711bc69

File tree

2 files changed

+0
-77
lines changed

2 files changed

+0
-77
lines changed

test/model/binding.dart

-23
Original file line numberDiff line numberDiff line change
@@ -392,24 +392,6 @@ class FakeFlutterLocalNotificationsPlugin extends Fake implements FlutterLocalNo
392392
}
393393
}
394394

395-
/// Consume the log of calls made to [show].
396-
///
397-
/// This returns a list of the arguments to all calls made
398-
/// to [show] since the last call to this method.
399-
List<FlutterLocalNotificationsPluginShowCall> takeShowCalls() {
400-
final result = _showCalls;
401-
_showCalls = [];
402-
return result;
403-
}
404-
List<FlutterLocalNotificationsPluginShowCall> _showCalls = [];
405-
406-
@override
407-
Future<void> show(int id, String? title, String? body,
408-
NotificationDetails? notificationDetails, {String? payload}) async {
409-
assert(initializationSettings != null);
410-
_showCalls.add((id, title, body, notificationDetails, payload: payload));
411-
}
412-
413395
/// The value to be returned by [getNotificationAppLaunchDetails].
414396
NotificationAppLaunchDetails? appLaunchDetails;
415397

@@ -425,11 +407,6 @@ class FakeFlutterLocalNotificationsPlugin extends Fake implements FlutterLocalNo
425407
}
426408
}
427409

428-
typedef FlutterLocalNotificationsPluginShowCall = (
429-
int id, String? title, String? body,
430-
NotificationDetails? notificationDetails, {String? payload}
431-
);
432-
433410
class FakeAndroidFlutterLocalNotificationsPlugin extends Fake implements AndroidFlutterLocalNotificationsPlugin {
434411
/// Consume the log of calls made to [createNotificationChannel].
435412
///

test/notifications/display_test.dart

-54
Original file line numberDiff line numberDiff line change
@@ -356,14 +356,6 @@ extension AndroidNotificationChannelChecks on Subject<AndroidNotificationChannel
356356
Subject<bool> get showBadge => has((x) => x.showBadge, 'showBadge');
357357
}
358358

359-
extension ShowCallChecks on Subject<FlutterLocalNotificationsPluginShowCall> {
360-
Subject<int> get id => has((x) => x.$1, 'id');
361-
Subject<String?> get title => has((x) => x.$2, 'title');
362-
Subject<String?> get body => has((x) => x.$3, 'body');
363-
Subject<NotificationDetails?> get notificationDetails => has((x) => x.$4, 'notificationDetails');
364-
Subject<String?> get payload => has((x) => x.payload, 'payload');
365-
}
366-
367359
extension on Subject<AndroidNotificationHostApiNotifyCall> {
368360
Subject<String?> get tag => has((x) => x.tag, 'tag');
369361
Subject<int> get id => has((x) => x.id, 'id');
@@ -381,49 +373,3 @@ extension on Subject<PendingIntent> {
381373
Subject<String> get intentPayload => has((x) => x.intentPayload, 'intentPayload');
382374
Subject<int> get flags => has((x) => x.flags, 'flags');
383375
}
384-
385-
extension NotificationDetailsChecks on Subject<NotificationDetails> {
386-
Subject<AndroidNotificationDetails?> get android => has((x) => x.android, 'android');
387-
Subject<DarwinNotificationDetails?> get iOS => has((x) => x.iOS, 'iOS');
388-
Subject<DarwinNotificationDetails?> get macOS => has((x) => x.macOS, 'macOS');
389-
Subject<LinuxNotificationDetails?> get linux => has((x) => x.linux, 'linux');
390-
}
391-
392-
extension AndroidNotificationDetailsChecks on Subject<AndroidNotificationDetails> {
393-
// The upstream [AndroidNotificationDetails] has many more properties
394-
// which only apply to creating a channel, or to notifications before
395-
// channels were introduced in Android 8. We ignore those here.
396-
Subject<String?> get icon => has((x) => x.icon, 'icon');
397-
Subject<String> get channelId => has((x) => x.channelId, 'channelId');
398-
Subject<StyleInformation?> get styleInformation => has((x) => x.styleInformation, 'styleInformation');
399-
Subject<String?> get groupKey => has((x) => x.groupKey, 'groupKey');
400-
Subject<bool> get setAsGroupSummary => has((x) => x.setAsGroupSummary, 'setAsGroupSummary');
401-
Subject<GroupAlertBehavior> get groupAlertBehavior => has((x) => x.groupAlertBehavior, 'groupAlertBehavior');
402-
Subject<bool> get autoCancel => has((x) => x.autoCancel, 'autoCancel');
403-
Subject<bool> get ongoing => has((x) => x.ongoing, 'ongoing');
404-
Subject<Color?> get color => has((x) => x.color, 'color');
405-
Subject<AndroidBitmap<Object>?> get largeIcon => has((x) => x.largeIcon, 'largeIcon');
406-
Subject<bool> get onlyAlertOnce => has((x) => x.onlyAlertOnce, 'onlyAlertOnce');
407-
Subject<bool> get showWhen => has((x) => x.showWhen, 'showWhen');
408-
Subject<int?> get when => has((x) => x.when, 'when');
409-
Subject<bool> get usesChronometer => has((x) => x.usesChronometer, 'usesChronometer');
410-
Subject<bool> get chronometerCountDown => has((x) => x.chronometerCountDown, 'chronometerCountDown');
411-
Subject<bool> get showProgress => has((x) => x.showProgress, 'showProgress');
412-
Subject<int> get maxProgress => has((x) => x.maxProgress, 'maxProgress');
413-
Subject<int> get progress => has((x) => x.progress, 'progress');
414-
Subject<bool> get indeterminate => has((x) => x.indeterminate, 'indeterminate');
415-
Subject<String?> get ticker => has((x) => x.ticker, 'ticker');
416-
Subject<AndroidNotificationChannelAction> get channelAction => has((x) => x.channelAction, 'channelAction');
417-
Subject<NotificationVisibility?> get visibility => has((x) => x.visibility, 'visibility');
418-
Subject<int?> get timeoutAfter => has((x) => x.timeoutAfter, 'timeoutAfter');
419-
Subject<AndroidNotificationCategory?> get category => has((x) => x.category, 'category');
420-
Subject<bool> get fullScreenIntent => has((x) => x.fullScreenIntent, 'fullScreenIntent');
421-
Subject<String?> get shortcutId => has((x) => x.shortcutId, 'shortcutId');
422-
Subject<Int32List?> get additionalFlags => has((x) => x.additionalFlags, 'additionalFlags');
423-
Subject<List<AndroidNotificationAction>?> get actions => has((x) => x.actions, 'actions');
424-
Subject<String?> get subText => has((x) => x.subText, 'subText');
425-
Subject<String?> get tag => has((x) => x.tag, 'tag');
426-
Subject<bool> get colorized => has((x) => x.colorized, 'colorized');
427-
Subject<int?> get number => has((x) => x.number, 'number');
428-
Subject<AudioAttributesUsage> get audioAttributesUsage => has((x) => x.audioAttributesUsage, 'audioAttributesUsage');
429-
}

0 commit comments

Comments
 (0)