Unverified Commit 834f5dc2 authored by Polina Cherkasova's avatar Polina Cherkasova Committed by GitHub

RestorationManager should dispatch creation in constructor. (#133911)

parent 621ad987
......@@ -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>[];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment