Commit 65ca3870 authored by Ian Hickson's avatar Ian Hickson Committed by GitHub

Make the Ahem font available to tests. (#7725)

parent 96e11e1b
......@@ -188,19 +188,19 @@ void main() {
testWidgets('TabBar can be scrolled independent of the selection', (WidgetTester tester) async {
List<String> tabs = <String>['AAAAAA', 'BBBBBB', 'CCCCCC', 'DDDDDD', 'EEEEEE', 'FFFFFF', 'GGGGGG', 'HHHHHH', 'IIIIII', 'JJJJJJ', 'KKKKKK', 'LLLLLL'];
List<String> tabs = <String>['AAAA', 'BBBB', 'CCCC', 'DDDD', 'EEEE', 'FFFF', 'GGGG', 'HHHH', 'IIII', 'JJJJ', 'KKKK', 'LLLL'];
Key tabBarKey = new Key('TabBar');
await tester.pumpWidget(buildFrame(tabs: tabs, value: 'AAAAAA', isScrollable: true, tabBarKey: tabBarKey));
TabController controller = DefaultTabController.of(tester.element(find.text('AAAAAA')));
await tester.pumpWidget(buildFrame(tabs: tabs, value: 'AAAA', isScrollable: true, tabBarKey: tabBarKey));
TabController controller = DefaultTabController.of(tester.element(find.text('AAAA')));
expect(controller, isNotNull);
expect(controller.index, 0);
// Fling-scroll the TabBar to the left
expect(tester.getCenter(find.text('HHHHHH')).x, lessThan(700.0));
expect(tester.getCenter(find.text('HHHH')).x, lessThan(700.0));
await tester.fling(find.byKey(tabBarKey), const Offset(-200.0, 0.0), 10000.0);
await tester.pump();
await tester.pump(const Duration(seconds: 1)); // finish the scroll animation
expect(tester.getCenter(find.text('HHHHHH')).x, lessThan(500.0));
expect(tester.getCenter(find.text('HHHH')).x, lessThan(500.0));
// Scrolling the TabBar doesn't change the selection
expect(controller.index, 0);
......
......@@ -17,7 +17,7 @@ void main() {
child: new Center(
child: new FlatButton(
onPressed: () { },
child: new Text('Hello')
child: new Text('ABC')
)
)
)
......@@ -30,7 +30,7 @@ void main() {
new TestSemantics(
id: 1,
actions: SemanticsAction.tap.index,
label: 'Hello',
label: 'ABC',
rect: new Rect.fromLTRB(0.0, 0.0, 88.0, 36.0),
transform: new Matrix4.translationValues(356.0, 282.0, 0.0)
)
......
......@@ -173,7 +173,7 @@ class TestCommand extends FlutterCommand {
testArgs.add('--');
Directory testDir;
List<String> files = argResults.rest.map((String testPath) => path.absolute(testPath)).toList();
Iterable<String> files = argResults.rest.map((String testPath) => path.absolute(testPath)).toList();
if (argResults['start-paused']) {
if (files.length != 1)
throwToolExit('When using --start-paused, you must specify a single test file to run.', exitCode: 1);
......
......@@ -451,6 +451,7 @@ void main() {
'--enable-dart-profiling',
'--non-interactive',
'--enable-checked-mode',
'--use-test-fonts',
'--packages=$packages',
testPath,
]);
......
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