未验证 提交 3fcf5463 编写于 作者: N nturgut 提交者: GitHub

Run IOS unit tests on LUCI (#19141)

* change the version of simulator. luci bots only has 13.0

* skip failing pointer binding tests

* skip path_metrics (canvaskit) and a method from surface_test

* fix analyzer errors

* remove extra added touch event context test

* removing left overs for screenshot debugging

* apply reviewers suggestion for skipping tests
上级 88cc61e7
......@@ -12,7 +12,7 @@ edge:
launcher_version: '1.2.0.0'
ios-safari:
majorVersion: 13
minorVersion: 5
minorVersion: 0
device: 'iPhone 11'
## geckodriver is used for testing Firefox Browser. It works with multiple
## Firefox Browser versions.
......
......@@ -9,59 +9,65 @@ import 'package:ui/src/engine.dart';
import 'package:ui/ui.dart' as ui;
void main() {
setUpAll(() async {
await ui.webOnlyInitializePlatform();
});
group('Path Metrics', () {
setUpAll(() async {
await ui.webOnlyInitializePlatform();
});
test('Using CanvasKit', () {
expect(experimentalUseSkia, true);
});
test('Using CanvasKit', () {
expect(experimentalUseSkia, true);
});
test(SkPathMetrics, () {
final ui.Path path = ui.Path();
expect(path, isA<SkPath>());
expect(path.computeMetrics().length, 0);
test(SkPathMetrics, () {
final ui.Path path = ui.Path();
expect(path, isA<SkPath>());
expect(path.computeMetrics().length, 0);
path.addRect(ui.Rect.fromLTRB(0, 0, 10, 10));
final ui.PathMetric metric = path.computeMetrics().single;
expect(metric.contourIndex, 0);
expect(metric.extractPath(0, 0.5).computeMetrics().length, 1);
path.addRect(ui.Rect.fromLTRB(0, 0, 10, 10));
final ui.PathMetric metric = path.computeMetrics().single;
expect(metric.contourIndex, 0);
expect(metric.extractPath(0, 0.5).computeMetrics().length, 1);
final ui.Tangent tangent1 = metric.getTangentForOffset(5);
expect(tangent1.position, ui.Offset(5, 0));
expect(tangent1.vector, ui.Offset(1, 0));
final ui.Tangent tangent1 = metric.getTangentForOffset(5);
expect(tangent1.position, ui.Offset(5, 0));
expect(tangent1.vector, ui.Offset(1, 0));
final ui.Tangent tangent2 = metric.getTangentForOffset(15);
expect(tangent2.position, ui.Offset(10, 5));
expect(tangent2.vector, ui.Offset(0, 1));
final ui.Tangent tangent2 = metric.getTangentForOffset(15);
expect(tangent2.position, ui.Offset(10, 5));
expect(tangent2.vector, ui.Offset(0, 1));
expect(metric.isClosed, true);
expect(metric.isClosed, true);
path.addOval(ui.Rect.fromLTRB(10, 10, 100, 100));
expect(path.computeMetrics().length, 2);
path.addOval(ui.Rect.fromLTRB(10, 10, 100, 100));
expect(path.computeMetrics().length, 2);
// Path metrics can be iterated over multiple times.
final ui.PathMetrics metrics = path.computeMetrics();
expect(metrics.toList().length, 2);
expect(metrics.toList().length, 2);
expect(metrics.toList().length, 2);
// Path metrics can be iterated over multiple times.
final ui.PathMetrics metrics = path.computeMetrics();
expect(metrics.toList().length, 2);
expect(metrics.toList().length, 2);
expect(metrics.toList().length, 2);
// Can simultaneously iterate over multiple metrics from the same path.
final ui.PathMetrics metrics1 = path.computeMetrics();
final ui.PathMetrics metrics2 = path.computeMetrics();
final Iterator<ui.PathMetric> iter1 = metrics1.iterator;
final Iterator<ui.PathMetric> iter2 = metrics2.iterator;
expect(iter1.moveNext(), true);
expect(iter2.moveNext(), true);
expect(iter1.current, isNotNull);
expect(iter2.current, isNotNull);
expect(iter1.moveNext(), true);
expect(iter2.moveNext(), true);
expect(iter1.current, isNotNull);
expect(iter2.current, isNotNull);
expect(iter1.moveNext(), false);
expect(iter2.moveNext(), false);
expect(iter1.current, isNull);
expect(iter2.current, isNull);
});
// Can simultaneously iterate over multiple metrics from the same path.
final ui.PathMetrics metrics1 = path.computeMetrics();
final ui.PathMetrics metrics2 = path.computeMetrics();
final Iterator<ui.PathMetric> iter1 = metrics1.iterator;
final Iterator<ui.PathMetric> iter2 = metrics2.iterator;
expect(iter1.moveNext(), true);
expect(iter2.moveNext(), true);
expect(iter1.current, isNotNull);
expect(iter2.current, isNotNull);
expect(iter1.moveNext(), true);
expect(iter2.moveNext(), true);
expect(iter1.current, isNotNull);
expect(iter2.current, isNotNull);
expect(iter1.moveNext(), false);
expect(iter2.moveNext(), false);
expect(iter1.current, isNull);
expect(iter2.current, isNull);
});
},
// This test failed on iOS Safari.
// TODO: https://github.com/flutter/flutter/issues/60040
skip: (browserEngine == BrowserEngine.webkit &&
operatingSystem == OperatingSystem.iOs));
}
......@@ -194,7 +194,11 @@ void main() {
expect(elementC.parent, elementA);
expect(elementB.parent, null);
});
},
// This method failed on iOS Safari.
// TODO: https://github.com/flutter/flutter/issues/60036
skip: (browserEngine == BrowserEngine.webkit &&
operatingSystem == OperatingSystem.iOs));
test('is retained', () {
final SceneBuilder builder1 = SceneBuilder();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册