Commit graph

344 commits

Author SHA1 Message Date
Todd Volkert 2ba0deb77a
Make runAsync() run in child zone, not root zone (#17359)
Some APIs (such as the ones in package:test) assume you're running
in a child zone of the test zone by attempting to extract information
from the zone values. When we run runAsync() in the root zone, those
zone values are lost, and such API methods don't work.

The solution is to run in a child zone, but with a specification that
says to use the Root zone for task scheduling (both timers and
microtakss).
2018-05-07 18:33:44 -07:00
Todd Volkert 52e4605677
Golden file fixes (#17299)
1. Make goldenFileComparator getter return `null` if it's set to the
   uninitialized comparator, which matches the behavior of the setter
   (it sets it to the uninitialized comparator if the caller specifies
   `null`).
2. Make the uninitialized comparator return trivial success (and print
   a message) when asked to compare as opposed to throwing. This ensures
   that the comparator will play nicely with live widget bindings
3. Augment documentation
4. Add assert that test doesn't modify the value of `autoUpdateGoldenFiles`
2018-05-07 11:33:41 -07:00
Michael Goderbauer 7984f6e043
Implicit a11y scrolling for iOS (and caching in Viewports) (#17021) 2018-05-04 10:48:06 -07:00
Todd Volkert be09a200ee
Expose generateTestBootstrap() as public API in test harness (#17290)
This will allow external tools that wrap our test harness to share the
code that generates the test bootstrap.

This change exposed an issue whereby the LocalGoldenFileComparator
was being too strict in its URI handling, so this changes relaxes
that constraint as well (and adds associated tests).
2018-05-04 10:31:53 -07:00
Todd Volkert c8908ff0e2
Follow-on work to goldens (#17267)
* Exclude flutter_goldens package from dartdoc because it's for internal
  use only
* Document why flutter_tools doesn' tneed to be excluded from the list of
  packages to document
* Performance optimization in the flutter comparator, and associated
  test updates.
2018-05-03 17:47:50 -07:00
Todd Volkert 65079ad5f2
Add Flutter-repo-specific golden comparator (#17205)
In order to avoid checking binaries into flutter/flutter,
this comparator can be used to retrieve golden files from
a sibling flutter/goldens repository.

https://github.com/flutter/flutter/issues/16859
2018-05-03 07:39:41 -07:00
Todd Volkert 28c1973340
Add support for flutter_test_config.dart (#17141)
This enables support for a `flutter_test_config.dart` configuration file,
which will be discovered and handed the responsibility of running the
test file (thus allowing it to run pre-test setup on a project level).

https://github.com/flutter/flutter/issues/16859
2018-05-01 12:36:22 -07:00
Todd Volkert b2c67e88d4
Make Layer.toImage() accept bounds rather than size (#17129)
It allows callers to account for things like shadows that paint
outside the bounds of the widget.

https://github.com/flutter/flutter/issues/16859
2018-04-30 15:26:17 -07:00
Todd Volkert e19db89a0e
Add basic support for golden image file testing (#17094)
* Add a `matchesGoldenFile()` async matcher that will match
  a finder's widget's rasterized image against a golden file.
* Add support for pluggable image comparison backends
* Add a default backend that does simplistic PNG byte
  comparison on locally stored golden files.
* Add support for `flutter test --update-goldens`, which will
  treat the rasterized image bytes produced during the test
  as the new golden bytes and update the golden file accordingly

Still TODO:

* Add support for the `flutter_test_config.dart` test config hook
* Utilize `flutter_test_config.dart` in `packages/flutter/test`
  to install a backend that retrieves golden files from a dedicated
  `flutter/goldens` repo

https://github.com/flutter/flutter/issues/16859
2018-04-30 10:35:56 -07:00
Todd Volkert dedd180f9f
Fix expectLater to not wrap the delegate in a guard (#17085)
Follow-up to https://github.com/flutter/flutter/pull/17063

https://github.com/flutter/flutter/issues/16859
2018-04-30 10:05:04 -07:00
Todd Volkert 8860627b63
Add WidgetTester.runAsync() (#17029)
This will allow callers to run real async code within a widget test.

https://github.com/flutter/flutter/issues/16859
2018-04-28 15:14:46 -07:00
Todd Volkert 8b99d1d83c
Add expectLater to flutter_test (#17063)
* Wrap `expectLater()` in flutter_tester so that callers can
  wait for the matcher to complete in their tests

https://github.com/flutter/flutter/issues/16859
2018-04-28 13:54:08 -07:00
Todd Volkert f408bb06f9
Update dependencies (#16442) 2018-04-10 14:27:53 -07:00
Jacob Richman 660408edd6
Switch to the new Matrix4.tryInvert method to avoid throwing and catching (#15771) exceptions while performing hit testing. 2018-04-09 10:32:22 -07:00
Jonah Williams 5125c43247
re-enable verify only test failure and update deps. (#16090)
* re-enable verify-only failing test for out of sync deps and update deps to latest version
2018-04-04 10:52:46 -07:00
Anatoly Pulyaevskiy 78434580d2 Upgrade quiver to 0.28.1 in flutter_test to fix usage of Maps (#16132) 2018-04-02 22:26:49 -07:00
Andrew Davies 72fd020a24
[fuchsia_remote_debug_protocol] Adds the fuchsia remote debug protocol package.
Adds a package that will support connecting to and debugging devices with multiple instances of the Dart VM, and operate on multiple Isolates and Flutter Views.

Currently supports connecting to all existing Dart VMs and extracting information about all Flutter Views running across each VM.
2018-03-22 17:19:02 -07:00
Jonah Williams 88cc977384
Remove package:http from Flutter (#15416)
* use HttpOverrides and dart:io HttpClient in flutter

* add missing package:http dependency

* update flutter packages and remove comment about createHttpClient from flutter_test

* move byte loading logic to common class, move string parsing logic to base class

* addAll doesn't work for a Uint8List

* use bytes.setRange

* undo addition to hello_world

* add newline to end of binding.dart

* and a newline for hello world

* refactor to function and add tests

* address comments on unknown length case

* alignment

* sort alaphabetically

* rename convertResponse to consolidateClientHttpClientResponseBytes.  Add header

* fix alignment in test
2018-03-22 08:21:01 -07:00
Jonah Williams ad9506d25a
Traverse dependencies and dev dependencies separately (#15581)
* traverse dependencies and dev dependencies separately

* separate dev and reg deps

* update pubspecs

* add checksum string and update transitive dep string.  Add additional verify command to check checksum

* cleanup comments

* add missing space, quote, run verify-onlu from bot script

* rerun tool with fixed string

* ensure correct working directory and bump versions

* flutter not flutterRoot
2018-03-20 20:03:32 -07:00
xster d8f360717f
Add a way to generically go back on both Material and Cupertino scaffold pages (#15602)
* Add a way to generically go back on both Material and Cupertino scaffold pages

* review

* lint

* review

* Fix text assert text
2018-03-19 16:57:05 -07:00
Yegor 9c49255f3e
a11y: remove SemanticsSortOrder; sort locally only; semanticsOwner post-test check (#15537)
* a11y: remove SemanticsSortOrder; sort locally only; semanticsOwner post-test check

* update accessibility test framework

- default nextNodeId/previousNodeId to -1
- stop treating null as opt-out from value testing
- add `id`, `TestSemantics.root`, and `tags` to the suggested code in the TestSemantics failure message
- fix a small bug with raw string escaping
- update all tests accordingly

* fix sortKey doc

* prefer const over final
2018-03-18 22:18:52 -07:00
Alexander Aprelev e23a658685
Rev dependencies up and regenerate stock_messages. (#15469)
This fixes https://github.com/flutter/flutter/issues/15458.
2018-03-12 17:46:26 -07:00
Alexander Aprelev 2f8474f9aa
Roll engine to b6df7a637498ca9beda1fa9cd7210e3202ea599f. (#15444)
* Roll engine to b6df7a637498ca9beda1fa9cd7210e3202ea599f.

Changes since last roll:
```
b6df7a637 Roll dart to 290c576264faa096a0b3206c71b2435309d9f904. (#4771)
a6764dbd5 Add sources for Fuchsia target. (#4763)
2d5900615 [fuchsia] Remove unused header file. (#4769)
9717063b7 Revert "Roll dart to c080951d45e79cd25df98036c4be835b284a269c. (#4767)" (#4768)
9a9814312 Roll dart to c080951d45e79cd25df98036c4be835b284a269c. (#4767)
e74e8b35c [async] Update includes of async headers to new path (#4760)
e2c4b2760 Use Dart 2 camel case constants in the engine Dart libraries (#4766)
9c1e48434 Updates for Fuchsia roll. (#4765)
14c940e27 Switch from fxl::Mutex to std::mutex (#4764)
debf82c0b Roll Garnet (#4759)
5bffdefbb Use weak pointers to the accesibility bridge from objects vended to the UIKit accessibility framework. (#4761)
```
2018-03-12 15:44:25 -07:00
P.Y. Laligand c0118ea4b9
Leave source list empty for Fuchsia targets. (#15337) 2018-03-12 15:38:32 +01:00
Alexander Aprelev ded538a1bb
Update dependencies with forced upgrade. (#15344)
* Update dependencies with forced upgrade.

Now that https://github.com/flutter/flutter/issues/15261 is fixed, do the update with upgrade.

* Update test package use following upgrade

* Replace addOption(allowMultiple) with addMultiOption
2018-03-09 10:38:54 -08:00
Alexander Aprelev 1a3c9b83c0
Step process, boolean_selector, collection deps up. (#15262)
This is needed to fix 'flutter test --preview-dart-2 test/all.dart' in dev/devicelab
2018-03-08 11:07:03 -08:00
P.Y. Laligand 8709e5e71f
[fuchsia] Add explicit sources to a few targets. (#15182) 2018-03-05 18:03:09 -08:00
Yegor 973742fe96
[flutter_test] more docs, tests for within; simpler _sizeDistance (#15084)
Document missing value types supported by `within`. Add missing tests. Simplify _sizeDistance implementation.
2018-03-02 15:44:58 -08:00
Jason Simmons 44592238bb
Roll engine to 33b88173f3820690169348859bbdc29133179e0b (#14832)
libtxt is now the default text renderer
2018-02-26 11:39:48 -08:00
Jason Simmons 7f03b9e41b
Upgrade to test package version 0.12.30+4 (#14853)
30+4 has made some changes to the remoting protocol that are incompatbile
with a test harness running 30+3 (e.g. adding a type='initial' field to the
first message)
2018-02-23 12:49:57 -08:00
Alexander Aprelev a448994543
Use the Dart SDK built from Flutter engine rather than from dartlang.org (#14610)
* Use engine-built dart sdk

* Download dart-sdk from engine

* Move up deps to fix dart sdk constraint problem

* Update update_dart_sdk.ps1 for Windows

* Fix tests so they pass analysis

* More types for tests

* Roll engine

* Update dart sdk stamp location in flutter.bat

* Add newline
2018-02-14 07:18:25 -08:00
Vyacheslav Egorov f5bbc5bb76
Upgrade packages (#14588)
We need to pull in Dart 2 compliant mockito

Fixes #14532
2018-02-09 11:16:58 +01:00
Greg Spencer df791279ab
Fix process running during package creation (#14508)
There were some problems I introduced with the last PR for this. It passed the test, but failed in practice.

This adds tests for those failure cases, adds a "--help" and fixes the test so that it doesn't try and actually download MinGit as part of the Windows test.

I added package:platform as a dependency, so I did a force upgrade on the packages.

Also, re-enabling 'create package' in the cache warming code, now that #14448 is fixed.
2018-02-07 12:21:14 -08:00
amirh 0da6bad656
add a matcher for area covered by paths (#14469) 2018-02-06 09:13:51 -08:00
Alexandre Ardhuin 2e80bf1db7
unnessary parenthesis (#14475) 2018-02-06 09:00:11 +01:00
Alexandre Ardhuin 3c379aaf43
whitespace cleanup (#14458) 2018-02-05 22:20:21 +01:00
Alexandre Ardhuin c02b6a8bcf
some whitespace cleanup (#14443) 2018-02-02 23:27:29 +01:00
Alexandre Ardhuin 12ceaefb18
work around const lints (#14416)
* work around const lints

* update nonconst doc
2018-02-02 08:06:42 +01:00
Alexandre Ardhuin 841d5d7bd5
prefer_const_declarations on local variables (#14358) 2018-02-01 07:51:26 +01:00
amirh 0672055a72
Support arbitrary shaped Material. (#14367)
For backward compatibility we keep supporting specifying the shape as a
combination of MaterialType and borderRadius, and we just use that as a
default when shapeBorder is null.

To cleanup the implementation if shapeBorder was not specified we just
translate the specified shape to a shapeBorder internally.
I benchmarked paint, layout and hit testing, with the specialized shape
clippers vs. the equivalent path clippers and did not see any
significant performance difference.

For testing, I extended the clippers/physicalShape matchers to match either the
specialized shape or the equivalent shape.
2018-01-30 23:24:42 -08:00
Vyacheslav Egorov 340d9e00cf
Fix various strong mode issues. (#14284) 2018-01-31 08:21:32 +01:00
amirh 178ad8aba8
Add unit tests for the Material widget (for clipping and elevation) (#14334) 2018-01-30 12:54:52 -08:00
Vyacheslav Egorov c23509e9fd
Unpin test and upgrade packages (#14282)
* Unpin package:test and upgrade packages

* Update packages/flutter/test/foundation/stack_trace_test.dart

* Also add packages/flutter_tools/test/data/asset_test/font/.dartignore to ensure that update-packages --force-upgrade does not crash.
2018-01-26 10:40:03 -08:00
Alexandre Ardhuin 10f721c8a5
use const instead of final with const declarations (#14253) 2018-01-25 19:28:22 +01:00
Sam Rawlins 7ffcce84a2 Bump async, http, and vm_service_client packages (#14136) 2018-01-19 14:59:16 -08:00
Ian Hickson 9e42e4b88f
New release process (#14061)
Generate the "version" file from git tags.
Remove the old VERSION file and mentions of versions in pubspec.yaml files.
Replace the old update_versions.dart script with a new roll_dev.dart script.
Update "flutter channel".
Update "flutter upgrade", including making it transition from alpha to dev.
Update "flutter --version" and "flutter doctor".
2018-01-18 07:59:06 -08:00
Ian Hickson 2908997b0e
Dump exceptions live when they happen when testing tests with flutter run (#14102)
* Dump exceptions live when they happen when testing tests with flutter run.

* Update binding.dart
2018-01-17 09:06:43 -08:00
Sam Rawlins e8b666249a Bump collection dependency to 1.14.5 (#14048) 2018-01-12 14:33:26 -08:00
Alexandre Ardhuin 0fe1e5bf5b
apply upcoming lint prefer_const_literals_to_create_immutables (#14029) 2018-01-11 08:38:55 +01:00
Leaf Petersen ab874da7be
Roll Dart SDK to 2.0.0-dev.16.0, along with associated package updates (#13857)
Rolling the Dart SDK to 2.0, with associated package updates.  

https://groups.google.com/forum/#!topic/flutter-dev/E22RdKAYjs8
2018-01-10 14:31:28 -08:00