anchor.diff:    });
   
     testWidgets('Application lifecycle affects frame scheduling', (WidgetTester tester) async {
  -    final BinaryMessenger defaultBinaryMessenger = ServicesBinding.instance!.defaultBinaryMessenger;
  -    ByteData message;
  -    expect(tester.binding.hasScheduledFrame, isFalse);
  -
  -    message = const StringCodec().encodeMessage('AppLifecycleState.paused')!;
  -    await defaultBinaryMessenger.handlePlatformMessage('flutter/lifecycle', message, (_) { });
  -    expect(tester.binding.hasScheduledFrame, isFalse);
  -
  -    message = const StringCodec().encodeMessage('AppLifecycleState.resumed')!;
  -    await defaultBinaryMessenger.handlePlatformMessage('flutter/lifecycle', message, (_) { });
  +    expect(tester.binding.hasScheduledFrame, isFalse);
  +
  +    setAppLifeCycleState(AppLifecycleState.paused);
  +    expect(tester.binding.hasScheduledFrame, isFalse);
  +
  +    setAppLifeCycleState(AppLifecycleState.resumed);
       expect(tester.binding.hasScheduledFrame, isTrue);
       await tester.pump();
       expect(tester.binding.hasScheduledFrame, isFalse);
   
  -    message = const StringCodec().encodeMessage('AppLifecycleState.inactive')!;
  -    await defaultBinaryMessenger.handlePlatformMessage('flutter/lifecycle', message, (_) { });
  -    expect(tester.binding.hasScheduledFrame, isFalse);
  -
  -    message = const StringCodec().encodeMessage('AppLifecycleState.detached')!;
  -    await defaultBinaryMessenger.handlePlatformMessage('flutter/lifecycle', message, (_) { });
  -    expect(tester.binding.hasScheduledFrame, isFalse);
  -
  -    message = const StringCodec().encodeMessage('AppLifecycleState.inactive')!;
  -    await defaultBinaryMessenger.handlePlatformMessage('flutter/lifecycle', message, (_) { });
  +    setAppLifeCycleState(AppLifecycleState.inactive);
  +    expect(tester.binding.hasScheduledFrame, isFalse);
  +
  +    setAppLifeCycleState(AppLifecycleState.detached);
  +    expect(tester.binding.hasScheduledFrame, isFalse);
  +
  +    setAppLifeCycleState(AppLifecycleState.inactive);
       expect(tester.binding.hasScheduledFrame, isTrue);
       await tester.pump();
       expect(tester.binding.hasScheduledFrame, isFalse);
   
  -    message = const StringCodec().encodeMessage('AppLifecycleState.paused')!;
  -    await defaultBinaryMessenger.handlePlatformMessage('flutter/lifecycle', message, (_) { });
  +    setAppLifeCycleState(AppLifecycleState.paused);
       expect(tester.binding.hasScheduledFrame, isFalse);
   
       tester.binding.scheduleFrame();
  
positive.code:     final ByteData message = const JSONMethodCodec().encodeMethodCall(
        const MethodCall('pushRouteInformation', testRouteInformation),
      );
      await ServicesBinding.instance!.defaultBinaryMessenger.handlePlatformMessage('flutter/navigation', message, (_) { });
      expect(observer.pushedRoute, 'testRouteName');
      WidgetsBinding.instance!.removeObserver(observer);
    });
  
negative.code: // Copyright 2014 The Flutter Authors. All rights reserved.
  // Use of this source code is governed by a BSD-style license that can be
  // found in the LICENSE file.
  
  import 'package:flutter/foundation.dart';
  import 'package:flutter/services.dart';
  