[flutter_tools] flag flip (#74444)

This commit is contained in:
Jonah Williams
2021-01-22 09:29:57 -08:00
committed by GitHub
parent 46b0797b58
commit 1d3f697160
4 changed files with 41 additions and 52 deletions

View File

@@ -452,4 +452,4 @@ class FeatureChannelSetting {
final bool enabledByDefault;
}
const bool flutterNext = false;
const bool flutterNext = true;

View File

@@ -186,19 +186,19 @@ void main() {
expect(
testLogger.statusText,
containsIgnoringWhitespace('enable-web: true (Unavailable)'),
containsIgnoringWhitespace('enable-web: true'),
);
expect(
testLogger.statusText,
containsIgnoringWhitespace('enable-linux-desktop: true (Unavailable)'),
containsIgnoringWhitespace('enable-linux-desktop: true'),
);
expect(
testLogger.statusText,
containsIgnoringWhitespace('enable-windows-desktop: true (Unavailable)'),
containsIgnoringWhitespace('enable-windows-desktop: true'),
);
expect(
testLogger.statusText,
containsIgnoringWhitespace('enable-macos-desktop: true (Unavailable)'),
containsIgnoringWhitespace('enable-macos-desktop: true'),
);
verifyNoAnalytics();
}, overrides: <Type, Generator>{

View File

@@ -79,25 +79,28 @@ void main() {
testWithoutContext('flutter web help string', () {
expect(flutterWebFeature.generateHelpMessage(),
'Enable or disable Flutter for web. '
'This setting will take effect on the master, dev, and beta channels.');
'This setting will take effect on the master, dev, beta, and stable channels.');
});
testWithoutContext('flutter macOS desktop help string', () {
expect(flutterMacOSDesktopFeature.generateHelpMessage(),
'Enable or disable beta-quality support for desktop on macOS. '
'This setting will take effect on the master and dev channels.');
'This setting will take effect on the master, dev, beta, and stable channels. '
'Newer beta versions are available on the beta channel.');
});
testWithoutContext('flutter Linux desktop help string', () {
expect(flutterLinuxDesktopFeature.generateHelpMessage(),
'Enable or disable beta-quality support for desktop on Linux. '
'This setting will take effect on the master and dev channels.');
'This setting will take effect on the master, dev, beta, and stable channels. '
'Newer beta versions are available on the beta channel.');
});
testWithoutContext('flutter Windows desktop help string', () {
expect(flutterWindowsDesktopFeature.generateHelpMessage(),
'Enable or disable beta-quality support for desktop on Windows. '
'This setting will take effect on the master and dev channels.');
'This setting will take effect on the master, dev, beta, and stable channels. '
'Newer beta versions are available on the beta channel.');
});
testWithoutContext('help string on multiple channels', () {
@@ -176,17 +179,18 @@ void main() {
expect(featureFlags.isWebEnabled, true);
});
testWithoutContext('flutter web off by default on stable', () {
testWithoutContext('flutter web on by default on stable', () {
when(mockFlutterVerion.channel).thenReturn('stable');
when<bool>(mockFlutterConfig.getValue(any) as bool).thenReturn(null);
expect(featureFlags.isWebEnabled, false);
expect(featureFlags.isWebEnabled, true);
});
testWithoutContext('flutter web not enabled with config on stable', () {
testWithoutContext('flutter web enabled with config on stable', () {
when(mockFlutterVerion.channel).thenReturn('stable');
when<bool>(mockFlutterConfig.getValue('enable-web') as bool).thenReturn(true);
expect(featureFlags.isWebEnabled, false);
expect(featureFlags.isWebEnabled, true);
});
testWithoutContext('flutter web not enabled with environment variable on stable', () {
@@ -244,18 +248,18 @@ void main() {
expect(featureFlags.isMacOSEnabled, false);
});
testWithoutContext('flutter macos desktop not enabled with config on beta', () {
testWithoutContext('flutter macos desktop enabled with config on beta', () {
when(mockFlutterVerion.channel).thenReturn('beta');
when<bool>(mockFlutterConfig.getValue('enable-macos-desktop') as bool).thenReturn(true);
expect(featureFlags.isMacOSEnabled, false);
expect(featureFlags.isMacOSEnabled, true);
});
testWithoutContext('flutter macos desktop not enabled with environment variable on beta', () {
testWithoutContext('flutter macos desktop enabled with environment variable on beta', () {
when(mockFlutterVerion.channel).thenReturn('beta');
when(mockPlatform.environment).thenReturn(<String, String>{'FLUTTER_MACOS': 'true'});
expect(featureFlags.isMacOSEnabled, false);
expect(featureFlags.isMacOSEnabled, true);
});
testWithoutContext('flutter macos desktop off by default on stable', () {
@@ -264,18 +268,18 @@ void main() {
expect(featureFlags.isMacOSEnabled, false);
});
testWithoutContext('flutter macos desktop not enabled with config on stable', () {
testWithoutContext('flutter macos desktop enabled with config on stable', () {
when(mockFlutterVerion.channel).thenReturn('stable');
when<bool>(mockFlutterConfig.getValue('enable-macos-desktop') as bool).thenReturn(true);
expect(featureFlags.isMacOSEnabled, false);
expect(featureFlags.isMacOSEnabled, true);
});
testWithoutContext('flutter macos desktop not enabled with environment variable on stable', () {
testWithoutContext('flutter macos desktop enabled with environment variable on stable', () {
when(mockFlutterVerion.channel).thenReturn('stable');
when(mockPlatform.environment).thenReturn(<String, String>{'FLUTTER_MACOS': 'true'});
expect(featureFlags.isMacOSEnabled, false);
expect(featureFlags.isMacOSEnabled, true);
});
/// Flutter Linux Desktop
@@ -325,18 +329,18 @@ void main() {
expect(featureFlags.isLinuxEnabled, false);
});
testWithoutContext('flutter linux desktop not enabled with config on beta', () {
testWithoutContext('flutter linux desktop enabled with config on beta', () {
when(mockFlutterVerion.channel).thenReturn('beta');
when<bool>(mockFlutterConfig.getValue('enable-linux-desktop') as bool).thenReturn(true);
expect(featureFlags.isLinuxEnabled, false);
expect(featureFlags.isLinuxEnabled, true);
});
testWithoutContext('flutter linux desktop not enabled with environment variable on beta', () {
testWithoutContext('flutter linux desktop enabled with environment variable on beta', () {
when(mockFlutterVerion.channel).thenReturn('beta');
when(mockPlatform.environment).thenReturn(<String, String>{'FLUTTER_LINUX': 'true'});
expect(featureFlags.isLinuxEnabled, false);
expect(featureFlags.isLinuxEnabled, true);
});
testWithoutContext('flutter linux desktop off by default on stable', () {
@@ -345,18 +349,18 @@ void main() {
expect(featureFlags.isLinuxEnabled, false);
});
testWithoutContext('flutter linux desktop not enabled with config on stable', () {
testWithoutContext('flutter linux desktop enabled with config on stable', () {
when(mockFlutterVerion.channel).thenReturn('stable');
when<bool>(mockFlutterConfig.getValue('enable-linux-desktop') as bool).thenReturn(true);
expect(featureFlags.isLinuxEnabled, false);
expect(featureFlags.isLinuxEnabled, true);
});
testWithoutContext('flutter linux desktop not enabled with environment variable on stable', () {
testWithoutContext('flutter linux desktop enabled with environment variable on stable', () {
when(mockFlutterVerion.channel).thenReturn('stable');
when(mockPlatform.environment).thenReturn(<String, String>{'FLUTTER_LINUX': 'true'});
expect(featureFlags.isLinuxEnabled, false);
expect(featureFlags.isLinuxEnabled, true);
});
/// Flutter Windows desktop.
@@ -406,18 +410,18 @@ void main() {
expect(featureFlags.isWindowsEnabled, false);
});
testWithoutContext('flutter windows desktop not enabled with config on beta', () {
testWithoutContext('flutter windows desktop enabled with config on beta', () {
when(mockFlutterVerion.channel).thenReturn('beta');
when<bool>(mockFlutterConfig.getValue('enable-windows-desktop') as bool).thenReturn(true);
expect(featureFlags.isWindowsEnabled, false);
expect(featureFlags.isWindowsEnabled, true);
});
testWithoutContext('flutter windows desktop not enabled with environment variable on beta', () {
testWithoutContext('flutter windows desktop enabled with environment variable on beta', () {
when(mockFlutterVerion.channel).thenReturn('beta');
when(mockPlatform.environment).thenReturn(<String, String>{'FLUTTER_WINDOWS': 'true'});
expect(featureFlags.isWindowsEnabled, false);
expect(featureFlags.isWindowsEnabled, true);
});
testWithoutContext('flutter windows desktop off by default on stable', () {
@@ -426,18 +430,18 @@ void main() {
expect(featureFlags.isWindowsEnabled, false);
});
testWithoutContext('flutter windows desktop not enabled with config on stable', () {
testWithoutContext('flutter windows desktop enabled with config on stable', () {
when(mockFlutterVerion.channel).thenReturn('stable');
when<bool>(mockFlutterConfig.getValue('enable-windows-desktop') as bool).thenReturn(true);
expect(featureFlags.isWindowsEnabled, false);
expect(featureFlags.isWindowsEnabled, true);
});
testWithoutContext('flutter windows desktop not enabled with environment variable on stable', () {
testWithoutContext('flutter windows desktop enabled with environment variable on stable', () {
when(mockFlutterVerion.channel).thenReturn('stable');
when(mockPlatform.environment).thenReturn(<String, String>{'FLUTTER_WINDOWS': 'true'});
expect(featureFlags.isWindowsEnabled, false);
expect(featureFlags.isWindowsEnabled, true);
});
});
}

View File

@@ -891,21 +891,6 @@ void main() {
Platform: () => FakePlatform(operatingSystem: 'linux', environment: <String, String>{}),
});
testUsingContext('printHelp without details has web warning', () async {
final ResidentRunner residentWebRunner = setUpResidentRunner(mockFlutterDevice);
fakeVmServiceHost = FakeVmServiceHost(requests: <VmServiceExpectation>[]);
residentWebRunner.printHelp(details: false);
expect(testLogger.statusText, contains('Warning'));
expect(testLogger.statusText, contains('https://flutter.dev/web'));
expect(testLogger.statusText, isNot(contains('https://flutter.dev/web.')));
}, overrides: <Type, Generator>{
FileSystem: () => fileSystem,
ProcessManager: () => processManager,
Pub: () => MockPub(),
Platform: () => FakePlatform(operatingSystem: 'linux', environment: <String, String>{}),
});
testUsingContext('debugDumpApp', () async {
final ResidentRunner residentWebRunner = setUpResidentRunner(mockFlutterDevice);
fakeVmServiceHost = FakeVmServiceHost(requests: <VmServiceExpectation>[