Roll engine to 33b88173f3820690169348859bbdc29133179e0b (#14832)
libtxt is now the default text renderer
This commit is contained in:
@@ -1 +1 @@
|
||||
ead227f118077d1f2b57842a32abaf105b573b8a
|
||||
33b88173f3820690169348859bbdc29133179e0b
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:async';
|
||||
import 'dart:io' show Platform;
|
||||
import 'dart:ui' show SemanticsFlag;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -735,7 +736,9 @@ void main() {
|
||||
expect(newFirstPos.dy, firstPos.dy);
|
||||
expect(inputBox.hitTest(new HitTestResult(), position: inputBox.globalToLocal(newFirstPos)), isTrue);
|
||||
expect(inputBox.hitTest(new HitTestResult(), position: inputBox.globalToLocal(newFourthPos)), isFalse);
|
||||
});
|
||||
},
|
||||
// This test does not run as expected in the MacOS environment on Travis
|
||||
skip: runningOnTravis && Platform.isMacOS);
|
||||
|
||||
testWidgets('TextField smoke test', (WidgetTester tester) async {
|
||||
String textFieldValue;
|
||||
@@ -1746,8 +1749,8 @@ void main() {
|
||||
// --------- rowBottomY
|
||||
|
||||
final double rowBottomY = tester.getBottomLeft(find.byType(Row)).dy;
|
||||
expect(tester.getBottomLeft(find.byKey(keyA)).dy, rowBottomY - 4.0);
|
||||
expect(tester.getBottomLeft(find.text('abc')).dy, rowBottomY - 2.0);
|
||||
expect(tester.getBottomLeft(find.byKey(keyA)).dy, closeTo(rowBottomY - 4.0, 0.001));
|
||||
expect(tester.getBottomLeft(find.text('abc')).dy, closeTo(rowBottomY - 2.0, 0.001));
|
||||
expect(tester.getBottomLeft(find.byKey(keyB)).dy, rowBottomY);
|
||||
});
|
||||
|
||||
|
||||
@@ -319,7 +319,9 @@ void main() {
|
||||
const TextBox.fromLTRBD(0.0, 10.0, 10.0, 20.0, TextDirection.rtl), // Alef
|
||||
],
|
||||
);
|
||||
}, skip: Platform.isWindows); // Ahem-based tests don't yet quite work on Windows
|
||||
},
|
||||
// Ahem-based tests don't yet quite work on Windows or the MacOS environment in Travis
|
||||
skip: Platform.isWindows || (runningOnTravis && Platform.isMacOS));
|
||||
|
||||
test('TextPainter - line wrap mid-word', () {
|
||||
final TextPainter painter = new TextPainter()
|
||||
|
||||
@@ -69,7 +69,9 @@ void main() {
|
||||
|
||||
expect(boxes.any((ui.TextBox box) => box.left == 250 && box.top == 0), isTrue);
|
||||
expect(boxes.any((ui.TextBox box) => box.right == 100 && box.top == 10), isTrue);
|
||||
}, skip: Platform.isWindows); // Ahem-based tests don't yet quite work on Windows
|
||||
},
|
||||
// Ahem-based tests don't yet quite work on Windows or the MacOS environment in Travis
|
||||
skip: Platform.isWindows || (runningOnTravis && Platform.isMacOS));
|
||||
|
||||
test('getWordBoundary control test', () {
|
||||
final RenderParagraph paragraph = new RenderParagraph(
|
||||
|
||||
@@ -38,6 +38,7 @@ void main() {
|
||||
),
|
||||
);
|
||||
expect(tester.renderObject<RenderBox>(find.text('X')).size, const Size(100.0, 100.0));
|
||||
expect(tester.renderObject<RenderBox>(find.byType(Baseline)).size, const Size(100.0, 200.0));
|
||||
expect(tester.renderObject<RenderBox>(find.byType(Baseline)).size,
|
||||
within<Size>(from: const Size(100.0, 200.0), distance: 0.001));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -825,6 +825,7 @@ void main() {
|
||||
),
|
||||
);
|
||||
expect(tester.renderObject<RenderBox>(find.text('X')).size, const Size(100.0, 100.0));
|
||||
expect(tester.renderObject<RenderBox>(find.byType(Baseline)).size, const Size(100.0, 200.0));
|
||||
expect(tester.renderObject<RenderBox>(find.byType(Baseline)).size,
|
||||
within<Size>(from: const Size(100.0, 200.0), distance: 0.001));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ export 'src/controller.dart';
|
||||
export 'src/finders.dart';
|
||||
export 'src/matchers.dart';
|
||||
export 'src/nonconst.dart';
|
||||
export 'src/platform.dart';
|
||||
export 'src/stack_manipulation.dart';
|
||||
export 'src/test_async_utils.dart';
|
||||
export 'src/test_pointer.dart';
|
||||
|
||||
@@ -622,6 +622,7 @@ const Map<Type, AnyDistanceFunction> _kStandardDistanceFunctions = const <Type,
|
||||
int: _intDistance,
|
||||
double: _doubleDistance,
|
||||
Rect: _rectDistance,
|
||||
Size: _sizeDistance,
|
||||
};
|
||||
|
||||
int _intDistance(int a, int b) => (b - a).abs();
|
||||
@@ -642,6 +643,11 @@ double _rectDistance(Rect a, Rect b) {
|
||||
return delta;
|
||||
}
|
||||
|
||||
double _sizeDistance(Size a, Size b) {
|
||||
final Offset delta = b - a;
|
||||
return math.sqrt(delta.dx * delta.dx + delta.dy * delta.dy);
|
||||
}
|
||||
|
||||
/// Asserts that two values are within a certain distance from each other.
|
||||
///
|
||||
/// The distance is computed by a [DistanceFunction].
|
||||
|
||||
8
packages/flutter_test/lib/src/platform.dart
Normal file
8
packages/flutter_test/lib/src/platform.dart
Normal file
@@ -0,0 +1,8 @@
|
||||
// Copyright 2018 The Chromium Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:io';
|
||||
|
||||
/// Whether the test is running in a Travis CI environment.
|
||||
bool get runningOnTravis => Platform.environment['TRAVIS'] == 'true';
|
||||
Reference in New Issue
Block a user