Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Added integration test for platform channels on windows. #36853

Merged

Conversation

gaaclarke
Copy link
Member

Adds an integration test for windows platform channels. This is preliminary groundwork to implementing background platform channels for windows.

issue: flutter/flutter#91635

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on
    writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@gaaclarke gaaclarke force-pushed the windows_integration_test_platform_channls branch 2 times, most recently from 9424fcc to 6d4bf1f Compare October 19, 2022 23:34
@gaaclarke gaaclarke force-pushed the windows_integration_test_platform_channls branch from 6d4bf1f to fd82337 Compare October 20, 2022 20:14
@gaaclarke gaaclarke force-pushed the windows_integration_test_platform_channls branch from fd82337 to 2c5c73b Compare October 20, 2022 20:30
ui.PlatformDispatcher.instance.sendPlatformMessage('hi', data,
(ByteData? reply) {
ui.PlatformDispatcher.instance
.sendPlatformMessage('hi', reply, (ByteData? reply) {});
Copy link
Member

Choose a reason for hiding this comment

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

Is this supposed to be bye instead of hi? The test seems to be checking for a message starting with b too.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yea, it's a bit confusing. I'm not sure how to make it more clear, "hi" is the name of the channel, not the payload. Dart just echos the payloads that it gets from the c++ side.

@@ -40,7 +42,9 @@ std::unique_ptr<FlutterWindowsEngine> GetTestEngine() {
}
} // namespace

TEST(FlutterWindowsEngine, RunDoesExpectedInitialization) {
class FlutterWindowsEngineTest : public WindowsTest {};
Copy link
Member

Choose a reason for hiding this comment

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

Just curious for my own knowledge, what are the benefits of this?

Copy link
Member Author

Choose a reason for hiding this comment

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

The WindowsTest class has access to the dart code that is compiled into the test runner. This tripped me up for a long time but you can't send and receive messages on windows unless you have a running engine, and you can't have a running engine without a dart kernel to execute. (On iOS and Android that isn't the case.) That's why I had to make this test suit a subclass of WindowsTest.

Copy link
Member

@loic-sharma loic-sharma left a comment

Choose a reason for hiding this comment

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

LGTM but left some questions

@gaaclarke gaaclarke merged commit 04fa86e into flutter:main Oct 20, 2022
zanderso pushed a commit to flutter/flutter that referenced this pull request Oct 21, 2022
…113847)

* e27e1964f Add touch-input-test to test_suites.yaml (flutter/engine#36900)

* b923707a3 [Impeller] remove solid stroke contents and allow strokes/vertices to use color sources (flutter/engine#36896)

* 85e4fa84d Roll Dart SDK from e06db8e1b620 to 1d418b40d8bd (1 revision) (flutter/engine#36902)

* 0b57b1cab Roll buildroot to a680bb1. (flutter/engine#36901)

* f1634aa30 Roll Fuchsia Mac SDK from IdQEnRNQNY7ZrLZ04... to jB4jUAxe89I2A-yqv... (flutter/engine#36904)

* f24ea1a04 Roll Fuchsia Linux SDK from g6-kU8so3PDiR1106... to mdl-0MUwR6uuQdKIm... (flutter/engine#36905)

* 04fa86e1b Added integration test for platform channels on windows. (flutter/engine#36853)

* 1dbf3ff76 Convert the executable directory path to UTF-8 on Windows (flutter/engine#36908)

* c3d4fc953 Roll Dart SDK from 1d418b40d8bd to f1d4c7c808bd (2 revisions) (flutter/engine#36913)

* 51b66c968 [Web] Synthesize key events for shift key on pointer events. (flutter/engine#36724)

* 584fffb67 Roll Fuchsia Mac SDK from jB4jUAxe89I2A-yqv... to fcFu9Z2KJH6oQvHnG... (flutter/engine#36919)

* 4369421b8 Roll Fuchsia Linux SDK from mdl-0MUwR6uuQdKIm... to NqPnoRHl3WYqH3SrC... (flutter/engine#36920)

* d6d38abb2 [Impeller] fix null geometry (flutter/engine#36922)

* d7f987ee3 [Impeller] Eliminate unused shader output (flutter/engine#36923)

* c255470e7 Roll Dart SDK from f1d4c7c808bd to eafe0119c9f5 (2 revisions) (flutter/engine#36925)

* 224a3def0 Restore support for building the web SDK without a prebuilt Dart SDK (flutter/engine#36926)

* c7c21e56f Re-landing Robolectric 4.8.1 (flutter/engine#34272)

* ab9802379 Roll libtess2 to 725e5e08ec8751477565f1d603fd7eb9058c277c (flutter/engine#36928)

* 95e937a44 Revert "Roll libtess2 to 725e5e08ec8751477565f1d603fd7eb9058c277c (#36928)" (flutter/engine#36932)

* 83092c04c Revert Dart SDK to 2.19.0-324.0.dev (flutter/engine#36930)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants