forked from firka/flutter
Reland: use flutter features for web and desktop (#36699)
This commit is contained in:
@@ -5,8 +5,6 @@
|
||||
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;
|
||||
|
||||
@@ -20,19 +18,6 @@ import 'package:flutter_tools/src/runner/flutter_command_runner.dart';
|
||||
|
||||
export 'package:test_core/test_core.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>();
|
||||
|
||||
@@ -17,6 +17,7 @@ import 'package:flutter_tools/src/base/logger.dart';
|
||||
import 'package:flutter_tools/src/base/terminal.dart';
|
||||
import 'package:flutter_tools/src/cache.dart';
|
||||
import 'package:flutter_tools/src/context_runner.dart';
|
||||
import 'package:flutter_tools/src/features.dart';
|
||||
import 'package:flutter_tools/src/reporting/usage.dart';
|
||||
import 'package:flutter_tools/src/version.dart';
|
||||
|
||||
@@ -687,3 +688,26 @@ class FakeFlutterVersion implements FlutterVersion {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// A test implementation of [FeatureFlags] that allows enabling without reading
|
||||
// config. If not otherwise specified, all values default to false.
|
||||
class TestFeatureFlags implements FeatureFlags {
|
||||
TestFeatureFlags({
|
||||
this.isLinuxEnabled = false,
|
||||
this.isMacOSEnabled = false,
|
||||
this.isWebEnabled = false,
|
||||
this.isWindowsEnabled = false,
|
||||
});
|
||||
|
||||
@override
|
||||
final bool isLinuxEnabled;
|
||||
|
||||
@override
|
||||
final bool isMacOSEnabled;
|
||||
|
||||
@override
|
||||
final bool isWebEnabled;
|
||||
|
||||
@override
|
||||
final bool isWindowsEnabled;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user