This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
add windows embedding test #12423
Merged
Merged
add windows embedding test #12423
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -90,7 +90,7 @@ task: | |
| task: | ||
| gce_instance: | ||
| image_project: flutter-cirrus | ||
| image_name: flutter-engine-windows-server-2016-core | ||
| image_name: flutter-engine-windows-server-2016 | ||
| zone: us-central1-a | ||
| platform: windows | ||
| cpu: 32 | ||
|
|
@@ -109,11 +109,14 @@ task: | |
| cd %ENGINE_PATH%/src | ||
| gclient sync | ||
| matrix: | ||
| - name: build_windows_unopt_debug | ||
| - name: build_and_test_windows_unopt_debug | ||
| compile_host_script: | | ||
| cd %ENGINE_PATH%/src | ||
| python flutter/tools/gn --runtime-mode debug --unoptimized | ||
| ninja -C out/host_debug_unopt | ||
| test_host_script: | | ||
| cd %ENGINE_PATH%/src | ||
| python flutter/testing/run_tests.py --type=engine --engine-filter=flutter_windows_unittests,client_wrapper_windows_unittests | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. some of the unit tests fail on windows platform, I think only run relevant tests should be enough |
||
| - name: build_windows_opt_debug | ||
| compile_host_script: | | ||
| cd %ENGINE_PATH%/src | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
shell/platform/windows/testing/win32_flutter_window_test.cc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| #include "flutter/shell/platform/windows/testing/win32_flutter_window_test.h" | ||
| #include <iostream> | ||
|
|
||
| namespace flutter { | ||
| namespace testing { | ||
|
|
||
| Win32FlutterWindowTest::Win32FlutterWindowTest(int width, int height) | ||
| : Win32FlutterWindow(width, height){}; | ||
|
|
||
| Win32FlutterWindowTest::~Win32FlutterWindowTest() = default; | ||
|
|
||
| void Win32FlutterWindowTest::OnFontChange() { | ||
| on_font_change_called_ = true; | ||
| } | ||
|
|
||
| bool Win32FlutterWindowTest::OnFontChangeWasCalled() { | ||
| return on_font_change_called_; | ||
| } | ||
| } // namespace testing | ||
| } // namespace flutter |
31 changes: 31 additions & 0 deletions
31
shell/platform/windows/testing/win32_flutter_window_test.h
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| // Copyright 2013 The Flutter Authors. All rights reserved. | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| #include <windowsx.h> | ||
|
|
||
| #include "flutter/fml/macros.h" | ||
| #include "flutter/shell/platform/windows/win32_flutter_window.h" | ||
|
|
||
| namespace flutter { | ||
chunhtai marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| namespace testing { | ||
|
|
||
| class Win32FlutterWindowTest : public Win32FlutterWindow { | ||
| public: | ||
| Win32FlutterWindowTest(int width, int height); | ||
|
|
||
| ~Win32FlutterWindowTest(); | ||
|
|
||
| // |Win32Window| | ||
| void OnFontChange() override; | ||
|
|
||
| bool OnFontChangeWasCalled(); | ||
|
|
||
| private: | ||
chunhtai marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| bool on_font_change_called_ = false; | ||
|
|
||
| FML_DISALLOW_COPY_AND_ASSIGN(Win32FlutterWindowTest); | ||
| }; | ||
|
|
||
| } // namespace testing | ||
| } // namespace flutter | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| #include "flutter/shell/platform/windows/testing/win32_flutter_window_test.h" | ||
| #include "gtest/gtest.h" | ||
|
|
||
| namespace flutter { | ||
chunhtai marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| namespace testing { | ||
|
|
||
| TEST(Win32FlutterWindowTest, CreateDestroy) { | ||
| Win32FlutterWindowTest window(800, 600); | ||
| ASSERT_TRUE(TRUE); | ||
| } | ||
|
|
||
| TEST(Win32FlutterWindowTest, CanFontChange) { | ||
| Win32FlutterWindowTest window(800, 600); | ||
| HWND hwnd = window.GetWindowHandle(); | ||
| LRESULT result = SendMessage(hwnd, WM_FONTCHANGE, NULL, NULL); | ||
| ASSERT_EQ(result, 0); | ||
| ASSERT_TRUE(window.OnFontChangeWasCalled()); | ||
| ASSERT_TRUE(TRUE); | ||
| } | ||
|
|
||
| } // namespace testing | ||
| } // namespace flutter | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The windows unit test requires opengl to run, I updated it to use a gui version of image