This reverts commit b96c3c22ce350cd1999066601804c50a36e97ce6.
This commit is contained in:
parent
b96c3c22ce
commit
69f2f8a18b
@ -7,6 +7,7 @@ import 'dart:async';
|
|||||||
import 'package:integration_test/integration_test_driver.dart' as driver;
|
import 'package:integration_test/integration_test_driver.dart' as driver;
|
||||||
|
|
||||||
Future<void> main() => driver.integrationDriver(
|
Future<void> main() => driver.integrationDriver(
|
||||||
|
timeout: const Duration(minutes: 5),
|
||||||
responseDataCallback: (Map<String, dynamic>? data) async {
|
responseDataCallback: (Map<String, dynamic>? data) async {
|
||||||
await driver.writeResponseData(
|
await driver.writeResponseData(
|
||||||
data,
|
data,
|
||||||
|
@ -15,5 +15,6 @@ Future<void> main() async {
|
|||||||
kCullOpacityRouteName,
|
kCullOpacityRouteName,
|
||||||
pageDelay: const Duration(seconds: 1),
|
pageDelay: const Duration(seconds: 1),
|
||||||
duration: const Duration(seconds: 10),
|
duration: const Duration(seconds: 10),
|
||||||
|
timeout: const Duration(seconds: 45),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -12,5 +12,6 @@ void main() {
|
|||||||
kMultiWidgetConstructionRouteName,
|
kMultiWidgetConstructionRouteName,
|
||||||
pageDelay: const Duration(seconds: 1),
|
pageDelay: const Duration(seconds: 1),
|
||||||
duration: const Duration(seconds: 10),
|
duration: const Duration(seconds: 10),
|
||||||
|
timeout: const Duration(seconds: 45),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ void macroPerfTestE2E(
|
|||||||
String routeName, {
|
String routeName, {
|
||||||
Duration pageDelay,
|
Duration pageDelay,
|
||||||
Duration duration = const Duration(seconds: 3),
|
Duration duration = const Duration(seconds: 3),
|
||||||
|
Duration timeout = const Duration(seconds: 30),
|
||||||
ControlCallback body,
|
ControlCallback body,
|
||||||
ControlCallback setup,
|
ControlCallback setup,
|
||||||
}) {
|
}) {
|
||||||
@ -62,5 +63,5 @@ void macroPerfTestE2E(
|
|||||||
}
|
}
|
||||||
await durationFuture;
|
await durationFuture;
|
||||||
});
|
});
|
||||||
}, semanticsEnabled: false);
|
}, semanticsEnabled: false, timeout: Timeout(timeout));
|
||||||
}
|
}
|
||||||
|
@ -12,5 +12,6 @@ void main() {
|
|||||||
kCullOpacityRouteName,
|
kCullOpacityRouteName,
|
||||||
pageDelay: const Duration(seconds: 1),
|
pageDelay: const Duration(seconds: 1),
|
||||||
duration: const Duration(seconds: 10),
|
duration: const Duration(seconds: 10),
|
||||||
|
timeout: const Duration(minutes: 2),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
import 'package:integration_test/integration_test_driver.dart' as driver;
|
import 'package:integration_test/integration_test_driver.dart' as driver;
|
||||||
|
|
||||||
Future<void> main() => driver.integrationDriver(
|
Future<void> main() => driver.integrationDriver(
|
||||||
|
timeout: const Duration(minutes: 5),
|
||||||
responseDataCallback: (Map<String, dynamic> data) async {
|
responseDataCallback: (Map<String, dynamic> data) async {
|
||||||
await driver.writeResponseData(
|
await driver.writeResponseData(
|
||||||
data['performance'] as Map<String, dynamic>,
|
data['performance'] as Map<String, dynamic>,
|
||||||
|
@ -7,6 +7,7 @@ import 'dart:io';
|
|||||||
import 'package:integration_test/integration_test_driver.dart' as driver;
|
import 'package:integration_test/integration_test_driver.dart' as driver;
|
||||||
|
|
||||||
Future<void> main() => driver.integrationDriver(
|
Future<void> main() => driver.integrationDriver(
|
||||||
|
timeout: const Duration(minutes: 1),
|
||||||
responseDataCallback: (Map<String, dynamic> data) async {
|
responseDataCallback: (Map<String, dynamic> data) async {
|
||||||
final Map<String, dynamic> benchmarkLiveResult =
|
final Map<String, dynamic> benchmarkLiveResult =
|
||||||
data['benchmarkLive'] as Map<String,dynamic>;
|
data['benchmarkLive'] as Map<String,dynamic>;
|
||||||
|
@ -12,5 +12,6 @@ void main() {
|
|||||||
kMultiWidgetConstructionRouteName,
|
kMultiWidgetConstructionRouteName,
|
||||||
pageDelay: const Duration(seconds: 1),
|
pageDelay: const Duration(seconds: 1),
|
||||||
duration: const Duration(seconds: 10),
|
duration: const Duration(seconds: 10),
|
||||||
|
timeout: const Duration(seconds: 45),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ void main() {
|
|||||||
macroPerfTest(
|
macroPerfTest(
|
||||||
'picture_cache_perf',
|
'picture_cache_perf',
|
||||||
kPictureCacheRouteName,
|
kPictureCacheRouteName,
|
||||||
|
timeout: const Duration(seconds: 60),
|
||||||
pageDelay: const Duration(seconds: 1),
|
pageDelay: const Duration(seconds: 1),
|
||||||
driverOps: (FlutterDriver driver) async {
|
driverOps: (FlutterDriver driver) async {
|
||||||
final SerializableFinder tabBarView = find.byValueKey('tabbar_view');
|
final SerializableFinder tabBarView = find.byValueKey('tabbar_view');
|
||||||
|
@ -30,7 +30,7 @@ void main() {
|
|||||||
await file.writeAsString(_encodeJson(<String, dynamic>{
|
await file.writeAsString(_encodeJson(<String, dynamic>{
|
||||||
'stack_size': stackSizeInBytes,
|
'stack_size': stackSizeInBytes,
|
||||||
}));
|
}));
|
||||||
});
|
}, timeout: const Timeout(kTimeout));
|
||||||
}
|
}
|
||||||
|
|
||||||
String _encodeJson(Map<String, dynamic> jsonObject) {
|
String _encodeJson(Map<String, dynamic> jsonObject) {
|
||||||
|
@ -6,6 +6,8 @@ import 'package:flutter_driver/flutter_driver.dart';
|
|||||||
import 'package:macrobenchmarks/common.dart';
|
import 'package:macrobenchmarks/common.dart';
|
||||||
import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
|
import 'package:test/test.dart' hide TypeMatcher, isInstanceOf;
|
||||||
|
|
||||||
|
const Duration kTimeout = Duration(seconds: 30);
|
||||||
|
|
||||||
typedef DriverTestCallBack = Future<void> Function(FlutterDriver driver);
|
typedef DriverTestCallBack = Future<void> Function(FlutterDriver driver);
|
||||||
|
|
||||||
Future<void> runDriverTestForRoute(String routeName, DriverTestCallBack body) async {
|
Future<void> runDriverTestForRoute(String routeName, DriverTestCallBack body) async {
|
||||||
@ -32,13 +34,14 @@ Future<void> runDriverTestForRoute(String routeName, DriverTestCallBack body) as
|
|||||||
}
|
}
|
||||||
|
|
||||||
void macroPerfTest(
|
void macroPerfTest(
|
||||||
String testName,
|
String testName,
|
||||||
String routeName, {
|
String routeName,
|
||||||
Duration pageDelay,
|
{ Duration pageDelay,
|
||||||
Duration duration = const Duration(seconds: 3),
|
Duration duration = const Duration(seconds: 3),
|
||||||
Future<void> Function(FlutterDriver driver) driverOps,
|
Duration timeout = kTimeout,
|
||||||
Future<void> Function(FlutterDriver driver) setupOps,
|
Future<void> Function(FlutterDriver driver) driverOps,
|
||||||
}) {
|
Future<void> Function(FlutterDriver driver) setupOps,
|
||||||
|
}) {
|
||||||
test(testName, () async {
|
test(testName, () async {
|
||||||
Timeline timeline;
|
Timeline timeline;
|
||||||
await runDriverTestForRoute(routeName, (FlutterDriver driver) async {
|
await runDriverTestForRoute(routeName, (FlutterDriver driver) async {
|
||||||
@ -64,5 +67,5 @@ void macroPerfTest(
|
|||||||
|
|
||||||
final TimelineSummary summary = TimelineSummary.summarize(timeline);
|
final TimelineSummary summary = TimelineSummary.summarize(timeline);
|
||||||
await summary.writeTimelineToFile(testName, pretty: true);
|
await summary.writeTimelineToFile(testName, pretty: true);
|
||||||
});
|
}, timeout: Timeout(timeout));
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,8 @@ void main() {
|
|||||||
|
|
||||||
final SerializableFinder stockOption =
|
final SerializableFinder stockOption =
|
||||||
find.byValueKey('AAPL_symbol_name');
|
find.byValueKey('AAPL_symbol_name');
|
||||||
final String symbol = await driver.getText(stockOption);
|
final String symbol = await driver.getText(stockOption,
|
||||||
|
timeout: const Duration(milliseconds: 500));
|
||||||
|
|
||||||
expect(symbol, 'AAPL');
|
expect(symbol, 'AAPL');
|
||||||
}, skip: 'Needs to be fixed on Fuchsia.');
|
}, skip: 'Needs to be fixed on Fuchsia.');
|
||||||
|
@ -59,6 +59,7 @@ Future<void> main() async {
|
|||||||
await driver.tap(tapWindow);
|
await driver.tap(tapWindow);
|
||||||
final String windowClickCount = await driver.getText(
|
final String windowClickCount = await driver.getText(
|
||||||
find.byValueKey('WindowClickCount'),
|
find.byValueKey('WindowClickCount'),
|
||||||
|
timeout: const Duration(seconds: 5),
|
||||||
);
|
);
|
||||||
expect(windowClickCount, 'Click count: 1');
|
expect(windowClickCount, 'Click count: 1');
|
||||||
});
|
});
|
||||||
|
@ -25,7 +25,7 @@ void main() {
|
|||||||
if (status != 'complete') {
|
if (status != 'complete') {
|
||||||
fail('Failed at step $step with status $status');
|
fail('Failed at step $step with status $status');
|
||||||
}
|
}
|
||||||
});
|
}, timeout: const Timeout(Duration(minutes: 1)));
|
||||||
|
|
||||||
tearDownAll(() async {
|
tearDownAll(() async {
|
||||||
driver.close();
|
driver.close();
|
||||||
|
@ -48,6 +48,7 @@ void main([List<String> args = const <String>[]]) {
|
|||||||
..removeAll(kProfiledDemos);
|
..removeAll(kProfiledDemos);
|
||||||
await runDemos(unprofiledDemos.toList(), tester);
|
await runDemos(unprofiledDemos.toList(), tester);
|
||||||
},
|
},
|
||||||
|
timeout: const Timeout(Duration(minutes: 5)),
|
||||||
semanticsEnabled: withSemantics,
|
semanticsEnabled: withSemantics,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
import 'package:integration_test/integration_test_driver.dart' as driver;
|
import 'package:integration_test/integration_test_driver.dart' as driver;
|
||||||
|
|
||||||
Future<void> main() => driver.integrationDriver(
|
Future<void> main() => driver.integrationDriver(
|
||||||
|
timeout: const Duration(minutes: 5),
|
||||||
responseDataCallback: (Map<String, dynamic>? data) async {
|
responseDataCallback: (Map<String, dynamic>? data) async {
|
||||||
await driver.writeResponseData(
|
await driver.writeResponseData(
|
||||||
data!['performance'] as Map<String, dynamic>,
|
data!['performance'] as Map<String, dynamic>,
|
||||||
|
@ -130,6 +130,7 @@ Future<void> runDemos(List<String> demos, FlutterDriver driver) async {
|
|||||||
await driver.scrollUntilVisible(demoList, demoItem,
|
await driver.scrollUntilVisible(demoList, demoItem,
|
||||||
dyScroll: -48.0,
|
dyScroll: -48.0,
|
||||||
alignment: 0.5,
|
alignment: 0.5,
|
||||||
|
timeout: const Duration(seconds: 30),
|
||||||
);
|
);
|
||||||
|
|
||||||
for (int i = 0; i < 2; i += 1) {
|
for (int i = 0; i < 2; i += 1) {
|
||||||
@ -217,6 +218,6 @@ void main([List<String> args = const <String>[]]) {
|
|||||||
await runDemos(unprofiledDemos.toList(), driver);
|
await runDemos(unprofiledDemos.toList(), driver);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
}, timeout: const Timeout(Duration(minutes: 5)));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,6 @@ void main() {
|
|||||||
|
|
||||||
test('check that we are in normal mode', () async {
|
test('check that we are in normal mode', () async {
|
||||||
expect(await driver.requestData('status'), 'log: paint');
|
expect(await driver.requestData('status'), 'log: paint');
|
||||||
await driver.waitForAbsent(find.byType('PerformanceOverlay'));
|
await driver.waitForAbsent(find.byType('PerformanceOverlay'), timeout: Duration.zero);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,6 @@ void main() {
|
|||||||
|
|
||||||
test('check that we are showing the performance overlay', () async {
|
test('check that we are showing the performance overlay', () async {
|
||||||
await driver.requestData('status'); // force a reassemble
|
await driver.requestData('status'); // force a reassemble
|
||||||
await driver.waitFor(find.byType('PerformanceOverlay'));
|
await driver.waitFor(find.byType('PerformanceOverlay'), timeout: Duration.zero);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,6 @@ void main() {
|
|||||||
await driver.close();
|
await driver.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('empty', () async {});
|
test('empty', () async {}, timeout: const Timeout(Duration(minutes: 1)));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -48,6 +48,6 @@ void main() {
|
|||||||
|
|
||||||
imageBefore = imageAfter;
|
imageBefore = imageAfter;
|
||||||
}
|
}
|
||||||
});
|
}, timeout: const Timeout(Duration(minutes: 2)));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ Future<void> writeResponseData(
|
|||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
Future<void> integrationDriver({
|
Future<void> integrationDriver({
|
||||||
Duration timeout = const Duration(minutes: 20),
|
Duration timeout = const Duration(minutes: 1),
|
||||||
ResponseDataCallback? responseDataCallback = writeResponseData,
|
ResponseDataCallback? responseDataCallback = writeResponseData,
|
||||||
}) async {
|
}) async {
|
||||||
final FlutterDriver driver = await FlutterDriver.connect();
|
final FlutterDriver driver = await FlutterDriver.connect();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user