Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
1d3f6971
Unverified
Commit
1d3f6971
authored
Jan 22, 2021
by
Jonah Williams
Committed by
GitHub
Jan 22, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] flag flip (#74444)
parent
46b0797b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
52 deletions
+41
-52
features.dart
packages/flutter_tools/lib/src/features.dart
+1
-1
config_test.dart
...utter_tools/test/commands.shard/hermetic/config_test.dart
+4
-4
features_test.dart
packages/flutter_tools/test/general.shard/features_test.dart
+36
-32
resident_web_runner_test.dart
...er_tools/test/general.shard/resident_web_runner_test.dart
+0
-15
No files found.
packages/flutter_tools/lib/src/features.dart
View file @
1d3f6971
...
...
@@ -452,4 +452,4 @@ class FeatureChannelSetting {
final
bool
enabledByDefault
;
}
const
bool
flutterNext
=
fals
e
;
const
bool
flutterNext
=
tru
e
;
packages/flutter_tools/test/commands.shard/hermetic/config_test.dart
View file @
1d3f6971
...
...
@@ -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
>{
...
...
packages/flutter_tools/test/general.shard/features_test.dart
View file @
1d3f6971
...
...
@@ -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 o
ff
by default on stable'
,
()
{
testWithoutContext
(
'flutter web o
n
by default on stable'
,
()
{
when
(
mockFlutterVerion
.
channel
).
thenReturn
(
'stable'
);
when
<
bool
>(
mockFlutterConfig
.
getValue
(
any
)
as
bool
).
thenReturn
(
null
);
expect
(
featureFlags
.
isWebEnabled
,
fals
e
);
expect
(
featureFlags
.
isWebEnabled
,
tru
e
);
});
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
,
fals
e
);
expect
(
featureFlags
.
isWebEnabled
,
tru
e
);
});
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
,
fals
e
);
expect
(
featureFlags
.
isMacOSEnabled
,
tru
e
);
});
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
,
fals
e
);
expect
(
featureFlags
.
isMacOSEnabled
,
tru
e
);
});
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
,
fals
e
);
expect
(
featureFlags
.
isMacOSEnabled
,
tru
e
);
});
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
,
fals
e
);
expect
(
featureFlags
.
isMacOSEnabled
,
tru
e
);
});
/// 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
,
fals
e
);
expect
(
featureFlags
.
isLinuxEnabled
,
tru
e
);
});
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
,
fals
e
);
expect
(
featureFlags
.
isLinuxEnabled
,
tru
e
);
});
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
,
fals
e
);
expect
(
featureFlags
.
isLinuxEnabled
,
tru
e
);
});
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
,
fals
e
);
expect
(
featureFlags
.
isLinuxEnabled
,
tru
e
);
});
/// 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
,
fals
e
);
expect
(
featureFlags
.
isWindowsEnabled
,
tru
e
);
});
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
,
fals
e
);
expect
(
featureFlags
.
isWindowsEnabled
,
tru
e
);
});
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
,
fals
e
);
expect
(
featureFlags
.
isWindowsEnabled
,
tru
e
);
});
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
,
fals
e
);
expect
(
featureFlags
.
isWindowsEnabled
,
tru
e
);
});
});
}
...
...
packages/flutter_tools/test/general.shard/resident_web_runner_test.dart
View file @
1d3f6971
...
...
@@ -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
>[
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment