Commit graph

344 commits

Author SHA1 Message Date
Ian Hickson 1af253e313 Update versions post-alpha roll. (#9941) 2017-05-09 17:53:41 -07:00
Ian Hickson 9f1d5ba50e Rev versions for alpha cut (#9940)
And add a script to rev the versions.
2017-05-09 17:06:52 -07:00
Ian Hickson 127545a353 More doc fixes. (#9848) 2017-05-06 15:08:14 -07:00
P.Y. Laligand 8cef5232d5 Use the correct set of options to analyze Flutter packages. (#9758)
This affects the Fuchsia build which will soon run analysis by default.
2017-05-05 17:18:58 -07:00
Ian Hickson 2a2b760689 Unbreak the benchmarks API (#9852) 2017-05-05 16:07:03 -07:00
Ian Hickson c7469e005d Fix many dartdoc typos (#9822) 2017-05-04 19:54:06 -07:00
Ian Hickson cbfde9650d Appbar should update when you add a drawer. (#9755)
Also, I had a question about flutter_test matchers and our style guide
says that when I have a question I should update the docs so I did
that and then got a bit carried away.
2017-05-03 12:56:18 -07:00
Ian Hickson 30d4736900 Random dartdoc fixes (#9745) 2017-05-03 09:13:57 -07:00
Adam Barth ea96773fd1 Use horizontal dots on iOS menu button (#9722)
As required by
<https://material.io/guidelines/platforms/platform-adaptation.html#platform-adaptation-platform-recommendations>.
2017-05-02 10:38:50 -07:00
Ian Hickson e8c46927c4 Flush microtasks after transient callbacks are run. (#9702)
This splits the frame pipeline into two, beginFrame and drawFrame.

As part of making this change I added some debugging hooks that helped
debug the issues that came up:

 * I added debugPrintScheduleFrameStacks which prints a stack whenever
   a frame is actually scheduled, so you can see why frames are being
   scheduled.

 * I added some toString output to EditableText and RawKeyboardListener.

 * I added a scheduler_tester.dart library for scheduler library tests.

 * I changed the test framework to flush microtasks before pumping.

 * Some asserts that had the old string literal form were replaced by
   asserts with messages.

I also fixed a few subtle bugs that this uncovered:

 * setState() now calls `ensureVisualUpdate`, rather than
   `scheduleFrame`. This means that calling it from an
   AnimationController callback does not actually schedule an extra
   redundant frame as it used to.

 * I corrected some documentation.
2017-05-02 09:27:53 -07:00
Adam Barth 55f334681b FocusNode.requestFocus should show the keyboard (#9558)
This patch introduces the notion of a keyboard token, which generalizes the
logic in EditableText for distinguishing between gaining focus by default and
gaining focus because of an explicit use action.

Fixes #7985
2017-04-24 09:46:49 -07:00
Ian Hickson 0252622869 Promote Layer to full AbstractNode status (#9456) 2017-04-19 10:04:58 -07:00
Mikkel Nygaard Ravn 945cfc3ee2 Make naming consistent across channel APIs (#9270) 2017-04-18 15:23:15 +02:00
Phil Quitslund fc58bd7679 IntelliJ metadata cleanup (flutter-intellij#914). (#9427)
Follow-up from #9422
2017-04-17 13:42:31 -07:00
Hans Muller 80a8c5629e WidgetTester enterText() and showKeyboard() can specify an EditableText ancestor (#9398) 2017-04-14 15:41:30 -07:00
Devon Carew 9493df2da8 update the IntelliJ metadata files (#9388) 2017-04-14 08:55:26 -07:00
Ian Hickson 00dfa224d1 Be more consistent about how stack traces are output from flutter_test (#9361) 2017-04-13 12:31:04 -07:00
Ian Hickson bf017b79b3 Move Point to Offset (#9277)
* Manually fix every use of Point.x and Point.y

Some of these were moved to dx/dy, but not all.

* Manually convert uses of the old gradient API

* Remove old reference to Point.

* Mechanical changes

I applied the following at the root of the Flutter repository:

git ls-files -z | xargs -0 sed -i 's/\bPoint[.]origin\b/Offset.zero/g'
git ls-files -z | xargs -0 sed -i 's/\bPoint[.]lerp\b/Offset.lerp/g'
git ls-files -z | xargs -0 sed -i 's/\bnew Point\b/new Offset/g'
git ls-files -z | xargs -0 sed -i 's/\bconst Point\b/const Offset/g'
git ls-files -z | xargs -0 sed -i 's/\bstatic Point /static Offset /g'
git ls-files -z | xargs -0 sed -i 's/\bfinal Point /final Offset /g'
git ls-files -z | xargs -0 sed -i 's/^\( *\)Point /\1Offset /g'
git ls-files -z | xargs -0 sed -i 's/ui[.]Point\b/ui.Offset/g'
git ls-files -z | xargs -0 sed -i 's/(Point\b/(Offset/g'
git ls-files -z | xargs -0 sed -i 's/\([[{,]\) Point\b/\1 Offset/g'
git ls-files -z | xargs -0 sed -i 's/@required Point\b/@required Offset/g'
git ls-files -z | xargs -0 sed -i 's/<Point>/<Offset>/g'
git ls-files -z | xargs -0 sed -i 's/[.]toOffset()//g'
git ls-files -z | xargs -0 sed -i 's/[.]toPoint()//g'
git ls-files -z | xargs -0 sed -i 's/\bshow Point, /show /g'
git ls-files -z | xargs -0 sed -i 's/\bshow Point;/show Offset;/g'

* Mechanical changes - dartdocs

I applied the following at the root of the Flutter repository:

git ls-files -z | xargs -0 sed -i 's/\ba \[Point\]/an [Offset]/g'
git ls-files -z | xargs -0 sed -i 's/\[Point\]/[Offset]/g'

* Further improvements and a test

* Fix minor errors from rebasing...

* Roll engine
2017-04-12 15:06:12 -07:00
Ian Hickson 2a54524337 Fix tests to use Ahem, and helpful changes around that (#9332)
* Fix tests to use Ahem, and helpful changes around that

- Fix fonts that had metric-specific behaviours.

- LiveTestWidgetsFlutterBinding.allowAllFrames has been renamed
  to LiveTestWidgetsFlutterBinding.framePolicy.

- LiveTestWidgetsFlutterBinding now defaults to using a frame policy
  that pumps slightly more frames, to animate the pointer crosshairs.

- Added "flutter run --use-test-fonts" to enable Ahem on devices.

- Changed how idle() works to be more effective in live mode.

- Display the test name in live mode (unless ahem fonts are enabled).

- Added a toString to TextSelectionPoint.

- Style nit fixes.

* Roll engine to get Ahem changes.

* Update tests for dartdoc changes.

* Fix flutter_tools tests
2017-04-12 13:33:02 -07:00
xster 89a7fdfc56 Rename State.config to widget everywhere (#9273)
Rename State.config to State.widget
Rename State.didUpdateConfig to State.didUpdateWidget
Renamed all State subclasses' local variables named config to something else
2017-04-10 18:32:24 -07:00
Ian Hickson 3eb87830e9 Constants! Constants everywhere! (#9286)
Aggressively apply the const lint.
2017-04-07 12:24:32 -07:00
Ian Hickson e355c60124 Add a timeout to pumpAndSettle. (#9195) 2017-04-05 12:27:42 -07:00
Adam Barth 0b31c69963 Make it possible to center the text in a TextField (#9140)
Also, fix an issue where hint text wasn't visible when the
InputDecoration was collapsed.

Fixes #8541
2017-04-01 23:11:18 -07:00
Alexandre Ardhuin 2de61a0853 add @required when there's an assert not null (#9124)
* add @required when there's an assert not null

* address review comments
2017-03-31 18:34:13 +02:00
Ian Hickson d709f18cd2 Do not swallow exceptions in guarded functions. (#9064) 2017-03-30 09:50:30 -07:00
Alexandre Ardhuin 4c530d5e8c prefer_final_fields (#8967) 2017-03-29 21:21:46 +02:00
Adam Barth d443d598c2 Align TextEditingValue and InputValue (#8922)
This patch prepares us to remove InputValue in favor of TextEditingValue.
2017-03-20 17:18:35 -07:00
Adam Barth 142922deb4 Add WidgetTester.hasRunningAnimation (#8886)
Fixes #4017
2017-03-20 13:32:00 -07:00
Adam Barth 5cf04b6141 Rename ImageFit to BoxFit (#8871)
This machinery is useful for arbitrary boxes (e.g., with FittedBox).

Fixes #6463
2017-03-17 15:21:55 -07:00
Mikkel Nygaard Ravn dce4bf8599 Remove old platform messaging API (#8837)
Breaking change: removed deprecated methods of PlatformMessages, leaving only binary messaging there. All other use of platform communication now goes through PlatformMessageChannel and PlatformMethodChannels. Retained use of String and JSON codecs for now.

Companion engine PR: flutter/engine#3482
2017-03-17 11:56:50 +01:00
Alexandre Ardhuin 2166ea5b7f apply partially the upcoming unnecessary_lambdas (#8810) 2017-03-15 23:09:58 +01:00
Alexandre Ardhuin a9ba0e2f88 prefer_initializing_formals (#8797) 2017-03-15 18:30:55 +01:00
Ian Hickson 8eac6cd0da Test API improvements: pumpAndSettle, autogenerate pointer IDs (#8751) 2017-03-13 16:27:15 -07:00
Alexandre Ardhuin 16d800b204 normalize setter format (#8708) 2017-03-10 21:52:30 +01:00
Alexandre Ardhuin c22812e0ea Flutter style guide: Prefer naming the argument to a setter 'value' (#8691) 2017-03-10 09:00:29 +01:00
Ian Hickson 68fb3e4868 Farewell, local fork of the http package. (#8642) 2017-03-07 18:08:36 -08:00
Ian Hickson 944ee24b94 Report GlobalKey duplicates (#8593) 2017-03-07 17:17:02 -08:00
Chris Bracken 895f3e6350 Declare locals final where not reassigned (flutter_test) (#8569) 2017-03-03 17:51:01 -08:00
Phil Quitslund a002e72022 Bump to test 0.12.20. (#8349)
* Bump to test `0.12.20`.

Some test `0.12.20` highlights:
  * introduces `expectLater()`  that returns a `Future` that completes when the matcher has finished running
  * deprecates the `verbose` parameter to `expect()` and the `formatFailure()` (to be removed in `0.13.0`)

Otherwise:
  * to keep up w/ the deprecation of `verbose`, removes `widget_tester` API to pass `verbose` flag (alternatively we could suppress the warning for now)

* Update stack manipulation.

* Fix framecount.
2017-02-23 15:08:25 -08:00
Alexandre Ardhuin 8c043d06de fix lints for directives_ordering rule (#8382) 2017-02-23 13:37:26 -08:00
Alexandre Ardhuin da925c7d71 Replace @checked with covariant (#8300)
Fixes #7734
2017-02-21 09:30:22 -08:00
Todd Volkert c233f38291 Update package:test dependencies to 0.12.18+2 (#8247) 2017-02-17 17:35:11 -08:00
Phil Quitslund c458fb9d2c Bump Dart SDK to 1.23.0-dev.0.0 (#8222)
* ups pinned `test` to `0.12.15+9` (to play nice w/ the latest analyzer)
* integrates `analyzer` with analysis driver defaulting to ON
2017-02-16 16:50:35 -08:00
Hans Muller 2d62d1b88d Test hero midflight reversals (#8161) 2017-02-14 16:03:32 -08:00
Ian Hickson c67575703c Improve testing of the RefreshIndicator widget. (#8111) 2017-02-13 16:31:20 -08:00
Adam Barth 4e95701541 Switch TabBarView to PageView (#7982)
Tabs are now fully driven by slivers.
2017-02-08 14:55:18 -08:00
Hans Muller af587a154f Support for tests that respond to text input (#7915) 2017-02-07 14:54:18 -08:00
zhenqiu1101 47666af54c Add find.descendant API to support find descendants of an element by passing the current element finder and the finder of descendant. (#7944)
* Add find.descendant API to support find descendants of an element by passing the current element and the finder of descendant.

* Add find.descendant API to support find descendants of an element by passing the current element finder and the finder of descendant.

* Add find.descendant API to support find descendants of an element by passing the current element finder and the finder of descendant.

* Add find.descendant API to support find descendants of an element by passing the current element finder and the finder of descendant.

* Add find.descendant API to support find descendants of an element by passing the current element finder and the finder of descendant.

* Add find.descendant API to support find descendants of an element by passing the current element finder and the finder of descendant.

* Add find.descendant API to support find descendants of an element by passing the current element finder and the finder of descendant.

* Add find.descendant API to support find descendants of an element by passing the current element finder and the finder of descendant.

* Add find.descendant API to support find descendants of an element by passing the current element finder and the finder of descendant.

* Add find.descendant API to support find descendants of an element by passing the current element finder and the finder of descendant.

* Add find.descendant API to support find descendants of an element by passing the current element finder and the finder of descendant.
2017-02-07 14:46:29 -08:00
Ian Hickson be7be2b8b6 Test service extensions (#7849)
...and fix bugs that the tests uncovered.

WRITE TEST FIND BUG
2017-02-03 13:55:07 -08:00
Ian Hickson 5928d221d4 ShrinkWrap Viewport (#7790) 2017-02-02 14:50:04 -08:00
Michael Goderbauer 40aab7f553 Bump Dart SDK to 1.22.0-dev.10.3 (#7791) 2017-02-01 16:33:27 -08:00
Adam Barth 134096022c Test PaginatedDataTable (#7594)
This patch contains some basic tests for PaginatedDataTable.
2017-01-23 21:36:42 -08:00
Ian Hickson 63aa1397a3 Increase the strictness of our requiring explicit types (#7585)
...now that we have generic methods, their types need to be specified too.
2017-01-23 01:04:31 -08:00
Ian Hickson 15a7eb3b6c Move to real generic method syntax (#7235) 2017-01-21 20:58:44 -08:00
Michael Goderbauer 394a736984 Roll engine to b3ed79122edd7172327ce415688ef674d6a7fa5d (#7476)
fixes #7433
2017-01-12 18:56:43 -08:00
Adam Barth 3c33bb4697 Add some more framework.dart tests (#7469) 2017-01-12 15:08:16 -08:00
Adam Barth 8f708bfbc1 Test AboutDrawerItem (#7453)
Also, fix a few minor bugs found by the test.
2017-01-11 18:38:03 -08:00
Yegor 0c7a9da98f microbenchmarks: single-line JSON; consolidate #7433 workaround (#7450)
- output single-line JSON because iOS 9.x cannot output more than one line
- move the workaround for #7433 into LiveTestWidgetsFlutterBinding so that it works in all cases (e.g. animation_bench.dart on iOS)
2017-01-11 14:29:21 -08:00
Adam Barth 2ee04c92bf Improve test coverage (#7430)
Also, make the exception handling for global key listeners slightly more
robust.
2017-01-10 20:41:42 -08:00
Ian Hickson 79c8e5c7c7 Add a toString to Simulation (#7364)
Also, make hasOneLineDescription more discerning.
Also, add a test for hasOneLineDescription.
Also, add a test for GravitySimulation, to test the toString.
2017-01-05 16:33:40 -08:00
Ian Hickson e08c3c3bdc moreOrLessEquals matcher for floating point numbers (#7358)
```dart
expect(x, moreOrLessEquals(0.0));
```

...for those cases where `x` might be 1e-11 or whatever.

Also, be more resilient when dumping the tree from inside the test framework.
Also, add an assert that helped me debug something the other day.
2017-01-05 14:51:01 -08:00
Adam Barth cd09370c13 Update quiver (#7349) 2017-01-05 12:45:10 -08:00
Adam Barth 86e5fce61a Tooltip update can cause assert (#7338)
We were trying to update the tooltip overlay entry, but that cannot work
because the overlay entry might have already built. Instead, we keep the
old value.

Fixes #7151
2017-01-04 16:08:29 -08:00
Hans Muller 440ddef69e Regression tests should verify that debug are not set (#7090) 2016-11-29 15:17:51 -08:00
Adam Barth 7c795d5fdd Update iml files (#7025)
These now match what 2016.3 expects.
2016-11-27 07:46:54 -08:00
Ian Hickson 9c1a24fa72 Reexport meta from foundation. (#6938) 2016-11-18 21:22:32 -08:00
Adam Barth a4a783b64f Add support for pointer hover (#6884) 2016-11-15 21:13:37 -08:00
Ian Hickson bf2c46e263 Fix the ignore identifiers (#6876)
I used the wrong identifiers here.
2016-11-15 16:52:58 -08:00
Ian Hickson 9cfde14762 Silence more new analyzer warnings (#6874)
See #6861
2016-11-15 14:24:01 -08:00
Ian Hickson 2b84d1ff1b Silence new analyzer warnings (#6866)
See https://github.com/flutter/flutter/pull/6861

This silences all but two of the warnings from https://travis-ci.org/flutter/flutter/builds/176055550

One of the silenced warnings was a genuine code error.

Some of the others were correct but there was no way for the analyzer to know, and I worked around them.

The remainder are problems with the analyzer, specifically https://github.com/dart-lang/sdk/issues/27827 and https://github.com/dart-lang/sdk/issues/27504.
2016-11-15 12:35:50 -08:00
Dan Rubel 34e466f1fd Refactor flutter command exit code - part 3 of 3 (#6838)
* Remove the workaround that pinned args to v0.13.6
This reverts most of the changes in commit 6331b6c8b5
* throw exception if exit code is not an integer
* rework command infrastructure to throw ToolExit when non-zero exitCode
* convert commands to return Future<Null>
* cleanup remaining commands to use throwToolExit for non-zero exit code
* remove isUnusual exception message
* add type annotations for updated args package
2016-11-14 14:21:30 -05:00
Andrew Wilson fa18423ccb Add BUILD.gn for flutter_test. (#6823) 2016-11-11 14:16:12 -08:00
Dan Rubel 6331b6c8b5 revert args to 0.13.6 (#6765) 2016-11-08 17:15:11 -05:00
Matt Perry b9bff6a912 Only show the keyboard when the user explicitly focuses an Input. (#6713)
Fixes https://github.com/flutter/flutter/issues/6603
2016-11-08 14:14:15 -05:00
Adam Barth 67f591000f Mentions flutter packages get rather than pub get (#6625)
Fixes #6417
2016-11-01 13:27:06 -07:00
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