apply lint prefer_void_to_null in dev/ (#22661)
This commit is contained in:
parent
89c5ace117
commit
d340e2f229
@ -13,6 +13,6 @@ void main() {
|
||||
throw FlutterError('Who lives, who dies, who tells your story?');
|
||||
});
|
||||
testWidgets('Exception handling in test harness - uncaught Future error', (WidgetTester tester) async {
|
||||
Future<Null>.error('Who lives, who dies, who tells your story?');
|
||||
Future<void>.error('Who lives, who dies, who tells your story?');
|
||||
});
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ class TestTestBinding extends AutomatedTestWidgetsFlutterBinding {
|
||||
static void testPrint(String message, { int wrapWidth }) { print(message); }
|
||||
}
|
||||
|
||||
Future<Null> guardedHelper(WidgetTester tester) {
|
||||
Future<void> guardedHelper(WidgetTester tester) {
|
||||
return TestAsyncUtils.guard(() async {
|
||||
await tester.pumpWidget(const Text('Hello', textDirection: TextDirection.ltr));
|
||||
});
|
||||
|
@ -11,7 +11,7 @@ class TestTestBinding extends AutomatedTestWidgetsFlutterBinding {
|
||||
static void testPrint(String message, { int wrapWidth }) { print(message); }
|
||||
}
|
||||
|
||||
Future<Null> helperFunction(WidgetTester tester) async {
|
||||
Future<void> helperFunction(WidgetTester tester) async {
|
||||
await tester.pump();
|
||||
}
|
||||
|
||||
|
@ -20,12 +20,12 @@ void main() {
|
||||
driver.close();
|
||||
});
|
||||
|
||||
Future<Null> testScrollPerf(String listKey, String summaryName) async {
|
||||
Future<void> testScrollPerf(String listKey, String summaryName) async {
|
||||
// The slight initial delay avoids starting the timing during a
|
||||
// period of increased load on the device. Without this delay, the
|
||||
// benchmark has greater noise.
|
||||
// See: https://github.com/flutter/flutter/issues/19434
|
||||
await Future<Null>.delayed(const Duration(milliseconds: 250));
|
||||
await Future<void>.delayed(const Duration(milliseconds: 250));
|
||||
final Timeline timeline = await driver.traceAction(() async {
|
||||
// Find the scrollable stock list
|
||||
final SerializableFinder list = find.byValueKey(listKey);
|
||||
@ -34,13 +34,13 @@ void main() {
|
||||
// Scroll down
|
||||
for (int i = 0; i < 5; i += 1) {
|
||||
await driver.scroll(list, 0.0, -300.0, const Duration(milliseconds: 300));
|
||||
await Future<Null>.delayed(const Duration(milliseconds: 500));
|
||||
await Future<void>.delayed(const Duration(milliseconds: 500));
|
||||
}
|
||||
|
||||
// Scroll up
|
||||
for (int i = 0; i < 5; i += 1) {
|
||||
await driver.scroll(list, 0.0, 300.0, const Duration(milliseconds: 300));
|
||||
await Future<Null>.delayed(const Duration(milliseconds: 500));
|
||||
await Future<void>.delayed(const Duration(milliseconds: 500));
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -25,7 +25,7 @@ void main() {
|
||||
|
||||
test('inital tree creation', () async {
|
||||
// Let app become fully idle.
|
||||
await Future<Null>.delayed(const Duration(seconds: 2));
|
||||
await Future<void>.delayed(const Duration(seconds: 2));
|
||||
|
||||
final Timeline timeline = await driver.traceAction(() async {
|
||||
expect(await driver.setSemantics(true), isTrue);
|
||||
|
@ -37,7 +37,7 @@ Future<void> main() async {
|
||||
/// Wait 50ms to allow the GPU thread to actually put up the frame. (The
|
||||
/// endOfFrame future ends when we send the data to the engine, before the GPU
|
||||
/// thread has had a chance to rasterize, etc.)
|
||||
await Future<Null>.delayed(const Duration(milliseconds: 50));
|
||||
await Future<void>.delayed(const Duration(milliseconds: 50));
|
||||
debugPrint('==== MEMORY BENCHMARK ==== READY ====');
|
||||
|
||||
await ready.future; // waits for tap sent by devicelab task
|
||||
@ -58,14 +58,14 @@ Future<void> main() async {
|
||||
for (int iteration = 0; iteration < maxIterations; iteration += 1) {
|
||||
debugPrint('Scroll down... $iteration/$maxIterations');
|
||||
await controller.fling(find.byType(ListView), const Offset(0.0, -700.0), speed);
|
||||
await Future<Null>.delayed(pauses);
|
||||
await Future<void>.delayed(pauses);
|
||||
}
|
||||
|
||||
// Scroll up
|
||||
for (int iteration = 0; iteration < maxIterations; iteration += 1) {
|
||||
debugPrint('Scroll up... $iteration/$maxIterations');
|
||||
await controller.fling(find.byType(ListView), const Offset(0.0, 300.0), speed);
|
||||
await Future<Null>.delayed(pauses);
|
||||
await Future<void>.delayed(pauses);
|
||||
}
|
||||
|
||||
debugPrint('==== MEMORY BENCHMARK ==== DONE ====');
|
||||
|
@ -33,7 +33,7 @@ class BenchmarkingBinding extends LiveTestWidgetsFlutterBinding {
|
||||
}
|
||||
}
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
assert(false); // don't run this in checked mode! Use --release.
|
||||
stock_data.StockData.actuallyFetchData = false;
|
||||
|
||||
|
@ -15,7 +15,7 @@ import '../common.dart';
|
||||
|
||||
const Duration kBenchmarkTime = Duration(seconds: 15);
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
assert(false); // don't run this in checked mode! Use --release.
|
||||
stock_data.StockData.actuallyFetchData = false;
|
||||
|
||||
|
@ -15,7 +15,7 @@ import '../common.dart';
|
||||
|
||||
const Duration kBenchmarkTime = Duration(seconds: 15);
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
stock_data.StockData.actuallyFetchData = false;
|
||||
|
||||
// We control the framePolicy below to prevent us from scheduling frames in
|
||||
|
@ -99,7 +99,7 @@ class Section {
|
||||
const String kDartDocPrefix = '///';
|
||||
const String kDartDocPrefixWithSpace = '$kDartDocPrefix ';
|
||||
|
||||
Future<Null> main(List<String> arguments) async {
|
||||
Future<void> main(List<String> arguments) async {
|
||||
final Directory tempDir = Directory.systemTemp.createTempSync('flutter_analyze_sample_code.');
|
||||
int exitCode = 1;
|
||||
bool keepMain = false;
|
||||
|
@ -11,8 +11,6 @@ import 'package:meta/meta.dart';
|
||||
|
||||
import 'run_command.dart';
|
||||
|
||||
typedef ShardRunner = Future<Null> Function();
|
||||
|
||||
final String flutterRoot = path.dirname(path.dirname(path.dirname(path.fromUri(Platform.script))));
|
||||
final String flutter = path.join(flutterRoot, 'bin', Platform.isWindows ? 'flutter.bat' : 'flutter');
|
||||
final String dart = path.join(flutterRoot, 'bin', 'cache', 'dart-sdk', 'bin', Platform.isWindows ? 'dart.exe' : 'dart');
|
||||
@ -25,7 +23,7 @@ final String pubCache = path.join(flutterRoot, '.pub-cache');
|
||||
///
|
||||
/// For example:
|
||||
/// bin/cache/dart-sdk/bin/dart dev/bots/analyze.dart --dart-sdk=/tmp/dart-sdk
|
||||
Future<Null> main(List<String> args) async {
|
||||
Future<void> main(List<String> args) async {
|
||||
await _verifyNoTestPackageImports(flutterRoot);
|
||||
await _verifyGeneratedPluginRegistrants(flutterRoot);
|
||||
await _verifyNoBadImportsInFlutter(flutterRoot);
|
||||
@ -84,7 +82,7 @@ Future<Null> main(List<String> args) async {
|
||||
print('${bold}DONE: Analysis successful.$reset');
|
||||
}
|
||||
|
||||
Future<Null> _verifyInternationalizations() async {
|
||||
Future<void> _verifyInternationalizations() async {
|
||||
final EvalResult genResult = await _evalCommand(
|
||||
dart,
|
||||
<String>[
|
||||
@ -134,7 +132,7 @@ Future<String> _getCommitRange() async {
|
||||
}
|
||||
|
||||
|
||||
Future<Null> _checkForTrailingSpaces() async {
|
||||
Future<void> _checkForTrailingSpaces() async {
|
||||
if (!Platform.isWindows) {
|
||||
final String commitRange = Platform.environment.containsKey('TEST_COMMIT_RANGE')
|
||||
? Platform.environment['TEST_COMMIT_RANGE']
|
||||
@ -229,7 +227,7 @@ Future<EvalResult> _evalCommand(String executable, List<String> arguments, {
|
||||
return result;
|
||||
}
|
||||
|
||||
Future<Null> _runFlutterAnalyze(String workingDirectory, {
|
||||
Future<void> _runFlutterAnalyze(String workingDirectory, {
|
||||
List<String> options = const <String>[]
|
||||
}) {
|
||||
return runCommand(flutter, <String>['analyze']..addAll(options),
|
||||
@ -237,7 +235,7 @@ Future<Null> _runFlutterAnalyze(String workingDirectory, {
|
||||
);
|
||||
}
|
||||
|
||||
Future<Null> _verifyNoTestPackageImports(String workingDirectory) async {
|
||||
Future<void> _verifyNoTestPackageImports(String workingDirectory) async {
|
||||
// TODO(ianh): Remove this whole test once https://github.com/dart-lang/matcher/issues/98 is fixed.
|
||||
final List<String> shims = <String>[];
|
||||
final List<String> errors = Directory(workingDirectory)
|
||||
@ -315,7 +313,7 @@ Future<Null> _verifyNoTestPackageImports(String workingDirectory) async {
|
||||
}
|
||||
}
|
||||
|
||||
Future<Null> _verifyNoBadImportsInFlutter(String workingDirectory) async {
|
||||
Future<void> _verifyNoBadImportsInFlutter(String workingDirectory) async {
|
||||
final List<String> errors = <String>[];
|
||||
final String libPath = path.join(workingDirectory, 'packages', 'flutter', 'lib');
|
||||
final String srcPath = path.join(workingDirectory, 'packages', 'flutter', 'lib', 'src');
|
||||
@ -439,7 +437,7 @@ List<T> _deepSearch<T>(Map<T, Set<T>> map, T start, [ Set<T> seen ]) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Future<Null> _verifyNoBadImportsInFlutterTools(String workingDirectory) async {
|
||||
Future<void> _verifyNoBadImportsInFlutterTools(String workingDirectory) async {
|
||||
final List<String> errors = <String>[];
|
||||
for (FileSystemEntity entity in Directory(path.join(workingDirectory, 'packages', 'flutter_tools', 'lib'))
|
||||
.listSync(recursive: true)
|
||||
@ -463,7 +461,7 @@ Future<Null> _verifyNoBadImportsInFlutterTools(String workingDirectory) async {
|
||||
}
|
||||
}
|
||||
|
||||
Future<Null> _verifyGeneratedPluginRegistrants(String flutterRoot) async {
|
||||
Future<void> _verifyGeneratedPluginRegistrants(String flutterRoot) async {
|
||||
final Directory flutterRootDir = Directory(flutterRoot);
|
||||
|
||||
final Map<String, List<File>> packageToRegistrants = <String, List<File>>{};
|
||||
|
@ -119,8 +119,8 @@ class ProcessRunner {
|
||||
stderr.write('Running "${commandLine.join(' ')}" in ${workingDirectory.path}.\n');
|
||||
}
|
||||
final List<int> output = <int>[];
|
||||
final Completer<Null> stdoutComplete = Completer<Null>();
|
||||
final Completer<Null> stderrComplete = Completer<Null>();
|
||||
final Completer<void> stdoutComplete = Completer<void>();
|
||||
final Completer<void> stderrComplete = Completer<void>();
|
||||
Process process;
|
||||
Future<int> allComplete() async {
|
||||
await stderrComplete.future;
|
||||
@ -291,7 +291,7 @@ class ArchiveCreator {
|
||||
|
||||
/// Clone the Flutter repo and make sure that the git environment is sane
|
||||
/// for when the user will unpack it.
|
||||
Future<Null> _checkoutFlutter() async {
|
||||
Future<void> _checkoutFlutter() async {
|
||||
// We want the user to start out the in the specified branch instead of a
|
||||
// detached head. To do that, we need to make sure the branch points at the
|
||||
// desired revision.
|
||||
@ -303,7 +303,7 @@ class ArchiveCreator {
|
||||
}
|
||||
|
||||
/// Retrieve the MinGit executable from storage and unpack it.
|
||||
Future<Null> _installMinGitIfNeeded() async {
|
||||
Future<void> _installMinGitIfNeeded() async {
|
||||
if (!platform.isWindows) {
|
||||
return;
|
||||
}
|
||||
@ -319,7 +319,7 @@ class ArchiveCreator {
|
||||
|
||||
/// Prepare the archive repo so that it has all of the caches warmed up and
|
||||
/// is configured for the user to begin working.
|
||||
Future<Null> _populateCaches() async {
|
||||
Future<void> _populateCaches() async {
|
||||
await _runFlutter(<String>['doctor']);
|
||||
await _runFlutter(<String>['update-packages']);
|
||||
await _runFlutter(<String>['precache']);
|
||||
@ -342,7 +342,7 @@ class ArchiveCreator {
|
||||
}
|
||||
|
||||
/// Write the archive to the given output file.
|
||||
Future<Null> _archiveFiles(File outputFile) async {
|
||||
Future<void> _archiveFiles(File outputFile) async {
|
||||
if (outputFile.path.toLowerCase().endsWith('.zip')) {
|
||||
await _createZipArchive(outputFile, flutterRoot);
|
||||
} else if (outputFile.path.toLowerCase().endsWith('.tar.xz')) {
|
||||
@ -454,7 +454,7 @@ class ArchivePublisher {
|
||||
static String getMetadataFilename(Platform platform) => 'releases_${platform.operatingSystem.toLowerCase()}.json';
|
||||
|
||||
/// Publish the archive to Google Storage.
|
||||
Future<Null> publishArchive() async {
|
||||
Future<void> publishArchive() async {
|
||||
final String destGsPath = '$gsReleaseFolder/$destinationArchivePath';
|
||||
await _cloudCopy(outputFile.absolute.path, destGsPath);
|
||||
assert(tempDir.existsSync());
|
||||
@ -497,7 +497,7 @@ class ArchivePublisher {
|
||||
return jsonData;
|
||||
}
|
||||
|
||||
Future<Null> _updateMetadata() async {
|
||||
Future<void> _updateMetadata() async {
|
||||
// We can't just cat the metadata from the server with 'gsutil cat', because
|
||||
// Windows wants to echo the commands that execute in gsutil.bat to the
|
||||
// stdout when we do that. So, we copy the file locally and then read it
|
||||
@ -569,7 +569,7 @@ class ArchivePublisher {
|
||||
///
|
||||
/// Archives contain the executables and customizations for the platform that
|
||||
/// they are created on.
|
||||
Future<Null> main(List<String> argList) async {
|
||||
Future<void> main(List<String> argList) async {
|
||||
final ArgParser argParser = ArgParser();
|
||||
argParser.addOption(
|
||||
'temp_dir',
|
||||
|
@ -30,7 +30,7 @@ void printProgress(String action, String workingDir, String command) {
|
||||
print('$arrow $action: cd $cyan$workingDir$reset; $yellow$command$reset');
|
||||
}
|
||||
|
||||
Future<Null> runCommand(String executable, List<String> arguments, {
|
||||
Future<void> runCommand(String executable, List<String> arguments, {
|
||||
String workingDirectory,
|
||||
Map<String, String> environment,
|
||||
bool expectNonZeroExit = false,
|
||||
|
@ -9,7 +9,7 @@ import 'package:path/path.dart' as path;
|
||||
|
||||
import 'run_command.dart';
|
||||
|
||||
typedef ShardRunner = Future<Null> Function();
|
||||
typedef ShardRunner = Future<void> Function();
|
||||
|
||||
final String flutterRoot = path.dirname(path.dirname(path.dirname(path.fromUri(Platform.script))));
|
||||
final String flutter = path.join(flutterRoot, 'bin', Platform.isWindows ? 'flutter.bat' : 'flutter');
|
||||
@ -37,7 +37,7 @@ const Duration _kShortTimeout = Duration(minutes: 5);
|
||||
/// For example:
|
||||
/// SHARD=tool_tests bin/cache/dart-sdk/bin/dart dev/bots/test.dart
|
||||
/// bin/cache/dart-sdk/bin/dart dev/bots/test.dart --local-engine=host_debug_unopt
|
||||
Future<Null> main(List<String> args) async {
|
||||
Future<void> main(List<String> args) async {
|
||||
flutterTestArgs.addAll(args);
|
||||
|
||||
final String shard = Platform.environment['SHARD'];
|
||||
@ -58,7 +58,7 @@ Future<Null> main(List<String> args) async {
|
||||
}
|
||||
}
|
||||
|
||||
Future<Null> _runSmokeTests() async {
|
||||
Future<void> _runSmokeTests() async {
|
||||
// Verify that the tests actually return failure on failure and success on
|
||||
// success.
|
||||
final String automatedTests = path.join(flutterRoot, 'dev', 'automated_tests');
|
||||
@ -138,7 +138,7 @@ Future<Null> _runSmokeTests() async {
|
||||
await _verifyVersion(path.join(flutterRoot, 'version'));
|
||||
}
|
||||
|
||||
Future<Null> _runToolTests() async {
|
||||
Future<void> _runToolTests() async {
|
||||
await _runSmokeTests();
|
||||
|
||||
await _pubRunTest(
|
||||
@ -149,7 +149,7 @@ Future<Null> _runToolTests() async {
|
||||
print('${bold}DONE: All tests successful.$reset');
|
||||
}
|
||||
|
||||
Future<Null> _runTests() async {
|
||||
Future<void> _runTests() async {
|
||||
await _runSmokeTests();
|
||||
|
||||
await _runFlutterTest(path.join(flutterRoot, 'packages', 'flutter'));
|
||||
@ -171,7 +171,7 @@ Future<Null> _runTests() async {
|
||||
print('${bold}DONE: All tests successful.$reset');
|
||||
}
|
||||
|
||||
Future<Null> _runCoverage() async {
|
||||
Future<void> _runCoverage() async {
|
||||
final File coverageFile = File(path.join(flutterRoot, 'packages', 'flutter', 'coverage', 'lcov.info'));
|
||||
if (!coverageFile.existsSync()) {
|
||||
print('${red}Coverage file not found.$reset');
|
||||
@ -193,7 +193,7 @@ Future<Null> _runCoverage() async {
|
||||
print('${bold}DONE: Coverage collection successful.$reset');
|
||||
}
|
||||
|
||||
Future<Null> _pubRunTest(
|
||||
Future<void> _pubRunTest(
|
||||
String workingDirectory, {
|
||||
String testPath,
|
||||
bool enableFlutterToolAsserts = false
|
||||
@ -234,7 +234,7 @@ class EvalResult {
|
||||
final int exitCode;
|
||||
}
|
||||
|
||||
Future<Null> _runFlutterTest(String workingDirectory, {
|
||||
Future<void> _runFlutterTest(String workingDirectory, {
|
||||
String script,
|
||||
bool expectFailure = false,
|
||||
bool printOutput = true,
|
||||
@ -268,7 +268,7 @@ Future<Null> _runFlutterTest(String workingDirectory, {
|
||||
);
|
||||
}
|
||||
|
||||
Future<Null> _verifyVersion(String filename) async {
|
||||
Future<void> _verifyVersion(String filename) async {
|
||||
if (!File(filename).existsSync()) {
|
||||
print('$redLine');
|
||||
print('The version logic failed to create the Flutter version file.');
|
||||
|
@ -177,7 +177,7 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(() async {
|
||||
... do something interesting ...
|
||||
|
||||
|
@ -19,7 +19,7 @@ List<String> _taskNames = <String>[];
|
||||
///
|
||||
/// The tasks are chosen depending on the command-line options
|
||||
/// (see [_argParser]).
|
||||
Future<Null> main(List<String> rawArgs) async {
|
||||
Future<void> main(List<String> rawArgs) async {
|
||||
ArgResults args;
|
||||
try {
|
||||
args = _argParser.parse(rawArgs);
|
||||
|
@ -7,6 +7,6 @@ import 'dart:async';
|
||||
import 'package:flutter_devicelab/tasks/analysis.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(analyzerBenchmarkTask);
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/framework/utils.dart';
|
||||
import 'package:flutter_devicelab/tasks/sample_catalog_generator.dart';
|
||||
|
||||
Future<Null> main(List<String> args) async {
|
||||
Future<void> main(List<String> args) async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(() => samplePageCatalogGenerator(extractCloudAuthTokenArg(args)));
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createBasicMaterialCompileTest());
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createBasicMaterialCompileTest());
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createBasicMaterialCompileTest());
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createChannelsIntegrationTest());
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createChannelsIntegrationTest());
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createChannelsIntegrationTest());
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ void main() {
|
||||
await device.unlock();
|
||||
final Directory appDir = dir(path.join(flutterDirectory.path, 'dev/integration_tests/ui'));
|
||||
await inDirectory(appDir, () async {
|
||||
final Completer<Null> ready = Completer<Null>();
|
||||
final Completer<void> ready = Completer<void>();
|
||||
bool ok;
|
||||
print('run: starting...');
|
||||
final Process run = await startProcess(
|
||||
@ -107,7 +107,7 @@ class DriveHelper {
|
||||
|
||||
final int vmServicePort;
|
||||
|
||||
Future<Null> drive(String name) async {
|
||||
Future<void> drive(String name) async {
|
||||
print('drive: running commands_$name check...');
|
||||
final Process drive = await startProcess(
|
||||
path.join(flutterDirectory.path, 'bin', 'flutter'),
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createComplexLayoutStartupTest());
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createComplexLayoutCompileTest());
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createComplexLayoutCompileTest());
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createComplexLayoutStartupTest());
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/framework/utils.dart';
|
||||
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(MemoryTest(
|
||||
'${flutterDirectory.path}/dev/benchmarks/complex_layout',
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createComplexLayoutScrollPerfTest());
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createComplexLayoutScrollPerfTest());
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createComplexLayoutCompileTest());
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/framework/utils.dart';
|
||||
import 'package:path/path.dart' as path;
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(() async {
|
||||
final Stopwatch clock = Stopwatch()..start();
|
||||
final Process analysis = await startProcess(
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createEmbeddedAndroidViewsIntegrationTest());
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createExternalUiIntegrationTest());
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createExternalUiIntegrationTest());
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createFlavorsTest());
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createFlavorsTest());
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createFlavorsTest());
|
||||
}
|
||||
|
@ -13,11 +13,11 @@ import 'package:flutter_devicelab/framework/utils.dart';
|
||||
|
||||
Future<void> testReload(Process process, { Future<void> Function() onListening }) async {
|
||||
section('Testing hot reload, restart and quit');
|
||||
final Completer<Null> listening = Completer<Null>();
|
||||
final Completer<Null> ready = Completer<Null>();
|
||||
final Completer<Null> reloaded = Completer<Null>();
|
||||
final Completer<Null> restarted = Completer<Null>();
|
||||
final Completer<Null> finished = Completer<Null>();
|
||||
final Completer<void> listening = Completer<void>();
|
||||
final Completer<void> ready = Completer<void>();
|
||||
final Completer<void> reloaded = Completer<void>();
|
||||
final Completer<void> restarted = Completer<void>();
|
||||
final Completer<void> finished = Completer<void>();
|
||||
final List<String> stdout = <String>[];
|
||||
final List<String> stderr = <String>[];
|
||||
|
||||
@ -52,7 +52,7 @@ Future<void> testReload(Process process, { Future<void> Function() onListening }
|
||||
|
||||
process.exitCode.then<void>((int processExitCode) { exitCode = processExitCode; });
|
||||
|
||||
Future<dynamic> eventOrExit(Future<Null> event) {
|
||||
Future<dynamic> eventOrExit(Future<void> event) {
|
||||
return Future.any<dynamic>(<Future<dynamic>>[ event, process.exitCode ]);
|
||||
}
|
||||
|
||||
@ -116,7 +116,7 @@ void main() {
|
||||
});
|
||||
|
||||
// Give the device the time to really shut down the app.
|
||||
await Future<Null>.delayed(const Duration(milliseconds: 200));
|
||||
await Future<void>.delayed(const Duration(milliseconds: 200));
|
||||
// After the delay, force-stopping it shouldn't do anything, but doesn't hurt.
|
||||
await device.shellExec('am', <String>['force-stop', kAppId]);
|
||||
|
||||
|
@ -35,7 +35,7 @@ class BackButtonMemoryTest extends MemoryTest {
|
||||
await receivedNextMessage;
|
||||
|
||||
// Give Android time to settle (e.g. run GCs) after closing the app.
|
||||
await Future<Null>.delayed(const Duration(milliseconds: 100));
|
||||
await Future<void>.delayed(const Duration(milliseconds: 100));
|
||||
|
||||
// Relaunch the app, wait for it to launch.
|
||||
prepareForNextMessage('READY');
|
||||
@ -46,13 +46,13 @@ class BackButtonMemoryTest extends MemoryTest {
|
||||
await receivedNextMessage;
|
||||
|
||||
// Wait for the Flutter app to settle (e.g. run GCs).
|
||||
await Future<Null>.delayed(const Duration(milliseconds: 100));
|
||||
await Future<void>.delayed(const Duration(milliseconds: 100));
|
||||
}
|
||||
await recordEnd();
|
||||
}
|
||||
}
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(BackButtonMemoryTest().run);
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/framework/utils.dart';
|
||||
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(MemoryTest(
|
||||
'${flutterDirectory.path}/examples/flutter_gallery',
|
||||
'test_memory/memory_nav.dart',
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createFlutterGalleryStartupTest());
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/gallery.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createGalleryTransitionTest());
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/gallery.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(() async {
|
||||
final TaskResult withoutSemantics = await createGalleryTransitionTest()();
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createFlutterGalleryCompileTest());
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ import 'package:flutter_devicelab/framework/utils.dart';
|
||||
// with the Java code to report its status. If this test fails due to a problem on the Dart
|
||||
// side, you can debug that by just running that file directly using `flutter run`.
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
|
||||
await task(() async {
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createFlutterGalleryStartupTest());
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/gallery.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createGalleryTransitionTest());
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createFlutterGalleryCompileTest());
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createFlutterGalleryStartupTest());
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/gallery.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createGalleryTransitionTest());
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createFlutterGalleryCompileTest());
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createFlutterViewStartupTest());
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(() async {
|
||||
final Directory iosDirectory = dir(
|
||||
|
@ -166,7 +166,7 @@ class FlutterProject {
|
||||
String get rootPath => path.join(parent.path, name);
|
||||
String get androidPath => path.join(rootPath, 'android');
|
||||
|
||||
Future<Null> addCustomBuildType(String name, {String initWith}) async {
|
||||
Future<void> addCustomBuildType(String name, {String initWith}) async {
|
||||
final File buildScript = File(
|
||||
path.join(androidPath, 'app', 'build.gradle'),
|
||||
);
|
||||
@ -183,7 +183,7 @@ android {
|
||||
''');
|
||||
}
|
||||
|
||||
Future<Null> addProductFlavor(String name) async {
|
||||
Future<void> addProductFlavor(String name) async {
|
||||
final File buildScript = File(
|
||||
path.join(androidPath, 'app', 'build.gradle'),
|
||||
);
|
||||
@ -202,14 +202,14 @@ android {
|
||||
''');
|
||||
}
|
||||
|
||||
Future<Null> introduceError() async {
|
||||
Future<void> introduceError() async {
|
||||
final File buildScript = File(
|
||||
path.join(androidPath, 'app', 'build.gradle'),
|
||||
);
|
||||
await buildScript.writeAsString((await buildScript.readAsString()).replaceAll('buildTypes', 'builTypes'));
|
||||
}
|
||||
|
||||
Future<Null> runGradleTask(String task, {List<String> options}) async {
|
||||
Future<void> runGradleTask(String task, {List<String> options}) async {
|
||||
return _runGradleTask(workingDirectory: androidPath, task: task, options: options);
|
||||
}
|
||||
|
||||
@ -244,14 +244,14 @@ class FlutterPluginProject {
|
||||
String get exampleAndroidPath => path.join(examplePath, 'android');
|
||||
String get debugApkPath => path.join(examplePath, 'build', 'app', 'outputs', 'apk', 'debug', 'app-debug.apk');
|
||||
|
||||
Future<Null> runGradleTask(String task, {List<String> options}) async {
|
||||
Future<void> runGradleTask(String task, {List<String> options}) async {
|
||||
return _runGradleTask(workingDirectory: exampleAndroidPath, task: task, options: options);
|
||||
}
|
||||
|
||||
bool get hasDebugApk => File(debugApkPath).existsSync();
|
||||
}
|
||||
|
||||
Future<Null> _runGradleTask({String workingDirectory, String task, List<String> options}) async {
|
||||
Future<void> _runGradleTask({String workingDirectory, String task, List<String> options}) async {
|
||||
final ProcessResult result = await _resultOfGradleTask(
|
||||
workingDirectory: workingDirectory,
|
||||
task: task,
|
||||
|
@ -27,13 +27,13 @@ class HelloWorldMemoryTest extends MemoryTest {
|
||||
'-d', device.deviceId,
|
||||
test,
|
||||
]);
|
||||
await Future<Null>.delayed(const Duration(milliseconds: 1500));
|
||||
await Future<void>.delayed(const Duration(milliseconds: 1500));
|
||||
await recordStart();
|
||||
await Future<Null>.delayed(const Duration(milliseconds: 3000));
|
||||
await Future<void>.delayed(const Duration(milliseconds: 3000));
|
||||
await recordEnd();
|
||||
}
|
||||
}
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(HelloWorldMemoryTest().run);
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createHelloWorldCompileTest());
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createHelloWorldCompileTest());
|
||||
}
|
||||
|
@ -7,6 +7,6 @@ import 'dart:async';
|
||||
import 'package:flutter_devicelab/tasks/hot_mode_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(createHotModeTest());
|
||||
}
|
||||
|
@ -7,6 +7,6 @@ import 'dart:async';
|
||||
import 'package:flutter_devicelab/tasks/hot_mode_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(createHotModeTest());
|
||||
}
|
||||
|
@ -7,6 +7,6 @@ import 'dart:async';
|
||||
import 'package:flutter_devicelab/tasks/hot_mode_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(createHotModeTest());
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
/// End to end tests for Android.
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(runEndToEndTests);
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
/// End to end tests for iOS.
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(runEndToEndTests);
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/framework/utils.dart';
|
||||
import 'package:flutter_devicelab/tasks/sample_catalog_generator.dart';
|
||||
|
||||
Future<Null> main(List<String> args) async {
|
||||
Future<void> main(List<String> args) async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(() => samplePageCatalogGenerator(extractCloudAuthTokenArg(args)));
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/microbenchmarks.dart';
|
||||
|
||||
/// Runs microbenchmarks on Android.
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createMicrobenchmarkTask());
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/microbenchmarks.dart';
|
||||
|
||||
/// Runs microbenchmarks on iOS.
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createMicrobenchmarkTask());
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ import 'package:path/path.dart' as path;
|
||||
|
||||
/// Tests that the Flutter module project template works and supports
|
||||
/// adding Flutter to an existing Android app.
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(() async {
|
||||
|
||||
section('Find Java');
|
||||
|
@ -12,7 +12,7 @@ import 'package:path/path.dart' as path;
|
||||
|
||||
/// Tests that the Flutter module project template works and supports
|
||||
/// adding Flutter to an existing iOS app.
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(() async {
|
||||
|
||||
section('Create Flutter module project');
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createPlatformChannelSampleTest());
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createPlatformChannelSampleTest());
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createPlatformInteractionTest());
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
import 'package:flutter_devicelab/tasks/integration_tests.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(createPlatformInteractionTest());
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createPlatformViewStartupTest());
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.ios;
|
||||
await task(() async {
|
||||
final Directory iosDirectory = dir(
|
||||
|
@ -7,7 +7,7 @@ import 'dart:async';
|
||||
import 'package:flutter_devicelab/tasks/plugin_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(combine(<TaskFunction>[
|
||||
PluginTest('apk', <String>['-a', 'java']),
|
||||
PluginTest('apk', <String>['-a', 'kotlin']),
|
||||
|
@ -7,7 +7,7 @@ import 'dart:async';
|
||||
import 'package:flutter_devicelab/tasks/plugin_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(combine(<TaskFunction>[
|
||||
PluginTest('ios', <String>['-i', 'objc']),
|
||||
PluginTest('ios', <String>['-i', 'swift']),
|
||||
|
@ -7,7 +7,7 @@ import 'dart:async';
|
||||
import 'package:flutter_devicelab/tasks/plugin_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(combine(<TaskFunction>[
|
||||
PluginTest('apk', <String>['-a', 'java']),
|
||||
PluginTest('apk', <String>['-a', 'kotlin']),
|
||||
|
@ -29,7 +29,7 @@ void main() {
|
||||
});
|
||||
section('TEST WHETHER `flutter run --route` WORKS');
|
||||
await inDirectory(appDir, () async {
|
||||
final Completer<Null> ready = Completer<Null>();
|
||||
final Completer<void> ready = Completer<void>();
|
||||
bool ok;
|
||||
print('run: starting...');
|
||||
final Process run = await startProcess(
|
||||
|
@ -39,7 +39,7 @@ void main() {
|
||||
final Directory appDir =
|
||||
dir(path.join(flutterDirectory.path, 'dev/integration_tests/ui'));
|
||||
await inDirectory(appDir, () async {
|
||||
final Completer<Null> ready = Completer<Null>();
|
||||
final Completer<void> ready = Completer<void>();
|
||||
bool ok;
|
||||
print('run: starting...');
|
||||
final Process run = await startProcess(
|
||||
|
@ -18,7 +18,7 @@ void main() {
|
||||
await device.unlock();
|
||||
final Directory appDir = dir(path.join(flutterDirectory.path, 'dev/integration_tests/ui'));
|
||||
await inDirectory(appDir, () async {
|
||||
final Completer<Null> ready = Completer<Null>();
|
||||
final Completer<void> ready = Completer<void>();
|
||||
print('run: starting...');
|
||||
final Process run = await startProcess(
|
||||
path.join(flutterDirectory.path, 'bin', 'flutter'),
|
||||
|
@ -21,7 +21,7 @@ void main() {
|
||||
await device.unlock();
|
||||
final Directory appDir = dir(path.join(flutterDirectory.path, 'dev/integration_tests/ui'));
|
||||
await inDirectory(appDir, () async {
|
||||
final Completer<Null> ready = Completer<Null>();
|
||||
final Completer<void> ready = Completer<void>();
|
||||
bool ok;
|
||||
print('run: starting...');
|
||||
final Process run = await startProcess(
|
||||
|
@ -7,7 +7,7 @@ import 'dart:async';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
/// Smoke test of a task that fails by returning an unsuccessful response.
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(() async {
|
||||
return TaskResult.failure('Failed');
|
||||
});
|
||||
|
@ -10,4 +10,4 @@ import 'dart:async';
|
||||
/// therefore will not accept requests to run tasks. When the runner attempts to
|
||||
/// connect and run the test it will receive a "method not found" error from the
|
||||
/// VM service, will likely retry and finally time out.
|
||||
Future<Null> main() async {}
|
||||
Future<void> main() async {}
|
||||
|
@ -7,7 +7,7 @@ import 'dart:async';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
/// Smoke test of a successful task.
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(() async {
|
||||
return TaskResult.success(<String, dynamic>{});
|
||||
});
|
||||
|
@ -7,7 +7,7 @@ import 'dart:async';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
/// Smoke test of a task that fails with an exception.
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(() async {
|
||||
throw 'failed';
|
||||
});
|
||||
|
@ -76,7 +76,7 @@ Future<int> countDependencies() async {
|
||||
const String _kCostBenchmarkKey = 'technical_debt_in_dollars';
|
||||
const String _kNumberOfDependenciesKey = 'dependencies_count';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
await task(() async {
|
||||
return TaskResult.success(
|
||||
<String, dynamic>{
|
||||
|
@ -8,7 +8,7 @@ import 'package:flutter_devicelab/tasks/perf_tests.dart';
|
||||
import 'package:flutter_devicelab/framework/adb.dart';
|
||||
import 'package:flutter_devicelab/framework/framework.dart';
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
deviceOperatingSystem = DeviceOperatingSystem.android;
|
||||
await task(createTilesScrollPerfTest());
|
||||
}
|
||||
|
@ -39,7 +39,7 @@ abstract class DeviceDiscovery {
|
||||
///
|
||||
/// Calling this method does not guarantee that the same device will be
|
||||
/// returned. For such behavior see [workingDevice].
|
||||
Future<Null> chooseWorkingDevice();
|
||||
Future<void> chooseWorkingDevice();
|
||||
|
||||
/// A device to work with.
|
||||
///
|
||||
@ -55,7 +55,7 @@ abstract class DeviceDiscovery {
|
||||
Future<Map<String, HealthCheckResult>> checkDevices();
|
||||
|
||||
/// Prepares the system to run tasks.
|
||||
Future<Null> performPreflightTasks();
|
||||
Future<void> performPreflightTasks();
|
||||
}
|
||||
|
||||
/// A proxy for one specific device.
|
||||
@ -70,21 +70,21 @@ abstract class Device {
|
||||
Future<bool> isAsleep();
|
||||
|
||||
/// Wake up the device if it is not awake.
|
||||
Future<Null> wakeUp();
|
||||
Future<void> wakeUp();
|
||||
|
||||
/// Send the device to sleep mode.
|
||||
Future<Null> sendToSleep();
|
||||
Future<void> sendToSleep();
|
||||
|
||||
/// Emulates pressing the power button, toggling the device's on/off state.
|
||||
Future<Null> togglePower();
|
||||
Future<void> togglePower();
|
||||
|
||||
/// Unlocks the device.
|
||||
///
|
||||
/// Assumes the device doesn't have a secure unlock pattern.
|
||||
Future<Null> unlock();
|
||||
Future<void> unlock();
|
||||
|
||||
/// Emulate a tap on the touch screen.
|
||||
Future<Null> tap(int x, int y);
|
||||
Future<void> tap(int x, int y);
|
||||
|
||||
/// Read memory statistics for a process.
|
||||
Future<Map<String, dynamic>> getMemoryStats(String packageName);
|
||||
@ -96,7 +96,7 @@ abstract class Device {
|
||||
Stream<String> get logcat;
|
||||
|
||||
/// Stop a process.
|
||||
Future<Null> stop(String packageName);
|
||||
Future<void> stop(String packageName);
|
||||
}
|
||||
|
||||
class AndroidDeviceDiscovery implements DeviceDiscovery {
|
||||
@ -127,7 +127,7 @@ class AndroidDeviceDiscovery implements DeviceDiscovery {
|
||||
/// Picks a random Android device out of connected devices and sets it as
|
||||
/// [workingDevice].
|
||||
@override
|
||||
Future<Null> chooseWorkingDevice() async {
|
||||
Future<void> chooseWorkingDevice() async {
|
||||
final List<Device> allDevices = (await discoverDevices())
|
||||
.map<Device>((String id) => AndroidDevice(deviceId: id))
|
||||
.toList();
|
||||
@ -187,7 +187,7 @@ class AndroidDeviceDiscovery implements DeviceDiscovery {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Null> performPreflightTasks() async {
|
||||
Future<void> performPreflightTasks() async {
|
||||
// Kills the `adb` server causing it to start a new instance upon next
|
||||
// command.
|
||||
//
|
||||
@ -218,14 +218,14 @@ class AndroidDevice implements Device {
|
||||
|
||||
/// Wake up the device if it is not awake using [togglePower].
|
||||
@override
|
||||
Future<Null> wakeUp() async {
|
||||
Future<void> wakeUp() async {
|
||||
if (!(await isAwake()))
|
||||
await togglePower();
|
||||
}
|
||||
|
||||
/// Send the device to sleep mode if it is not asleep using [togglePower].
|
||||
@override
|
||||
Future<Null> sendToSleep() async {
|
||||
Future<void> sendToSleep() async {
|
||||
if (!(await isAsleep()))
|
||||
await togglePower();
|
||||
}
|
||||
@ -233,7 +233,7 @@ class AndroidDevice implements Device {
|
||||
/// Sends `KEYCODE_POWER` (26), which causes the device to toggle its mode
|
||||
/// between awake and asleep.
|
||||
@override
|
||||
Future<Null> togglePower() async {
|
||||
Future<void> togglePower() async {
|
||||
await shellExec('input', const <String>['keyevent', '26']);
|
||||
}
|
||||
|
||||
@ -241,13 +241,13 @@ class AndroidDevice implements Device {
|
||||
///
|
||||
/// This only works when the device doesn't have a secure unlock pattern.
|
||||
@override
|
||||
Future<Null> unlock() async {
|
||||
Future<void> unlock() async {
|
||||
await wakeUp();
|
||||
await shellExec('input', const <String>['keyevent', '82']);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Null> tap(int x, int y) async {
|
||||
Future<void> tap(int x, int y) async {
|
||||
await shellExec('input', <String>['tap', '$x', '$y']);
|
||||
}
|
||||
|
||||
@ -261,7 +261,7 @@ class AndroidDevice implements Device {
|
||||
}
|
||||
|
||||
/// Executes [command] on `adb shell` and returns its exit code.
|
||||
Future<Null> shellExec(String command, List<String> arguments, { Map<String, String> environment }) async {
|
||||
Future<void> shellExec(String command, List<String> arguments, { Map<String, String> environment }) async {
|
||||
await adb(<String>['shell', command]..addAll(arguments), environment: environment);
|
||||
}
|
||||
|
||||
@ -343,7 +343,7 @@ class AndroidDevice implements Device {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Null> stop(String packageName) async {
|
||||
Future<void> stop(String packageName) async {
|
||||
return shellExec('am', <String>['force-stop', packageName]);
|
||||
}
|
||||
}
|
||||
@ -371,7 +371,7 @@ class IosDeviceDiscovery implements DeviceDiscovery {
|
||||
/// Picks a random iOS device out of connected devices and sets it as
|
||||
/// [workingDevice].
|
||||
@override
|
||||
Future<Null> chooseWorkingDevice() async {
|
||||
Future<void> chooseWorkingDevice() async {
|
||||
final List<IosDevice> allDevices = (await discoverDevices())
|
||||
.map<IosDevice>((String id) => IosDevice(deviceId: id))
|
||||
.toList();
|
||||
@ -405,7 +405,7 @@ class IosDeviceDiscovery implements DeviceDiscovery {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Null> performPreflightTasks() async {
|
||||
Future<void> performPreflightTasks() async {
|
||||
// Currently we do not have preflight tasks for iOS.
|
||||
return null;
|
||||
}
|
||||
@ -430,19 +430,19 @@ class IosDevice implements Device {
|
||||
Future<bool> isAsleep() async => false;
|
||||
|
||||
@override
|
||||
Future<Null> wakeUp() async {}
|
||||
Future<void> wakeUp() async {}
|
||||
|
||||
@override
|
||||
Future<Null> sendToSleep() async {}
|
||||
Future<void> sendToSleep() async {}
|
||||
|
||||
@override
|
||||
Future<Null> togglePower() async {}
|
||||
Future<void> togglePower() async {}
|
||||
|
||||
@override
|
||||
Future<Null> unlock() async {}
|
||||
Future<void> unlock() async {}
|
||||
|
||||
@override
|
||||
Future<Null> tap(int x, int y) async {
|
||||
Future<void> tap(int x, int y) async {
|
||||
throw 'Not implemented';
|
||||
}
|
||||
|
||||
@ -457,7 +457,7 @@ class IosDevice implements Device {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Null> stop(String packageName) async {}
|
||||
Future<void> stop(String packageName) async {}
|
||||
}
|
||||
|
||||
/// Path to the `adb` executable.
|
||||
|
@ -19,7 +19,7 @@ const FileSystem _fs = io.LocalFileSystem();
|
||||
/// information required to build and run the project, if
|
||||
/// FLUTTER_DEVICELAB_XCODE_PROVISIONING_CONFIG is set. If it is not set,
|
||||
/// we rely on automatic signing by Xcode.
|
||||
Future<Null> prepareProvisioningCertificates(String flutterProjectPath) async {
|
||||
Future<void> prepareProvisioningCertificates(String flutterProjectPath) async {
|
||||
final String certificateConfig = await _readProvisioningConfigFile();
|
||||
if (certificateConfig == null) {
|
||||
// No cert config available, rely on automatic signing by Xcode.
|
||||
@ -31,12 +31,12 @@ Future<Null> prepareProvisioningCertificates(String flutterProjectPath) async {
|
||||
await testXcconfig.writeAsString(certificateConfig);
|
||||
}
|
||||
|
||||
Future<Null> runPodInstallForCustomPodfile(String flutterProjectPath) async {
|
||||
Future<void> runPodInstallForCustomPodfile(String flutterProjectPath) async {
|
||||
final String iosPath = path.join(flutterProjectPath, 'ios');
|
||||
exec('pod', <String>['install', '--project-directory=$iosPath']);
|
||||
}
|
||||
|
||||
Future<Null> _patchXcconfigFilesIfNotPatched(String flutterProjectPath) async {
|
||||
Future<void> _patchXcconfigFilesIfNotPatched(String flutterProjectPath) async {
|
||||
final List<File> xcconfigFiles = <File>[
|
||||
_fs.file(path.join(flutterProjectPath, 'ios/Flutter/Flutter.xcconfig')),
|
||||
_fs.file(path.join(flutterProjectPath, 'ios/Flutter/Debug.xcconfig')),
|
||||
|
@ -97,7 +97,7 @@ Future<VMIsolateRef> _connectToRunnerIsolate(int vmServicePort) async {
|
||||
// delay to let the task process open up the VM service port.
|
||||
// Otherwise we almost always hit the non-ready case first and
|
||||
// wait a whole 1 second, which is annoying.
|
||||
await Future<Null>.delayed(const Duration(milliseconds: 100));
|
||||
await Future<void>.delayed(const Duration(milliseconds: 100));
|
||||
|
||||
while (true) {
|
||||
try {
|
||||
@ -123,7 +123,7 @@ Future<VMIsolateRef> _connectToRunnerIsolate(int vmServicePort) async {
|
||||
print('VM service not ready yet: $error');
|
||||
const Duration pauseBetweenRetries = Duration(milliseconds: 200);
|
||||
print('Will retry in $pauseBetweenRetries.');
|
||||
await Future<Null>.delayed(pauseBetweenRetries);
|
||||
await Future<void>.delayed(pauseBetweenRetries);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -243,12 +243,12 @@ Future<Process> startProcess(
|
||||
return process;
|
||||
}
|
||||
|
||||
Future<Null> forceQuitRunningProcesses() async {
|
||||
Future<void> forceQuitRunningProcesses() async {
|
||||
if (_runningProcesses.isEmpty)
|
||||
return;
|
||||
|
||||
// Give normally quitting processes a chance to report their exit code.
|
||||
await Future<Null>.delayed(const Duration(seconds: 1));
|
||||
await Future<void>.delayed(const Duration(seconds: 1));
|
||||
|
||||
// Whatever's left, kill it.
|
||||
for (ProcessInfo p in _runningProcesses) {
|
||||
@ -270,8 +270,8 @@ Future<int> exec(
|
||||
}) async {
|
||||
final Process process = await startProcess(executable, arguments, environment: environment, workingDirectory: workingDirectory);
|
||||
|
||||
final Completer<Null> stdoutDone = Completer<Null>();
|
||||
final Completer<Null> stderrDone = Completer<Null>();
|
||||
final Completer<void> stdoutDone = Completer<void>();
|
||||
final Completer<void> stderrDone = Completer<void>();
|
||||
process.stdout
|
||||
.transform<String>(utf8.decoder)
|
||||
.transform<String>(const LineSplitter())
|
||||
@ -285,7 +285,7 @@ Future<int> exec(
|
||||
print('stderr: $line');
|
||||
}, onDone: () { stderrDone.complete(); });
|
||||
|
||||
await Future.wait<Null>(<Future<Null>>[stdoutDone.future, stderrDone.future]);
|
||||
await Future.wait<void>(<Future<void>>[stdoutDone.future, stderrDone.future]);
|
||||
final int exitCode = await process.exitCode;
|
||||
|
||||
if (exitCode != 0 && !canFail)
|
||||
@ -307,8 +307,8 @@ Future<String> eval(
|
||||
final Process process = await startProcess(executable, arguments, environment: environment, workingDirectory: workingDirectory);
|
||||
|
||||
final StringBuffer output = StringBuffer();
|
||||
final Completer<Null> stdoutDone = Completer<Null>();
|
||||
final Completer<Null> stderrDone = Completer<Null>();
|
||||
final Completer<void> stdoutDone = Completer<void>();
|
||||
final Completer<void> stderrDone = Completer<void>();
|
||||
process.stdout
|
||||
.transform<String>(utf8.decoder)
|
||||
.transform<String>(const LineSplitter())
|
||||
@ -323,7 +323,7 @@ Future<String> eval(
|
||||
print('stderr: $line');
|
||||
}, onDone: () { stderrDone.complete(); });
|
||||
|
||||
await Future.wait<Null>(<Future<Null>>[stdoutDone.future, stderrDone.future]);
|
||||
await Future.wait<void>(<Future<void>>[stdoutDone.future, stderrDone.future]);
|
||||
final int exitCode = await process.exitCode;
|
||||
|
||||
if (exitCode != 0 && !canFail)
|
||||
@ -420,7 +420,7 @@ String jsonEncode(dynamic data) {
|
||||
return const JsonEncoder.withIndent(' ').convert(data) + '\n';
|
||||
}
|
||||
|
||||
Future<Null> getFlutter(String revision) async {
|
||||
Future<void> getFlutter(String revision) async {
|
||||
section('Get Flutter!');
|
||||
|
||||
if (exists(flutterDirectory)) {
|
||||
@ -495,8 +495,8 @@ Iterable<String> grep(Pattern pattern, {@required String from}) {
|
||||
/// } catch (error, chain) {
|
||||
///
|
||||
/// }
|
||||
Future<Null> runAndCaptureAsyncStacks(Future<Null> callback()) {
|
||||
final Completer<Null> completer = Completer<Null>();
|
||||
Future<void> runAndCaptureAsyncStacks(Future<void> callback()) {
|
||||
final Completer<void> completer = Completer<void>();
|
||||
Chain.capture(() async {
|
||||
await callback();
|
||||
completer.complete();
|
||||
|
@ -43,8 +43,8 @@ TaskFunction createHotModeTest() {
|
||||
environment: null
|
||||
);
|
||||
|
||||
final Completer<Null> stdoutDone = Completer<Null>();
|
||||
final Completer<Null> stderrDone = Completer<Null>();
|
||||
final Completer<void> stdoutDone = Completer<void>();
|
||||
final Completer<void> stderrDone = Completer<void>();
|
||||
process.stdout
|
||||
.transform<String>(utf8.decoder)
|
||||
.transform<String>(const LineSplitter())
|
||||
@ -80,8 +80,8 @@ TaskFunction createHotModeTest() {
|
||||
stderrDone.complete();
|
||||
});
|
||||
|
||||
await Future.wait<Null>(
|
||||
<Future<Null>>[stdoutDone.future, stderrDone.future]);
|
||||
await Future.wait<void>(
|
||||
<Future<void>>[stdoutDone.future, stderrDone.future]);
|
||||
await process.exitCode;
|
||||
|
||||
twoReloadsData = json.decode(benchmarkFile.readAsStringSync());
|
||||
@ -96,8 +96,8 @@ TaskFunction createHotModeTest() {
|
||||
<String>['run']..addAll(options),
|
||||
environment: null
|
||||
);
|
||||
final Completer<Null> stdoutDone = Completer<Null>();
|
||||
final Completer<Null> stderrDone = Completer<Null>();
|
||||
final Completer<void> stdoutDone = Completer<void>();
|
||||
final Completer<void> stderrDone = Completer<void>();
|
||||
process.stdout
|
||||
.transform<String>(utf8.decoder)
|
||||
.transform<String>(const LineSplitter())
|
||||
@ -118,8 +118,8 @@ TaskFunction createHotModeTest() {
|
||||
stderrDone.complete();
|
||||
});
|
||||
|
||||
await Future.wait<Null>(
|
||||
<Future<Null>>[stdoutDone.future, stderrDone.future]);
|
||||
await Future.wait<void>(
|
||||
<Future<void>>[stdoutDone.future, stderrDone.future]);
|
||||
await process.exitCode;
|
||||
|
||||
freshRestartReloadsData =
|
||||
|
@ -73,7 +73,7 @@ class FlutterProject {
|
||||
|
||||
String get rootPath => path.join(parent.path, name);
|
||||
|
||||
Future<Null> addPlugin(String plugin) async {
|
||||
Future<void> addPlugin(String plugin) async {
|
||||
final File pubspec = File(path.join(rootPath, 'pubspec.yaml'));
|
||||
String content = await pubspec.readAsString();
|
||||
content = content.replaceFirst(
|
||||
@ -83,13 +83,13 @@ class FlutterProject {
|
||||
await pubspec.writeAsString(content, flush: true);
|
||||
}
|
||||
|
||||
Future<Null> build(String target) async {
|
||||
Future<void> build(String target) async {
|
||||
await inDirectory(Directory(rootPath), () async {
|
||||
await flutter('build', options: <String>[target]);
|
||||
});
|
||||
}
|
||||
|
||||
Future<Null> delete() async {
|
||||
Future<void> delete() async {
|
||||
if (Platform.isWindows) {
|
||||
// A running Gradle daemon might prevent us from deleting the project
|
||||
// folder on Windows.
|
||||
@ -99,7 +99,7 @@ class FlutterProject {
|
||||
canFail: true,
|
||||
);
|
||||
// TODO(ianh): Investigating if flakiness is timing dependent.
|
||||
await Future<Null>.delayed(const Duration(seconds: 10));
|
||||
await Future<void>.delayed(const Duration(seconds: 10));
|
||||
}
|
||||
rmTree(parent);
|
||||
}
|
||||
|
@ -61,7 +61,7 @@ class Upload {
|
||||
final HttpClientResponse response = await request.close().timeout(timeLimit);
|
||||
if (response.statusCode == HttpStatus.ok) {
|
||||
logMessage('Saved $name');
|
||||
await response.drain<Null>();
|
||||
await response.drain<void>();
|
||||
} else {
|
||||
// TODO(hansmuller): only retry on 5xx and 429 responses
|
||||
logMessage('Request to save "$name" (length ${content.length}) failed with status ${response.statusCode}, will retry');
|
||||
@ -93,7 +93,7 @@ class Upload {
|
||||
static bool isNotComplete(Upload upload) => !upload.isComplete;
|
||||
}
|
||||
|
||||
Future<Null> saveScreenshots(List<String> fromPaths, List<String> largeNames, List<String> smallNames) async {
|
||||
Future<void> saveScreenshots(List<String> fromPaths, List<String> largeNames, List<String> smallNames) async {
|
||||
assert(fromPaths.length == largeNames.length);
|
||||
assert(fromPaths.length == smallNames.length);
|
||||
|
||||
@ -113,7 +113,7 @@ Future<Null> saveScreenshots(List<String> fromPaths, List<String> largeNames, Li
|
||||
// If path is lib/foo.png then screenshotName is foo.
|
||||
String screenshotName(String path) => basenameWithoutExtension(path);
|
||||
|
||||
Future<Null> saveCatalogScreenshots({
|
||||
Future<void> saveCatalogScreenshots({
|
||||
Directory directory, // Where the *.png screenshots are.
|
||||
String commit, // The commit hash to be used as a cloud storage "directory".
|
||||
String token, // Cloud storage authorization token.
|
||||
|
@ -192,7 +192,7 @@ class FakeDevice extends AndroidDevice {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Null> shellExec(String command, List<String> arguments, { Map<String, String> environment }) async {
|
||||
Future<void> shellExec(String command, List<String> arguments, { Map<String, String> environment }) async {
|
||||
commandLog.add(CommandArgs(
|
||||
command: command,
|
||||
arguments: arguments,
|
||||
|
@ -30,7 +30,7 @@ class MyAppState extends State<MyApp> with SingleTickerProviderStateMixin {
|
||||
IconData _icon;
|
||||
double _flutterFrameRate;
|
||||
|
||||
Future<Null> _summarizeStats() async {
|
||||
Future<void> _summarizeStats() async {
|
||||
final double framesProduced = await channel.invokeMethod('getProducedFrameRate');
|
||||
final double framesConsumed = await channel.invokeMethod('getConsumedFrameRate');
|
||||
_summary = '''
|
||||
@ -39,7 +39,7 @@ Consumed: ${framesConsumed.toStringAsFixed(1)}fps
|
||||
Widget builds: $_widgetBuilds''';
|
||||
}
|
||||
|
||||
Future<Null> _nextState() async {
|
||||
Future<void> _nextState() async {
|
||||
switch (_state) {
|
||||
case FrameState.initial:
|
||||
debugPrint('Starting .5x speed test...');
|
||||
@ -90,9 +90,9 @@ Widget builds: $_widgetBuilds''';
|
||||
static const int calibrationTickCount = 600;
|
||||
|
||||
/// Measures Flutter's frame rate.
|
||||
Future<Null> _calibrate() async {
|
||||
Future<void> _calibrate() async {
|
||||
debugPrint('Awaiting calm (3 second pause)...');
|
||||
await Future<Null>.delayed(const Duration(milliseconds: 3000));
|
||||
await Future<void>.delayed(const Duration(milliseconds: 3000));
|
||||
debugPrint('Calibrating...');
|
||||
DateTime startTime;
|
||||
int tickCount = 0;
|
||||
|
@ -11,7 +11,7 @@ final RegExp calibrationRegExp = RegExp('Flutter frame rate is (.*)fps');
|
||||
final RegExp statsRegExp = RegExp('Produced: (.*)fps\nConsumed: (.*)fps\nWidget builds: (.*)');
|
||||
const Duration samplingTime = Duration(seconds: 8);
|
||||
|
||||
Future<Null> main() async {
|
||||
Future<void> main() async {
|
||||
group('texture suite', () {
|
||||
FlutterDriver driver;
|
||||
|
||||
@ -38,7 +38,7 @@ Future<Null> main() async {
|
||||
|
||||
// Texture frame stats at 0.5x Flutter frame rate
|
||||
await driver.tap(fab);
|
||||
await Future<Null>.delayed(samplingTime);
|
||||
await Future<void>.delayed(samplingTime);
|
||||
await driver.tap(fab);
|
||||
|
||||
final String statsSlow = await driver.getText(summary);
|
||||
@ -50,7 +50,7 @@ Future<Null> main() async {
|
||||
|
||||
// Texture frame stats at 2.0x Flutter frame rate
|
||||
await driver.tap(fab);
|
||||
await Future<Null>.delayed(samplingTime);
|
||||
await Future<void>.delayed(samplingTime);
|
||||
await driver.tap(fab);
|
||||
|
||||
final String statsFast = await driver.getText(summary);
|
||||
|
@ -36,14 +36,14 @@ void main() {
|
||||
|
||||
test('waitForAbsent should resolve when text "present" disappears', () async {
|
||||
// Begin waiting for it to disappear
|
||||
final Completer<Null> whenWaitForAbsentResolves = Completer<Null>();
|
||||
final Completer<void> whenWaitForAbsentResolves = Completer<void>();
|
||||
driver.waitForAbsent(presentText).then(
|
||||
whenWaitForAbsentResolves.complete,
|
||||
onError: whenWaitForAbsentResolves.completeError,
|
||||
);
|
||||
|
||||
// Wait 1 second then make it disappear
|
||||
await Future<Null>.delayed(const Duration(seconds: 1));
|
||||
await Future<void>.delayed(const Duration(seconds: 1));
|
||||
await driver.tap(find.byValueKey('togglePresent'));
|
||||
|
||||
// Ensure waitForAbsent resolves
|
||||
@ -61,14 +61,14 @@ void main() {
|
||||
|
||||
test('waitFor should resolve when text "present" reappears', () async {
|
||||
// Begin waiting for it to reappear
|
||||
final Completer<Null> whenWaitForResolves = Completer<Null>();
|
||||
final Completer<void> whenWaitForResolves = Completer<void>();
|
||||
driver.waitFor(presentText).then(
|
||||
whenWaitForResolves.complete,
|
||||
onError: whenWaitForResolves.completeError,
|
||||
);
|
||||
|
||||
// Wait 1 second then make it appear
|
||||
await Future<Null>.delayed(const Duration(seconds: 1));
|
||||
await Future<void>.delayed(const Duration(seconds: 1));
|
||||
await driver.tap(find.byValueKey('togglePresent'));
|
||||
|
||||
// Ensure waitFor resolves
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user