RestorationManager should dispatch creation in constructor. (#133911)
This commit is contained in:
committed by
GitHub
parent
621ad9872c
commit
834f5dc296
@@ -154,6 +154,9 @@ class RestorationManager extends ChangeNotifier {
|
||||
/// Construct the restoration manager and set up the communications channels
|
||||
/// with the engine to get restoration messages (by calling [initChannels]).
|
||||
RestorationManager() {
|
||||
if (kFlutterMemoryAllocationsEnabled) {
|
||||
maybeDispatchObjectCreation();
|
||||
}
|
||||
initChannels();
|
||||
}
|
||||
|
||||
|
||||
@@ -8,10 +8,15 @@ import 'package:flutter/scheduler.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:leak_tracker_flutter_testing/leak_tracker_flutter_testing.dart';
|
||||
|
||||
import 'restoration.dart';
|
||||
|
||||
void main() {
|
||||
testWidgetsWithLeakTracking('$RestorationManager dispatches memory events', (WidgetTester tester) async {
|
||||
expect(() => RestorationManager().dispose(), dispatchesMemoryEvents(RestorationManager));
|
||||
});
|
||||
|
||||
group('RestorationManager', () {
|
||||
testWidgets('root bucket retrieval', (WidgetTester tester) async {
|
||||
final List<MethodCall> callsToEngine = <MethodCall>[];
|
||||
|
||||
Reference in New Issue
Block a user