- 29 Apr, 2016 1 commit
-
-
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
-
- 27 Apr, 2016 1 commit
-
-
Ian Hickson authored
-
- 22 Apr, 2016 4 commits
-
-
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)
-
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.
-
Adam Barth authored
This reverts commit 161f945e. This patch caused a number of regressions. Fixes #3497
-
Ian Hickson authored
The old names were getting silly and started stepping on valuable namespace. The new names are consistent and clear.
-
- 21 Apr, 2016 1 commit
-
-
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.
-
- 19 Apr, 2016 2 commits
-
-
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.
-
Ian Hickson authored
To be more consistent with other parts of the platform: * put the binding in a binding.dart file. * rearrange some members of the Scheduler class to be more close to execution order. * factor out Priority class into its own file. * add more dart docs.
-
- 15 Apr, 2016 2 commits
-
-
Ian Hickson authored
Exception stack variable was shadowing the function argument stack.
-
Ian Hickson authored
We're getting back to the point where we have a bunch of foundation APIs and it's getting confusing having them mixed with services/.
-
- 13 Apr, 2016 1 commit
-
-
Ian Hickson authored
...by adding tests to our examples that don't import flutter_test, which pins the relevant dependencies. Also, provide more information when complaining about leaked transient callbacks in tests. Also, make tests display full information when they have an exception, by bypassing the throttling we have for Android logging in tests. Also, make the word wrapping not wrap stack traces if they happen to be included in exception output. Also, fix a leaked transient callback in the checkbox code.
-
- 02 Apr, 2016 1 commit
-
-
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.
-
- 14 Mar, 2016 1 commit
-
-
Hixie authored
-
- 12 Mar, 2016 3 commits
-
-
Hixie authored
And fix the zillion issues that uncovered.
-
Ian Hickson authored
This reverts commit f41b3411, reversing changes made to e33d8d96. This was a bad check-in due to my mangling uploading a new version of the branch from a different machine. This reverts https://github.com/flutter/flutter/pull/2639 and will be replaced by https://github.com/flutter/flutter/pull/2640
-
Hixie authored
And fix the zillion issues that uncovered.
-
- 11 Mar, 2016 1 commit
-
-
Ian Hickson authored
Well, all the easy ones, anyway. For some reason `// ignore:` isn't working for me so I've disabled lints that need that. Also disabled those that require a ton of work (which I'm doing, but not in this PR, to keep it reviewable). This adds: - avoid_init_to_null - library_names - package_api_docs - package_names - package_prefixed_library_names - prefer_is_not_empty - sort_constructors_first - sort_unnamed_constructors_first - unnecessary_getters_setters
-
- 13 Feb, 2016 1 commit
-
-
Hixie authored
Drawer doesn't need a SizeObserver, since it only looks at the size in event handlers. It can just go and probe the tree to read the size. Also, change from using _kEdgeDragWidth to using _kWidth when figuring out how much of the drawer to show when dragging it from the edge, since that is more likely to match the drawer's width.
-
- 11 Feb, 2016 1 commit
-
-
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.
-
- 28 Jan, 2016 1 commit
-
-
Hixie authored
-
- 24 Jan, 2016 1 commit
-
-
Ian Hickson authored
-
- 07 Jan, 2016 1 commit
-
-
Ian Hickson authored
- make them all have the same style - make them all include the stack trace last - make them all stop printing if their callback is set (if appropriate, they don't yet all have callbacks)
-
- 15 Dec, 2015 1 commit
-
-
Hixie authored
This is a workaround for: https://github.com/dart-lang/sdk/issues/25246
-
- 14 Dec, 2015 1 commit
-
-
Ian Hickson authored
-
- 02 Dec, 2015 3 commits
-
-
Florian Loitsch authored
The names are probably less familiar, but more consistent: - FrameCallback: a callback that is relative to the frame and wants the frame offset (a duration) as argument. - addXFrameCallback: adds the given callback to the internal lists/maps. - scheduleXFrameCallback (currently only X = ""): add the callback, but also trigger a new frame. - handleX: the method that is invoked when the event-loop or the frame calls into the scheduler. - ensureXYZ: ensure that the callback happens. Unfortunately there is the ambiguity between a "callback": it can be a closure, or the action of doing a callback, so we end up with: ensureBeginFrameCallback, and ensureEventLoopCallback, where "callback" means the action of being called back.
-
Florian Loitsch authored
-
Florian Loitsch authored
-
- 17 Nov, 2015 1 commit
-
-
Florian Loitsch authored
The current implementation is still pretty rudimentary.
-