1. 25 May, 2016 1 commit
  2. 16 May, 2016 1 commit
  3. 29 Apr, 2016 3 commits
    • Yegor's avatar
      7c017898
    • Ian Hickson's avatar
      Refactor the test framework (#3622) · 91dd9699
      Ian Hickson authored
      * Refactor widget test framework
      
      Instead of:
      
      ```dart
        test("Card Collection smoke test", () {
          testWidgets((WidgetTester tester) {
      ```
      
      ...you now say:
      
      ```dart
        testWidgets("Card Collection smoke test", (WidgetTester tester) {
      ```
      
      Instead of:
      
      ```dart
        expect(tester, hasWidget(find.text('hello')));
      ```
      
      ...you now say:
      
      ```dart
        expect(find.text('hello'), findsOneWidget);
      ```
      
      Instead of the previous API (exists, widgets, widget, stateOf,
      elementOf, etc), you now have the following comprehensive API. All these
      are functions that take a Finder, except the all* properties.
      
      * `any()` - true if anything matches, c.f. `Iterable.any`
      * `allWidgets` - all the widgets in the tree
      * `widget()` - the one and only widget that matches the finder
      * `firstWidget()` - the first widget that matches the finder
      * `allElements` - all the elements in the tree
      * `element()` - the one and only element that matches the finder
      * `firstElement()` - the first element that matches the finder
      * `allStates` - all the `State`s in the tree
      * `state()` - the one and only state that matches the finder
      * `firstState()` - the first state that matches the finder
      * `allRenderObjects` - all the render objects in the tree
      * `renderObject()` - the one and only render object that matches the finder
      * `firstRenderObject()` - the first render object that matches the finder
      
      There's also `layers' which returns the list of current layers.
      
      `tap`, `fling`, getCenter, getSize, etc, take Finders, like the APIs
      above, and expect there to only be one matching widget.
      
      The finders are:
      
       * `find.text(String text)`
       * `find.widgetWithText(Type widgetType, String text)`
       * `find.byKey(Key key)`
       * `find.byType(Type type)`
       * `find.byElementType(Type type)`
       * `find.byConfig(Widget config)`
       * `find.byWidgetPredicate(WidgetPredicate predicate)`
       * `find.byElementPredicate(ElementPredicate predicate)`
      
      The matchers (for `expect`) are:
      
       * `findsNothing`
       * `findsWidgets`
       * `findsOneWidget`
       * `findsNWidgets(n)`
       * `isOnStage`
       * `isOffStage`
       * `isInCard`
       * `isNotInCard`
      
      Benchmarks now use benchmarkWidgets instead of testWidgets.
      
      Also, for those of you using mockers, `serviceMocker` now automatically
      handles the binding initialization.
      
      This patch also:
      
      * changes how tests are run so that we can more easily swap the logic
        out for a "real" mode instead of FakeAsync.
      
      * introduces CachingIterable.
      
      * changes how flutter_driver interacts with the widget tree to use the
        aforementioned new API rather than ElementTreeTester, which is gone.
      
      * removes ElementTreeTester.
      
      * changes the semantics of a test for scrollables because we couldn't
        convince ourselves that the old semantics made sense; it only worked
        before because flushing the microtasks after every event was broken.
      
      * fixes the flushing of microtasks after every event.
      
      * Reindent the tests
      
      * Fix review comments
      91dd9699
    • Yegor's avatar
      fix first frame reporting logic (#3640) · e60a624a
      Yegor authored
      e60a624a
  4. 28 Apr, 2016 1 commit
  5. 25 Apr, 2016 1 commit
    • Adam Barth's avatar
      Block should work inside LazyBlock (#3546) · cc9d602b
      Adam Barth authored
      Previously we were locking down the state even when calling layout in
      LazyBlock. Now we lock only when building children. Making this work well
      involved moving the catch out of lockState and into the few callers who
      actually wanted it.
      
      Fixes #3534
      cc9d602b
  6. 22 Apr, 2016 3 commits
    • Adam Barth's avatar
      A blinking cursor should push only one frame (#3445) (#3506) · a5e794ca
      Adam Barth authored
      Prior to this patch, we were pushing two frames each time the cursor blinked.
      In turning the cursor on or off, the markNeedsPaint call was triggering another
      frame to be scheduled because we cleared a bit in the scheduler at the
      beginning of the frame instead of at the end of the frame.
      
      To implement scheduling correctly, we actually need two bits: one for
      ensureVisualUpdate, which just promises to get to the end of the pipeline soon,
      and scheduleFrame, which promises to get to the beginning of the pipeline soon.
      
      (Reland)
      a5e794ca
    • Ian Hickson's avatar
      Clean up our timeline events. (#3504) · b5a827bf
      Ian Hickson authored
      This adds in particular the ability to track the time at which the
      framework boots up, and the time at which we are confident we have
      completed the first useful frame.
      b5a827bf
    • Ian Hickson's avatar
      Rename binding abstract classes (#3482) · e968d91c
      Ian Hickson authored
      The old names were getting silly and started stepping on valuable namespace.
      
      The new names are consistent and clear.
      e968d91c
  7. 21 Apr, 2016 2 commits
    • Ian Hickson's avatar
      Make the widgets binding reusable. (#3479) · 0e11b0e6
      Ian Hickson authored
      Previously the widgets layer only provided a concrete binding, which
      makes it awkward to extend it compared to other bindings. This moves
      widgets to the same style as the other layers.
      
      In a subsequent patch I'll use this to make the tests layer saner.
      0e11b0e6
    • Eric Seidel's avatar
      Add a service extension for toggling the PerformanceOverlay · 898b3ce8
      Eric Seidel authored
      This only works for apps which use WidgetsApp.  Apps which don't
      (like the game) could presumably read the static themselves
      off of WidgetsApp.
      
      @devoncarew @hixie
      898b3ce8
  8. 19 Apr, 2016 1 commit
    • Ian Hickson's avatar
      Refactor service extensions (#3397) · 261923e5
      Ian Hickson authored
      Bindings now have a debugRegisterServiceExtensions() method that is
      invoked in debug mode (only). (Once we have a profile mode, there'll be
      a registerProfileServiceExtensions() method that gets called in that
      mode only to register extensions that apply then.)
      
      The BindingBase class provides convenience methods for registering
      service extensions that do the equivalent of:
      
      ```dart
      void extension() { ... }
      bool extension([bool enabled]) { ... }
      double extension([double extension])  { ... }
      Map<String, String> extension([Map<String, String> parameters]) { ... }
      ```
      
      The BindingBase class also itself registers ext.flutter.reassemble,
      which it has call a function on the binding called
      reassembleApplication().
      
      The Scheduler binding now exposes the preexisting
      ext.flutter.timeDilation.
      
      The Renderer binding now exposes the preexisting ext.flutter.debugPaint.
      
      The Renderer binding hooks reassembleApplication to trigger the
      rendering tree to be reprocessed (in particular, to fix up the
      optimisation closures).
      
      All the logic from rendering/debug.dart about service extensions is
      replaced by the above.
      
      I moved basic_types to foundation.
      
      The FlutterWidgets binding hooks reassembleApplication to trigger the
      widget tree to be entirely rebuilt.
      
      Flutter Driver now uses ext.flutter.driver instead of
      ext.flutter_driver, and is hooked using the same binding mechanism.
      Eventually we'll probably move the logic into the Flutter library so
      that you just get it without having to invoke a special method first.
      261923e5
  9. 02 Apr, 2016 1 commit
    • Ian Hickson's avatar
      Rationalise all our exception handling. · ee703da9
      Ian Hickson authored
      - Create a FlutterErrorDetails struct-like class that describes an
      
        exception along with more details that aren't in the exception, like
      
        where it was caught and what was going on when it was caught.
      
      
      
      - Provide a FlutterError static API for handling these objects:
      
      
      
        - FlutterError.onError which is called whenever Flutter catches an
      
          error.
      
      
      
        - FlutterError.reportError() which handles an error.
      
      
      
        - FlutterError.dumpErrorToConsole() which is the default behavior
      
          for onError.
      
      
      
      - Removes all the existing exception handler callbacks.
      
      
      
      - Replaces all the existing places that described exceptions using
      
        debugPrint with calls to FlutterError.reportError().
      
      
      
      - Extend lockState() to also catch exceptions, so that we catch
      
        exceptions that happen during finalizers.
      
      
      
      - Make the test framework catch errors and treat them as failures.
      
      
      
      - Provide a mechanism to override this behavior in the test framework.
      
      
      
      - Make the tests that used to depend on the exception handler
      
        callbacks use this new mechanism.
      
      
      
      - Make pump() also support the phase argument.
      
      
      
      - Improve some tests using these new features.
      
      
      
      Fixes #2356, #2988, #2985, #2220.
      ee703da9
  10. 31 Mar, 2016 1 commit
    • Kris Giesing's avatar
      Part 2 of independent layout pipelines · 9dfd5d40
      Kris Giesing authored
      Adds BuildOwner to manage the dirty list and build processing for
      widgets/elements, and adds a widget unit test to make sure separation
      is enforced.
      
      Fixes #2723
      9dfd5d40
  11. 18 Mar, 2016 1 commit
  12. 14 Mar, 2016 1 commit
  13. 12 Mar, 2016 3 commits
  14. 11 Mar, 2016 1 commit
  15. 10 Mar, 2016 1 commit
  16. 04 Mar, 2016 2 commits
  17. 11 Feb, 2016 1 commit
    • Ian Hickson's avatar
      Clean up imports and exports. · a94999ba
      Ian Hickson authored
      Each layer is supposed to reexport the parts of the previous layer
      that are part of its API.
      
      - In painting.dart, export from dart:ui all the Canvas-related APIs
        that make sense to be used at higher levels, e.g. PaintingStyle.
      
      - Delete painting/shadows.dart. It was dead code.
      
      - In rendering/object.dart, export all of painting.dart.
      
      - In widgets/basic.dart, export all of painting.dart and
        animation.dart. Some classes in animation/ are renamed to make this
        less disruptive and confusing to the namespace.
      
      - Split out Stocks back into an import model rather than a part model,
        so that it's easier to manage its dependencies on a per-file basis.
      
      - Move Ticker to scheduler library.
      
      - Remove as many redundant imports as possible now.
      
      - Some minor nit picking cleanup in various files.
      a94999ba
  18. 01 Feb, 2016 1 commit
  19. 24 Jan, 2016 1 commit
  20. 22 Jan, 2016 2 commits
  21. 07 Jan, 2016 1 commit
    • Adam Barth's avatar
      Move default back behavior to FlutterWidgetBinding · e3d587ea
      Adam Barth authored
      Previously MaterialApp was responsible for ending the activity when the
      back stack was empty. However, this behavior is more general than
      material. This patch moves the behavior to FlutterWidgetBinding, which
      has a global view of all the binding observers.
      
      Fixes #1086
      e3d587ea
  22. 16 Dec, 2015 1 commit
  23. 14 Dec, 2015 2 commits
  24. 09 Dec, 2015 2 commits
  25. 08 Dec, 2015 1 commit
  26. 02 Dec, 2015 1 commit
  27. 18 Nov, 2015 1 commit
  28. 06 Nov, 2015 1 commit
    • Adam Barth's avatar
      We throw an exception if you tap the screen during load · 060b34f7
      Adam Barth authored
      Inside runApp, we were building the render tree for the app, but we weren't
      calling layout, which meant we were running a hit test on a dirty tree. Now
      hitTest specifically asserts that the tree is clean and we synchronously call
      layout for your app during runApp.
      
      Fixes #1960
      060b34f7
  29. 22 Oct, 2015 1 commit