anchor.diff:  
       expect(find.text('Page 1'), findsNothing);
       expect(find.text('Page 2'), isOnstage);
  -    verifyNever(navigatorObserver.didPop(any, any));
  -    verify(navigatorObserver.didStopUserGesture()).called(1);
  +    expect(navigatorObserver.invocations.removeLast(), NavigatorInvocation.didStopUserGesture);
  +    expect(navigatorObserver.invocations.removeLast(), isNot(NavigatorInvocation.didPop));
       expect(
         tester.state<NavigatorState>(find.byType(Navigator)).userGestureInProgress,
         false,
  
positive.code:     // Back to the page covering the whole screen.
      expect(tester.getTopLeft(find.text('2')).dx, moreOrLessEquals(0));
      expect(navigatorKey.currentState.userGestureInProgress, false);
      verify(navigatorObserver.didStopUserGesture()).called(1);
      verifyNever(navigatorObserver.didPop(any, any));
  
      await tester.dragFrom(const Offset(5, 100), const Offset(500, 0));
      await tester.pump();
      expect(tester.getTopLeft(find.text('2')).dx, moreOrLessEquals(500));
      expect(navigatorKey.currentState.userGestureInProgress, true);
      verify(navigatorObserver.didPop(any, any)).called(1);
  
      // Did go far enough to snap out of this route.
      await tester.pump(const Duration(milliseconds: 301));
  
negative.code:   });
  }
  
  class MockNavigatorObserver extends NavigatorObserver {
    final List<NavigatorInvocation> invocations = <NavigatorInvocation>[];
  
    @override
    void didStartUserGesture(Route<Object> route, Route<Object> previousRoute) {
      invocations.add(NavigatorInvocation.didStartUserGesture);
    }
  
    @override
    void didPop(Route<Object> route, Route<Object> previousRoute) {
      invocations.add(NavigatorInvocation.didPop);
    }
  
    @override
    void didPush(Route<Object> route, Route<Object> previousRoute) {
      invocations.add(NavigatorInvocation.didPush);
    }
  
    @override
    void didStopUserGesture() {
      invocations.add(NavigatorInvocation.didStopUserGesture);
    }
  }
  
  enum NavigatorInvocation {
    didStartUserGesture,
    didPop,
    didPush,
    didStopUserGesture,
  }
  
  class PopupObserver extends NavigatorObserver {
    int popupCount = 0;
  