This adds the ability to define variants of tests with different environmental values for a particular testWidgets test.
This allows you to run the same test multiple times with a different test environment. One test variant has been implemented that allows running a test with different settings of the TargetPlatform.
* Update project.pbxproj files to say Flutter rather than Chromium
Also, the templates now have an empty organization so that we don't cause people to give their apps a Flutter copyright.
* Update the copyright notice checker to require a standard notice on all files
* Update copyrights on Dart files. (This was a mechanical commit.)
* Fix weird license headers on Dart files that deviate from our conventions; relicense Shrine.
Some were already marked "The Flutter Authors", not clear why. Their
dates have been normalized. Some were missing the blank line after the
license. Some were randomly different in trivial ways for no apparent
reason (e.g. missing the trailing period).
* Clean up the copyrights in non-Dart files. (Manual edits.)
Also, make sure templates don't have copyrights.
* Fix some more ORGANIZATIONNAMEs
* Add structured errors in Animations, TabView, ChangeNotifier
* Add structured error on MaterialPageRoute, BoxBorder, DecorationImagePainter, TextSpan
* Add structured errors in Debug
* Fix test errors
* Add structured errors in Scaffold and Stepper
* Add structured errors in part of Rendering Layer
* Fix failing test due to FloatingPoint precision
* Fix failing tests due to precision error and not using final
* Fix failing test due to floating precision error with RegEx instead
* Add structured error in CustomLayout and increase test coverage
* Add structured error & its test in ListBody
* Add structured error in ProxyBox and increase test coverage
* Add structured error message in Viewport
* Fix styles and add more assertions on ErrorHint and DiagnosticProperty
* Add structured error in scheduler/binding and scheduler/ticker
Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>
* Add structured error in AssetBundle and TextInput
Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>
* Add structured errors in several widgets #1
Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>
* Remove unused import
Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>
* Add assertions on hint messages
Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>
* Fix catch spacing
Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>
* Add structured error in several widgets part 2 and increase code coverage
Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>
* Add structured error in flutter_test/widget_tester
* Fix floating precision accuracy by using RegExp
Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>
* Remove todo to add tests in Scaffold showBottomSheet
Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>
* Fix reviews by indenting lines and fixing the assertion orders
Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>
* Fix failing tests due to renaming class
Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>
* Try skipping the NetworkBundleTest
Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>
* Remove leading space in material/debug error hint
Signed-off-by: Albertus Angga Raharja <albertusangga@google.com>
There were four or five different implementations in various tests for sendFakeKeyEvent, which roughly all did the same thing. I was going to add yet another one, and decided that it needed to be generalized and centralized. This replaces those instances with something that just takes a LogicalKeyboardKey so that it's self-documenting, and can be used with multiple platforms.
This adds two functions to widget tester: sendKeyDownEvent and sendKeyUpEvent which simulate key up/down from a physical keyboard. It also adds global functions simulateKeyDownEvent and simulateKeyUpEvent that can be called without a widget tester. All are async functions protected by the async guard.
* Fixing LocalFileComparator output
* Fixing path separators for windows failures
* Windows path issues
* Testing
* ++
* ++
* Fixing base directory - windows
* Clean up
* Make it possible to override the FLUTTER_TEST env variable without unsetting it.
* Switch to using platform instead of Platform.
* Document the bindings, and introduce tests that initialize multiple WidgetsBindings with different environments.
* Add tests for the flutter platform test.
* Add license headers
* Fix lints
* Remove trailing whitespace
* Respond to Jonahs comments
* Respond to Ians comments
* Mock out the HttpServer in flutter_platform_test
* Mock out the HttpServer in flutter_platform_test
* Explain why we mock out the HttpServer in flutter_platform_test
Instead of using a custom WidgetController, which is very brittle, we just use the usual infrastructure.
Also, use structured data instead of an array.
This adds offsetMoreOrLessEquals to handle small floating point errors in offsets.