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
fc1e7642
Unverified
Commit
fc1e7642
authored
Sep 23, 2020
by
Emmanuel Garcia
Committed by
GitHub
Sep 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose enable-experiment in Flutter drive (#66311)
parent
1a9ea39a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
102 additions
and
5 deletions
+102
-5
executable.dart
packages/flutter_tools/lib/executable.dart
+1
-1
drive.dart
packages/flutter_tools/lib/src/commands/drive.dart
+16
-3
drive_test.dart
...lutter_tools/test/commands.shard/hermetic/drive_test.dart
+85
-1
No files found.
packages/flutter_tools/lib/executable.dart
View file @
fc1e7642
...
...
@@ -93,7 +93,7 @@ Future<void> main(List<String> args) async {
DevicesCommand
(),
DoctorCommand
(
verbose:
verbose
),
DowngradeCommand
(),
DriveCommand
(),
DriveCommand
(
verboseHelp:
verboseHelp
),
EmulatorsCommand
(),
FormatCommand
(),
GenerateCommand
(),
...
...
packages/flutter_tools/lib/src/commands/drive.dart
View file @
fc1e7642
...
...
@@ -50,9 +50,11 @@ import 'run.dart';
/// successful the exit code will be `0`. Otherwise, you will see a non-zero
/// exit code.
class
DriveCommand
extends
RunCommandBase
{
DriveCommand
()
{
DriveCommand
({
bool
verboseHelp
=
false
,
})
{
requiresPubspecYaml
();
addEnableExperimentation
(
hide:
!
verboseHelp
);
argParser
..
addFlag
(
'keep-app-running'
,
defaultsTo:
null
,
...
...
@@ -322,7 +324,18 @@ $ex
}
try
{
await
testRunner
(<
String
>[
testFile
],
environment
);
await
testRunner
(
<
String
>[
if
(
buildInfo
.
dartExperiments
.
isNotEmpty
)
'--enable-experiment=
${buildInfo.dartExperiments.join(',')}
'
,
if
(
buildInfo
.
nullSafetyMode
==
NullSafetyMode
.
sound
)
'--sound-null-safety'
,
if
(
buildInfo
.
nullSafetyMode
==
NullSafetyMode
.
unsound
)
'--no-sound-null-safety'
,
testFile
,
],
environment
,
);
}
on
Exception
catch
(
error
,
stackTrace
)
{
if
(
error
is
ToolExit
)
{
rethrow
;
...
...
packages/flutter_tools/test/commands.shard/hermetic/drive_test.dart
View file @
fc1e7642
...
...
@@ -205,7 +205,7 @@ void main() {
return
LaunchResult
.
succeeded
();
});
testRunner
=
expectAsync2
((
List
<
String
>
testArgs
,
Map
<
String
,
String
>
environment
)
async
{
expect
(
testArgs
,
<
String
>[
testFile
]);
expect
(
testArgs
,
<
String
>[
'--no-sound-null-safety'
,
testFile
]);
// VM_SERVICE_URL is not set by drive command arguments
expect
(
environment
,
<
String
,
String
>{
'VM_SERVICE_URL'
:
'null'
,
...
...
@@ -273,6 +273,90 @@ void main() {
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
testUsingContext
(
'enable experiment'
,
()
async
{
final
MockAndroidDevice
mockDevice
=
MockAndroidDevice
();
applyDdsMocks
(
mockDevice
);
testDeviceManager
.
addDevice
(
mockDevice
);
final
String
testApp
=
globals
.
fs
.
path
.
join
(
tempDir
.
path
,
'test'
,
'e2e.dart'
);
final
String
testFile
=
globals
.
fs
.
path
.
join
(
tempDir
.
path
,
'test_driver'
,
'e2e_test.dart'
);
appStarter
=
expectAsync2
((
DriveCommand
command
,
Uri
webUri
)
async
{
return
LaunchResult
.
succeeded
();
});
testRunner
=
expectAsync2
((
List
<
String
>
testArgs
,
Map
<
String
,
String
>
environment
)
async
{
expect
(
testArgs
,
<
String
>[
'--enable-experiment=experiment1,experiment2'
,
'--no-sound-null-safety'
,
testFile
,
]
);
});
appStopper
=
expectAsync1
((
DriveCommand
command
)
async
{
return
true
;
});
final
MemoryFileSystem
memFs
=
fs
;
await
memFs
.
file
(
testApp
).
writeAsString
(
'main() {}'
);
await
memFs
.
file
(
testFile
).
writeAsString
(
'main() {}'
);
final
List
<
String
>
args
=
<
String
>[
'drive'
,
'--target=
$testApp
'
,
'--no-pub'
,
'--enable-experiment=experiment1'
,
'--enable-experiment=experiment2'
,
];
await
createTestCommandRunner
(
command
).
run
(
args
);
expect
(
testLogger
.
errorText
,
isEmpty
);
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fs
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
testUsingContext
(
'sound null safety'
,
()
async
{
final
MockAndroidDevice
mockDevice
=
MockAndroidDevice
();
applyDdsMocks
(
mockDevice
);
testDeviceManager
.
addDevice
(
mockDevice
);
final
String
testApp
=
globals
.
fs
.
path
.
join
(
tempDir
.
path
,
'test'
,
'e2e.dart'
);
final
String
testFile
=
globals
.
fs
.
path
.
join
(
tempDir
.
path
,
'test_driver'
,
'e2e_test.dart'
);
appStarter
=
expectAsync2
((
DriveCommand
command
,
Uri
webUri
)
async
{
return
LaunchResult
.
succeeded
();
});
testRunner
=
expectAsync2
((
List
<
String
>
testArgs
,
Map
<
String
,
String
>
environment
)
async
{
expect
(
testArgs
,
<
String
>[
'--sound-null-safety'
,
testFile
,
]
);
});
appStopper
=
expectAsync1
((
DriveCommand
command
)
async
{
return
true
;
});
final
MemoryFileSystem
memFs
=
fs
;
await
memFs
.
file
(
testApp
).
writeAsString
(
'main() {}'
);
await
memFs
.
file
(
testFile
).
writeAsString
(
'main() {}'
);
final
List
<
String
>
args
=
<
String
>[
'drive'
,
'--target=
$testApp
'
,
'--no-pub'
,
'--sound-null-safety'
,
];
await
createTestCommandRunner
(
command
).
run
(
args
);
expect
(
testLogger
.
errorText
,
isEmpty
);
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fs
,
ProcessManager:
()
=>
FakeProcessManager
.
any
(),
});
group
(
'findTargetDevice'
,
()
{
testUsingContext
(
'uses specified device'
,
()
async
{
testDeviceManager
.
specifiedDeviceId
=
'123'
;
...
...
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