mirror of
https://github.com/flutter/flutter.git
synced 2026-01-29 23:02:44 +08:00
Closes https://github.com/flutter/flutter/issues/143396 ### Description - Removes `js_util` library usage across the codebase In order to get rid of `dart.library.js_util` in [`kIsWeb`](e8d56b25c0/packages/flutter/lib/src/foundation/constants.dart (L83)) constant the dart analyzer has to be updated first. For now, the `dart.library.js_util` value is hardcoded in the source code:1a88edceb7/pkg/analyzer/lib/src/dart/constant/evaluation.dart (L2908-L2915). So we either have to update this value or wait for the https://github.com/dart-lang/sdk/issues/50045 fix. ## Pre-launch Checklist - [X] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [X] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [X] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [X] I signed the [CLA]. - [X] I listed at least one issue that this PR fixes in the description above. - [ ] I updated/added relevant documentation (doc comments with `///`). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [X] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [X] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Flutter Web integration tests
To run the tests in this package download the chromedriver matching the version of Chrome. To find out the version of your Chrome installation visit chrome://version.
Start chromedriver using the following command:
chromedriver --port=4444
An integration test is run using the flutter drive command. Some tests are
written for a specific web renderer and/or specific build mode.
Before running a test, check the _runWebLongRunningTests function defined in
dev/bots/test.dart, and determine the right web renderer and the build
mode you'd like to run the test in.
Here's an example of running an integration test:
flutter drive --target=test_driver/text_editing_integration.dart \
-d web-server \
--browser-name=chrome \
--profile
This example runs the test in profile mode (--profile).
More resources:
- chromedriver: https://chromedriver.chromium.org/getting-started
- FlutterDriver: https://github.com/flutter/flutter/blob/main/docs/contributing/testing/Running-Flutter-Driver-tests-with-Web.md
package:integration_test: https://pub.dev/packages/integration_test