Unverified Commit 1d3f6971 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

[flutter_tools] flag flip (#74444)

parent 46b0797b
...@@ -452,4 +452,4 @@ class FeatureChannelSetting { ...@@ -452,4 +452,4 @@ class FeatureChannelSetting {
final bool enabledByDefault; final bool enabledByDefault;
} }
const bool flutterNext = false; const bool flutterNext = true;
...@@ -186,19 +186,19 @@ void main() { ...@@ -186,19 +186,19 @@ void main() {
expect( expect(
testLogger.statusText, testLogger.statusText,
containsIgnoringWhitespace('enable-web: true (Unavailable)'), containsIgnoringWhitespace('enable-web: true'),
); );
expect( expect(
testLogger.statusText, testLogger.statusText,
containsIgnoringWhitespace('enable-linux-desktop: true (Unavailable)'), containsIgnoringWhitespace('enable-linux-desktop: true'),
); );
expect( expect(
testLogger.statusText, testLogger.statusText,
containsIgnoringWhitespace('enable-windows-desktop: true (Unavailable)'), containsIgnoringWhitespace('enable-windows-desktop: true'),
); );
expect( expect(
testLogger.statusText, testLogger.statusText,
containsIgnoringWhitespace('enable-macos-desktop: true (Unavailable)'), containsIgnoringWhitespace('enable-macos-desktop: true'),
); );
verifyNoAnalytics(); verifyNoAnalytics();
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
......
...@@ -79,25 +79,28 @@ void main() { ...@@ -79,25 +79,28 @@ void main() {
testWithoutContext('flutter web help string', () { testWithoutContext('flutter web help string', () {
expect(flutterWebFeature.generateHelpMessage(), expect(flutterWebFeature.generateHelpMessage(),
'Enable or disable Flutter for web. ' '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', () { testWithoutContext('flutter macOS desktop help string', () {
expect(flutterMacOSDesktopFeature.generateHelpMessage(), expect(flutterMacOSDesktopFeature.generateHelpMessage(),
'Enable or disable beta-quality support for desktop on macOS. ' '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', () { testWithoutContext('flutter Linux desktop help string', () {
expect(flutterLinuxDesktopFeature.generateHelpMessage(), expect(flutterLinuxDesktopFeature.generateHelpMessage(),
'Enable or disable beta-quality support for desktop on Linux. ' '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', () { testWithoutContext('flutter Windows desktop help string', () {
expect(flutterWindowsDesktopFeature.generateHelpMessage(), expect(flutterWindowsDesktopFeature.generateHelpMessage(),
'Enable or disable beta-quality support for desktop on Windows. ' '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', () { testWithoutContext('help string on multiple channels', () {
...@@ -176,17 +179,18 @@ void main() { ...@@ -176,17 +179,18 @@ void main() {
expect(featureFlags.isWebEnabled, true); 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(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(mockFlutterVerion.channel).thenReturn('stable');
when<bool>(mockFlutterConfig.getValue('enable-web') as bool).thenReturn(true); 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', () { testWithoutContext('flutter web not enabled with environment variable on stable', () {
...@@ -244,18 +248,18 @@ void main() { ...@@ -244,18 +248,18 @@ void main() {
expect(featureFlags.isMacOSEnabled, false); 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(mockFlutterVerion.channel).thenReturn('beta');
when<bool>(mockFlutterConfig.getValue('enable-macos-desktop') as bool).thenReturn(true); 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(mockFlutterVerion.channel).thenReturn('beta');
when(mockPlatform.environment).thenReturn(<String, String>{'FLUTTER_MACOS': 'true'}); 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', () { testWithoutContext('flutter macos desktop off by default on stable', () {
...@@ -264,18 +268,18 @@ void main() { ...@@ -264,18 +268,18 @@ void main() {
expect(featureFlags.isMacOSEnabled, false); 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(mockFlutterVerion.channel).thenReturn('stable');
when<bool>(mockFlutterConfig.getValue('enable-macos-desktop') as bool).thenReturn(true); 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(mockFlutterVerion.channel).thenReturn('stable');
when(mockPlatform.environment).thenReturn(<String, String>{'FLUTTER_MACOS': 'true'}); when(mockPlatform.environment).thenReturn(<String, String>{'FLUTTER_MACOS': 'true'});
expect(featureFlags.isMacOSEnabled, false); expect(featureFlags.isMacOSEnabled, true);
}); });
/// Flutter Linux Desktop /// Flutter Linux Desktop
...@@ -325,18 +329,18 @@ void main() { ...@@ -325,18 +329,18 @@ void main() {
expect(featureFlags.isLinuxEnabled, false); 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(mockFlutterVerion.channel).thenReturn('beta');
when<bool>(mockFlutterConfig.getValue('enable-linux-desktop') as bool).thenReturn(true); 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(mockFlutterVerion.channel).thenReturn('beta');
when(mockPlatform.environment).thenReturn(<String, String>{'FLUTTER_LINUX': 'true'}); 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', () { testWithoutContext('flutter linux desktop off by default on stable', () {
...@@ -345,18 +349,18 @@ void main() { ...@@ -345,18 +349,18 @@ void main() {
expect(featureFlags.isLinuxEnabled, false); 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(mockFlutterVerion.channel).thenReturn('stable');
when<bool>(mockFlutterConfig.getValue('enable-linux-desktop') as bool).thenReturn(true); 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(mockFlutterVerion.channel).thenReturn('stable');
when(mockPlatform.environment).thenReturn(<String, String>{'FLUTTER_LINUX': 'true'}); when(mockPlatform.environment).thenReturn(<String, String>{'FLUTTER_LINUX': 'true'});
expect(featureFlags.isLinuxEnabled, false); expect(featureFlags.isLinuxEnabled, true);
}); });
/// Flutter Windows desktop. /// Flutter Windows desktop.
...@@ -406,18 +410,18 @@ void main() { ...@@ -406,18 +410,18 @@ void main() {
expect(featureFlags.isWindowsEnabled, false); 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(mockFlutterVerion.channel).thenReturn('beta');
when<bool>(mockFlutterConfig.getValue('enable-windows-desktop') as bool).thenReturn(true); 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(mockFlutterVerion.channel).thenReturn('beta');
when(mockPlatform.environment).thenReturn(<String, String>{'FLUTTER_WINDOWS': 'true'}); 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', () { testWithoutContext('flutter windows desktop off by default on stable', () {
...@@ -426,18 +430,18 @@ void main() { ...@@ -426,18 +430,18 @@ void main() {
expect(featureFlags.isWindowsEnabled, false); 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(mockFlutterVerion.channel).thenReturn('stable');
when<bool>(mockFlutterConfig.getValue('enable-windows-desktop') as bool).thenReturn(true); 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(mockFlutterVerion.channel).thenReturn('stable');
when(mockPlatform.environment).thenReturn(<String, String>{'FLUTTER_WINDOWS': 'true'}); when(mockPlatform.environment).thenReturn(<String, String>{'FLUTTER_WINDOWS': 'true'});
expect(featureFlags.isWindowsEnabled, false); expect(featureFlags.isWindowsEnabled, true);
}); });
}); });
} }
......
...@@ -891,21 +891,6 @@ void main() { ...@@ -891,21 +891,6 @@ void main() {
Platform: () => FakePlatform(operatingSystem: 'linux', environment: <String, String>{}), 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 { testUsingContext('debugDumpApp', () async {
final ResidentRunner residentWebRunner = setUpResidentRunner(mockFlutterDevice); final ResidentRunner residentWebRunner = setUpResidentRunner(mockFlutterDevice);
fakeVmServiceHost = FakeVmServiceHost(requests: <VmServiceExpectation>[ fakeVmServiceHost = FakeVmServiceHost(requests: <VmServiceExpectation>[
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment