Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add a comment to web test
  • Loading branch information
loic-sharma committed Feb 16, 2023
commit 34f4a1be0840f21f881fbb3e50a4b6fe4f85b8b7
1 change: 1 addition & 0 deletions lib/web_ui/test/window_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ void testMain() {
await window.resetHistory();
});

// For now, web always has an implicit view provided by the web engine.
test('EnginePlatformDispatcher.instance.implicitView should be non-null', () async {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same.

Copy link
Member Author

@loic-sharma loic-sharma Feb 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From my understanding, only desktop platforms will be able to create windows (and therefore views). All other platforms - mobile and web - will have an implicit view instead. In other words, this test will be correct for the foreseeable future.

Side note: in theory we could allow all embedders to opt-out of the implicit view for add-to-app scenarios. We don't have any concrete plans there though... /cc @goderbauer

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All other platforms - mobile and web - will have an implicit view instead. In other words, this test will be correct for the foreseeable future.

I think we'd rather not assume that (and we don't have to, right?). The user might very possibly attach multiple views from the native code, and the framework will handle them. And with that, the user might even choose not to use the implicit view.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All other platforms - mobile and web - will have an implicit view instead.

Web will (possibly) want to render to multiple different target DIVs at some point, so I guess we're going to have multiple "views" too?

Copy link
Member Author

@loic-sharma loic-sharma Feb 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All other platforms - mobile and web - will have an implicit view instead.

Web will (possibly) want to render to multiple different target DIVs at some point, so I guess we're going to have multiple "views" too?

To clarify there's two semi-related things here:

  1. Multi-view: all platforms, including web, will have multi-view support from the framework side
  2. Implicit view: this replaces the window global

Having an implicit view does not block multi-view. It's just the replacement for the window global. For now, we don't have plans to move web off the implicit view as that's not required for supporting multi-window on desktop.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification @loic-sharma (expect a quick call from me soon-ish though, I want to start redoing stuff in the web engine so the multi-view lands more easily!)

expect(EnginePlatformDispatcher.instance.implicitView, isNotNull);
expect(EnginePlatformDispatcher.instance.implicitView?.viewId, 0);
Expand Down