Commit Graph

1469 Commits

Author SHA1 Message Date
Adam Barth
6d99acfdde Remove dependency on package:mojo (#6413)
Fixes #5843
2016-10-20 00:15:35 -07:00
Yegor
995fcdc92b add description to by-predicate finders (#6362)
Add an option to provide a custom description to predicate
finders. Without a custom description we default to printing the
predicate function's signature, which is not all that useful.

Use this new option in the driver extension to print the text of the
sought after tooltip.
2016-10-17 17:16:22 -07:00
Adam Barth
9cab64a72c More automated edits of iml files 2016-10-14 21:57:28 -07:00
Adam Barth
9ae7f4903e Update IML files 2016-10-14 09:58:48 -07:00
Adam Barth
a6b5293df9 Update iml files (#6300)
These changes were generated by IntelliJ.
2016-10-12 23:33:17 -07:00
Adam Barth
2c21d795a4 Deploy @checked (#6244)
This patch adds `@checked` everywhere is needed to remove the
`strong_mode_invalid_method_override` strong mode error.
2016-10-07 11:27:54 -07:00
Devon Carew
4c8b7b5d44 commit intellij project metadata (#6232)
* commit intellij project metadata

* move metadata to the top level

* delete dev/intellij
2016-10-06 17:43:52 -07:00
Ian Hickson
63e0fb1026 Prevent infinite loop in expect(). (#6203)
The only change here is that if we run off the end of the loop in a way
that previously would have just hung, we return silently.
2016-10-06 12:29:59 -07:00
Hans Muller
b329894b4d Added byTooltip() to CommonFinders (#6178) 2016-10-03 12:52:06 -07:00
Ian Hickson
9e673853e5 Turn off AnimationControllers when not in use (#5902)
This requires all AnimationController objects to be given a
TickerProvider, a class that can create the Ticker.

It also provides some nice mixins for people who want to have their
State provide a TickerProvider. And a schedulerTickerProvider for those
cases where you just want to see your battery burn.

Also, we now enforce destruction order for elements.
2016-09-26 10:57:10 -07:00
Adam Barth
c1a2967430 Use SDK sources to refer to our own packages (#6001)
Switch our pubspec.yamls to using SDK sources so that we can have consistent
source types when we depend on these packages from external packages using SDK
sources.
2016-09-22 20:39:35 -07:00
Devon Carew
8755e569ca suppress pub override warning; decouple the analyzer versions (#5991)
* suppress warning; decouple the analyzer versions

* also pass in --no-packages-dir
2016-09-22 07:40:38 -07:00
Chinmay Garde
400585cb96 Update flutter/http.dart to use dart:io. (#5940) 2016-09-20 14:17:33 -07:00
Phil Quitslund
2d4d171338 Roll to Dart SDK 1.20.0-dev.5.0. (#5911)
* Roll to Dart SDK `1.20.0-dev.5.0`.

* bumps to `1.20.0-dev.5.0`.
* updates `analyzer` API use.

* Add explicit types.
2016-09-16 16:30:34 -07:00
Phil Quitslund
fffde14f64 Update tools to use analyzer from vended Dart SDK. (#5900)
* Update tools to use `analyzer` from vended Dart SDK.

* updates `flutter_tools` and `flutter_test` to use the SDK-vended `analyzer` package
* tweaks dependency tracking logic to only record the SDK-vended `analyzer` so as not to crash on spurious conflicts (due to transitive dependencies)

* Review fixes.
2016-09-16 11:06:17 -07:00
Adam Barth
179ea4a0a6 Update framework to account from engine API changes (#5887)
The engine now reports coordinates in physical pixels.
2016-09-15 13:13:42 -07:00
Ian Hickson
5bc8888e7d Make tests more realistic (#5762)
Previously, pumpWidget() would do a partial pump (it didn't trigger
Ticker callbacks or post-frame callbacks), and pump() would do a full
pump. This patch brings them closer together. It also makes runApp run a
full actual frame, rather than skipping the transient callback part of
the frame logic. Having "half-frames" in the system was confusing and
could lead to bugs where code expecting to run before the next layout
pass didn't because a "half-frame" ran first.

Also, make Tickers start ticking in the frame that they were started in,
if they were started during a frame. This means we no longer spin a
frame for t=0, we jump straight to the first actual frame.

Other changes in this patch:

* rename WidgetsBinding._runApp to WidgetsBinding.attachRootWidget, so
  that tests can use it to more accurately mock out runApp.

* allow loadStructuredData to return synchronously.

* make handleBeginFrame handle not being given a time stamp.

* make DataPipeImageProvider.loadAsync protected (rather than private),
  and document it. There wasn't really a reason for it to be private.

* fix ImageConfiguration.toString.

* introduce debugPrintBuildScope and debugPrintScheduleBuildForStacks,
  which can help debug problems with widgets getting marked as dirty but
  not cleaned.

* make debugPrintRebuildDirtyWidgets say "Building" the first time and
  "Rebuilding" the second, to make it clearer when a widget is first
  created. This makes debugging widget lifecycle issues much easier.

* make debugDumpApp more resilient.

* debugPrintStack now takes a label that is printed before the stack.

* improve the banner shown for debugPrintBeginFrameBanner.

* various and sundry documentation fixes
2016-09-08 13:54:21 -07:00
Phil Quitslund
d2fda677e1 Update to Dart 1.20.0-dev.1.0. (#5689)
* Udpate to Dart `1.20.0-dev.1.0`.

Udpate to Dart `1.20.0-dev.1.0` and corresponding `analyzer` package.

* Added `--no-packages-dir`.

* Revert extension to master.

* Added ignores.

* Review nits.

* More nits.
2016-09-08 13:14:08 -07:00
Ian Hickson
99a9bbbe7c Add a test for 5630 (#5768)
This issue got fixed by a recent check-in, but I had a test specifically
for this incarnation so we should probably keep it just in case.

Closes https://github.com/flutter/flutter/issues/5630
2016-09-08 12:14:24 -07:00
Ian Hickson
1f15e06e45 Handle stateful widgets in layout builders. (#5752)
Previously, if a StatefulWidget was marked dirty, then removed from the
build, then reinserted using the exact same widget under a widget under
a LayoutBuilder, it wouldn't rebuild.

This fixes that.

It also introduces an assert that's supposed to catch SizeObserver-like
behaviour. Rather than make this patch even bigger, I papered over two
pre-existing bugs which this assert uncovered (and fixed the other
problems it found):

   https://github.com/flutter/flutter/issues/5751
   https://github.com/flutter/flutter/issues/5749

We should fix those before 1.0 though.
2016-09-07 14:45:19 -07:00
Ian Hickson
1152fd60f6 Adds tester.pumpUntilNoTransientCallbacks (#5696)
Fixes https://github.com/flutter/flutter/issues/5234
2016-09-01 12:42:38 -07:00
Ian Hickson
ea6bf4706a Fix the losing of state when pushing opaque routes (#5624)
Fixes https://github.com/flutter/flutter/issues/5283

Other changes in this patch:

Rename OffStage to Offstage.
Fixes https://github.com/flutter/flutter/issues/5378

Add a lot of docs.

Some minor punctuation and whitespace fixes.
2016-08-29 11:28:37 -07:00
Ian Hickson
17cdc88958 Improve our scroll physics on iOS (#5340)
Changes in this patch:
- iOS now uses a different scrollDrag constant than Android.
   - ScrollConfigurationDelegate now knows about target platforms.
   - ScrollBehaviors now know about target platforms.
   - RawInputLine now has to be told what platform it's targetting.
   - PageableList now has a concept of target platform.
- make debugPrintStack filter its stack.
   - move debugPrintStack to `assertions.dart`.
- add support for limiting the number of frames to debugPrintStack.
- make defaultTargetPlatform default to android in test environments.
- remove OverscrollStyle and MaterialApp's overscrollStyle argument. You
  can now control the overscroll style using Theme.platform.
- the default scroll configuration is now private to avoid people
  relying on the defaultTargetPlatform getter in their subclasses (since
  they really should use Theme.of(context).platform).
- fix some typos I noticed in some tests.
- added a test for flinging scrollables, that checks that the behavior
  differs on the two target platforms.
- made flingFrom and fling in the test API pump the frames.
- added more docs to the test API.
- made the TestAsyncUtils.guard() method report uncaught errors to help
  debug errors when using that API.
2016-08-11 11:31:30 -07:00
Phil Quitslund
0fe82c3a6f Update Dart SDK to 1.19.0-dev.4.0. (#5329) 2016-08-10 16:21:58 -07:00
Phil Quitslund
1fe118fe20 Merge pull request #5076 from pq/dart_1.19.0-dev.0.0
Update Dart (1.19.0-dev.0.0) and analyzer (0.27.4-alpha.19).
2016-07-27 13:04:54 -07:00
Adam Barth
c27a9e8292 Add offstage attribute to OffStage (#5059)
Also, add a few more debugging flags.
2016-07-27 12:26:07 -07:00
pq
13c3f9d946 Update Dart (1.19.0-dev.0.0) and analyzer (0.27.4-alpha.19). 2016-07-27 10:44:44 -07:00
YoungSeok Yoon
486b783076 Fix the documentation for find.byElementPredicate (#4935) 2016-07-25 12:23:00 -07:00
pq
cb4f01ae3d Bump Dart SDK to 1.18.0-dev.4.0.
Last dev push for `1.18`.
2016-07-06 14:43:40 -07:00
Adam Barth
5ed8f1a1fd Add semantics for Sliders (#4808)
Also, make SemanticsOwner into a real class and use it instead of a static in
several places.
2016-07-01 13:38:24 -07:00
pq
a417786d77 Update to latest analyzer (w/ cleanup).
Bye-bye `@protected `trampolines! :)
2016-06-30 10:39:45 -07:00
Adam Barth
2898768dde Add some missing docs (#4772)
These docs complete the dartdocs for their respective libraries.
2016-06-27 14:42:25 -07:00
Adam Barth
46da9e8498 Add a simple way of merging coverage data (#4726)
`flutter test` now has a `--merge-coverage` flag that can be used to merge
coverage data from previous runs, enabling faster iteration cycles.
2016-06-23 18:02:55 -07:00
Adam Barth
56039c0e64 Improve test coverage for animation.dart (#4718)
We now have 100% coverage of animation.dart and animation_controller.dart.
Also, add some basic tools for working with lcov files. These tools need much
more polish.
2016-06-23 13:43:42 -07:00
pq
352e2f573b Update to latest analyzer (0.27.4-alpha.14) and misc. analysis fixes.
* brings in analyzer version (`0.27.4-alpha.14`) corresponding to current Dart SDK (`1.18.0-dev.2.0`).
* updates analysis to use prefered API for embedder URI resolution
* adds trampolines to `State` and `StatelessWidget` to allow for warning-free within-library @protected access (needed since we closed off access to @protected closures from outside subclasses).
* turns off cache dependency tracking for analysis (in DDC this amounted to a 10% speed improvement).
2016-06-22 14:34:30 -07:00
Todd Volkert
2e48c1a1bb Simplify SystemChrome.setSystemUIOverlayStyle() (#4653)
* Only schedule overlay style update microtask if needed

* Simplify API
2016-06-21 08:28:29 -07:00
Devon Carew
415324f2f0 bump our dep on the test package (#4625)
* bump out dep on the test package

* add other pubspecs
2016-06-19 08:10:03 -07:00
pq
3e9067a4ec Dead code and switch cleanup (continued).
Prep to get us ready to pull in a new dev SDK and bump our analyzer DEP.

* updates `crypto` (required by fresh analyzer)
* fixes newly flagged dead code warnings
* fixes switches that fall through and don't return
2016-06-16 09:45:37 -07:00
pq
985a7b91cf Update analyzer dep to 0.27.4-alpha.9
Update analyzer dep to 0.27.4-alpha.9 to enjoy analyzer perf improvements (https://codereview.chromium.org/2011183004/) (and keep in sync with the SDK).

(This is a revisit to https://github.com/flutter/flutter/pull/4253.)
2016-05-31 06:59:56 -07:00
Adam Barth
d1cb026a65 Update engine and Mojo usage (#4258)
The new mojom.dart code makes mocking services a bit tricky. I've filed
https://github.com/domokit/mojo/issues/786 about improving that.
2016-05-28 18:28:21 -07:00
Adam Barth
c69cff9428 Update test package (#4198) 2016-05-25 17:45:23 -07:00
Adam Barth
b1b6271683 Use "call" instead of "invoke" (#4177)
For consistency.

Fixes #4142
2016-05-24 17:53:04 -07:00
Ian Hickson
390c7ce23f Use debugPrint instead of print in test lib (#4122) 2016-05-23 16:19:51 -07:00
Ian Hickson
b5c6da105c Port our microbenchmarks to the new world (#4121)
Our microbenchmarks now run on real devices.
2016-05-23 15:04:50 -07:00
Ian Hickson
06d80f22f0 Identify the widgets you tap on in live tests (#4079) 2016-05-20 14:21:38 -07:00
Ian Hickson
07719ad5ba Improve error reporting (#4025)
Don't suggest filing an issue when we can definitively say that the
assertion in question was not thrown from within the flutter package.
Fixes https://github.com/flutter/flutter/issues/3812.

Put the stack trace first after the message, with more details below the
stack trace, since the stack is often very useful and the stacks are no
longer stupidly long.

Better document the 'rescheduling' feature, and improve the error
handling asserts when it is misused.
Fixes https://github.com/flutter/flutter/issues/3888.

Improve the wording around the stack dump for exceptions during
callbacks.

Improve the color and font size of messages in live tests.
Fixes https://github.com/flutter/flutter/issues/4018.
2016-05-18 16:39:27 -07:00
Ian Hickson
ef563c485e Handle stack traces that don't give column numbers (#4016) 2016-05-18 12:34:43 -07:00
Ian Hickson
dacfdb64cf Track fake pointers in live test runs (#4011) 2016-05-18 12:09:39 -07:00
pq
addc888926 Update to new analyzer and linter.
Notably, this will allow us to play with

* the fixed `public_member_api_docs` that now checks for documented getters when checking setters (https://github.com/dart-lang/linter/issues/237), and
* the new `comment_references` lint that ensures identifiers referenced in docs are in scope (https://github.com/dart-lang/linter/issues/240).
2016-05-18 11:47:44 -07:00
pq
7163cf115d Revert "Update to new analyzer and linter."
This reverts commit f91cf1c450.
2016-05-18 11:45:25 -07:00
pq
f91cf1c450 Update to new analyzer and linter.
Notably, this will allow us to play with

* the fixed `public_member_api_docs` that now checks for documented getters when checking setters (https://github.com/dart-lang/linter/issues/237), and
* the new `comment_references` lint that ensures identifiers referenced in docs are in scope (https://github.com/dart-lang/linter/issues/240).
2016-05-18 11:44:43 -07:00
Ian Hickson
d2c8c82f4b Some cleanup of the test framework (#4001)
* Add a "build" phase to EnginePhase for completeness.
* Ignore events from the device during test execution.
* More dartdocs
* Slightly more helpful messages about Timers in verifyInvariants.
* Add widgetList, elementList, stateList, renderObjectList.
* Send test events asynchronously for consistency with other APIs.
* Fix a test that was depending on test events being synchronous (or
  rather, scheduled in a microtask that came before the microtask for
  the completer of the future that the tap() function returned).
2016-05-17 17:12:03 -07:00
Ian Hickson
f284c1a049 Fix tests (#3977)
Also, make sure that broken tests actually break the bots.

And add a test to make sure that keeps happening.
2016-05-17 12:45:37 -07:00
Ian Hickson
7d2519f073 Make it easier to disable print throttling. (#3941)
This exposes the default throttling implementation, and an alternative
non-throttling implementation, of `debugPrint`.
2016-05-16 13:24:06 -07:00
Ian Hickson
3252701753 Make it possible to run tests live on a device (#3936)
This makes it possible to substitute 'flutter run' for 'flutter test'
and actually watch a test run on a device.

For any test that depends on flutter_test:

1. Remove any import of 'package:test/test.dart'.

2. Replace `testWidgets('...', (WidgetTester tester) {`
      with `testWidgets('...', (WidgetTester tester) async {`

3. Add an "await" in front of calls to any of the following:
    * tap()
    * tapAt()
    * fling()
    * flingFrom()
    * scroll()
    * scrollAt()
    * pump()
    * pumpWidget()

4. Replace any calls to `tester.flushMicrotasks()` with calls to
   `await tester.idle()`.

There's a guarding API that you can use, if you have particularly
complicated tests, to get better error messages. Search for
TestAsyncUtils.
2016-05-16 12:53:13 -07:00
pq
eb215c14ac Review cleanup. 2016-05-05 15:16:27 -07:00
pq
71203e9a89 Analyzer dep commentary fix. 2016-05-05 12:15:26 -07:00
pq
a59a713f75 Analysis re-work to use analyzer APIs.
Introduces a new Dart analysis wrapper that works directly with the analyzer API (in favor of shelling out to a separate process).

Some consequences:

  * we no longer need to fear parts (simplifying our dart file gathering)
  * we can filter by error code (when needed), rather than by error strings
  * no more IO scraping
  * no need to generate `main()` or to run with `--package-warnings`
  * we now specify an analyzer (and linter) version in the pubspec (we’ll want to make sure this doesn’t diverge too far from the analyzer shipped with the SDK but it does give us some room to play with experimental builds)
  * no more (re)scanning of error source files (and so no more source cache)
  * should generally be a bit simpler and easier to maintain
  * runs a bit faster :)
2016-05-05 12:08:58 -07:00
Adam Barth
8da98105b4 Skip the gallery smoke test (#3736)
This test hangs occationally on the bots and the bots aren't smart enough to
recover, which means the whole project gets blocked.

Filed #3735 about the hang.
2016-05-04 13:42:29 -07:00
Ian Hickson
91dd969966 Refactor the test framework (#3622)
* 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
2016-04-29 13:23:27 -07:00
Devon Carew
50b1b16db6 rev test to 0.12.13+1 to support 1.17.0-dev dart sdks (#3613) 2016-04-28 12:56:55 -07:00
Adam Barth
b7fd5426b5 Enable avoid_as lint (#3612)
Related to #3608
2016-04-28 11:07:39 -07:00
Adam Barth
51b1550df7 Delay win-by-default in gesture arena (#3552)
Wait until the end of the microtask to tell gesture recognizers that
they've won in the gesture arena. This lets recognizers dispose reject
themselves at arbitrary times without triggering gestures in awkward
call stacks.

Fixes #3183
2016-04-26 14:52:31 -07:00
Devon Carew
86723ab99e Better devices text (#3519)
* improve text for devices

* nit

* tweak text
2016-04-25 10:14:38 -07:00
Ian Hickson
e968d91ca4 Rename binding abstract classes (#3482)
The old names were getting silly and started stepping on valuable namespace.

The new names are consistent and clear.
2016-04-21 17:18:46 -07:00
Ian Hickson
c167efca17 Minor widget_tester refactoring and docs (#3472)
This reorders some classes so that this file makes more sense, and adds
a bunch of docs. It also makes the following changes:

* Move allElements from Instrumentation to TestWidgets. (Instrumentation
  is going away.)

* Remove findElements.

* Rename byElement to byElementPredicate

* Rename byPredicate to byWidgetPredicate

* Implement _WidgetPredicateFinder so that byWidgetPredicate has good
  messages

* Fix one use of byElementPredicate to use byWidgetPredicate.
2016-04-21 16:35:46 -07:00
Ian Hickson
0e11b0e6e3 Make the widgets binding reusable. (#3479)
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.
2016-04-21 16:06:51 -07:00
Ian Hickson
b7af64ee50 Refactor TestGesture (#3461)
Moves TestGesture into test_pointer.dart and makes it more
self-contained.

This is part of a general refactoring of flutter_test.

Depends on https://github.com/flutter/flutter/pull/3459
2016-04-21 13:18:02 -07:00
Hans Muller
22e8d85d16 Enhance Finder toString() (#3458)
* Enhance Finder toString()
2016-04-21 12:13:51 -07:00
Adam Barth
248960a734 Add a route table to Material Gallery (#3457)
Use the route table to generate the list of screens to test in the smoke test.
2016-04-21 10:24:22 -07:00
Ian Hickson
112f2cc37b Reset _simulation at the end of a fling (#3435)
Also a bit of code cleanup.

The key part of this patch is the addition in `_endScroll` to reset
`_simulation`. It seems like this was the one place where it's possible
for us to end the animation but not reset our state. Since we assert
that are state is coherent, we were hitting asserts when a fling
finished and then you interacted with the widget again.
2016-04-20 11:02:20 -07:00
Hans Muller
c4ae13ed22 Refresh indicator (#3354) 2016-04-15 18:39:18 -07:00
Yegor
db2f66aab1 [test] make CommonFinders constructor private to disallow extensions (#3371) 2016-04-15 16:49:51 -07:00
Ian Hickson
e41c1c0b06 Split services/ into services/ and foundation/ (#3350)
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/.
2016-04-15 13:18:29 -07:00
Ian Hickson
0f1dee5f46 Always dump (unwanted) exceptions during tests (#3344)
...even if the test fails.
2016-04-15 09:38:04 -07:00
Yegor
f3a4f722c4 [flutter_test] new WidgetTester API based on finder objects (#3288) 2016-04-13 23:40:15 -07:00
Ian Hickson
7861d02943 Fix dependency skew. (#3306)
...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.
2016-04-13 13:53:39 -07:00
Devon Carew
8d02f304cf update styles for the generated dartdocs (#3276)
* styles updates for the api docs

* update library docs

* use the new --favion and --use-categories options for dartdoc
2016-04-12 13:08:57 -07:00
Adam Barth
d9b73a2b7a Improve docs about why we pin analyzer (#3254) 2016-04-12 12:42:14 -07:00
Adam Barth
65b36f131d Remove pub package version skew (#3212)
We need to pin the version of package:analyzer we use to avoid version skew
within our project.
2016-04-08 10:08:13 -07:00
Ian Hickson
ee703da9de Rationalise all our exception handling.
- 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.
2016-04-02 10:24:12 -07:00
Kris Giesing
9dfd5d4021 Part 2 of independent layout pipelines
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
2016-03-31 11:02:00 -07:00
Devon Carew
7b694ddd42 upgrade to test 0.12.13 2016-03-27 13:36:01 -07:00
Andrew Wilson
f90ccf4825 Add a callabck when a Draggable is dropped without being accepted. 2016-03-25 14:18:24 -07:00
Kris Giesing
bb5a82a726 Allow independent rendering pipelines
Fixes #2723
2016-03-24 14:59:21 -07:00
Hixie
797e27edd3 Add @override annotations to flutter framework 2016-03-14 14:02:26 -07:00
Adam Barth
95fc5ae070 [rename fixit] *Component* -> *Widget*
This patch renames StatelessComponent to StatelessWidget and
StatefulComponent to StatefulWidget.

Fixes #2308
2016-03-12 12:34:05 -08:00
Hixie
6795efacab Enable always_specify_types lint
And fix the zillion issues that uncovered.
2016-03-12 00:37:31 -08:00
Ian Hickson
43b0104114 Revert "Merge pull request #2639 from Hixie/always_specify_types"
This reverts commit f41b3411da, reversing
changes made to e33d8d9621.

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
2016-03-12 00:34:37 -08:00
Hixie
d162d98c79 Enable always_specify_types lint
And fix the zillion issues that uncovered.
2016-03-11 18:27:32 -08:00
Hixie
5810cd80bd Avoid 'as' keyword
It has performance implications in release mode.

We'll enable the lint once https://github.com/dart-lang/linter/issues/195 is fixed.
2016-03-09 15:00:55 -08:00
Adam Barth
0d7b0f9ec1 Test harness should check for running Timers and AnimationControllers
After running a widget test, we now clear out the widget tree and check that we
didn't leak any timers or animations.

Also, fix several bugs that this addtional check revealed.

Fixes #2481
2016-03-09 13:37:24 -08:00
Ian Hickson
826b13bde3 Include more details in the Red Box of Doom 2016-03-06 23:00:03 -08:00
krisgiesing
1655ca800a Merge pull request #2405 from krisgiesing/scaling_test
Add tests for AssetVendor and resolution-dependent image loading
2016-03-03 20:48:12 -08:00
Kris Giesing
390fcd9931 Fix code style 2016-03-03 17:07:14 -08:00
Kris Giesing
fca41bc2c5 Add tests for AssetVendor and resolution-dependent image loading
Fixes #2198
2016-03-03 16:51:42 -08:00
Adam Barth
41cdd600df Remove test dependency from package:flutter
The mojo_sdk has cleaned up its dependencies, so we no longer need to depend on
package:test from package:flutter.
2016-03-03 12:26:58 -08:00
Adam Barth
932b09c33a Merge pull request #2048 from abarth/test2
Switch from hack_load_vm_file_hook to PlatformPlugin
2016-03-03 12:11:53 -08:00
Adam Barth
96ec5316b8 Switch from hack_load_vm_file_hook to PlatformPlugin
This patch switches us from using our previous hacking approach to integrating
with package:test to using the new PlatformPlugin interface.
2016-03-03 11:23:36 -08:00
Adam Barth
00a00deffc Add a test for icon opacity crash
Fixes #2361
2016-03-03 10:33:57 -08:00
Hixie
f808055756 Remove size observers from scrollables.
Also:
 - add operator==/hashCode/toString to ViewportDimensions
 - add toString to BindingBase
 - add toString and debugFillDescription to ScrollBehavior
 - fix a bug in the RawGestureDetectorState's replaceGestureRecognizers
 - rename MixedViewport's onExtentsUpdate to onExtentChanged
 - replace ExtentsUpdateCallback with ValueChanged<double>
 - remove a microtask for dispatching scroll start, since it
   did not appear to have any purpose
 - added dartdocs to Instrumentation until I understood it
 - made all event dispatch in Instrumentation drain microtasks
2016-02-25 10:55:12 -08:00
Adam Barth
1484add104 Add TestGesture
This helper makes it easier to write correct tests that involve
gestures.

Fixes #1855
2016-02-21 14:32:58 -08:00
Ian Hickson
3eb1b412e0 Fix color of icons in drawers in dark theme.
This makes it match the material spec more.
https://www.google.com/design/spec/style/icons.html

Fixes https://github.com/flutter/flutter/issues/1357
2016-02-13 17:10:10 -08:00
Ian Hickson
a94999ba50 Clean up imports and exports.
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.
2016-02-11 00:06:23 -08:00
Adam Barth
b303e3db48 Move ServiceMocker into flutter_test
People writing their own tests will want to mock services as well.
2016-02-03 10:46:19 -08:00
Hans Muller
5ae1b41ca4 Added TwoLevelList 2016-01-21 16:27:18 -08:00
Eric Seidel
1bde1e7939 Generate docs for more of our packages
I also stopped pushing docs to domokit.org I presume we
were doing that to not break old links.  @abarth

@sethladd
2015-12-18 08:52:05 -08:00
Hixie
7a12d70df2 Fix build breakage 2015-12-14 14:31:56 -08:00
Eric Seidel
3053c0ad72 Split out Instrumentation logic from WidgetTester
This will allow writing tests/benchmark which want to use
the engine's default beginFrame and normal passage of time.

@Hixie
2015-12-14 13:54:15 -08:00
Ian Hickson
ade93651ac Refactor bindings. 2015-12-13 23:34:41 -08:00
Jason Simmons
cb6eef70e8 Upgrade the test package (needed by the latest mojo roll) 2015-12-10 16:25:12 -08:00
Eric Seidel
09894ec50b Add a test to stocks for changing the locale
I had to add a setLocale method to WidgetTester and
split the code in FlutterBinding which handled locale
changes to allow me to dispatch a locale change w/o actually
changing what the c++ code reports as the locale.

Also added the test to Travis.

@abarth @jason-simmons
2015-12-08 16:16:24 -08:00
Ian Hickson
f162555648 PointerInput refactor
Instead of PointerInputEvent having a "type" field, we now have a
different class for each pointer type.

This has ripple effects throughout the system.

I also did code cleanup in affected files while I was there.
2015-12-04 22:42:38 -08:00
Hixie
df07a69b12 Let MaterialApp.onGenerateRoute return a Route
Also:
 - minor code reindents in places.
 - reset the widget tree between tests.
 - once you generate a route, don't let its builder change
   (previously it would keep changing as the routes table changed).
 - revert the stocks app toolbar-fading-on-forward-transition thing.
2015-12-03 14:21:38 -08:00
Florian Loitsch
728211526a Rename some of the functions from the scheduler.
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.
2015-12-02 15:37:11 -08:00
Florian Loitsch
018bcbf2d9 Remove animation scheduler. 2015-12-01 20:36:52 -08:00
Adam Barth
f41869f639 Update package:test to the latest version 2015-11-30 18:41:10 -08:00
Adam Barth
58f056da68 Pin package:test to an exact revision
We use a number of non-public APIs in the test package, which makes our
dependency quite fragile. This patch pins a specific, known-good version. We
should update to the lastest version in a follow-up patch.
2015-11-24 09:22:11 -08:00
Adam Barth
727ce65ffc Add package:flutter_test
This package contains WidgetTester, which is very useful when writing tests for
widgets.
2015-11-23 14:09:12 -08:00