未验证 提交 33515242 编写于 作者: Y Yegor 提交者: GitHub

test CkPath.reset() (#21567)

上级 948dd970
......@@ -257,6 +257,8 @@ class CkPath implements ui.Path {
@override
void reset() {
// Only reset the local field. Skia will reset its internal state via
// SkPath.reset() below.
_fillType = ui.PathFillType.nonZero;
_skPath.reset();
}
......
......@@ -16,7 +16,7 @@ void main() {
}
void testMain() {
group('Path Metrics', () {
group('CkPath', () {
setUpAll(() async {
await ui.webOnlyInitializePlatform();
});
......@@ -72,5 +72,20 @@ void testMain() {
expect(() => iter1.current, throwsRangeError);
expect(() => iter2.current, throwsRangeError);
});
test('CkPath.reset', () {
final ui.Path path = ui.Path();
expect(path, isA<CkPath>());
path.addRect(const ui.Rect.fromLTRB(0, 0, 10, 10));
expect(path.contains(const ui.Offset(5, 5)), isTrue);
expect(path.fillType, ui.PathFillType.nonZero);
path.fillType = ui.PathFillType.evenOdd;
expect(path.fillType, ui.PathFillType.evenOdd);
path.reset();
expect(path.fillType, ui.PathFillType.nonZero);
expect(path.contains(const ui.Offset(5, 5)), isFalse);
});
}, skip: isIosSafari); // TODO: https://github.com/flutter/flutter/issues/60040
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册