From 29d5210d8b75eaf5d62a0bbe886bfa99605f1232 Mon Sep 17 00:00:00 2001 From: Brian Wilkerson Date: Wed, 14 Nov 2018 08:16:12 -0800 Subject: [PATCH] Use constant durations in more places (#24306) --- .../material/user_accounts_drawer_header_test.dart | 12 ++++++------ packages/flutter_tools/test/time_test.dart | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/flutter/test/material/user_accounts_drawer_header_test.dart b/packages/flutter/test/material/user_accounts_drawer_header_test.dart index 8a7f0ef001..58b6b7490b 100644 --- a/packages/flutter/test/material/user_accounts_drawer_header_test.dart +++ b/packages/flutter/test/material/user_accounts_drawer_header_test.dart @@ -113,7 +113,7 @@ void main() { await tester.tap(find.byType(Icon)); await tester.pump(); - await tester.pump(Duration(milliseconds: 10)); + await tester.pump(const Duration(milliseconds: 10)); expect(tester.hasRunningAnimations, isTrue); await tester.pumpAndSettle(); @@ -126,7 +126,7 @@ void main() { await tester.tap(find.byType(Icon)); await tester.pump(); - await tester.pump(Duration(milliseconds: 10)); + await tester.pump(const Duration(milliseconds: 10)); expect(tester.hasRunningAnimations, isTrue); await tester.pumpAndSettle(); @@ -149,25 +149,25 @@ void main() { // Icon starts to rotate down. await tester.tap(find.byType(Icon)); await tester.pump(); - await tester.pump(Duration(milliseconds: 100)); + await tester.pump(const Duration(milliseconds: 100)); expect(tester.hasRunningAnimations, isTrue); // Icon starts to rotate up mid animation. await tester.tap(find.byType(Icon)); await tester.pump(); - await tester.pump(Duration(milliseconds: 100)); + await tester.pump(const Duration(milliseconds: 100)); expect(tester.hasRunningAnimations, isTrue); // Icon starts to rotate down again still mid animation. await tester.tap(find.byType(Icon)); await tester.pump(); - await tester.pump(Duration(milliseconds: 100)); + await tester.pump(const Duration(milliseconds: 100)); expect(tester.hasRunningAnimations, isTrue); // Icon starts to rotate up to its original position mid animation. await tester.tap(find.byType(Icon)); await tester.pump(); - await tester.pump(Duration(milliseconds: 100)); + await tester.pump(const Duration(milliseconds: 100)); expect(tester.hasRunningAnimations, isTrue); await tester.pumpAndSettle(); diff --git a/packages/flutter_tools/test/time_test.dart b/packages/flutter_tools/test/time_test.dart index c140d4a68d..289b0b67c6 100644 --- a/packages/flutter_tools/test/time_test.dart +++ b/packages/flutter_tools/test/time_test.dart @@ -15,7 +15,7 @@ void main() { test('can find a time ago', () { final SystemClock clock = SystemClock.fixed(DateTime(1991, 8, 23)); - expect(clock.ago(Duration(days: 10)), DateTime(1991, 8, 13)); + expect(clock.ago(const Duration(days: 10)), DateTime(1991, 8, 13)); }); }); }