Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lindexi_gd
Uno
提交
794ad251
U
Uno
项目概览
lindexi_gd
/
Uno
11 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
Uno
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
794ad251
编写于
3月 06, 2023
作者:
M
Martin Zikmund
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: Correctly run FullWindow tests in context of Uno Island
上级
bd216e44
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
56 addition
and
4 deletion
+56
-4
src/SamplesApp/SamplesApp.Shared/App.xaml.cs
src/SamplesApp/SamplesApp.Shared/App.xaml.cs
+4
-0
src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UnitTest/UnitTestsControl.cs
...pp.UnitTests.Shared/Controls/UnitTest/UnitTestsControl.cs
+7
-0
src/Uno.UI.RuntimeTests/IntegrationTests/common/TestServices.WindowHelper.cs
...ests/IntegrationTests/common/TestServices.WindowHelper.cs
+40
-4
src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Given_XamlRoot.cs
...o.UI.RuntimeTests/Tests/Windows_UI_Xaml/Given_XamlRoot.cs
+5
-0
未找到文件。
src/SamplesApp/SamplesApp.Shared/App.xaml.cs
浏览文件 @
794ad251
...
...
@@ -656,6 +656,10 @@ namespace SamplesApp
public
void
AssertIssue8641NativeOverlayInitialized
()
{
#if __SKIA__
if
(
Uno
.
UI
.
Xaml
.
Core
.
CoreServices
.
Instance
.
InitializationType
==
Uno
.
UI
.
Xaml
.
Core
.
InitializationType
.
IslandsOnly
)
{
return
;
}
// Temporarily add a TextBox to the current page's content to verify native overlay is available
Frame
rootFrame
=
Windows
.
UI
.
Xaml
.
Window
.
Current
.
Content
as
Frame
;
var
textBox
=
new
TextBox
();
...
...
src/SamplesApp/SamplesApp.UnitTests.Shared/Controls/UnitTest/UnitTestsControl.cs
浏览文件 @
794ad251
...
...
@@ -87,6 +87,13 @@ namespace Uno.UI.Samples.Tests
Private
.
Infrastructure
.
TestServices
.
WindowHelper
.
CurrentTestWindow
=
Windows
.
UI
.
Xaml
.
Window
.
Current
;
Private
.
Infrastructure
.
TestServices
.
WindowHelper
.
IsXamlIsland
=
#if HAS_UNO
Uno
.
UI
.
Xaml
.
Core
.
CoreServices
.
Instance
.
InitializationType
==
Xaml
.
Core
.
InitializationType
.
IslandsOnly
;
#else
false
;
#endif
DataContext
=
null
;
SampleChooserViewModel
.
Instance
.
SampleChanging
+=
OnSampleChanging
;
...
...
src/Uno.UI.RuntimeTests/IntegrationTests/common/TestServices.WindowHelper.cs
浏览文件 @
794ad251
...
...
@@ -7,6 +7,8 @@ using System.Runtime.CompilerServices;
using
Windows.UI.Xaml.Media
;
using
Windows.UI.Xaml.Tests.Enterprise
;
using
Windows.UI.Core
;
using
Uno.Helpers
;
using
MUXControlsTestApp.Utilities
;
#if NETFX_CORE
using
Uno.UI.Extensions
;
#elif __IOS__
...
...
@@ -28,6 +30,8 @@ namespace Private.Infrastructure
public
static
XamlRoot
XamlRoot
{
get
;
set
;
}
public
static
bool
IsXamlIsland
{
get
;
set
;
}
public
static
Windows
.
UI
.
Xaml
.
Window
CurrentTestWindow
{
get
...
...
@@ -46,14 +50,21 @@ namespace Private.Infrastructure
public
static
UIElement
WindowContent
{
get
=>
UseActualWindowRoot
?
CurrentTestWindow
.
Content
?
(
IsXamlIsland
?
GetXamlIslandRootContentControl
().
Content
as
UIElement
:
CurrentTestWindow
.
Content
)
:
EmbeddedTestRoot
.
getContent
?.
Invoke
();
internal
set
{
if
(
UseActualWindowRoot
)
{
if
(
IsXamlIsland
)
{
GetXamlIslandRootContentControl
().
Content
=
value
;
}
else
{
CurrentTestWindow
.
Content
=
value
;
}
}
else
if
(
EmbeddedTestRoot
.
setContent
is
{
}
setter
)
{
setter
(
value
);
...
...
@@ -65,16 +76,41 @@ namespace Private.Infrastructure
}
}
private
static
ContentControl
GetXamlIslandRootContentControl
()
{
var
islandContentRoot
=
EmbeddedTestRoot
.
control
.
XamlRoot
.
Content
;
if
(
islandContentRoot
is
not
ContentControl
contentControl
)
{
contentControl
=
VisualTreeUtils
.
FindVisualChildByType
<
ContentControl
>(
islandContentRoot
);
}
return
contentControl
;
}
public
static
void
SaveOriginalWindowContent
()
{
if
(
IsXamlIsland
)
{
_originalWindowContent
=
GetXamlIslandRootContentControl
().
Content
as
UIElement
;
}
else
{
_originalWindowContent
=
CurrentTestWindow
.
Content
;
}
}
public
static
void
RestoreOriginalWindowContent
()
{
if
(
_originalWindowContent
!=
null
)
{
if
(
IsXamlIsland
)
{
GetXamlIslandRootContentControl
().
Content
=
_originalWindowContent
;
}
else
{
CurrentTestWindow
.
Content
=
_originalWindowContent
;
}
_originalWindowContent
=
null
;
}
}
...
...
src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml/Given_XamlRoot.cs
浏览文件 @
794ad251
...
...
@@ -12,6 +12,11 @@ namespace Uno.UI.RuntimeTests.Tests.Windows_UI_Xaml
[
RunsOnUIThread
]
public
async
Task
When_Loaded_Matches_Window_Root
()
{
if
(
TestServices
.
WindowHelper
.
IsXamlIsland
)
{
return
;
}
var
border
=
new
Border
();
var
completionSource
=
new
TaskCompletionSource
<
XamlRoot
>();
border
.
Loaded
+=
(
s
,
e
)
=>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录