Cleanup random dead test code (#104568)

This commit is contained in:
Michael Goderbauer 2022-05-25 10:23:10 -07:00 committed by GitHub
parent da24f105bd
commit 2b14e993a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 5 additions and 66 deletions

View File

@ -8,10 +8,7 @@ import 'package:flutter_driver/src/common/error.dart';
import 'package:test_api/test_api.dart'; // ignore: deprecated_member_use
export 'package:test_api/fake.dart'; // ignore: deprecated_member_use
export 'package:test_api/test_api.dart' hide isInstanceOf; // ignore: deprecated_member_use
/// A matcher that compares the type of the actual value to the type argument T.
TypeMatcher<T> isInstanceOf<T>() => isA<T>();
export 'package:test_api/test_api.dart'; // ignore: deprecated_member_use
void tryToDelete(Directory directory) {
// This should not be necessary, but it turns out that
@ -26,6 +23,3 @@ void tryToDelete(Directory directory) {
/// Matcher for functions that throw [DriverError].
final Matcher throwsDriverError = throwsA(isA<DriverError>());
/// Matcher for functions that throw [AssertionError].
final Matcher throwsAssertionError = throwsA(isA<AssertionError>());

View File

@ -4,7 +4,6 @@
// See also dev/automated_tests/flutter_test/flutter_gold_test.dart
import 'dart:async';
import 'dart:convert';
import 'dart:io' hide Directory;
import 'dart:typed_data';
@ -1090,23 +1089,6 @@ class FakeHttpClientRequest extends Fake implements HttpClientRequest {
}
}
class FakeHttpClientResponse extends Fake implements HttpClientResponse {
FakeHttpClientResponse(this.response);
final List<int> response;
@override
StreamSubscription<List<int>> listen(
void Function(List<int> event)? onData, {
Function? onError,
void Function()? onDone,
bool? cancelOnError,
}) {
return Stream<List<int>>.fromFuture(Future<List<int>>.value(response))
.listen(onData, onError: onError, onDone: onDone, cancelOnError: cancelOnError);
}
}
class FakeHttpImageResponse extends Fake implements HttpClientResponse {
FakeHttpImageResponse(this.response);

View File

@ -782,31 +782,6 @@ class FakeMatcher extends AsyncMatcher {
Description describe(Description description) => description.add('--fake--');
}
class _SingleTickerTest extends StatefulWidget {
const _SingleTickerTest();
@override
_SingleTickerTestState createState() => _SingleTickerTestState();
}
class _SingleTickerTestState extends State<_SingleTickerTest> with SingleTickerProviderStateMixin {
late AnimationController controller;
@override
void initState() {
super.initState();
controller = AnimationController(
vsync: this,
duration: const Duration(seconds: 100),
) ;
}
@override
Widget build(BuildContext context) {
return Container();
}
}
class _AlwaysAnimating extends StatefulWidget {
const _AlwaysAnimating({
required this.onPaint,

View File

@ -1,10 +0,0 @@
// Copyright 2014 The Flutter 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 'package:test/test.dart';
export 'package:test/test.dart' hide isInstanceOf;
/// A matcher that compares the type of the actual value to the type argument T.
TypeMatcher<T> isInstanceOf<T>() => isA<T>();

View File

@ -4,10 +4,9 @@
import 'package:fuchsia_remote_debug_protocol/fuchsia_remote_debug_protocol.dart';
import 'package:test/fake.dart';
import 'package:test/test.dart';
import 'package:vm_service/vm_service.dart' as vms;
import 'common.dart';
void main() {
group('FuchsiaRemoteConnection.connect', () {
late List<FakePortForwarder> forwardedPorts;

View File

@ -4,7 +4,7 @@
import 'package:fuchsia_remote_debug_protocol/src/common/network.dart';
import '../../common.dart';
import 'package:test/test.dart';
void main() {
final List<String> ipv4Addresses = <String>['127.0.0.1', '8.8.8.8'];

View File

@ -6,10 +6,9 @@ import 'dart:async';
import 'package:fuchsia_remote_debug_protocol/src/dart/dart_vm.dart';
import 'package:test/fake.dart';
import 'package:test/test.dart';
import 'package:vm_service/vm_service.dart' as vms;
import '../../common.dart';
void main() {
group('DartVm.connect', () {
tearDown(() {

View File

@ -9,7 +9,7 @@ import 'package:fuchsia_remote_debug_protocol/src/runners/ssh_command_runner.dar
import 'package:process/process.dart';
import 'package:test/fake.dart';
import '../../common.dart';
import 'package:test/test.dart';
void main() {
group('SshCommandRunner.constructors', () {