Unverified Commit 44592238 authored by Jason Simmons's avatar Jason Simmons Committed by GitHub

Roll engine to 33b88173f3820690169348859bbdc29133179e0b (#14832)

libtxt is now the default text renderer
parent ed84fb96
ead227f118077d1f2b57842a32abaf105b573b8a 33b88173f3820690169348859bbdc29133179e0b
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
// found in the LICENSE file. // found in the LICENSE file.
import 'dart:async'; import 'dart:async';
import 'dart:io' show Platform;
import 'dart:ui' show SemanticsFlag; import 'dart:ui' show SemanticsFlag;
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
...@@ -735,7 +736,9 @@ void main() { ...@@ -735,7 +736,9 @@ void main() {
expect(newFirstPos.dy, firstPos.dy); expect(newFirstPos.dy, firstPos.dy);
expect(inputBox.hitTest(new HitTestResult(), position: inputBox.globalToLocal(newFirstPos)), isTrue); expect(inputBox.hitTest(new HitTestResult(), position: inputBox.globalToLocal(newFirstPos)), isTrue);
expect(inputBox.hitTest(new HitTestResult(), position: inputBox.globalToLocal(newFourthPos)), isFalse); 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 { testWidgets('TextField smoke test', (WidgetTester tester) async {
String textFieldValue; String textFieldValue;
...@@ -1746,8 +1749,8 @@ void main() { ...@@ -1746,8 +1749,8 @@ void main() {
// --------- rowBottomY // --------- rowBottomY
final double rowBottomY = tester.getBottomLeft(find.byType(Row)).dy; final double rowBottomY = tester.getBottomLeft(find.byType(Row)).dy;
expect(tester.getBottomLeft(find.byKey(keyA)).dy, rowBottomY - 4.0); expect(tester.getBottomLeft(find.byKey(keyA)).dy, closeTo(rowBottomY - 4.0, 0.001));
expect(tester.getBottomLeft(find.text('abc')).dy, rowBottomY - 2.0); expect(tester.getBottomLeft(find.text('abc')).dy, closeTo(rowBottomY - 2.0, 0.001));
expect(tester.getBottomLeft(find.byKey(keyB)).dy, rowBottomY); expect(tester.getBottomLeft(find.byKey(keyB)).dy, rowBottomY);
}); });
......
...@@ -319,7 +319,9 @@ void main() { ...@@ -319,7 +319,9 @@ void main() {
const TextBox.fromLTRBD(0.0, 10.0, 10.0, 20.0, TextDirection.rtl), // Alef 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', () { test('TextPainter - line wrap mid-word', () {
final TextPainter painter = new TextPainter() final TextPainter painter = new TextPainter()
......
...@@ -69,7 +69,9 @@ void main() { ...@@ -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.left == 250 && box.top == 0), isTrue);
expect(boxes.any((ui.TextBox box) => box.right == 100 && box.top == 10), 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', () { test('getWordBoundary control test', () {
final RenderParagraph paragraph = new RenderParagraph( final RenderParagraph paragraph = new RenderParagraph(
......
...@@ -38,6 +38,7 @@ void main() { ...@@ -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.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() { ...@@ -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.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'; ...@@ -13,6 +13,7 @@ export 'src/controller.dart';
export 'src/finders.dart'; export 'src/finders.dart';
export 'src/matchers.dart'; export 'src/matchers.dart';
export 'src/nonconst.dart'; export 'src/nonconst.dart';
export 'src/platform.dart';
export 'src/stack_manipulation.dart'; export 'src/stack_manipulation.dart';
export 'src/test_async_utils.dart'; export 'src/test_async_utils.dart';
export 'src/test_pointer.dart'; export 'src/test_pointer.dart';
......
...@@ -622,6 +622,7 @@ const Map<Type, AnyDistanceFunction> _kStandardDistanceFunctions = const <Type, ...@@ -622,6 +622,7 @@ const Map<Type, AnyDistanceFunction> _kStandardDistanceFunctions = const <Type,
int: _intDistance, int: _intDistance,
double: _doubleDistance, double: _doubleDistance,
Rect: _rectDistance, Rect: _rectDistance,
Size: _sizeDistance,
}; };
int _intDistance(int a, int b) => (b - a).abs(); int _intDistance(int a, int b) => (b - a).abs();
...@@ -642,6 +643,11 @@ double _rectDistance(Rect a, Rect b) { ...@@ -642,6 +643,11 @@ double _rectDistance(Rect a, Rect b) {
return delta; 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. /// Asserts that two values are within a certain distance from each other.
/// ///
/// The distance is computed by a [DistanceFunction]. /// The distance is computed by a [DistanceFunction].
......
// 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';
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment