Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
736c28b3
E
engine
项目概览
sxychenjing
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
736c28b3
编写于
7月 19, 2019
作者:
J
Jason Simmons
提交者:
GitHub
7月 19, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update Dart engine tests to check for assertion failures only when running in debug mode (#9959)
上级
b56e1ad7
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
121 addition
and
83 deletion
+121
-83
testing/dart/compositing_test.dart
testing/dart/compositing_test.dart
+105
-69
testing/dart/gradient_test.dart
testing/dart/gradient_test.dart
+16
-14
未找到文件。
testing/dart/compositing_test.dart
浏览文件 @
736c28b3
...
...
@@ -24,10 +24,13 @@ void main() {
0
,
0
,
1
,
0
,
0
,
0
,
0
,
]);
expect
(
()
=>
builder
.
pushTransform
(
matrix4WrongLength
),
throwsA
(
const
TypeMatcher
<
AssertionError
>()),
);
assert
(()
{
expect
(
()
=>
builder
.
pushTransform
(
matrix4WrongLength
),
throwsA
(
const
TypeMatcher
<
AssertionError
>()),
);
return
true
;
}());
final
Float64List
matrix4NaN
=
Float64List
.
fromList
(<
double
>[
1
,
0
,
0
,
0
,
...
...
@@ -35,10 +38,13 @@ void main() {
0
,
0
,
1
,
0
,
0
,
0
,
0
,
double
.
nan
,
]);
expect
(
()
=>
builder
.
pushTransform
(
matrix4NaN
),
throwsA
(
const
TypeMatcher
<
AssertionError
>()),
);
assert
(()
{
expect
(
()
=>
builder
.
pushTransform
(
matrix4NaN
),
throwsA
(
const
TypeMatcher
<
AssertionError
>()),
);
return
true
;
}());
final
Float64List
matrix4Infinity
=
Float64List
.
fromList
(<
double
>[
1
,
0
,
0
,
0
,
...
...
@@ -46,10 +52,13 @@ void main() {
0
,
0
,
1
,
0
,
0
,
0
,
0
,
double
.
infinity
,
]);
expect
(
()
=>
builder
.
pushTransform
(
matrix4Infinity
),
throwsA
(
const
TypeMatcher
<
AssertionError
>()),
);
assert
(()
{
expect
(
()
=>
builder
.
pushTransform
(
matrix4Infinity
),
throwsA
(
const
TypeMatcher
<
AssertionError
>()),
);
return
true
;
}());
});
test
(
'SceneBuilder accepts typed layers'
,
()
{
...
...
@@ -76,12 +85,15 @@ void main() {
final
SceneBuilder
builder2
=
SceneBuilder
();
pushFunction
(
builder2
,
layer
);
builder2
.
pop
();
try
{
builder2
.
addRetained
(
layer
);
fail
(
'Expected addRetained to throw AssertionError but it returned successully'
);
}
on
AssertionError
catch
(
error
)
{
expect
(
error
.
toString
(),
contains
(
'The layer is already being used'
));
}
assert
(()
{
try
{
builder2
.
addRetained
(
layer
);
fail
(
'Expected addRetained to throw AssertionError but it returned successully'
);
}
on
AssertionError
catch
(
error
)
{
expect
(
error
.
toString
(),
contains
(
'The layer is already being used'
));
}
return
true
;
}());
builder2
.
build
();
}
...
...
@@ -94,12 +106,15 @@ void main() {
final
SceneBuilder
builder2
=
SceneBuilder
();
builder2
.
addRetained
(
layer
);
try
{
pushFunction
(
builder2
,
layer
);
fail
(
'Expected push to throw AssertionError but it returned successully'
);
}
on
AssertionError
catch
(
error
)
{
expect
(
error
.
toString
(),
contains
(
'The layer is already being used'
));
}
assert
(()
{
try
{
pushFunction
(
builder2
,
layer
);
fail
(
'Expected push to throw AssertionError but it returned successully'
);
}
on
AssertionError
catch
(
error
)
{
expect
(
error
.
toString
(),
contains
(
'The layer is already being used'
));
}
return
true
;
}());
builder2
.
build
();
}
...
...
@@ -112,12 +127,15 @@ void main() {
final
SceneBuilder
builder2
=
SceneBuilder
();
builder2
.
addRetained
(
layer
);
try
{
builder2
.
addRetained
(
layer
);
fail
(
'Expected second addRetained to throw AssertionError but it returned successully'
);
}
on
AssertionError
catch
(
error
)
{
expect
(
error
.
toString
(),
contains
(
'The layer is already being used'
));
}
assert
(()
{
try
{
builder2
.
addRetained
(
layer
);
fail
(
'Expected second addRetained to throw AssertionError but it returned successully'
);
}
on
AssertionError
catch
(
error
)
{
expect
(
error
.
toString
(),
contains
(
'The layer is already being used'
));
}
return
true
;
}());
builder2
.
build
();
}
...
...
@@ -130,12 +148,15 @@ void main() {
final
SceneBuilder
builder2
=
SceneBuilder
();
pushFunction
(
builder2
,
layer
);
try
{
pushFunction
(
builder2
,
layer
);
fail
(
'Expected push to throw AssertionError but it returned successully'
);
}
on
AssertionError
catch
(
error
)
{
expect
(
error
.
toString
(),
contains
(
'was previously used as oldLayer'
));
}
assert
(()
{
try
{
pushFunction
(
builder2
,
layer
);
fail
(
'Expected push to throw AssertionError but it returned successully'
);
}
on
AssertionError
catch
(
error
)
{
expect
(
error
.
toString
(),
contains
(
'was previously used as oldLayer'
));
}
return
true
;
}());
builder2
.
build
();
}
...
...
@@ -150,12 +171,15 @@ void main() {
final
SceneBuilder
builder2
=
SceneBuilder
();
builder2
.
addRetained
(
layer
);
try
{
builder2
.
pushOpacity
(
321
,
oldLayer:
childLayer
);
fail
(
'Expected pushOpacity to throw AssertionError but it returned successully'
);
}
on
AssertionError
catch
(
error
)
{
expect
(
error
.
toString
(),
contains
(
'The layer is already being used'
));
}
assert
(()
{
try
{
builder2
.
pushOpacity
(
321
,
oldLayer:
childLayer
);
fail
(
'Expected pushOpacity to throw AssertionError but it returned successully'
);
}
on
AssertionError
catch
(
error
)
{
expect
(
error
.
toString
(),
contains
(
'The layer is already being used'
));
}
return
true
;
}());
builder2
.
build
();
}
...
...
@@ -171,12 +195,15 @@ void main() {
final
SceneBuilder
builder2
=
SceneBuilder
();
builder2
.
pushOpacity
(
234
,
oldLayer:
childLayer
);
builder2
.
pop
();
try
{
builder2
.
addRetained
(
layer
);
fail
(
'Expected addRetained to throw AssertionError but it returned successully'
);
}
on
AssertionError
catch
(
error
)
{
expect
(
error
.
toString
(),
contains
(
'The layer is already being used'
));
}
assert
(()
{
try
{
builder2
.
addRetained
(
layer
);
fail
(
'Expected addRetained to throw AssertionError but it returned successully'
);
}
on
AssertionError
catch
(
error
)
{
expect
(
error
.
toString
(),
contains
(
'The layer is already being used'
));
}
return
true
;
}());
builder2
.
build
();
}
...
...
@@ -190,13 +217,16 @@ void main() {
final
SceneBuilder
builder2
=
SceneBuilder
();
pushFunction
(
builder2
,
layer
);
builder2
.
pop
();
try
{
final
SceneBuilder
builder3
=
SceneBuilder
();
builder3
.
addRetained
(
layer
);
fail
(
'Expected addRetained to throw AssertionError but it returned successully'
);
}
on
AssertionError
catch
(
error
)
{
expect
(
error
.
toString
(),
contains
(
'was previously used as oldLayer'
));
}
assert
(()
{
try
{
final
SceneBuilder
builder3
=
SceneBuilder
();
builder3
.
addRetained
(
layer
);
fail
(
'Expected addRetained to throw AssertionError but it returned successully'
);
}
on
AssertionError
catch
(
error
)
{
expect
(
error
.
toString
(),
contains
(
'was previously used as oldLayer'
));
}
return
true
;
}());
builder2
.
build
();
}
...
...
@@ -210,13 +240,16 @@ void main() {
final
SceneBuilder
builder2
=
SceneBuilder
();
pushFunction
(
builder2
,
layer
);
builder2
.
pop
();
try
{
final
SceneBuilder
builder3
=
SceneBuilder
();
pushFunction
(
builder3
,
layer
);
fail
(
'Expected addRetained to throw AssertionError but it returned successully'
);
}
on
AssertionError
catch
(
error
)
{
expect
(
error
.
toString
(),
contains
(
'was previously used as oldLayer'
));
}
assert
(()
{
try
{
final
SceneBuilder
builder3
=
SceneBuilder
();
pushFunction
(
builder3
,
layer
);
fail
(
'Expected addRetained to throw AssertionError but it returned successully'
);
}
on
AssertionError
catch
(
error
)
{
expect
(
error
.
toString
(),
contains
(
'was previously used as oldLayer'
));
}
return
true
;
}());
builder2
.
build
();
}
...
...
@@ -232,13 +265,16 @@ void main() {
final
SceneBuilder
builder2
=
SceneBuilder
();
builder2
.
pushOpacity
(
321
,
oldLayer:
childLayer
);
builder2
.
pop
();
try
{
final
SceneBuilder
builder3
=
SceneBuilder
();
builder3
.
addRetained
(
parentLayer
);
fail
(
'Expected addRetained to throw AssertionError but it returned successully'
);
}
on
AssertionError
catch
(
error
)
{
expect
(
error
.
toString
(),
contains
(
'was previously used as oldLayer'
));
}
assert
(()
{
try
{
final
SceneBuilder
builder3
=
SceneBuilder
();
builder3
.
addRetained
(
parentLayer
);
fail
(
'Expected addRetained to throw AssertionError but it returned successully'
);
}
on
AssertionError
catch
(
error
)
{
expect
(
error
.
toString
(),
contains
(
'was previously used as oldLayer'
));
}
return
true
;
}());
builder2
.
build
();
}
...
...
testing/dart/gradient_test.dart
浏览文件 @
736c28b3
...
...
@@ -53,19 +53,21 @@ void main() {
// this would result in div/0 on skia side.
test
(
'radial center and focal == Offset.zero and focalRadius != 0.0 assert'
,
()
{
expect
(
()
=>
Gradient
.
radial
(
Offset
.
zero
,
0.0
,
<
Color
>[
const
Color
(
0xFFFFFFFF
),
const
Color
(
0xFFFFFFFF
)],
<
double
>[
0.0
,
1.0
],
TileMode
.
mirror
,
null
,
Offset
.
zero
,
1.0
,
),
throwsA
(
const
TypeMatcher
<
AssertionError
>()),
);
()
{
assert
(()
{
expect
(
()
=>
Gradient
.
radial
(
Offset
.
zero
,
0.0
,
<
Color
>[
const
Color
(
0xFFFFFFFF
),
const
Color
(
0xFFFFFFFF
)],
<
double
>[
0.0
,
1.0
],
TileMode
.
mirror
,
null
,
Offset
.
zero
,
1.0
,
),
throwsA
(
const
TypeMatcher
<
AssertionError
>()),
);
}());
});
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录