-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Description
Use case
When developers want to embed an HTML element in the widget hierarchy in Flutter web, they use HtmlElementView. Under the hood, HtmlElementView uses method channels and platformViewRegistry from dart:ui_web.
Let's say a user wants to test that the HTML element is created and configured as expected via HtmlElementView in widgets test on Chrome (by using --platform chrome option).
Mocking of method channels is trivial by using TestDefaultBinaryMessenger.setMockMethodCallHandler. However, mocking of platformViewRegistry is not possible. So the user has to switch to the integration tests in order to test the aforementioned scenario, which might not be an option for some users.
Proposal
Add a visible for testing debugOverridePlatformViewRegistry function to the ui_web to allow users to override platformViewRegistry in tests.