This test fails consistently on mac2 and mac3 with the attached Moto G4
devices but passes consistently on other machines.
Adding a delay of 1s right after driver.connect() in setUpAll() causes
it to pass on the machines in question, which suggests a race condition.
Specifically it looks like connect returns the moment Flutter Driver
identifies that the isolate is up and running, but empirically it looks
like we start running the first test before the UI is actually up. This
triggers a failure wherein we start looking for elements before they're
onstage.
Link to viewport.dart:213 at HEAD:
b2b4665926/packages/flutter/lib/src/widgets/viewport.dart (L213)
Stack trace:
FlutterDriver waitFor should find text "present"
```
DriverError: Error in Flutter application: Uncaught extension error while executing waitFor: NoSuchMethodError: The getter 'visible' was called on null.
Receiver: null
Tried calling: visible
#0 Object.noSuchMethod (dart:core/runtime/libobject_patch.dart:46:5)
#1 _ViewportElement.debugVisitOnstageChildren. (package:flutter/src/widgets/viewport.dart:213:36)
#2 WhereIterator.moveNext (dart:_internal/iterable.dart:439:11)
#3 Iterable.forEach (dart:core/iterable.dart)
#4 _ViewportElement.debugVisitOnstageChildren (package:flutter/src/widgets/viewport.dart:214:8)
#5 _DepthFirstChildIterator._reverseChildrenOf (package:flutter_test/src/all_elements.dart:54:15)
#6 _DepthFirstChildIterator.moveNext (package:flutter_test/src/all_elements.dart:45:19)
#7 CachingIterable._fillNext (package:flutter/src/foundation/basic_types.dart:252:27)
#8 _LazyListIterator.moveNext (package:flutter/src/foundation/basic_types.dart:279:21)
#9 WhereIterator.moveNext (dart:_internal/iterable.dart:438:22)
#10 CachingIterable._fillNext (package:flutter/src/foundation/basic_types.dart:252:27)
#11 _LazyListIterator.moveNext (package:flutter/src/foundation/basic_types.dart:279:21)
#12 Iterable.isEmpty (dart:core/iterable.dart:449:33)
#13 Iterable.isNotEmpty (dart:core/iterable.dart:456:27)
#14 FlutterDriverExtension._waitForElement. (package:flutter_driver/src/extension/extension.dart:215:51)
#15 FlutterDriverExtension._waitUntilFrame (package:flutter_driver/src/extension/extension.dart:197:19)
#16 FlutterDriverExtension._waitForElement (package:flutter_driver/src/extension/extension.dart:215:11)
#17 FlutterDriverExtension._waitFor (package:flutter_driver/src/extension/extension.dart:286:11)
#18 FlutterDriverExtension.call (package:flutter_driver/src/extension/extension.dart:168:51)
#19 BindingBase.registerServiceExtension. (package:flutter/src/foundation/binding.dart:370:32)
```
Removes a previous hack that no longer appears to help (adding a 1
second delay in setUpAll() does seem to work around this issue though).
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.
* 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
* With dart being default, move preview_dart_2 tests to dart1.
* Swap out defaults for preview-dart-2 option in tests. Make dart1 explicit
* Move suffix around
* Rename files
* 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)
```
* Update the following packages
- dart-petitparser to 1.7.5
- dart-xml to 3.0.3
- image to 1.1.30
These updates fix some of the strong mode errors we were encountering
while running flutter tests.
* 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
* Fix some of the generic types specified to avoid runtime errors in
--preview-dart-2
type 'YamlMap' is not a subtype of type 'Map<String, dynamic>' where
YamlMap is from package:yaml/src/yaml_node.dart
Map is from dart:core
String is from dart:core
package:flutter_devicelab/framework/manifest.dart 17:36 loadTaskManifest
test/manifest_test.dart 14:33 main.<fn>.<fn>
package:test/src/backend/declarer.dart 161:27 Declarer.test.<fn>.<fn>.<fn>
* Add dynamic generic types to keep the analyer happy.
* Address code review comment.
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)
* 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
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.
* Reject requests for hot reload if a hot reload is already in progress.
Fixes#14184
* Implement TODO, verifying further hot reloads complete sucessfully.
* Fix year on new file.
* Add missing type annotations to fix lints
* Add run_machine_concurrent_hot_reload to manifest for CI
* Reformat document
... but undo things that cause lints (like single-line ifs)
* Extract std stream transformations
* Make inProgressHotReload private
* Disallow all types of reload while hot reload in progress
* Simplify code handling in-progress hot reloads
* first round fastlane working on Android
* clean up and start ios
* Partial iOS
* Got a fastfile that works on iOS
* Finalize Android push instructions
* Finalize instructions for iOS
* Extra cleanup and optipng
* Disable readme autogen and add a default readme
* 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.
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".
* Revert "Reverting package changes until I can figure out how to fix Windows. (#14007)"
This reverts commit 6fda8ee821.
* Make prepare_package run on Windows
* Revert "Fixed output validation. (#14005)"
This reverts commit d84398db72.
* Revert "Update package prep script to do async process execution and emit output as it happens. (#13918)"
This reverts commit b7169c1d95.
- Switches to async process execution, which now shows output as it happens instead of in chunks when the process completes
- Now uses ProcessManager so that it may be mocked for the test.
- Adds in the download and install of mingit on Windows.
- Updated package dependencies because of added dependency on process package.
This simply updates the package dependencies by running flutter update-packages --force-upgrade.
I'm doing this with no other changes, because the last time I tried that, redness occurred. I want to isolate the problem to a "clean" update of the packages.
It looks like the plugins device_info, connectivity, and url_launcher haven't yet had their gradle configurations updated, so they fail when trying to build with the new gradle. I did not upgrade for those three packages only (in flutter_gallery) until we are ready to fix them (fixing them for master will break them for alpha users, so we need to do an alpha roll to do that).
This adds our self-compiled copy of the MinGit executable (built from the flutter/git repo) to the archive when building an archive for Windows.
I also tweaked the internal API for prepare_package.dart so that there's a single entry point to build an archive.
This replaces the use of ideviceinfo (whose output was then filtered for
device IDs) with an invocation idevice_id -l, which returns the list
directly, one per line.
This patch migrates iOS device listing from using Xcode instruments to
using the libimobiledevice tools idevice_id and ideviceinfo.
ideviceinfo was previously incompatible with iOS 11 physical devices;
this has now been fixed.
In 58fe8237d2 flutter_tools migrated from
libimobiledevice-based device listing on iOS to using Xcode instruments
to work around the lack of support for iOS 11. Using instruments entails
several downsides, including a significantly higher performance hit, and
leaking hung DTServiceHub processes in certain cases when a simulator is
running, necessitating workarounds in which we watched for, and cleaned
up leaked DTServiceHub processes. This patch returns reverts the move to
instruments now that it's no longer necessary.
This reverts commit 58fe8237d2.
* Revert "Include a directory with Flutter assets (#12944)"
This reverts commit 3af6b9cbf5.
* Revert "Upgrade project.pbxproj to include flutter_assets (#13011)"
This reverts commit 08128cb29b.
* Revert "Upgrade complex_layout project.pbxproj to include flutter_assets (#13544)"
This reverts commit 35f1a04195.
* mark complex_layout_ios__start_up as flaky
* Change some of the dev/devicelab tests to support testing against local engine.
We can already configure flutter tools to use local engine by setting
FLUTTER_ENGINE environment variable. However when this variable is set
this also requires setting --local-engine to specify which flavor of
engine to use.
This change changes tests in dev/devicelab to pass a sensible default for
--local-engine, e.g. when testing hot reload on Android we pass android_debug
and when testing release AOT build for IOS we pass ios_release.
* Fix analysis issues
* Update utils.dart
This fills out the following matrix:
App: `flutter create` default app, Complex Layout, and Gallery.
Platforms: Linux/Android, Mac/iOS, Windows/Android
Build modes: full release, aot blobs, debug
Dart: normal, 2.0 preview
It also renames all the tests that used "build" to mean compilation
build to use "compile" instead, so that it's much clearer on the
dashboard.
Also, mark some flaky tests that are no longer flaky as not flaky.
Also, remove uses of call() since that's probably going to go away at
some point.
This consolidates all of the non-template .gitignore rules into the top level .gitignore, to ignore common things more broadly, with less maintenance needed for the .gitignore files. Does not touch the templates, so that they still produce needed .gitignores as part of flutter create.
I got tired of drive-by spelling fixes, so I figured I'd just take care of them all at once.
This only corrects errors in the dartdocs, not regular comments, and I skipped any sample code in the dartdocs. It doesn't touch any identifiers in the dartdocs either. No code changes, just comments.
Creates a new (hidden) flutter command 'ide-config' that will create and/or update
existing .iml files and some files under the .idea directory, as well as
removing existing *.iml files and the .idea directory.
It also:
* Adds *.iml to the .gitignore
* Removes existing .iml files from the repo, and moves them to the
packages/flutter_tools/ide_templates/intellij directory.
* Adds a flag to ide-config ('--update-templates') that will take any new .iml
files in the flutter tree and add them to the existing templates.
- If --overwrite is also specified, then all existing templates will also
be overwritten with the contents from the flutter tree, and any that have
been deleted from the flutter tree will also be removed from the
templates.
* Added new run configurations for all existing app targets that will now also
be automatically added to IntelliJ.
* Setting up the environment also includes setting the coding style guidelines
and the git VCS.
* Note that after this PR lands, Flutter developers will need to run it once to
re-create the .iml files and configuration files that have been removed.
After this PR lands, .iml files will no longer appear in the untracked files
section for git.
* fix updrade script; upgrade to the latest package versions
* exclude special dependencies from transitive closure
* fix stack trace handling in flutter_test due to stack_trace change
* change type on _emptyStackTrace
* Restructure hot mode test so it runs interactively.
This allows to add a benchmark for hot reload after actual source code change.
* Add curly braces, refactory copyRecursive
* Add hotReloadInitialDevFSSyncMilliseconds to track how long user have to wait before being able to do first reload.
This stat is significantly different between existing and preview-dart-2 setting (for the latter, this stat is ~3x slower: 13s vs ~4s).
* Remove ws
* Cleanup timer-related code
* Clone hot reload benchmark for --preview-dart-2 option.
* Get rid of linux and win preview_dart_2 (only android would be sufficient for now). Refactor code into lib/tasks
* Revert 2016 to 2017
* Mark new test as flaky
* Pin all dependencies ONCE AND FOR ALL
This replaces the secret `flutter update-packages --upgrade` with a destructive `flutter update-packages --force-upgrade` that actually goes and pins every dependency and transitive dependency in every flutter package to the same version.
* Add comments.
* only tap on widgets reachable by hit testing
* use FractionalOffset
* added tests
* check finder finds correct widget
* undo unintentional changes
* address comments
* style fix
* add Directionality in test
* fix analysis warning
* Revert "Revert "fire service protocol events for frames (#11565)" (#11727)"
This reverts commit f25e2f5213.
* move the postEvent() call into a separate method
- Wait for full Hot Reload
- Wait for full Restart
- Fallback if checkHealth throws METHOD_NOT_FOUND.
We try to wait for the service extensions to be registered and retry.
The most recent Flutter IntelliJ plugin replaces FLUTTER_MODULE with
WEB_MODULE and eliminates the exclusion of packages/ directories.
Use of the packages/ directory was turned off by default months ago, and
is replaced by the .packages file.
* fire service protocol extension events for frames
* start time in micros
* introduce a profile() function; only send frame events when in profile (or debug) modes
* moved the profile() function to foundation/profile.dart
* refactor to make the change more testable; test the change
* fire service protocol events by listening to onFrameInfo
* remove the frame event stream; add a devicelab test
* remove a todo
* final
Mainly, this adds documentation to members that were previously
lacking documentation.
It also adds a big block of documentation about improving performance
of widgets.
This also removes some references to package:collection and adds
global setEquals and listEquals methods in foundation that we can use.
(setEquals in particular should be much faster than the
package:collection equivalent, though both should be faster as they
avoid allocating new objects.) All remaining references now qualify
the import so we know what our remaining dependencies are.
Also lots of code reordering in Flutter driver to make the code
consistent and apply the style guide more thoroughly.
* add Android instrumentation test
* add devicelab test
* add to manifest.yaml
* rename _smoke_test.dart to _smoketest.dart to prevent flutter test from picking it up
* volatile fields; style fixes
* use ConditionVariable; fix sh script
The main purpose of this PR is to make it so that when you set the
initial route and it's a hierarchical route (e.g. `/a/b/c`), it
implies multiple pushes, one for each step of the route (so in that
case, `/`, `/a`, `/a/b`, and `/a/b/c`, in that order). If any of those
routes don't exist, it falls back to '/'.
As part of doing that, I:
* Changed the default for MaterialApp.initialRoute to honor the
actual initial route.
* Added a MaterialApp.onUnknownRoute for handling bad routes.
* Added a feature to flutter_driver that allows the host test script
and the device test app to communicate.
* Added a test to make sure `flutter drive --route` works.
(Hopefully that will also prove `flutter run --route` works, though
this isn't testing the `flutter` tool's side of that. My main
concern is over whether the engine side works.)
* Fixed `flutter drive` to output the right target file name.
* Changed how the stocks app represents its data, so that we can
show a page for a stock before we know if it exists.
* Made it possible to show a stock page that doesn't exist. It shows
a progress indicator if we're loading the data, or else shows a
message saying it doesn't exist.
* Changed the pathing structure of routes in stocks to work more
sanely.
* Made search in the stocks app actually work (before it only worked
if we happened to accidentally trigger a rebuild). Added a test.
* Replaced some custom code in the stocks app with a BackButton.
* Added a "color" feature to BackButton to support the stocks use case.
* Spaced out the ErrorWidget text a bit more.
* Added `RouteSettings.copyWith`, which I ended up not using.
* Improved the error messages around routing.
While I was in some files I made a few formatting fixes, fixed some
code health issues, and also removed `flaky: true` from some devicelab
tests that have been stable for a while. Also added some documentation
here and there.
Adds an initial integration test that:
1. captures laid-out widget size
2. focuses a text field to show the keyboard and resize the view
3. unfocuses the text field to dismiss the keyboard and resize the view
4. verify that the final widget size matches the initial size
Eliminates Gallery-specific hardcoding of app package and activity name
in the test.
Fixes breakage introduced with 1dc2d4eb43
due to main activity class now being MainActivity.