commit | 90fd90ed62571fb765df8c49000b14e3c8c643ec | [log] [tgz] |
---|---|---|
author | stuartmorgan <stuartmorgan@google.com> | Tue Aug 17 12:09:03 2021 -0700 |
committer | GitHub <noreply@github.com> | Tue Aug 17 12:09:03 2021 -0700 |
tree | cbba506f20c81b557b4dee977e2876e580801e0b | |
parent | 04ea39acd6d8c2ec0ed9bb022ae225470285060a [diff] |
[url_launcher] Add native unit tests for Windows (#4156) Adds a unit test target based on googletest. This is intended to be both a set of unit tests for this plugin, and also a model of changes that can be made to the `flutter create` template for Windows plugins to include better testing out of the box (https://github.com/flutter/flutter/issues/82458). In addition to the test binary being directly runnable, the integration between CMake, VS, and googletest means that these tests are visible—and runnable—in the VS Test Explorer UI after opening the generated .sln file. Changes for testing in general: - Moved the plugin class declaration to a header. - Moved the C registration API implementation to a separate file. - Added (opt-in, so it won't affect plugin client builds) plugin CMake rules to download googletest and build a new executable target that builds all the plugin sources, plus gtest and gmock. - Added a line to the example app CMake rules to enable the unit tests. - Added a unit test file. url_launcher-specific changes: - Wrapped all Win32 calls in a thin class for mockability in unit tests. - Factored some logic into helpers for better maintainability while I was refactoring anyway. Note: This unit test is not yet being run by CI. A tools command to run Windows plugin unit tests will be a separate PR. Part of https://github.com/flutter/flutter/issues/82445
This repo is a companion repo to the main flutter repo. It contains the source code for Flutter first-party plugins (i.e., plugins developed by the core Flutter team). Check the packages
directory for all plugins.
Flutter plugins enable access to platform-specific APIs. For more information about plugins, and how to use them, see https://flutter.dev/platform-plugins/.
These plugins are also available on pub.
Please file any issues, bugs, or feature requests in the main flutter repo.
Issues pertaining to this repository are labeled “plugin”.
If you wish to contribute a new plugin to the Flutter ecosystem, please see the documentation for developing packages and platform channels. You can store your plugin source code in any GitHub repository (the present repo is only intended for plugins developed by the core Flutter team). Once your plugin is ready you can publish to the pub repository.
If you wish to contribute a change to any of the existing plugins in this repo, please review our contribution guide, and send a pull request.
These are the available plugins in this repository.
The following plugins are also part of this repository, but are deprecated in favor of the Flutter Community Plus versions.
Plugin | Pub | Replacement | Pub | |
---|---|---|---|---|
android_alarm_manager | android_alarm_manager_plus | |||
android_intent | android_intent_plus | |||
battery | battery_plus | |||
connectivity | connectivity_plus | |||
device_info | device_info_plus | |||
package_info | package_info_plus | |||
sensors | sensors_plus | |||
share | share_plus | |||
wifi_info_flutter | network_info_plus |