Remove environment variable guards for command line desktop and web (#33867)

This commit is contained in:
Jonah Williams
2019-06-19 13:39:27 -07:00
committed by GitHub
parent 42d8383c9e
commit 0d9a1b201e
11 changed files with 64 additions and 30 deletions

View File

@@ -5,6 +5,8 @@
import 'dart:async';
import 'package:args/command_runner.dart';
import 'package:flutter_tools/src/desktop.dart';
import 'package:flutter_tools/src/web/workflow.dart';
import 'package:test_api/test_api.dart' hide TypeMatcher, isInstanceOf;
import 'package:test_api/test_api.dart' as test_package show TypeMatcher;
@@ -18,6 +20,19 @@ import 'package:flutter_tools/src/runner/flutter_command_runner.dart';
export 'package:test_api/test_api.dart' hide TypeMatcher, isInstanceOf; // Defines a 'package:test' shim.
/// Disable both web and desktop to make testing easier. For example, prevent
/// them from showing up in the devices list if the host happens to be setup
/// properly.
set debugDisableWebAndDesktop(bool value) {
if (value) {
debugDisableDesktop = true;
debugDisableWeb = true;
} else {
debugDisableDesktop = false;
debugDisableWeb = false;
}
}
/// A matcher that compares the type of the actual value to the type argument T.
// TODO(ianh): Remove this once https://github.com/dart-lang/matcher/issues/98 is fixed
Matcher isInstanceOf<T>() => test_package.TypeMatcher<T>();