1. 26 Sep, 2019 1 commit
    • Greg Spencer's avatar
      Fix mouse hover to not schedule a frame for every mouse move. (#41014) · 05097916
      Greg Spencer authored
      This fixes the mouse hover code to not schedule frames with every mouse move.
      
      Before this, it would schedule a post frame callback, and then schedule a frame immediately, even if there was nothing that needed to be updated. Now it will schedule checks for mouse position updates synchronously, unless there's a new annotation, and skip scheduling a new frame in all cases. It has to be async in the case of a new annotation (i.e. a new MouseRegion is added), since when the annotation is added, it hasn't yet painted, and it can't hit test against the new layer until after the paint, so in that case it schedules a post frame callback, but since it's already building a frame when it does that, it doesn't need to schedule a frame.
      
      The code also used to do mouse position checks for all mice if only one mouse changed position. I fixed this part too, so that it will only check position for the mouse that changed.
      05097916
  2. 24 Sep, 2019 2 commits
    • Mehmet Fidanboylu's avatar
    • Greg Spencer's avatar
      Add fake keyboard key generation to the testing framework (#40706) · 0e6cb28d
      Greg Spencer authored
      There were four or five different implementations in various tests for sendFakeKeyEvent, which roughly all did the same thing. I was going to add yet another one, and decided that it needed to be generalized and centralized. This replaces those instances with something that just takes a LogicalKeyboardKey so that it's self-documenting, and can be used with multiple platforms.
      
      This adds two functions to widget tester: sendKeyDownEvent and sendKeyUpEvent which simulate key up/down from a physical keyboard. It also adds global functions simulateKeyDownEvent and simulateKeyUpEvent that can be called without a widget tester. All are async functions protected by the async guard.
      0e6cb28d
  3. 13 Sep, 2019 1 commit
  4. 11 Sep, 2019 1 commit
  5. 06 Sep, 2019 2 commits
  6. 27 Aug, 2019 1 commit
  7. 21 Aug, 2019 1 commit
  8. 20 Aug, 2019 1 commit
    • James D. Lin's avatar
      Instrument pending timers in tests (#37646) · b2f8d3a6
      James D. Lin authored
      Flutter widget tests assert if a test completes with timers still
      pending.  However, it can be hard to diagnose where a pending timer
      came from.  For example, a widget might consume a third-party library
      that internally uses a timer.
      
      I added a FakeAsync.pendingTimersDebugInfo getter to quiver
      (https://github.com/google/quiver-dart/pull/500).  Make flutter_test
      use it.
      
      Additionally modify Flutter's debugPrintStack to take an optional
      StackTrace argument instead of always printing StackTrace.current.
      
      Fixes #4237.
      b2f8d3a6
  9. 16 Aug, 2019 1 commit
    • Nurhan Turgut's avatar
      Navigator change backup (#38494) · c2e2f093
      Nurhan Turgut authored
      * Broadcasting popRoute and pushRoute methods via SystemChannels.navigation. These messages will be used in flutter_web to detect the route
      
      * Broadcasting popRoute and pushRoute methods via SystemChannels.navigation. These messages will be used in flutter_web to detect the route
      
      * Reverting all unrelated formatting changes.
      
      * Adding unit tests. Adding more comments.
      
      * Changing string method names with constant strings.
      
      * Fixing a constant strings.
      
      * Fixing analyzer error.
      
      * Fixing more white space.
      
      * Changing the method names. Adding comments to the SystemChannels
      
      * Comment and code name fixes
      
      * replacing the comment with reviewer suggestion.
      
      * addinf systemchannels.navigation mock to test bindings
      
      * Adding a new class for sending route change notrifications. The nottifications are only sent on web. This should fix breaking android/ios
      
      * using new class RouteNotificationMessages in navigator
      
      * Fixing analyzer issues.
      
      * fixing cycle dependency
      
      * fixing github analyze error
      
      * dartfmt two new classes. trying to fix anayze errors
      
      * Update route_notification_messages.dart
      
      * trying to fix white space errors
      c2e2f093
  10. 09 Aug, 2019 2 commits
  11. 19 Jul, 2019 1 commit
  12. 16 Jul, 2019 1 commit
  13. 02 Jul, 2019 1 commit
  14. 28 Jun, 2019 1 commit
    • David Shuckerow's avatar
      Make it possible to override the FLUTTER_TEST env variable (#34301) · df6e4d48
      David Shuckerow authored
      * Make it possible to override the FLUTTER_TEST env variable without unsetting it.
      
      * Switch to using platform instead of Platform.
      
      * Document the bindings, and introduce tests that initialize multiple WidgetsBindings with different environments.
      
      * Add tests for the flutter platform test.
      
      * Add license headers
      
      * Fix lints
      
      * Remove trailing whitespace
      
      * Respond to Jonahs comments
      
      * Respond to Ians comments
      
      * Mock out the HttpServer in flutter_platform_test
      
      * Mock out the HttpServer in flutter_platform_test
      
      * Explain why we mock out the HttpServer in flutter_platform_test
      df6e4d48
  15. 26 Jun, 2019 1 commit
  16. 22 Jun, 2019 1 commit
    • Todd Volkert's avatar
      Prepare for HttpClientResponse Uint8List SDK change (#34863) · e8270ff6
      Todd Volkert authored
      * Prepare for HttpClientResponse Uint8List SDK change
      
      An upcoming change in the Dart SDK will change `HttpClientResponse`
      from implementing `Stream<List<int>>` to instead implement
      `Stream<Uint8List>`.
      
      This forwards-compatible change to `_MockHttpClientResponse` is being
      made to allow for a smooth rollout of that SDK breaking change. The
      current structure of the class is as follows:
      
      ```dart
      _MockHttpClientResponse extends Stream<List<int>> implements HttpClientResponse {
        ...
      }
      ```
      
      This structure would require that the Dart SDK change land atomically
      a change to the class (`extends Stream<Uint8List>`). This atomic landing
      requirement doesn't play well at all with Flutter's roll model vis-a-vis
      the Dart SDK's roll model to Google's internal repo.  As such, this commit
      changes the structure of `_MockHttpClientResponse` to be:
      
      ```dart
      _MockHttpClientResponse implements HttpClientResponse {
        final Stream<Uint8List> _delegate;
      
        ...
      }
      ```
      
      Once the Dart SDK change has fully rolled out, we can simplify this class
      back to its former structure.
      
      https://github.com/dart-lang/sdk/issues/36900
      
      * Review comment
      e8270ff6
  17. 13 Jun, 2019 1 commit
  18. 12 Jun, 2019 1 commit
  19. 07 Jun, 2019 1 commit
  20. 03 Jun, 2019 1 commit
  21. 01 Jun, 2019 1 commit
  22. 28 May, 2019 1 commit
  23. 20 May, 2019 1 commit
  24. 17 May, 2019 1 commit
  25. 13 May, 2019 1 commit
    • Greg Spencer's avatar
      Fix transforms for things with RenderPointerListeners (#32535) · a5053bfb
      Greg Spencer authored
      This fixes #32525, because it now marks the compositing bits as needing to be recalculated if the mouse tracker changes its idea of whether or not a mouse is attached.
      
      This bug occurred because the test framework was leaking state from one test to the next (the state about whether a mouse pointer was active), and so even though there was a "passing" test when run in order with the other tests in the file, when the test was run individually (or first), it would have failed and caught the bug.
      
      This adds an assert to make sure that after each test there are no simulated mouse pointers connected, and now calls removePointer in all of the tests where this was a problem.
      a5053bfb
  26. 01 May, 2019 1 commit
  27. 30 Apr, 2019 1 commit
  28. 25 Apr, 2019 2 commits
  29. 23 Apr, 2019 1 commit
  30. 22 Apr, 2019 1 commit
    • Greg Spencer's avatar
      Implement focus traversal for desktop platforms, shoehorn edition. (#30040) · 4218c0bc
      Greg Spencer authored
      Implements focus traversal for desktop platforms, including re-implementing the existing focus manager and focus tree.
      
      This implements a Focus widget that can be put into a widget tree to allow input focus to be given to a particular part of a widget tree.
      
      It incorporates with the existing FocusScope and FocusNode infrastructure, and has minimal breakage to the API, although FocusScope.reparentIfNeeded is removed, replaced by a call to FocusAttachment.reparent(), so this is a breaking change:
      
      FocusScopeNodes must now be attached to the focus tree using FocusScopeNode.attach, which takes a context and an optional onKey callback, and returns a FocusAttachment that should be kept by the widget that hosts the FocusScopeNode. This is necessary because of the need to make sure that the focus tree reflects the widget hierarchy.
      
      Callers that used to call FocusScope(context).reparentIfNeeded in their build method will call reparent  on a FocusAttachment instead, which they will obtain by calling FocusScopeNode.attach in their initState method. Widgets that own FocusNodes will need to call dispose on the focus node in their dispose method.
      
      Addresses #11344, #1608, #13264, and #1678
      Fixes #30084
      Fixes #26704
      4218c0bc
  31. 18 Apr, 2019 1 commit
  32. 15 Apr, 2019 1 commit
  33. 10 Apr, 2019 1 commit
  34. 22 Mar, 2019 1 commit
  35. 09 Mar, 2019 1 commit
  36. 08 Mar, 2019 1 commit