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
89427d67
Unverified
Commit
89427d67
authored
Sep 24, 2019
by
Alexandre Ardhuin
Committed by
GitHub
Sep 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add missing trailing commas in flutter_tools (#40968)
parent
e9965f56
Changes
66
Hide whitespace changes
Inline
Side-by-side
Showing
66 changed files
with
238 additions
and
211 deletions
+238
-211
android_device.dart
packages/flutter_tools/lib/src/android/android_device.dart
+3
-2
gradle.dart
packages/flutter_tools/lib/src/android/gradle.dart
+1
-1
build_runner.dart
...ages/flutter_tools/lib/src/build_runner/build_runner.dart
+2
-2
build_script.dart
...ages/flutter_tools/lib/src/build_runner/build_script.dart
+1
-1
resident_web_runner.dart
...utter_tools/lib/src/build_runner/resident_web_runner.dart
+1
-1
web_compilation_delegate.dart
..._tools/lib/src/build_runner/web_compilation_delegate.dart
+1
-1
web_fs.dart
packages/flutter_tools/lib/src/build_runner/web_fs.dart
+9
-6
build_system.dart
...ages/flutter_tools/lib/src/build_system/build_system.dart
+4
-4
macos.dart
...ges/flutter_tools/lib/src/build_system/targets/macos.dart
+1
-1
assemble.dart
packages/flutter_tools/lib/src/commands/assemble.dart
+2
-2
build_bundle.dart
packages/flutter_tools/lib/src/commands/build_bundle.dart
+1
-1
build_linux.dart
packages/flutter_tools/lib/src/commands/build_linux.dart
+1
-1
build_windows.dart
packages/flutter_tools/lib/src/commands/build_windows.dart
+1
-1
drive.dart
packages/flutter_tools/lib/src/commands/drive.dart
+1
-1
run.dart
packages/flutter_tools/lib/src/commands/run.dart
+1
-1
test.dart
packages/flutter_tools/lib/src/commands/test.dart
+3
-3
fuchsia_dev_finder.dart
...ges/flutter_tools/lib/src/fuchsia/fuchsia_dev_finder.dart
+2
-2
fuchsia_device.dart
packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart
+2
-2
fuchsia_sdk.dart
packages/flutter_tools/lib/src/fuchsia/fuchsia_sdk.dart
+1
-1
devices.dart
packages/flutter_tools/lib/src/ios/devices.dart
+1
-1
mac.dart
packages/flutter_tools/lib/src/ios/mac.dart
+5
-5
simulators.dart
packages/flutter_tools/lib/src/ios/simulators.dart
+1
-1
xcodeproj.dart
packages/flutter_tools/lib/src/ios/xcodeproj.dart
+2
-2
usage.dart
packages/flutter_tools/lib/src/reporting/usage.dart
+12
-6
run_hot.dart
packages/flutter_tools/lib/src/run_hot.dart
+3
-3
flutter_command.dart
packages/flutter_tools/lib/src/runner/flutter_command.dart
+1
-1
flutter_platform.dart
packages/flutter_tools/lib/src/test/flutter_platform.dart
+2
-2
flutter_web_platform.dart
...ages/flutter_tools/lib/src/test/flutter_web_platform.dart
+9
-5
runner.dart
packages/flutter_tools/lib/src/test/runner.dart
+1
-1
chrome.dart
packages/flutter_tools/lib/src/web/chrome.dart
+1
-1
compile.dart
packages/flutter_tools/lib/src/web/compile.dart
+1
-1
web_device.dart
packages/flutter_tools/lib/src/web/web_device.dart
+1
-1
web_runner.dart
packages/flutter_tools/lib/src/web/web_runner.dart
+1
-1
visual_studio_validator.dart
...lutter_tools/lib/src/windows/visual_studio_validator.dart
+2
-2
analytics_test.dart
...ages/flutter_tools/test/general.shard/analytics_test.dart
+2
-2
gradle_test.dart
...flutter_tools/test/general.shard/android/gradle_test.dart
+40
-45
multiroot_asset_reader_test.dart
...neral.shard/build_runner/multiroot_asset_reader_test.dart
+1
-1
build_system_test.dart
...ls/test/general.shard/build_system/build_system_test.dart
+1
-1
exceptions_test.dart
...ools/test/general.shard/build_system/exceptions_test.dart
+5
-5
dart_test.dart
...ls/test/general.shard/build_system/targets/dart_test.dart
+4
-4
macos_test.dart
...s/test/general.shard/build_system/targets/macos_test.dart
+1
-1
cold_test.dart
packages/flutter_tools/test/general.shard/cold_test.dart
+3
-3
build_apk_test.dart
...ter_tools/test/general.shard/commands/build_apk_test.dart
+3
-3
build_appbundle_test.dart
...ols/test/general.shard/commands/build_appbundle_test.dart
+3
-3
build_bundle_test.dart
..._tools/test/general.shard/commands/build_bundle_test.dart
+6
-6
build_web_test.dart
...ter_tools/test/general.shard/commands/build_web_test.dart
+1
-1
config_test.dart
...lutter_tools/test/general.shard/commands/config_test.dart
+5
-5
create_test.dart
...lutter_tools/test/general.shard/commands/create_test.dart
+34
-27
test_test.dart
.../flutter_tools/test/general.shard/commands/test_test.dart
+1
-1
flutter_platform_test.dart
...utter_tools/test/general.shard/flutter_platform_test.dart
+2
-2
forbidden_imports_test.dart
...tter_tools/test/general.shard/forbidden_imports_test.dart
+1
-1
hot_test.dart
packages/flutter_tools/test/general.shard/hot_test.dart
+3
-3
devices_test.dart
...es/flutter_tools/test/general.shard/ios/devices_test.dart
+6
-6
mac_test.dart
packages/flutter_tools/test/general.shard/ios/mac_test.dart
+1
-1
linux_doctor_test.dart
...ter_tools/test/general.shard/linux/linux_doctor_test.dart
+1
-1
xcode_test.dart
...es/flutter_tools/test/general.shard/macos/xcode_test.dart
+4
-4
resident_runner_test.dart
...lutter_tools/test/general.shard/resident_runner_test.dart
+3
-3
resident_web_runner_test.dart
...er_tools/test/general.shard/resident_web_runner_test.dart
+8
-2
flutter_command_test.dart
...tools/test/general.shard/runner/flutter_command_test.dart
+1
-1
runner_test.dart
.../flutter_tools/test/general.shard/runner/runner_test.dart
+9
-4
chrome_test.dart
...ges/flutter_tools/test/general.shard/web/chrome_test.dart
+1
-1
web_fs_test.dart
...ges/flutter_tools/test/general.shard/web/web_fs_test.dart
+1
-1
visual_studio_test.dart
..._tools/test/general.shard/windows/visual_studio_test.dart
+2
-2
visual_studio_validator_test.dart
...t/general.shard/windows/visual_studio_validator_test.dart
+1
-1
mocks.dart
packages/flutter_tools/test/src/mocks.dart
+1
-1
testbed.dart
packages/flutter_tools/test/src/testbed.dart
+2
-2
No files found.
packages/flutter_tools/lib/src/android/android_device.dart
View file @
89427d67
...
@@ -513,8 +513,9 @@ class AndroidDevice extends Device {
...
@@ -513,8 +513,9 @@ class AndroidDevice extends Device {
await
androidBuilder
.
buildApk
(
await
androidBuilder
.
buildApk
(
project:
project
,
project:
project
,
target:
mainPath
,
target:
mainPath
,
androidBuildInfo:
AndroidBuildInfo
(
debuggingOptions
.
buildInfo
,
androidBuildInfo:
AndroidBuildInfo
(
targetArchs:
<
AndroidArch
>[
androidArch
]
debuggingOptions
.
buildInfo
,
targetArchs:
<
AndroidArch
>[
androidArch
],
),
),
);
);
// Package has been built, so we can get the updated application ID and
// Package has been built, so we can get the updated application ID and
...
...
packages/flutter_tools/lib/src/android/gradle.dart
View file @
89427d67
...
@@ -261,7 +261,7 @@ Future<GradleProject> _readGradleProject({bool isLibrary = false}) async {
...
@@ -261,7 +261,7 @@ Future<GradleProject> _readGradleProject({bool isLibrary = false}) async {
project
=
GradleProject
(
project
=
GradleProject
(
<
String
>[
'debug'
,
'profile'
,
'release'
],
<
String
>[
'debug'
,
'profile'
,
'release'
],
<
String
>[],
<
String
>[],
fs
.
path
.
join
(
flutterProject
.
android
.
hostAppGradleRoot
.
path
,
'app'
,
'build'
)
fs
.
path
.
join
(
flutterProject
.
android
.
hostAppGradleRoot
.
path
,
'app'
,
'build'
)
,
);
);
}
}
status
.
stop
();
status
.
stop
();
...
...
packages/flutter_tools/lib/src/build_runner/build_runner.dart
View file @
89427d67
...
@@ -113,7 +113,7 @@ class BuildRunner extends CodeGenerator {
...
@@ -113,7 +113,7 @@ class BuildRunner extends CodeGenerator {
}
}
scriptIdFile
.
writeAsBytesSync
(
appliedBuilderDigest
);
scriptIdFile
.
writeAsBytesSync
(
appliedBuilderDigest
);
final
ProcessResult
generateResult
=
await
processManager
.
run
(<
String
>[
final
ProcessResult
generateResult
=
await
processManager
.
run
(<
String
>[
sdkBinaryName
(
'pub'
),
'run'
,
'build_runner'
,
'generate-build-script'
sdkBinaryName
(
'pub'
),
'run'
,
'build_runner'
,
'generate-build-script'
,
],
workingDirectory:
syntheticPubspec
.
parent
.
path
);
],
workingDirectory:
syntheticPubspec
.
parent
.
path
);
if
(
generateResult
.
exitCode
!=
0
)
{
if
(
generateResult
.
exitCode
!=
0
)
{
throwToolExit
(
'Error generating build_script snapshot:
${generateResult.stderr}
'
);
throwToolExit
(
'Error generating build_script snapshot:
${generateResult.stderr}
'
);
...
@@ -173,7 +173,7 @@ class BuildRunner extends CodeGenerator {
...
@@ -173,7 +173,7 @@ class BuildRunner extends CodeGenerator {
if
(
log
.
message
!=
null
)
{
if
(
log
.
message
!=
null
)
{
printTrace
(
log
.
message
);
printTrace
(
log
.
message
);
}
}
}
}
,
);
);
}
finally
{
}
finally
{
status
.
stop
();
status
.
stop
();
...
...
packages/flutter_tools/lib/src/build_runner/build_script.dart
View file @
89427d67
...
@@ -190,7 +190,7 @@ final List<core.BuilderApplication> builders = <core.BuilderApplication>[
...
@@ -190,7 +190,7 @@ final List<core.BuilderApplication> builders = <core.BuilderApplication>[
),
),
),
),
core
.
applyPostProcess
(
'flutter_tools:module_cleanup'
,
moduleCleanup
,
core
.
applyPostProcess
(
'flutter_tools:module_cleanup'
,
moduleCleanup
,
defaultGenerateFor:
const
InputSet
())
defaultGenerateFor:
const
InputSet
())
,
];
];
/// The entrypoint to this build script.
/// The entrypoint to this build script.
...
...
packages/flutter_tools/lib/src/build_runner/resident_web_runner.dart
View file @
89427d67
...
@@ -33,7 +33,7 @@ class DwdsWebRunnerFactory extends WebRunnerFactory {
...
@@ -33,7 +33,7 @@ class DwdsWebRunnerFactory extends WebRunnerFactory {
String
target
,
String
target
,
@required
FlutterProject
flutterProject
,
@required
FlutterProject
flutterProject
,
@required
bool
ipv6
,
@required
bool
ipv6
,
@required
DebuggingOptions
debuggingOptions
@required
DebuggingOptions
debuggingOptions
,
})
{
})
{
return
ResidentWebRunner
(
return
ResidentWebRunner
(
device
,
device
,
...
...
packages/flutter_tools/lib/src/build_runner/web_compilation_delegate.dart
View file @
89427d67
...
@@ -131,7 +131,7 @@ class MultirootFileBasedAssetReader extends core.FileBasedAssetReader {
...
@@ -131,7 +131,7 @@ class MultirootFileBasedAssetReader extends core.FileBasedAssetReader {
}
}
}
}
final
String
generatedRoot
=
fs
.
path
.
join
(
final
String
generatedRoot
=
fs
.
path
.
join
(
generatedDirectory
.
path
,
packageGraph
.
root
.
name
generatedDirectory
.
path
,
packageGraph
.
root
.
name
,
);
);
if
(!
fs
.
isDirectorySync
(
generatedRoot
))
{
if
(!
fs
.
isDirectorySync
(
generatedRoot
))
{
return
;
return
;
...
...
packages/flutter_tools/lib/src/build_runner/web_fs.dart
View file @
89427d67
...
@@ -254,7 +254,7 @@ class WebFs {
...
@@ -254,7 +254,7 @@ class WebFs {
'lib'
,
'lib'
,
'dev_compiler'
,
'dev_compiler'
,
'web'
,
'web'
,
'dart_stack_trace_mapper.js'
'dart_stack_trace_mapper.js'
,
));
));
return
Response
.
ok
(
file
.
readAsBytesSync
(),
headers:
<
String
,
String
>{
return
Response
.
ok
(
file
.
readAsBytesSync
(),
headers:
<
String
,
String
>{
'Content-Type'
:
'text/javascript'
,
'Content-Type'
:
'text/javascript'
,
...
@@ -266,7 +266,7 @@ class WebFs {
...
@@ -266,7 +266,7 @@ class WebFs {
'dev_compiler'
,
'dev_compiler'
,
'kernel'
,
'kernel'
,
'amd'
,
'amd'
,
'require.js'
'require.js'
,
));
));
return
Response
.
ok
(
file
.
readAsBytesSync
(),
headers:
<
String
,
String
>{
return
Response
.
ok
(
file
.
readAsBytesSync
(),
headers:
<
String
,
String
>{
'Content-Type'
:
'text/javascript'
,
'Content-Type'
:
'text/javascript'
,
...
@@ -394,9 +394,12 @@ class BuildDaemonCreator {
...
@@ -394,9 +394,12 @@ class BuildDaemonCreator {
}
}
Future
<
BuildDaemonClient
>
_connectClient
(
Future
<
BuildDaemonClient
>
_connectClient
(
String
workingDirectory
,
String
workingDirectory
,
{
{
bool
release
,
bool
profile
,
bool
hasPlugins
,
bool
initializePlatform
}
bool
release
,
)
{
bool
profile
,
bool
hasPlugins
,
bool
initializePlatform
,
})
{
final
String
flutterToolsPackages
=
fs
.
path
.
join
(
Cache
.
flutterRoot
,
'packages'
,
'flutter_tools'
,
'.packages'
);
final
String
flutterToolsPackages
=
fs
.
path
.
join
(
Cache
.
flutterRoot
,
'packages'
,
'flutter_tools'
,
'.packages'
);
final
String
buildScript
=
fs
.
path
.
join
(
Cache
.
flutterRoot
,
'packages'
,
'flutter_tools'
,
'lib'
,
'src'
,
'build_runner'
,
'build_script.dart'
);
final
String
buildScript
=
fs
.
path
.
join
(
Cache
.
flutterRoot
,
'packages'
,
'flutter_tools'
,
'lib'
,
'src'
,
'build_runner'
,
'build_script.dart'
);
final
String
flutterWebSdk
=
artifacts
.
getArtifactPath
(
Artifact
.
flutterWebSdk
);
final
String
flutterWebSdk
=
artifacts
.
getArtifactPath
(
Artifact
.
flutterWebSdk
);
...
@@ -417,7 +420,7 @@ class BuildDaemonCreator {
...
@@ -417,7 +420,7 @@ class BuildDaemonCreator {
'--define'
,
'flutter_tools:entrypoint=profile=
$profile
'
,
'--define'
,
'flutter_tools:entrypoint=profile=
$profile
'
,
'--define'
,
'flutter_tools:shell=flutterWebSdk=
$flutterWebSdk
'
,
'--define'
,
'flutter_tools:shell=flutterWebSdk=
$flutterWebSdk
'
,
'--define'
,
'flutter_tools:shell=hasPlugins=
$hasPlugins
'
,
'--define'
,
'flutter_tools:shell=hasPlugins=
$hasPlugins
'
,
'--define'
,
'flutter_tools:shell=initializePlatform=
$initializePlatform
'
'--define'
,
'flutter_tools:shell=initializePlatform=
$initializePlatform
'
,
],
],
logHandler:
(
ServerLog
serverLog
)
{
logHandler:
(
ServerLog
serverLog
)
{
switch
(
serverLog
.
level
)
{
switch
(
serverLog
.
level
)
{
...
...
packages/flutter_tools/lib/src/build_system/build_system.dart
View file @
89427d67
...
@@ -126,7 +126,7 @@ abstract class Target {
...
@@ -126,7 +126,7 @@ abstract class Target {
<
Node
>[
<
Node
>[
for
(
Target
target
in
dependencies
)
target
.
_toNode
(
environment
)
for
(
Target
target
in
dependencies
)
target
.
_toNode
(
environment
)
],
],
environment
environment
,
);
);
}
}
...
@@ -390,9 +390,9 @@ class BuildSystem {
...
@@ -390,9 +390,9 @@ class BuildSystem {
/// Build `target` and all of its dependencies.
/// Build `target` and all of its dependencies.
Future
<
BuildResult
>
build
(
Future
<
BuildResult
>
build
(
Target
target
,
Target
target
,
Environment
environment
,
Environment
environment
,
{
{
BuildSystemConfig
buildSystemConfig
=
const
BuildSystemConfig
()
}
BuildSystemConfig
buildSystemConfig
=
const
BuildSystemConfig
(),
)
async
{
}
)
async
{
environment
.
buildDir
.
createSync
(
recursive:
true
);
environment
.
buildDir
.
createSync
(
recursive:
true
);
environment
.
outputDir
.
createSync
(
recursive:
true
);
environment
.
outputDir
.
createSync
(
recursive:
true
);
...
...
packages/flutter_tools/lib/src/build_system/targets/macos.dart
View file @
89427d67
...
@@ -288,7 +288,7 @@ abstract class MacOSBundleFlutterAssets extends Target {
...
@@ -288,7 +288,7 @@ abstract class MacOSBundleFlutterAssets extends Target {
List
<
Source
>
get
inputs
=>
const
<
Source
>[
List
<
Source
>
get
inputs
=>
const
<
Source
>[
Source
.
pattern
(
'{PROJECT_DIR}/pubspec.yaml'
),
Source
.
pattern
(
'{PROJECT_DIR}/pubspec.yaml'
),
Source
.
pattern
(
'{BUILD_DIR}/App.framework/App'
),
Source
.
pattern
(
'{BUILD_DIR}/App.framework/App'
),
Source
.
behavior
(
MacOSAssetBehavior
())
Source
.
behavior
(
MacOSAssetBehavior
())
,
];
];
@override
@override
...
...
packages/flutter_tools/lib/src/commands/assemble.dart
View file @
89427d67
...
@@ -44,7 +44,7 @@ class AssembleCommand extends FlutterCommand {
...
@@ -44,7 +44,7 @@ class AssembleCommand extends FlutterCommand {
argParser
.
addMultiOption
(
argParser
.
addMultiOption
(
'define'
,
'define'
,
abbr:
'd'
,
abbr:
'd'
,
help:
'Allows passing configuration to a target with --define=target=key=value.'
help:
'Allows passing configuration to a target with --define=target=key=value.'
,
);
);
argParser
.
addOption
(
'build-inputs'
,
help:
'A file path where a newline '
argParser
.
addOption
(
'build-inputs'
,
help:
'A file path where a newline '
'separated file containing all inputs used will be written after a build.'
'separated file containing all inputs used will be written after a build.'
...
@@ -60,7 +60,7 @@ class AssembleCommand extends FlutterCommand {
...
@@ -60,7 +60,7 @@ class AssembleCommand extends FlutterCommand {
);
);
argParser
.
addOption
(
argParser
.
addOption
(
'resource-pool-size'
,
'resource-pool-size'
,
help:
'The maximum number of concurrent tasks the build system will run.'
help:
'The maximum number of concurrent tasks the build system will run.'
,
);
);
}
}
...
...
packages/flutter_tools/lib/src/commands/build_bundle.dart
View file @
89427d67
...
@@ -82,7 +82,7 @@ class BuildBundleCommand extends BuildSubCommand {
...
@@ -82,7 +82,7 @@ class BuildBundleCommand extends BuildSubCommand {
}
}
return
<
CustomDimensions
,
String
>{
return
<
CustomDimensions
,
String
>{
CustomDimensions
.
commandBuildBundleTargetPlatform
:
argResults
[
'target-platform'
],
CustomDimensions
.
commandBuildBundleTargetPlatform
:
argResults
[
'target-platform'
],
CustomDimensions
.
commandBuildBundleIsModule
:
'
${futterProject.isModule}
'
CustomDimensions
.
commandBuildBundleIsModule
:
'
${futterProject.isModule}
'
,
};
};
}
}
...
...
packages/flutter_tools/lib/src/commands/build_linux.dart
View file @
89427d67
...
@@ -24,7 +24,7 @@ class BuildLinuxCommand extends BuildSubCommand {
...
@@ -24,7 +24,7 @@ class BuildLinuxCommand extends BuildSubCommand {
);
);
argParser
.
addFlag
(
'profile'
,
argParser
.
addFlag
(
'profile'
,
negatable:
false
,
negatable:
false
,
help:
'Build a version of your app specialized for performance profiling.'
help:
'Build a version of your app specialized for performance profiling.'
,
);
);
argParser
.
addFlag
(
'release'
,
argParser
.
addFlag
(
'release'
,
negatable:
false
,
negatable:
false
,
...
...
packages/flutter_tools/lib/src/commands/build_windows.dart
View file @
89427d67
...
@@ -24,7 +24,7 @@ class BuildWindowsCommand extends BuildSubCommand {
...
@@ -24,7 +24,7 @@ class BuildWindowsCommand extends BuildSubCommand {
);
);
argParser
.
addFlag
(
'profile'
,
argParser
.
addFlag
(
'profile'
,
negatable:
false
,
negatable:
false
,
help:
'Build a version of your app specialized for performance profiling.'
help:
'Build a version of your app specialized for performance profiling.'
,
);
);
argParser
.
addFlag
(
'release'
,
argParser
.
addFlag
(
'release'
,
negatable:
false
,
negatable:
false
,
...
...
packages/flutter_tools/lib/src/commands/drive.dart
View file @
89427d67
...
@@ -274,7 +274,7 @@ Future<LaunchResult> _startApp(DriveCommand command) async {
...
@@ -274,7 +274,7 @@ Future<LaunchResult> _startApp(DriveCommand command) async {
command
.
getBuildInfo
(),
command
.
getBuildInfo
(),
startPaused:
true
,
startPaused:
true
,
observatoryPort:
command
.
observatoryPort
,
observatoryPort:
command
.
observatoryPort
,
verboseSystemLogs:
command
.
verboseSystemLogs
verboseSystemLogs:
command
.
verboseSystemLogs
,
),
),
platformArgs:
platformArgs
,
platformArgs:
platformArgs
,
prebuiltApplication:
!
command
.
shouldBuild
,
prebuiltApplication:
!
command
.
shouldBuild
,
...
...
packages/flutter_tools/lib/src/commands/run.dart
View file @
89427d67
...
@@ -173,7 +173,7 @@ class RunCommand extends RunCommandBase {
...
@@ -173,7 +173,7 @@ class RunCommand extends RunCommandBase {
negatable:
true
,
negatable:
true
,
defaultsTo:
true
,
defaultsTo:
true
,
hide:
true
,
hide:
true
,
help:
'Whether to automatically invoke webOnlyInitializePlatform.'
help:
'Whether to automatically invoke webOnlyInitializePlatform.'
,
)
)
..
addOption
(
FlutterOptions
.
kExtraFrontEndOptions
,
hide:
true
)
..
addOption
(
FlutterOptions
.
kExtraFrontEndOptions
,
hide:
true
)
..
addOption
(
FlutterOptions
.
kExtraGenSnapshotOptions
,
hide:
true
)
..
addOption
(
FlutterOptions
.
kExtraGenSnapshotOptions
,
hide:
true
)
...
...
packages/flutter_tools/lib/src/commands/test.dart
View file @
89427d67
...
@@ -50,7 +50,7 @@ class TestCommand extends FastFlutterCommand {
...
@@ -50,7 +50,7 @@ class TestCommand extends FastFlutterCommand {
defaultsTo:
false
,
defaultsTo:
false
,
negatable:
false
,
negatable:
false
,
help:
'No longer require an authentication code to connect to the VM '
help:
'No longer require an authentication code to connect to the VM '
'service (not recommended).'
'service (not recommended).'
,
)
)
..
addFlag
(
'coverage'
,
..
addFlag
(
'coverage'
,
defaultsTo:
false
,
defaultsTo:
false
,
...
@@ -87,7 +87,7 @@ class TestCommand extends FastFlutterCommand {
...
@@ -87,7 +87,7 @@ class TestCommand extends FastFlutterCommand {
abbr:
'j'
,
abbr:
'j'
,
defaultsTo:
math
.
max
<
int
>(
1
,
platform
.
numberOfProcessors
-
2
).
toString
(),
defaultsTo:
math
.
max
<
int
>(
1
,
platform
.
numberOfProcessors
-
2
).
toString
(),
help:
'The number of concurrent test processes to run.'
,
help:
'The number of concurrent test processes to run.'
,
valueHelp:
'jobs'
valueHelp:
'jobs'
,
)
)
..
addFlag
(
'test-assets'
,
..
addFlag
(
'test-assets'
,
defaultsTo:
true
,
defaultsTo:
true
,
...
@@ -98,7 +98,7 @@ class TestCommand extends FastFlutterCommand {
...
@@ -98,7 +98,7 @@ class TestCommand extends FastFlutterCommand {
..
addOption
(
'platform'
,
..
addOption
(
'platform'
,
allowed:
const
<
String
>[
'tester'
,
'chrome'
],
allowed:
const
<
String
>[
'tester'
,
'chrome'
],
defaultsTo:
'tester'
,
defaultsTo:
'tester'
,
help:
'The platform to run the unit tests on. Defaults to "tester".'
help:
'The platform to run the unit tests on. Defaults to "tester".'
,
);
);
usesTrackWidgetCreation
(
verboseHelp:
verboseHelp
);
usesTrackWidgetCreation
(
verboseHelp:
verboseHelp
);
}
}
...
...
packages/flutter_tools/lib/src/fuchsia/fuchsia_dev_finder.dart
View file @
89427d67
...
@@ -30,7 +30,7 @@ class FuchsiaDevFinder {
...
@@ -30,7 +30,7 @@ class FuchsiaDevFinder {
final
List
<
String
>
command
=
<
String
>[
final
List
<
String
>
command
=
<
String
>[
fuchsiaArtifacts
.
devFinder
.
path
,
fuchsiaArtifacts
.
devFinder
.
path
,
'list'
,
'list'
,
'-full'
'-full'
,
];
];
final
RunResult
result
=
await
processUtils
.
run
(
command
);
final
RunResult
result
=
await
processUtils
.
run
(
command
);
if
(
result
.
exitCode
!=
0
)
{
if
(
result
.
exitCode
!=
0
)
{
...
@@ -55,7 +55,7 @@ class FuchsiaDevFinder {
...
@@ -55,7 +55,7 @@ class FuchsiaDevFinder {
'resolve'
,
'resolve'
,
'-local'
,
'-local'
,
'-device-limit'
,
'1'
,
'-device-limit'
,
'1'
,
deviceName
deviceName
,
];
];
final
RunResult
result
=
await
processUtils
.
run
(
command
);
final
RunResult
result
=
await
processUtils
.
run
(
command
);
if
(
result
.
exitCode
!=
0
)
{
if
(
result
.
exitCode
!=
0
)
{
...
...
packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart
View file @
89427d67
...
@@ -459,7 +459,7 @@ class FuchsiaDevice extends Device {
...
@@ -459,7 +459,7 @@ class FuchsiaDevice extends Device {
'-F'
,
'-F'
,
fuchsiaArtifacts
.
sshConfig
.
absolute
.
path
,
fuchsiaArtifacts
.
sshConfig
.
absolute
.
path
,
id
,
id
,
command
command
,
]);
]);
}
}
...
@@ -652,7 +652,7 @@ class _FuchsiaPortForwarder extends DevicePortForwarder {
...
@@ -652,7 +652,7 @@ class _FuchsiaPortForwarder extends DevicePortForwarder {
'-vvv'
,
'-vvv'
,
'-L'
,
'-L'
,
'
${forwardedPort.hostPort}
:
$_ipv4Loopback
:
${forwardedPort.devicePort}
'
,
'
${forwardedPort.hostPort}
:
$_ipv4Loopback
:
${forwardedPort.devicePort}
'
,
device
.
id
device
.
id
,
];
];
final
ProcessResult
result
=
await
processManager
.
run
(
command
);
final
ProcessResult
result
=
await
processManager
.
run
(
command
);
if
(
result
.
exitCode
!=
0
)
{
if
(
result
.
exitCode
!=
0
)
{
...
...
packages/flutter_tools/lib/src/fuchsia/fuchsia_sdk.dart
View file @
89427d67
...
@@ -77,7 +77,7 @@ class FuchsiaSdk {
...
@@ -77,7 +77,7 @@ class FuchsiaSdk {
'-F'
,
'-F'
,
fuchsiaArtifacts
.
sshConfig
.
absolute
.
path
,
fuchsiaArtifacts
.
sshConfig
.
absolute
.
path
,
id
,
id
,
remoteCommand
remoteCommand
,
];
];
processManager
.
start
(
cmd
).
then
((
Process
newProcess
)
{
processManager
.
start
(
cmd
).
then
((
Process
newProcess
)
{
if
(
controller
.
isClosed
)
{
if
(
controller
.
isClosed
)
{
...
...
packages/flutter_tools/lib/src/ios/devices.dart
View file @
89427d67
...
@@ -133,7 +133,7 @@ class IOSDevice extends Device {
...
@@ -133,7 +133,7 @@ class IOSDevice extends Device {
);
);
_iproxyPath
=
artifacts
.
getArtifactPath
(
_iproxyPath
=
artifacts
.
getArtifactPath
(
Artifact
.
iproxy
,
Artifact
.
iproxy
,
platform:
TargetPlatform
.
ios
platform:
TargetPlatform
.
ios
,
);
);
}
}
...
...
packages/flutter_tools/lib/src/ios/mac.dart
View file @
89427d67
...
@@ -111,7 +111,7 @@ class IMobileDevice {
...
@@ -111,7 +111,7 @@ class IMobileDevice {
_isInstalled
??=
processUtils
.
exitsHappySync
(
_isInstalled
??=
processUtils
.
exitsHappySync
(
<
String
>[
<
String
>[
_ideviceIdPath
,
_ideviceIdPath
,
'-h'
'-h'
,
],
],
environment:
Map
<
String
,
String
>.
fromEntries
(
environment:
Map
<
String
,
String
>.
fromEntries
(
<
MapEntry
<
String
,
String
>>[
cache
.
dyLdLibEntry
]
<
MapEntry
<
String
,
String
>>[
cache
.
dyLdLibEntry
]
...
@@ -141,7 +141,7 @@ class IMobileDevice {
...
@@ -141,7 +141,7 @@ class IMobileDevice {
<
String
>[
<
String
>[
_ideviceinfoPath
,
_ideviceinfoPath
,
'-u'
,
'-u'
,
fakeIphoneId
fakeIphoneId
,
],
],
environment:
executionEnv
,
environment:
executionEnv
,
)).
processResult
;
)).
processResult
;
...
@@ -176,7 +176,7 @@ class IMobileDevice {
...
@@ -176,7 +176,7 @@ class IMobileDevice {
final
ProcessResult
result
=
await
processManager
.
run
(
final
ProcessResult
result
=
await
processManager
.
run
(
<
String
>[
<
String
>[
_ideviceIdPath
,
_ideviceIdPath
,
'-l'
'-l'
,
],
],
environment:
Map
<
String
,
String
>.
fromEntries
(
environment:
Map
<
String
,
String
>.
fromEntries
(
<
MapEntry
<
String
,
String
>>[
cache
.
dyLdLibEntry
]
<
MapEntry
<
String
,
String
>>[
cache
.
dyLdLibEntry
]
...
@@ -199,7 +199,7 @@ class IMobileDevice {
...
@@ -199,7 +199,7 @@ class IMobileDevice {
'-u'
,
'-u'
,
deviceID
,
deviceID
,
'-k'
,
'-k'
,
key
key
,
],
],
environment:
Map
<
String
,
String
>.
fromEntries
(
environment:
Map
<
String
,
String
>.
fromEntries
(
<
MapEntry
<
String
,
String
>>[
cache
.
dyLdLibEntry
]
<
MapEntry
<
String
,
String
>>[
cache
.
dyLdLibEntry
]
...
@@ -250,7 +250,7 @@ class IMobileDevice {
...
@@ -250,7 +250,7 @@ class IMobileDevice {
return
processUtils
.
run
(
return
processUtils
.
run
(
<
String
>[
<
String
>[
_idevicescreenshotPath
,
_idevicescreenshotPath
,
outputFile
.
path
outputFile
.
path
,
],
],
throwOnError:
true
,
throwOnError:
true
,
environment:
Map
<
String
,
String
>.
fromEntries
(
environment:
Map
<
String
,
String
>.
fromEntries
(
...
...
packages/flutter_tools/lib/src/ios/simulators.dart
View file @
89427d67
...
@@ -373,7 +373,7 @@ class IOSSimulator extends Device {
...
@@ -373,7 +373,7 @@ class IOSSimulator extends Device {
if
(
debuggingOptions
.
skiaDeterministicRendering
)
'--skia-deterministic-rendering'
,
if
(
debuggingOptions
.
skiaDeterministicRendering
)
'--skia-deterministic-rendering'
,
if
(
debuggingOptions
.
useTestFonts
)
'--use-test-fonts'
,
if
(
debuggingOptions
.
useTestFonts
)
'--use-test-fonts'
,
'--observatory-port=
${debuggingOptions.observatoryPort ?? 0}
'
,
'--observatory-port=
${debuggingOptions.observatoryPort ?? 0}
'
,
]
]
,
];
];
ProtocolDiscovery
observatoryDiscovery
;
ProtocolDiscovery
observatoryDiscovery
;
...
...
packages/flutter_tools/lib/src/ios/xcodeproj.dart
View file @
89427d67
...
@@ -59,7 +59,7 @@ Future<void> updateGeneratedXcodeProperties({
...
@@ -59,7 +59,7 @@ Future<void> updateGeneratedXcodeProperties({
targetOverride:
targetOverride
,
targetOverride:
targetOverride
,
useMacOSConfig:
useMacOSConfig
,
useMacOSConfig:
useMacOSConfig
,
setSymroot:
setSymroot
,
setSymroot:
setSymroot
,
buildDirOverride:
buildDirOverride
buildDirOverride:
buildDirOverride
,
);
);
_updateGeneratedXcodePropertiesFile
(
_updateGeneratedXcodePropertiesFile
(
...
@@ -327,7 +327,7 @@ class XcodeProjectInterpreter {
...
@@ -327,7 +327,7 @@ class XcodeProjectInterpreter {
'-scheme'
,
'-scheme'
,
scheme
,
scheme
,
'-quiet'
,
'-quiet'
,
'clean'
'clean'
,
],
workingDirectory:
fs
.
currentDirectory
.
path
);
],
workingDirectory:
fs
.
currentDirectory
.
path
);
}
}
...
...
packages/flutter_tools/lib/src/reporting/usage.dart
View file @
89427d67
...
@@ -108,8 +108,9 @@ abstract class Usage {
...
@@ -108,8 +108,9 @@ abstract class Usage {
///
///
/// Note that using [command] above is preferred to ensure that the parameter
/// Note that using [command] above is preferred to ensure that the parameter
/// keys are well-defined in [CustomDimensions] above.
/// keys are well-defined in [CustomDimensions] above.
void
sendCommand
(
String
command
,
{
void
sendCommand
(
Map
<
String
,
String
>
parameters
String
command
,
{
Map
<
String
,
String
>
parameters
,
});
});
/// Sends an 'event' to the underlying analytics implementation.
/// Sends an 'event' to the underlying analytics implementation.
...
@@ -118,13 +119,18 @@ abstract class Usage {
...
@@ -118,13 +119,18 @@ abstract class Usage {
/// event types defined in this directory in events.dart.
/// event types defined in this directory in events.dart.
@visibleForOverriding
@visibleForOverriding
@visibleForTesting
@visibleForTesting
void
sendEvent
(
String
category
,
String
parameter
,
{
void
sendEvent
(
Map
<
String
,
String
>
parameters
String
category
,
String
parameter
,
{
Map
<
String
,
String
>
parameters
,
});
});
/// Sends timing information to the underlying analytics implementation.
/// Sends timing information to the underlying analytics implementation.
void
sendTiming
(
String
category
,
String
variableName
,
Duration
duration
,
{
void
sendTiming
(
String
label
String
category
,
String
variableName
,
Duration
duration
,
{
String
label
,
});
});
/// Sends an exception to the underlying analytics implementation.
/// Sends an exception to the underlying analytics implementation.
...
...
packages/flutter_tools/lib/src/run_hot.dart
View file @
89427d67
...
@@ -384,7 +384,7 @@ class HotRunner extends ResidentRunner {
...
@@ -384,7 +384,7 @@ class HotRunner extends ResidentRunner {
Future
<
OperationResult
>
_restartFromSources
({
Future
<
OperationResult
>
_restartFromSources
({
String
reason
,
String
reason
,
bool
benchmarkMode
=
false
bool
benchmarkMode
=
false
,
})
async
{
})
async
{
if
(!
_isPaused
())
{
if
(!
_isPaused
())
{
printTrace
(
'Refreshing active FlutterViews before restarting.'
);
printTrace
(
'Refreshing active FlutterViews before restarting.'
);
...
@@ -520,7 +520,7 @@ class HotRunner extends ResidentRunner {
...
@@ -520,7 +520,7 @@ class HotRunner extends ResidentRunner {
bool
fullRestart
=
false
,
bool
fullRestart
=
false
,
bool
pauseAfterRestart
=
false
,
bool
pauseAfterRestart
=
false
,
String
reason
,
String
reason
,
bool
benchmarkMode
=
false
bool
benchmarkMode
=
false
,
})
async
{
})
async
{
String
targetPlatform
;
String
targetPlatform
;
String
sdkName
;
String
sdkName
;
...
@@ -663,7 +663,7 @@ class HotRunner extends ResidentRunner {
...
@@ -663,7 +663,7 @@ class HotRunner extends ResidentRunner {
bool
emulator
,
bool
emulator
,
bool
pause
=
false
,
bool
pause
=
false
,
String
reason
,
String
reason
,
void
Function
(
String
message
)
onSlow
void
Function
(
String
message
)
onSlow
,
})
async
{
})
async
{
for
(
FlutterDevice
device
in
flutterDevices
)
{
for
(
FlutterDevice
device
in
flutterDevices
)
{
for
(
FlutterView
view
in
device
.
views
)
{
for
(
FlutterView
view
in
device
.
views
)
{
...
...
packages/flutter_tools/lib/src/runner/flutter_command.dart
View file @
89427d67
...
@@ -293,7 +293,7 @@ abstract class FlutterCommand extends Command<void> {
...
@@ -293,7 +293,7 @@ abstract class FlutterCommand extends Command<void> {
'which shortens the names of your app’s classes and members, '
'which shortens the names of your app’s classes and members, '
'and optimization, which applies more aggressive strategies to '
'and optimization, which applies more aggressive strategies to '
'further reduce the size of your app.'
'further reduce the size of your app.'
'To learn more, see: https://developer.android.com/studio/build/shrink-code'
'To learn more, see: https://developer.android.com/studio/build/shrink-code'
,
);
);
}
}
...
...
packages/flutter_tools/lib/src/test/flutter_platform.dart
View file @
89427d67
...
@@ -94,7 +94,7 @@ FlutterPlatform installHook({
...
@@ -94,7 +94,7 @@ FlutterPlatform installHook({
Uri
projectRootDirectory
,
Uri
projectRootDirectory
,
FlutterProject
flutterProject
,
FlutterProject
flutterProject
,
String
icudtlPath
,
String
icudtlPath
,
PlatformPluginRegistration
platformPluginRegistration
PlatformPluginRegistration
platformPluginRegistration
,
})
{
})
{
assert
(
enableObservatory
||
(!
startPaused
&&
observatoryPort
==
null
));
assert
(
enableObservatory
||
(!
startPaused
&&
observatoryPort
==
null
));
...
@@ -104,7 +104,7 @@ FlutterPlatform installHook({
...
@@ -104,7 +104,7 @@ FlutterPlatform installHook({
<
Runtime
>[
Runtime
.
vm
],
<
Runtime
>[
Runtime
.
vm
],
()
{
()
{
return
platform
;
return
platform
;
}
}
,
);
);
};
};
final
FlutterPlatform
platform
=
FlutterPlatform
(
final
FlutterPlatform
platform
=
FlutterPlatform
(
...
...
packages/flutter_tools/lib/src/test/flutter_web_platform.dart
View file @
89427d67
...
@@ -248,7 +248,7 @@ class FlutterWebPlatform extends PlatformPlugin {
...
@@ -248,7 +248,7 @@ class FlutterWebPlatform extends PlatformPlugin {
.
resolve
(
'static/index.html'
)
.
resolve
(
'static/index.html'
)
.
replace
(
queryParameters:
<
String
,
String
>{
.
replace
(
queryParameters:
<
String
,
String
>{
'managerUrl'
:
webSocketUrl
.
toString
(),
'managerUrl'
:
webSocketUrl
.
toString
(),
'debug'
:
_config
.
pauseAfterLoad
.
toString
()
'debug'
:
_config
.
pauseAfterLoad
.
toString
()
,
});
});
printTrace
(
'Serving tests at
$hostUrl
'
);
printTrace
(
'Serving tests at
$hostUrl
'
);
...
@@ -551,12 +551,16 @@ class BrowserManager {
...
@@ -551,12 +551,16 @@ class BrowserManager {
/// If [mapper] is passed, it's used to map stack traces for errors coming
/// If [mapper] is passed, it's used to map stack traces for errors coming
/// from this test suite.
/// from this test suite.
Future
<
RunnerSuite
>
load
(
Future
<
RunnerSuite
>
load
(
String
path
,
Uri
url
,
SuiteConfiguration
suiteConfig
,
Object
message
,
String
path
,
{
StackTraceMapper
mapper
})
async
{
Uri
url
,
SuiteConfiguration
suiteConfig
,
Object
message
,
{
StackTraceMapper
mapper
,
})
async
{
url
=
url
.
replace
(
url
=
url
.
replace
(
fragment:
Uri
.
encodeFull
(
jsonEncode
(<
String
,
Object
>{
fragment:
Uri
.
encodeFull
(
jsonEncode
(<
String
,
Object
>{
'metadata'
:
suiteConfig
.
metadata
.
serialize
(),
'metadata'
:
suiteConfig
.
metadata
.
serialize
(),
'browser'
:
_runtime
.
identifier
'browser'
:
_runtime
.
identifier
,
})));
})));
final
int
suiteID
=
_suiteID
++;
final
int
suiteID
=
_suiteID
++;
...
@@ -585,7 +589,7 @@ class BrowserManager {
...
@@ -585,7 +589,7 @@ class BrowserManager {
'command'
:
'loadSuite'
,
'command'
:
'loadSuite'
,
'url'
:
url
.
toString
(),
'url'
:
url
.
toString
(),
'id'
:
suiteID
,
'id'
:
suiteID
,
'channel'
:
suiteChannelID
'channel'
:
suiteChannelID
,
});
});
try
{
try
{
...
...
packages/flutter_tools/lib/src/test/runner.dart
View file @
89427d67
...
@@ -84,7 +84,7 @@ Future<int> runTests(
...
@@ -84,7 +84,7 @@ Future<int> runTests(
<
Runtime
>[
Runtime
.
chrome
],
<
Runtime
>[
Runtime
.
chrome
],
()
{
()
{
return
FlutterWebPlatform
.
start
(
flutterProject
.
directory
.
path
);
return
FlutterWebPlatform
.
start
(
flutterProject
.
directory
.
path
);
}
}
,
);
);
await
test
.
main
(
testArgs
);
await
test
.
main
(
testArgs
);
return
exitCode
;
return
exitCode
;
...
...
packages/flutter_tools/lib/src/web/chrome.dart
View file @
89427d67
...
@@ -35,7 +35,7 @@ const String kWindowsExecutable = r'Google\Chrome\Application\chrome.exe';
...
@@ -35,7 +35,7 @@ const String kWindowsExecutable = r'Google\Chrome\Application\chrome.exe';
final
List
<
String
>
kWindowsPrefixes
=
<
String
>[
final
List
<
String
>
kWindowsPrefixes
=
<
String
>[
platform
.
environment
[
'LOCALAPPDATA'
],
platform
.
environment
[
'LOCALAPPDATA'
],
platform
.
environment
[
'PROGRAMFILES'
],
platform
.
environment
[
'PROGRAMFILES'
],
platform
.
environment
[
'PROGRAMFILES(X86)'
]
platform
.
environment
[
'PROGRAMFILES(X86)'
]
,
];
];
/// Find the chrome executable on the current platform.
/// Find the chrome executable on the current platform.
...
...
packages/flutter_tools/lib/src/web/compile.dart
View file @
89427d67
...
@@ -46,7 +46,7 @@ Future<void> buildWeb(FlutterProject flutterProject, String target, BuildInfo bu
...
@@ -46,7 +46,7 @@ Future<void> buildWeb(FlutterProject flutterProject, String target, BuildInfo bu
'build'
,
'build'
,
'flutter_web'
,
'flutter_web'
,
flutterProject
.
manifest
.
appName
,
flutterProject
.
manifest
.
appName
,
'
${fs.path.withoutExtension(target)}
_web_entrypoint.dart.js'
'
${fs.path.withoutExtension(target)}
_web_entrypoint.dart.js'
,
);
);
fs
.
file
(
outputPath
).
copySync
(
fs
.
path
.
join
(
outputDir
.
path
,
'main.dart.js'
));
fs
.
file
(
outputPath
).
copySync
(
fs
.
path
.
join
(
outputDir
.
path
,
'main.dart.js'
));
fs
.
file
(
'
$outputPath
.map'
).
copySync
(
fs
.
path
.
join
(
outputDir
.
path
,
'main.dart.js.map'
));
fs
.
file
(
'
$outputPath
.map'
).
copySync
(
fs
.
path
.
join
(
outputDir
.
path
,
'main.dart.js.map'
));
...
...
packages/flutter_tools/lib/src/web/web_device.dart
View file @
89427d67
...
@@ -98,7 +98,7 @@ class ChromeDevice extends Device {
...
@@ -98,7 +98,7 @@ class ChromeDevice extends Device {
String
version
=
'unknown'
;
String
version
=
'unknown'
;
if
(
platform
.
isWindows
)
{
if
(
platform
.
isWindows
)
{
final
ProcessResult
result
=
await
processManager
.
run
(<
String
>[
final
ProcessResult
result
=
await
processManager
.
run
(<
String
>[
r'reg'
,
'query'
,
'HKEY_CURRENT_USER
\\
Software
\\
Google
\\
Chrome
\\
BLBeacon'
,
'/v'
,
'version'
r'reg'
,
'query'
,
'HKEY_CURRENT_USER
\\
Software
\\
Google
\\
Chrome
\\
BLBeacon'
,
'/v'
,
'version'
,
]);
]);
if
(
result
.
exitCode
==
0
)
{
if
(
result
.
exitCode
==
0
)
{
final
List
<
String
>
parts
=
result
.
stdout
.
split
(
RegExp
(
r'\s+'
));
final
List
<
String
>
parts
=
result
.
stdout
.
split
(
RegExp
(
r'\s+'
));
...
...
packages/flutter_tools/lib/src/web/web_runner.dart
View file @
89427d67
...
@@ -21,6 +21,6 @@ abstract class WebRunnerFactory {
...
@@ -21,6 +21,6 @@ abstract class WebRunnerFactory {
String
target
,
String
target
,
@required
FlutterProject
flutterProject
,
@required
FlutterProject
flutterProject
,
@required
bool
ipv6
,
@required
bool
ipv6
,
@required
DebuggingOptions
debuggingOptions
@required
DebuggingOptions
debuggingOptions
,
});
});
}
}
packages/flutter_tools/lib/src/windows/visual_studio_validator.dart
View file @
89427d67
...
@@ -51,7 +51,7 @@ class VisualStudioValidator extends DoctorValidator {
...
@@ -51,7 +51,7 @@ class VisualStudioValidator extends DoctorValidator {
messages
.
add
(
ValidationMessage
.
error
(
messages
.
add
(
ValidationMessage
.
error
(
userMessages
.
visualStudioMissingComponents
(
userMessages
.
visualStudioMissingComponents
(
visualStudio
.
workloadDescription
,
visualStudio
.
workloadDescription
,
visualStudio
.
necessaryComponentDescriptions
(
majorVersion
)
visualStudio
.
necessaryComponentDescriptions
(
majorVersion
)
,
)
)
));
));
}
}
...
@@ -61,7 +61,7 @@ class VisualStudioValidator extends DoctorValidator {
...
@@ -61,7 +61,7 @@ class VisualStudioValidator extends DoctorValidator {
messages
.
add
(
ValidationMessage
.
error
(
messages
.
add
(
ValidationMessage
.
error
(
userMessages
.
visualStudioMissing
(
userMessages
.
visualStudioMissing
(
visualStudio
.
workloadDescription
,
visualStudio
.
workloadDescription
,
visualStudio
.
necessaryComponentDescriptions
(
majorVersion
)
visualStudio
.
necessaryComponentDescriptions
(
majorVersion
)
,
)
)
));
));
}
}
...
...
packages/flutter_tools/test/general.shard/analytics_test.dart
View file @
89427d67
...
@@ -67,7 +67,7 @@ void main() {
...
@@ -67,7 +67,7 @@ void main() {
FlutterVersion:
()
=>
FlutterVersion
(
const
SystemClock
()),
FlutterVersion:
()
=>
FlutterVersion
(
const
SystemClock
()),
Usage:
()
=>
Usage
(
Usage:
()
=>
Usage
(
configDirOverride:
tempDir
.
path
,
configDirOverride:
tempDir
.
path
,
logFile:
tempDir
.
childFile
(
'analytics.log'
).
path
logFile:
tempDir
.
childFile
(
'analytics.log'
).
path
,
),
),
});
});
...
@@ -89,7 +89,7 @@ void main() {
...
@@ -89,7 +89,7 @@ void main() {
FlutterVersion:
()
=>
FlutterVersion
(
const
SystemClock
()),
FlutterVersion:
()
=>
FlutterVersion
(
const
SystemClock
()),
Usage:
()
=>
Usage
(
Usage:
()
=>
Usage
(
configDirOverride:
tempDir
.
path
,
configDirOverride:
tempDir
.
path
,
logFile:
tempDir
.
childFile
(
'analytics.log'
).
path
logFile:
tempDir
.
childFile
(
'analytics.log'
).
path
,
),
),
});
});
...
...
packages/flutter_tools/test/general.shard/android/gradle_test.dart
View file @
89427d67
...
@@ -328,13 +328,12 @@ someOtherTask
...
@@ -328,13 +328,12 @@ someOtherTask
expect
(
project
.
apkFilesFor
(
expect
(
project
.
apkFilesFor
(
const
AndroidBuildInfo
(
const
AndroidBuildInfo
(
BuildInfo
.
debug
,
BuildInfo
.
debug
,
splitPerAbi:
true
,
splitPerAbi:
true
,
targetArchs:
<
AndroidArch
>[
targetArchs:
<
AndroidArch
>[
AndroidArch
.
armeabi_v7a
,
AndroidArch
.
armeabi_v7a
,
AndroidArch
.
arm64_v8a
,
AndroidArch
.
arm64_v8a
,
]
],
)
)),
),
<
String
>[
<
String
>[
'app-armeabi-v7a-debug.apk'
,
'app-armeabi-v7a-debug.apk'
,
'app-arm64-v8a-debug.apk'
,
'app-arm64-v8a-debug.apk'
,
...
@@ -343,13 +342,12 @@ someOtherTask
...
@@ -343,13 +342,12 @@ someOtherTask
expect
(
project
.
apkFilesFor
(
expect
(
project
.
apkFilesFor
(
const
AndroidBuildInfo
(
const
AndroidBuildInfo
(
BuildInfo
.
release
,
BuildInfo
.
release
,
splitPerAbi:
true
,
splitPerAbi:
true
,
targetArchs:
<
AndroidArch
>[
targetArchs:
<
AndroidArch
>[
AndroidArch
.
armeabi_v7a
,
AndroidArch
.
armeabi_v7a
,
AndroidArch
.
arm64_v8a
,
AndroidArch
.
arm64_v8a
,
]
],
)
)),
),
<
String
>[
<
String
>[
'app-armeabi-v7a-release.apk'
,
'app-armeabi-v7a-release.apk'
,
'app-arm64-v8a-release.apk'
,
'app-arm64-v8a-release.apk'
,
...
@@ -358,26 +356,24 @@ someOtherTask
...
@@ -358,26 +356,24 @@ someOtherTask
expect
(
project
.
apkFilesFor
(
expect
(
project
.
apkFilesFor
(
const
AndroidBuildInfo
(
const
AndroidBuildInfo
(
BuildInfo
(
BuildMode
.
release
,
'unknown'
),
BuildInfo
(
BuildMode
.
release
,
'unknown'
),
splitPerAbi:
true
,
splitPerAbi:
true
,
targetArchs:
<
AndroidArch
>[
targetArchs:
<
AndroidArch
>[
AndroidArch
.
armeabi_v7a
,
AndroidArch
.
armeabi_v7a
,
AndroidArch
.
arm64_v8a
,
AndroidArch
.
arm64_v8a
,
]
],
)
)).
isEmpty
,
isTrue
);
).
isEmpty
,
isTrue
);
});
});
test
(
'should provide apks for each ABI and flavored build types'
,
()
{
test
(
'should provide apks for each ABI and flavored build types'
,
()
{
final
GradleProject
project
=
GradleProject
(<
String
>[
'debug'
,
'profile'
,
'release'
],
<
String
>[
'free'
,
'paid'
],
'/some/dir'
);
final
GradleProject
project
=
GradleProject
(<
String
>[
'debug'
,
'profile'
,
'release'
],
<
String
>[
'free'
,
'paid'
],
'/some/dir'
);
expect
(
project
.
apkFilesFor
(
expect
(
project
.
apkFilesFor
(
const
AndroidBuildInfo
(
const
AndroidBuildInfo
(
BuildInfo
(
BuildMode
.
debug
,
'free'
),
BuildInfo
(
BuildMode
.
debug
,
'free'
),
splitPerAbi:
true
,
splitPerAbi:
true
,
targetArchs:
<
AndroidArch
>[
targetArchs:
<
AndroidArch
>[
AndroidArch
.
armeabi_v7a
,
AndroidArch
.
armeabi_v7a
,
AndroidArch
.
arm64_v8a
,
AndroidArch
.
arm64_v8a
,
]
],
)
)),
),
<
String
>[
<
String
>[
'app-free-armeabi-v7a-debug.apk'
,
'app-free-armeabi-v7a-debug.apk'
,
'app-free-arm64-v8a-debug.apk'
,
'app-free-arm64-v8a-debug.apk'
,
...
@@ -386,13 +382,12 @@ someOtherTask
...
@@ -386,13 +382,12 @@ someOtherTask
expect
(
project
.
apkFilesFor
(
expect
(
project
.
apkFilesFor
(
const
AndroidBuildInfo
(
const
AndroidBuildInfo
(
BuildInfo
(
BuildMode
.
release
,
'paid'
),
BuildInfo
(
BuildMode
.
release
,
'paid'
),
splitPerAbi:
true
,
splitPerAbi:
true
,
targetArchs:
<
AndroidArch
>[
targetArchs:
<
AndroidArch
>[
AndroidArch
.
armeabi_v7a
,
AndroidArch
.
armeabi_v7a
,
AndroidArch
.
arm64_v8a
,
AndroidArch
.
arm64_v8a
,
]
],
)
)),
),
<
String
>[
<
String
>[
'app-paid-armeabi-v7a-release.apk'
,
'app-paid-armeabi-v7a-release.apk'
,
'app-paid-arm64-v8a-release.apk'
,
'app-paid-arm64-v8a-release.apk'
,
...
@@ -401,13 +396,12 @@ someOtherTask
...
@@ -401,13 +396,12 @@ someOtherTask
expect
(
project
.
apkFilesFor
(
expect
(
project
.
apkFilesFor
(
const
AndroidBuildInfo
(
const
AndroidBuildInfo
(
BuildInfo
(
BuildMode
.
release
,
'unknown'
),
BuildInfo
(
BuildMode
.
release
,
'unknown'
),
splitPerAbi:
true
,
splitPerAbi:
true
,
targetArchs:
<
AndroidArch
>[
targetArchs:
<
AndroidArch
>[
AndroidArch
.
armeabi_v7a
,
AndroidArch
.
armeabi_v7a
,
AndroidArch
.
arm64_v8a
,
AndroidArch
.
arm64_v8a
,
]
],
)
)).
isEmpty
,
isTrue
);
).
isEmpty
,
isTrue
);
});
});
test
(
'should provide assemble task name for default build types'
,
()
{
test
(
'should provide assemble task name for default build types'
,
()
{
final
GradleProject
project
=
GradleProject
(<
String
>[
'debug'
,
'profile'
,
'release'
],
<
String
>[],
'/some/dir'
);
final
GradleProject
project
=
GradleProject
(<
String
>[
'debug'
,
'profile'
,
'release'
],
<
String
>[],
'/some/dir'
);
...
@@ -1144,11 +1138,12 @@ at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)''';
...
@@ -1144,11 +1138,12 @@ at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)''';
migrateToR8
(
sampleAppAndroid
);
migrateToR8
(
sampleAppAndroid
);
expect
(
testLogger
.
traceText
,
contains
(
'set `android.enableR8=true` in gradle.properties'
));
expect
(
testLogger
.
traceText
,
contains
(
'set `android.enableR8=true` in gradle.properties'
));
expect
(
sampleAppAndroid
.
childFile
(
'gradle.properties'
).
readAsStringSync
(),
expect
(
sampleAppAndroid
.
childFile
(
'gradle.properties'
).
readAsStringSync
(),
equals
(
equals
(
'org.gradle.jvmargs=-Xmx1536M
\n
'
'org.gradle.jvmargs=-Xmx1536M
\n
'
'android.enableR8=true
\n
'
'android.enableR8=true
\n
'
)
)
,
);
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
memoryFileSystem
,
FileSystem:
()
=>
memoryFileSystem
,
...
@@ -1246,7 +1241,7 @@ at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)''';
...
@@ -1246,7 +1241,7 @@ at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)''';
androidBuildInfo:
const
AndroidBuildInfo
(
BuildInfo
(
BuildMode
.
release
,
null
)),
androidBuildInfo:
const
AndroidBuildInfo
(
BuildInfo
(
BuildMode
.
release
,
null
)),
project:
FlutterProject
.
current
(),
project:
FlutterProject
.
current
(),
outputDir:
'build/'
,
outputDir:
'build/'
,
target:
''
target:
''
,
);
);
final
List
<
String
>
actualGradlewCall
=
verify
(
mockProcessManager
.
start
(
final
List
<
String
>
actualGradlewCall
=
verify
(
mockProcessManager
.
start
(
...
...
packages/flutter_tools/test/general.shard/build_runner/multiroot_asset_reader_test.dart
View file @
89427d67
...
@@ -36,7 +36,7 @@ void main() {
...
@@ -36,7 +36,7 @@ void main() {
test
(
'Can find assets from the generated directory'
,
()
=>
testbed
.
run
(()
async
{
test
(
'Can find assets from the generated directory'
,
()
=>
testbed
.
run
(()
async
{
final
MultirootFileBasedAssetReader
reader
=
MultirootFileBasedAssetReader
(
final
MultirootFileBasedAssetReader
reader
=
MultirootFileBasedAssetReader
(
packageGraph
,
packageGraph
,
fs
.
directory
(
fs
.
path
.
join
(
'.dart_tool'
,
'build'
,
'generated'
))
fs
.
directory
(
fs
.
path
.
join
(
'.dart_tool'
,
'build'
,
'generated'
))
,
);
);
// Note: we can't read from the regular directory because the default
// Note: we can't read from the regular directory because the default
...
...
packages/flutter_tools/test/general.shard/build_system/build_system_test.dart
View file @
89427d67
...
@@ -102,7 +102,7 @@ void main() {
...
@@ -102,7 +102,7 @@ void main() {
},
},
overrides:
<
Type
,
Generator
>{
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
mockPlatform
,
Platform:
()
=>
mockPlatform
,
}
}
,
);
);
});
});
...
...
packages/flutter_tools/test/general.shard/build_system/exceptions_test.dart
View file @
89427d67
...
@@ -21,7 +21,7 @@ void main() {
...
@@ -21,7 +21,7 @@ void main() {
);
);
final
MissingOutputException
missingOutputException
=
MissingOutputException
(
final
MissingOutputException
missingOutputException
=
MissingOutputException
(
<
File
>[
fs
.
file
(
'foo'
),
fs
.
file
(
'bar'
)
],
<
File
>[
fs
.
file
(
'foo'
),
fs
.
file
(
'bar'
)
],
'example'
'example'
,
);
);
final
MisplacedOutputException
misplacedOutputException
=
MisplacedOutputException
(
final
MisplacedOutputException
misplacedOutputException
=
MisplacedOutputException
(
'foo'
,
'foo'
,
...
@@ -38,16 +38,16 @@ void main() {
...
@@ -38,16 +38,16 @@ void main() {
'but did not exist. Check the definition of target:example for errors'
);
'but did not exist. Check the definition of target:example for errors'
);
expect
(
expect
(
cycleException
.
toString
(),
cycleException
.
toString
(),
'Dependency cycle detected in build: foo -> bar'
'Dependency cycle detected in build: foo -> bar'
,
);
);
expect
(
expect
(
invalidPatternException
.
toString
(),
invalidPatternException
.
toString
(),
'The pattern "ABC" is not valid'
'The pattern "ABC" is not valid'
,
);
);
expect
(
expect
(
missingOutputException
.
toString
(),
missingOutputException
.
toString
(),
'foo, bar were declared as outputs, but were not generated by the '
'foo, bar were declared as outputs, but were not generated by the '
'action. Check the definition of target:example for errors'
'action. Check the definition of target:example for errors'
,
);
);
expect
(
expect
(
misplacedOutputException
.
toString
(),
misplacedOutputException
.
toString
(),
...
@@ -56,7 +56,7 @@ void main() {
...
@@ -56,7 +56,7 @@ void main() {
);
);
expect
(
expect
(
missingDefineException
.
toString
(),
missingDefineException
.
toString
(),
'Target example required define foobar but it was not provided'
'Target example required define foobar but it was not provided'
,
);
);
});
});
}
}
...
...
packages/flutter_tools/test/general.shard/build_system/targets/dart_test.dart
View file @
89427d67
...
@@ -44,7 +44,7 @@ void main() {
...
@@ -44,7 +44,7 @@ void main() {
defines:
<
String
,
String
>{
defines:
<
String
,
String
>{
kBuildMode:
getNameForBuildMode
(
BuildMode
.
profile
),
kBuildMode:
getNameForBuildMode
(
BuildMode
.
profile
),
kTargetPlatform:
getNameForTargetPlatform
(
TargetPlatform
.
android_arm
),
kTargetPlatform:
getNameForTargetPlatform
(
TargetPlatform
.
android_arm
),
}
}
,
);
);
iosEnvironment
=
Environment
(
iosEnvironment
=
Environment
(
outputDir:
fs
.
currentDirectory
,
outputDir:
fs
.
currentDirectory
,
...
@@ -52,7 +52,7 @@ void main() {
...
@@ -52,7 +52,7 @@ void main() {
defines:
<
String
,
String
>{
defines:
<
String
,
String
>{
kBuildMode:
getNameForBuildMode
(
BuildMode
.
profile
),
kBuildMode:
getNameForBuildMode
(
BuildMode
.
profile
),
kTargetPlatform:
getNameForTargetPlatform
(
TargetPlatform
.
ios
),
kTargetPlatform:
getNameForTargetPlatform
(
TargetPlatform
.
ios
),
}
}
,
);
);
HostPlatform
hostPlatform
;
HostPlatform
hostPlatform
;
if
(
platform
.
isWindows
)
{
if
(
platform
.
isWindows
)
{
...
@@ -130,7 +130,7 @@ flutter_tools:lib/''');
...
@@ -130,7 +130,7 @@ flutter_tools:lib/''');
outputFilePath:
anyNamed
(
'outputFilePath'
),
outputFilePath:
anyNamed
(
'outputFilePath'
),
depFilePath:
anyNamed
(
'depFilePath'
),
depFilePath:
anyNamed
(
'depFilePath'
),
packagesPath:
anyNamed
(
'packagesPath'
),
packagesPath:
anyNamed
(
'packagesPath'
),
mainPath:
anyNamed
(
'mainPath'
)
mainPath:
anyNamed
(
'mainPath'
)
,
)).
thenAnswer
((
Invocation
_
)
async
{
)).
thenAnswer
((
Invocation
_
)
async
{
return
const
CompilerOutput
(
'example'
,
0
,
<
Uri
>[]);
return
const
CompilerOutput
(
'example'
,
0
,
<
Uri
>[]);
});
});
...
@@ -154,7 +154,7 @@ flutter_tools:lib/''');
...
@@ -154,7 +154,7 @@ flutter_tools:lib/''');
outputFilePath:
anyNamed
(
'outputFilePath'
),
outputFilePath:
anyNamed
(
'outputFilePath'
),
depFilePath:
anyNamed
(
'depFilePath'
),
depFilePath:
anyNamed
(
'depFilePath'
),
packagesPath:
anyNamed
(
'packagesPath'
),
packagesPath:
anyNamed
(
'packagesPath'
),
mainPath:
anyNamed
(
'mainPath'
)
mainPath:
anyNamed
(
'mainPath'
)
,
)).
thenAnswer
((
Invocation
_
)
async
{
)).
thenAnswer
((
Invocation
_
)
async
{
return
const
CompilerOutput
(
'example'
,
0
,
<
Uri
>[]);
return
const
CompilerOutput
(
'example'
,
0
,
<
Uri
>[]);
});
});
...
...
packages/flutter_tools/test/general.shard/build_system/targets/macos_test.dart
View file @
89427d67
...
@@ -73,7 +73,7 @@ void main() {
...
@@ -73,7 +73,7 @@ void main() {
defines:
<
String
,
String
>{
defines:
<
String
,
String
>{
kBuildMode:
'debug'
,
kBuildMode:
'debug'
,
kTargetPlatform:
'darwin-x64'
,
kTargetPlatform:
'darwin-x64'
,
}
}
,
);
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
ProcessManager:
()
=>
MockProcessManager
(),
ProcessManager:
()
=>
MockProcessManager
(),
...
...
packages/flutter_tools/test/general.shard/cold_test.dart
View file @
89427d67
...
@@ -41,7 +41,7 @@ void main() {
...
@@ -41,7 +41,7 @@ void main() {
device:
mockDevice
,
device:
mockDevice
,
generator:
residentCompiler
,
generator:
residentCompiler
,
exception:
const
HttpException
(
'Connection closed before full header was received, '
exception:
const
HttpException
(
'Connection closed before full header was received, '
'uri = http://127.0.0.1:63394/5ZmLv8A59xY=/ws'
)
'uri = http://127.0.0.1:63394/5ZmLv8A59xY=/ws'
)
,
),
),
];
];
...
@@ -68,7 +68,7 @@ void main() {
...
@@ -68,7 +68,7 @@ void main() {
TestFlutterDevice
(
TestFlutterDevice
(
device:
mockDevice
,
device:
mockDevice
,
generator:
residentCompiler
,
generator:
residentCompiler
,
exception:
const
HttpException
(
', uri = http://127.0.0.1:63394/5ZmLv8A59xY=/ws'
)
exception:
const
HttpException
(
', uri = http://127.0.0.1:63394/5ZmLv8A59xY=/ws'
)
,
),
),
];
];
...
@@ -96,7 +96,7 @@ class TestFlutterDevice extends FlutterDevice {
...
@@ -96,7 +96,7 @@ class TestFlutterDevice extends FlutterDevice {
TestFlutterDevice
({
TestFlutterDevice
({
@required
Device
device
,
@required
Device
device
,
@required
this
.
exception
,
@required
this
.
exception
,
@required
ResidentCompiler
generator
@required
ResidentCompiler
generator
,
})
:
assert
(
exception
!=
null
),
})
:
assert
(
exception
!=
null
),
super
(
device
,
buildMode:
BuildMode
.
debug
,
generator:
generator
,
trackWidgetCreation:
false
);
super
(
device
,
buildMode:
BuildMode
.
debug
,
generator:
generator
,
trackWidgetCreation:
false
);
...
...
packages/flutter_tools/test/general.shard/commands/build_apk_test.dart
View file @
89427d67
...
@@ -258,9 +258,9 @@ void main() {
...
@@ -258,9 +258,9 @@ void main() {
}
}
Future
<
BuildApkCommand
>
runBuildApkCommand
(
Future
<
BuildApkCommand
>
runBuildApkCommand
(
String
target
,
String
target
,
{
{
List
<
String
>
arguments
}
List
<
String
>
arguments
,
)
async
{
}
)
async
{
final
BuildApkCommand
command
=
BuildApkCommand
();
final
BuildApkCommand
command
=
BuildApkCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
await
runner
.
run
(<
String
>[
...
...
packages/flutter_tools/test/general.shard/commands/build_appbundle_test.dart
View file @
89427d67
...
@@ -247,9 +247,9 @@ void main() {
...
@@ -247,9 +247,9 @@ void main() {
}
}
Future
<
BuildAppBundleCommand
>
runBuildAppBundleCommand
(
Future
<
BuildAppBundleCommand
>
runBuildAppBundleCommand
(
String
target
,
String
target
,
{
{
List
<
String
>
arguments
}
List
<
String
>
arguments
,
)
async
{
}
)
async
{
final
BuildAppBundleCommand
command
=
BuildAppBundleCommand
();
final
BuildAppBundleCommand
command
=
BuildAppBundleCommand
();
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
final
CommandRunner
<
void
>
runner
=
createTestCommandRunner
(
command
);
await
runner
.
run
(<
String
>[
await
runner
.
run
(<
String
>[
...
...
packages/flutter_tools/test/general.shard/commands/build_bundle_test.dart
View file @
89427d67
...
@@ -103,7 +103,7 @@ void main() {
...
@@ -103,7 +103,7 @@ void main() {
expect
(()
=>
runner
.
run
(<
String
>[
expect
(()
=>
runner
.
run
(<
String
>[
'bundle'
,
'bundle'
,
'--no-pub'
,
'--no-pub'
,
'--target-platform=windows-x64'
'--target-platform=windows-x64'
,
]),
throwsA
(
isInstanceOf
<
ToolExit
>()));
]),
throwsA
(
isInstanceOf
<
ToolExit
>()));
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
MemoryFileSystem
(),
FileSystem:
()
=>
MemoryFileSystem
(),
...
@@ -120,7 +120,7 @@ void main() {
...
@@ -120,7 +120,7 @@ void main() {
expect
(()
=>
runner
.
run
(<
String
>[
expect
(()
=>
runner
.
run
(<
String
>[
'bundle'
,
'bundle'
,
'--no-pub'
,
'--no-pub'
,
'--target-platform=linux-x64'
'--target-platform=linux-x64'
,
]),
throwsA
(
isInstanceOf
<
ToolExit
>()));
]),
throwsA
(
isInstanceOf
<
ToolExit
>()));
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
MemoryFileSystem
(),
FileSystem:
()
=>
MemoryFileSystem
(),
...
@@ -137,7 +137,7 @@ void main() {
...
@@ -137,7 +137,7 @@ void main() {
expect
(()
=>
runner
.
run
(<
String
>[
expect
(()
=>
runner
.
run
(<
String
>[
'bundle'
,
'bundle'
,
'--no-pub'
,
'--no-pub'
,
'--target-platform=darwin-x64'
'--target-platform=darwin-x64'
,
]),
throwsA
(
isInstanceOf
<
ToolExit
>()));
]),
throwsA
(
isInstanceOf
<
ToolExit
>()));
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
MemoryFileSystem
(),
FileSystem:
()
=>
MemoryFileSystem
(),
...
@@ -154,7 +154,7 @@ void main() {
...
@@ -154,7 +154,7 @@ void main() {
await
runner
.
run
(<
String
>[
await
runner
.
run
(<
String
>[
'bundle'
,
'bundle'
,
'--no-pub'
,
'--no-pub'
,
'--target-platform=windows-x64'
'--target-platform=windows-x64'
,
]);
]);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
MemoryFileSystem
(),
FileSystem:
()
=>
MemoryFileSystem
(),
...
@@ -171,7 +171,7 @@ void main() {
...
@@ -171,7 +171,7 @@ void main() {
await
runner
.
run
(<
String
>[
await
runner
.
run
(<
String
>[
'bundle'
,
'bundle'
,
'--no-pub'
,
'--no-pub'
,
'--target-platform=linux-x64'
'--target-platform=linux-x64'
,
]);
]);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
MemoryFileSystem
(),
FileSystem:
()
=>
MemoryFileSystem
(),
...
@@ -188,7 +188,7 @@ void main() {
...
@@ -188,7 +188,7 @@ void main() {
await
runner
.
run
(<
String
>[
await
runner
.
run
(<
String
>[
'bundle'
,
'bundle'
,
'--no-pub'
,
'--no-pub'
,
'--target-platform=darwin-x64'
'--target-platform=darwin-x64'
,
]);
]);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
MemoryFileSystem
(),
FileSystem:
()
=>
MemoryFileSystem
(),
...
...
packages/flutter_tools/test/general.shard/commands/build_web_test.dart
View file @
89427d67
...
@@ -44,7 +44,7 @@ void main() {
...
@@ -44,7 +44,7 @@ void main() {
projectName:
anyNamed
(
'projectName'
),
projectName:
anyNamed
(
'projectName'
),
projectDirectory:
anyNamed
(
'projectDirectory'
),
projectDirectory:
anyNamed
(
'projectDirectory'
),
mode:
anyNamed
(
'mode'
),
mode:
anyNamed
(
'mode'
),
initializePlatform:
anyNamed
(
'initializePlatform'
)
initializePlatform:
anyNamed
(
'initializePlatform'
)
,
)).
thenAnswer
((
Invocation
invocation
)
{
)).
thenAnswer
((
Invocation
invocation
)
{
final
String
path
=
fs
.
path
.
join
(
'.dart_tool'
,
'build'
,
'flutter_web'
,
'foo'
,
'lib'
,
'main_web_entrypoint.dart.js'
);
final
String
path
=
fs
.
path
.
join
(
'.dart_tool'
,
'build'
,
'flutter_web'
,
'foo'
,
'lib'
,
'main_web_entrypoint.dart.js'
);
fs
.
file
(
path
).
createSync
(
recursive:
true
);
fs
.
file
(
path
).
createSync
(
recursive:
true
);
...
...
packages/flutter_tools/test/general.shard/commands/config_test.dart
View file @
89427d67
...
@@ -61,7 +61,7 @@ void main() {
...
@@ -61,7 +61,7 @@ void main() {
await
commandRunner
.
run
(<
String
>[
await
commandRunner
.
run
(<
String
>[
'config'
,
'config'
,
'--build-dir=foo'
'--build-dir=foo'
,
]);
]);
expect
(
getBuildDirectory
(),
'foo'
);
expect
(
getBuildDirectory
(),
'foo'
);
...
@@ -73,7 +73,7 @@ void main() {
...
@@ -73,7 +73,7 @@ void main() {
expect
(()
=>
commandRunner
.
run
(<
String
>[
expect
(()
=>
commandRunner
.
run
(<
String
>[
'config'
,
'config'
,
'--build-dir=/foo'
'--build-dir=/foo'
,
]),
throwsA
(
isInstanceOf
<
ToolExit
>()));
]),
throwsA
(
isInstanceOf
<
ToolExit
>()));
});
});
...
@@ -86,7 +86,7 @@ void main() {
...
@@ -86,7 +86,7 @@ void main() {
'--enable-web'
,
'--enable-web'
,
'--enable-linux-desktop'
,
'--enable-linux-desktop'
,
'--enable-windows-desktop'
,
'--enable-windows-desktop'
,
'--enable-macos-desktop'
'--enable-macos-desktop'
,
]);
]);
expect
(
Config
.
instance
.
getValue
(
'enable-web'
),
true
);
expect
(
Config
.
instance
.
getValue
(
'enable-web'
),
true
);
...
@@ -108,7 +108,7 @@ void main() {
...
@@ -108,7 +108,7 @@ void main() {
'--no-enable-web'
,
'--no-enable-web'
,
'--no-enable-linux-desktop'
,
'--no-enable-linux-desktop'
,
'--no-enable-windows-desktop'
,
'--no-enable-windows-desktop'
,
'--no-enable-macos-desktop'
'--no-enable-macos-desktop'
,
]);
]);
expect
(
Config
.
instance
.
getValue
(
'enable-web'
),
false
);
expect
(
Config
.
instance
.
getValue
(
'enable-web'
),
false
);
...
@@ -131,7 +131,7 @@ void main() {
...
@@ -131,7 +131,7 @@ void main() {
'--enable-web'
,
'--enable-web'
,
'--enable-linux-desktop'
,
'--enable-linux-desktop'
,
'--enable-windows-desktop'
,
'--enable-windows-desktop'
,
'--enable-macos-desktop'
'--enable-macos-desktop'
,
]);
]);
await
commandRunner
.
run
(<
String
>[
await
commandRunner
.
run
(<
String
>[
...
...
packages/flutter_tools/test/general.shard/commands/create_test.dart
View file @
89427d67
...
@@ -140,18 +140,21 @@ void main() {
...
@@ -140,18 +140,21 @@ void main() {
await
_createAndAnalyzeProject
(
await
_createAndAnalyzeProject
(
projectDir
,
projectDir
,
<
String
>[
<
String
>[
'-i'
,
'objc'
,
'-a'
,
'java'
'-i'
,
'objc'
,
'-a'
,
'java'
,
],
<
String
>[
],
'android/app/src/main/java/com/example/flutter_project/MainActivity.java'
,
<
String
>[
'android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java'
,
'android/app/src/main/java/com/example/flutter_project/MainActivity.java'
,
'flutter_project.iml'
,
'android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java'
,
'ios/Flutter/AppFrameworkInfo.plist'
,
'flutter_project.iml'
,
'ios/Runner/AppDelegate.m'
,
'ios/Flutter/AppFrameworkInfo.plist'
,
'ios/Runner/GeneratedPluginRegistrant.h'
,
'ios/Runner/AppDelegate.m'
,
],
unexpectedPaths:
<
String
>[
'ios/Runner/GeneratedPluginRegistrant.h'
,
'.android/'
,
],
'.ios/'
,
unexpectedPaths:
<
String
>[
]);
'.android/'
,
'.ios/'
,
],
);
},
timeout:
allowForRemotePubInvocation
);
},
timeout:
allowForRemotePubInvocation
);
testUsingContext
(
'detects and recreates an app project correctly'
,
()
async
{
testUsingContext
(
'detects and recreates an app project correctly'
,
()
async
{
...
@@ -160,18 +163,21 @@ void main() {
...
@@ -160,18 +163,21 @@ void main() {
await
_createAndAnalyzeProject
(
await
_createAndAnalyzeProject
(
projectDir
,
projectDir
,
<
String
>[
<
String
>[
'-i'
,
'objc'
,
'-a'
,
'java'
'-i'
,
'objc'
,
'-a'
,
'java'
,
],
<
String
>[
],
'android/app/src/main/java/com/example/flutter_project/MainActivity.java'
,
<
String
>[
'android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java'
,
'android/app/src/main/java/com/example/flutter_project/MainActivity.java'
,
'flutter_project.iml'
,
'android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java'
,
'ios/Flutter/AppFrameworkInfo.plist'
,
'flutter_project.iml'
,
'ios/Runner/AppDelegate.m'
,
'ios/Flutter/AppFrameworkInfo.plist'
,
'ios/Runner/GeneratedPluginRegistrant.h'
,
'ios/Runner/AppDelegate.m'
,
],
unexpectedPaths:
<
String
>[
'ios/Runner/GeneratedPluginRegistrant.h'
,
'.android/'
,
],
'.ios/'
,
unexpectedPaths:
<
String
>[
]);
'.android/'
,
'.ios/'
,
],
);
},
timeout:
allowForRemotePubInvocation
);
},
timeout:
allowForRemotePubInvocation
);
testUsingContext
(
'detects and recreates a plugin project correctly'
,
()
async
{
testUsingContext
(
'detects and recreates a plugin project correctly'
,
()
async
{
...
@@ -180,8 +186,9 @@ void main() {
...
@@ -180,8 +186,9 @@ void main() {
return
_createAndAnalyzeProject
(
return
_createAndAnalyzeProject
(
projectDir
,
projectDir
,
<
String
>[
<
String
>[
'-i'
,
'objc'
,
'-a'
,
'java'
'-i'
,
'objc'
,
'-a'
,
'java'
,
],
<
String
>[
],
<
String
>[
'android/src/main/java/com/example/flutter_project/FlutterProjectPlugin.java'
,
'android/src/main/java/com/example/flutter_project/FlutterProjectPlugin.java'
,
'example/android/app/src/main/java/com/example/flutter_project_example/MainActivity.java'
,
'example/android/app/src/main/java/com/example/flutter_project_example/MainActivity.java'
,
'example/ios/Runner/AppDelegate.h'
,
'example/ios/Runner/AppDelegate.h'
,
...
@@ -921,7 +928,7 @@ void main() {
...
@@ -921,7 +928,7 @@ void main() {
'--template=app'
,
'--template=app'
,
'--org'
,
'com.bar.foo'
,
'--org'
,
'com.bar.foo'
,
'-i'
,
'objc'
,
'-i'
,
'objc'
,
'-a'
,
'java'
'-a'
,
'java'
,
],
],
<
String
>[],
<
String
>[],
);
);
...
...
packages/flutter_tools/test/general.shard/commands/test_test.dart
View file @
89427d67
...
@@ -243,7 +243,7 @@ Future<ProcessResult> _runFlutterTest(
...
@@ -243,7 +243,7 @@ Future<ProcessResult> _runFlutterTest(
'test'
,
'test'
,
'--no-color'
,
'--no-color'
,
...
extraArguments
,
...
extraArguments
,
testPath
testPath
,
];
];
while
(
_testExclusionLock
!=
null
)
{
while
(
_testExclusionLock
!=
null
)
{
...
...
packages/flutter_tools/test/general.shard/flutter_platform_test.dart
View file @
89427d67
...
@@ -88,14 +88,14 @@ void main() {
...
@@ -88,14 +88,14 @@ void main() {
expect
(()
=>
installHook
(
expect
(()
=>
installHook
(
shellPath:
'abc'
,
shellPath:
'abc'
,
enableObservatory:
false
,
enableObservatory:
false
,
startPaused:
true
startPaused:
true
,
),
throwsA
(
isA
<
AssertionError
>()));
),
throwsA
(
isA
<
AssertionError
>()));
expect
(()
=>
installHook
(
expect
(()
=>
installHook
(
shellPath:
'abc'
,
shellPath:
'abc'
,
enableObservatory:
false
,
enableObservatory:
false
,
startPaused:
false
,
startPaused:
false
,
observatoryPort:
123
observatoryPort:
123
,
),
throwsA
(
isA
<
AssertionError
>()));
),
throwsA
(
isA
<
AssertionError
>()));
FlutterPlatform
capturedPlatform
;
FlutterPlatform
capturedPlatform
;
...
...
packages/flutter_tools/test/general.shard/forbidden_imports_test.dart
View file @
89427d67
...
@@ -12,7 +12,7 @@ void main() {
...
@@ -12,7 +12,7 @@ void main() {
test
(
'no imports of commands/* or test/* in lib/src/*'
,
()
{
test
(
'no imports of commands/* or test/* in lib/src/*'
,
()
{
final
List
<
String
>
skippedPaths
=
<
String
>
[
final
List
<
String
>
skippedPaths
=
<
String
>
[
fs
.
path
.
join
(
flutterTools
,
'lib'
,
'src'
,
'commands'
),
fs
.
path
.
join
(
flutterTools
,
'lib'
,
'src'
,
'commands'
),
fs
.
path
.
join
(
flutterTools
,
'lib'
,
'src'
,
'test'
)
fs
.
path
.
join
(
flutterTools
,
'lib'
,
'src'
,
'test'
)
,
];
];
bool
_isNotSkipped
(
FileSystemEntity
entity
)
=>
skippedPaths
.
every
((
String
path
)
=>
!
entity
.
path
.
startsWith
(
path
));
bool
_isNotSkipped
(
FileSystemEntity
entity
)
=>
skippedPaths
.
every
((
String
path
)
=>
!
entity
.
path
.
startsWith
(
path
));
...
...
packages/flutter_tools/test/general.shard/hot_test.dart
View file @
89427d67
...
@@ -290,7 +290,7 @@ void main() {
...
@@ -290,7 +290,7 @@ void main() {
device:
mockDevice
,
device:
mockDevice
,
generator:
residentCompiler
,
generator:
residentCompiler
,
exception:
const
HttpException
(
'Connection closed before full header was received, '
exception:
const
HttpException
(
'Connection closed before full header was received, '
'uri = http://127.0.0.1:63394/5ZmLv8A59xY=/ws'
)
'uri = http://127.0.0.1:63394/5ZmLv8A59xY=/ws'
)
,
),
),
];
];
...
@@ -319,7 +319,7 @@ void main() {
...
@@ -319,7 +319,7 @@ void main() {
TestFlutterDevice
(
TestFlutterDevice
(
device:
mockDevice
,
device:
mockDevice
,
generator:
residentCompiler
,
generator:
residentCompiler
,
exception:
const
HttpException
(
', uri = http://127.0.0.1:63394/5ZmLv8A59xY=/ws'
)
exception:
const
HttpException
(
', uri = http://127.0.0.1:63394/5ZmLv8A59xY=/ws'
)
,
),
),
];
];
...
@@ -353,7 +353,7 @@ class TestFlutterDevice extends FlutterDevice {
...
@@ -353,7 +353,7 @@ class TestFlutterDevice extends FlutterDevice {
TestFlutterDevice
({
TestFlutterDevice
({
@required
Device
device
,
@required
Device
device
,
@required
this
.
exception
,
@required
this
.
exception
,
@required
ResidentCompiler
generator
@required
ResidentCompiler
generator
,
})
:
assert
(
exception
!=
null
),
})
:
assert
(
exception
!=
null
),
super
(
device
,
buildMode:
BuildMode
.
debug
,
generator:
generator
,
trackWidgetCreation:
false
);
super
(
device
,
buildMode:
BuildMode
.
debug
,
generator:
generator
,
trackWidgetCreation:
false
);
...
...
packages/flutter_tools/test/general.shard/ios/devices_test.dart
View file @
89427d67
...
@@ -65,8 +65,8 @@ void main() {
...
@@ -65,8 +65,8 @@ void main() {
for
(
Platform
platform
in
unsupportedPlatforms
)
{
for
(
Platform
platform
in
unsupportedPlatforms
)
{
testUsingContext
(
'throws UnsupportedError exception if instantiated on
${platform.operatingSystem}
'
,
()
{
testUsingContext
(
'throws UnsupportedError exception if instantiated on
${platform.operatingSystem}
'
,
()
{
expect
(
expect
(
()
{
IOSDevice
(
'device-123'
);
},
()
{
IOSDevice
(
'device-123'
);
},
throwsA
(
isInstanceOf
<
AssertionError
>())
throwsA
(
isInstanceOf
<
AssertionError
>()),
);
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
Platform:
()
=>
platform
,
Platform:
()
=>
platform
,
...
@@ -95,7 +95,7 @@ void main() {
...
@@ -95,7 +95,7 @@ void main() {
// const String appId = '789';
// const String appId = '789';
const
MapEntry
<
String
,
String
>
libraryEntry
=
MapEntry
<
String
,
String
>(
const
MapEntry
<
String
,
String
>
libraryEntry
=
MapEntry
<
String
,
String
>(
'DYLD_LIBRARY_PATH'
,
'DYLD_LIBRARY_PATH'
,
'/path/to/libraries'
'/path/to/libraries'
,
);
);
final
Map
<
String
,
String
>
env
=
Map
<
String
,
String
>.
fromEntries
(
final
Map
<
String
,
String
>
env
=
Map
<
String
,
String
>.
fromEntries
(
<
MapEntry
<
String
,
String
>>[
libraryEntry
]
<
MapEntry
<
String
,
String
>>[
libraryEntry
]
...
@@ -149,7 +149,7 @@ void main() {
...
@@ -149,7 +149,7 @@ void main() {
when
(
mockProcessManager
.
run
(
when
(
mockProcessManager
.
run
(
installArgs
,
installArgs
,
workingDirectory:
anyNamed
(
'workingDirectory'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
environment:
env
environment:
env
,
)).
thenAnswer
(
)).
thenAnswer
(
(
_
)
=>
Future
<
ProcessResult
>.
value
(
ProcessResult
(
1
,
0
,
''
,
''
))
(
_
)
=>
Future
<
ProcessResult
>.
value
(
ProcessResult
(
1
,
0
,
''
,
''
))
);
);
...
@@ -381,8 +381,8 @@ void main() {
...
@@ -381,8 +381,8 @@ void main() {
const
String
installerPath
=
'/path/to/ideviceinstaller'
;
const
String
installerPath
=
'/path/to/ideviceinstaller'
;
const
String
appId
=
'789'
;
const
String
appId
=
'789'
;
const
MapEntry
<
String
,
String
>
libraryEntry
=
MapEntry
<
String
,
String
>(
const
MapEntry
<
String
,
String
>
libraryEntry
=
MapEntry
<
String
,
String
>(
'DYLD_LIBRARY_PATH'
,
'DYLD_LIBRARY_PATH'
,
'/path/to/libraries'
'/path/to/libraries'
,
);
);
final
Map
<
String
,
String
>
env
=
Map
<
String
,
String
>.
fromEntries
(
final
Map
<
String
,
String
>
env
=
Map
<
String
,
String
>.
fromEntries
(
<
MapEntry
<
String
,
String
>>[
libraryEntry
]
<
MapEntry
<
String
,
String
>>[
libraryEntry
]
...
...
packages/flutter_tools/test/general.shard/ios/mac_test.dart
View file @
89427d67
...
@@ -56,7 +56,7 @@ void main() {
...
@@ -56,7 +56,7 @@ void main() {
testUsingContext
(
'isWorking returns false if libimobiledevice is not installed'
,
()
async
{
testUsingContext
(
'isWorking returns false if libimobiledevice is not installed'
,
()
async
{
when
(
mockProcessManager
.
runSync
(
when
(
mockProcessManager
.
runSync
(
<
String
>[
ideviceIdPath
,
'-h'
],
environment:
anyNamed
(
'environment'
)
<
String
>[
ideviceIdPath
,
'-h'
],
environment:
anyNamed
(
'environment'
)
,
)).
thenReturn
(
ProcessResult
(
123
,
1
,
''
,
''
));
)).
thenReturn
(
ProcessResult
(
123
,
1
,
''
,
''
));
expect
(
await
iMobileDevice
.
isWorking
,
false
);
expect
(
await
iMobileDevice
.
isWorking
,
false
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
...
...
packages/flutter_tools/test/general.shard/linux/linux_doctor_test.dart
View file @
89427d67
...
@@ -96,7 +96,7 @@ void main() {
...
@@ -96,7 +96,7 @@ void main() {
expect
(
result
.
type
,
ValidationType
.
missing
);
expect
(
result
.
type
,
ValidationType
.
missing
);
expect
(
result
.
messages
,
<
ValidationMessage
>[
expect
(
result
.
messages
,
<
ValidationMessage
>[
ValidationMessage
(
'clang++ 4.0.1'
),
ValidationMessage
(
'clang++ 4.0.1'
),
ValidationMessage
.
error
(
'make is not installed'
)
ValidationMessage
.
error
(
'make is not installed'
)
,
]);
]);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
ProcessManager:
()
=>
processManager
,
ProcessManager:
()
=>
processManager
,
...
...
packages/flutter_tools/test/general.shard/macos/xcode_test.dart
View file @
89427d67
...
@@ -113,7 +113,7 @@ void main() {
...
@@ -113,7 +113,7 @@ void main() {
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
XcodeProjectInterpreter:
()
=>
mockXcodeProjectInterpreter
,
XcodeProjectInterpreter:
()
=>
mockXcodeProjectInterpreter
,
Platform:
()
=>
mockPlatform
,
Platform:
()
=>
mockPlatform
,
ProcessManager:
()
=>
mockProcessManager
ProcessManager:
()
=>
mockProcessManager
,
});
});
testUsingContext
(
'isInstalledAndMeetsVersionCheck is false when no xcode-select'
,
()
{
testUsingContext
(
'isInstalledAndMeetsVersionCheck is false when no xcode-select'
,
()
{
...
@@ -130,7 +130,7 @@ void main() {
...
@@ -130,7 +130,7 @@ void main() {
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
XcodeProjectInterpreter:
()
=>
mockXcodeProjectInterpreter
,
XcodeProjectInterpreter:
()
=>
mockXcodeProjectInterpreter
,
Platform:
()
=>
mockPlatform
,
Platform:
()
=>
mockPlatform
,
ProcessManager:
()
=>
mockProcessManager
ProcessManager:
()
=>
mockProcessManager
,
});
});
testUsingContext
(
'isInstalledAndMeetsVersionCheck is false when version not satisfied'
,
()
{
testUsingContext
(
'isInstalledAndMeetsVersionCheck is false when version not satisfied'
,
()
{
...
@@ -147,7 +147,7 @@ void main() {
...
@@ -147,7 +147,7 @@ void main() {
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
XcodeProjectInterpreter:
()
=>
mockXcodeProjectInterpreter
,
XcodeProjectInterpreter:
()
=>
mockXcodeProjectInterpreter
,
Platform:
()
=>
mockPlatform
,
Platform:
()
=>
mockPlatform
,
ProcessManager:
()
=>
mockProcessManager
ProcessManager:
()
=>
mockProcessManager
,
});
});
testUsingContext
(
'isInstalledAndMeetsVersionCheck is true when macOS and installed and version is satisfied'
,
()
{
testUsingContext
(
'isInstalledAndMeetsVersionCheck is true when macOS and installed and version is satisfied'
,
()
{
...
@@ -164,7 +164,7 @@ void main() {
...
@@ -164,7 +164,7 @@ void main() {
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
XcodeProjectInterpreter:
()
=>
mockXcodeProjectInterpreter
,
XcodeProjectInterpreter:
()
=>
mockXcodeProjectInterpreter
,
Platform:
()
=>
mockPlatform
,
Platform:
()
=>
mockPlatform
,
ProcessManager:
()
=>
mockProcessManager
ProcessManager:
()
=>
mockProcessManager
,
});
});
testUsingContext
(
'eulaSigned is false when clang is not installed'
,
()
{
testUsingContext
(
'eulaSigned is false when clang is not installed'
,
()
{
...
...
packages/flutter_tools/test/general.shard/resident_runner_test.dart
View file @
89427d67
...
@@ -93,7 +93,7 @@ void main() {
...
@@ -93,7 +93,7 @@ void main() {
when
(
mockFlutterDevice
.
connect
(
when
(
mockFlutterDevice
.
connect
(
reloadSources:
anyNamed
(
'reloadSources'
),
reloadSources:
anyNamed
(
'reloadSources'
),
restart:
anyNamed
(
'restart'
),
restart:
anyNamed
(
'restart'
),
compileExpression:
anyNamed
(
'compileExpression'
)
compileExpression:
anyNamed
(
'compileExpression'
)
,
)).
thenAnswer
((
Invocation
invocation
)
async
{
});
)).
thenAnswer
((
Invocation
invocation
)
async
{
});
when
(
mockFlutterDevice
.
setupDevFS
(
any
,
any
,
packagesFilePath:
anyNamed
(
'packagesFilePath'
)))
when
(
mockFlutterDevice
.
setupDevFS
(
any
,
any
,
packagesFilePath:
anyNamed
(
'packagesFilePath'
)))
.
thenAnswer
((
Invocation
invocation
)
async
{
.
thenAnswer
((
Invocation
invocation
)
async
{
...
@@ -223,7 +223,7 @@ void main() {
...
@@ -223,7 +223,7 @@ void main() {
expect
(
verify
(
flutterUsage
.
sendEvent
(
'hot'
,
'reload'
,
expect
(
verify
(
flutterUsage
.
sendEvent
(
'hot'
,
'reload'
,
parameters:
captureAnyNamed
(
'parameters'
))).
captured
[
0
],
parameters:
captureAnyNamed
(
'parameters'
))).
captured
[
0
],
containsPair
(
cdKey
(
CustomDimensions
.
hotEventTargetPlatform
),
containsPair
(
cdKey
(
CustomDimensions
.
hotEventTargetPlatform
),
getNameForTargetPlatform
(
TargetPlatform
.
android_arm
))
getNameForTargetPlatform
(
TargetPlatform
.
android_arm
))
,
);
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
Usage:
()
=>
MockUsage
(),
Usage:
()
=>
MockUsage
(),
...
@@ -253,7 +253,7 @@ void main() {
...
@@ -253,7 +253,7 @@ void main() {
expect
(
verify
(
flutterUsage
.
sendEvent
(
'hot'
,
'restart'
,
expect
(
verify
(
flutterUsage
.
sendEvent
(
'hot'
,
'restart'
,
parameters:
captureAnyNamed
(
'parameters'
))).
captured
[
0
],
parameters:
captureAnyNamed
(
'parameters'
))).
captured
[
0
],
containsPair
(
cdKey
(
CustomDimensions
.
hotEventTargetPlatform
),
containsPair
(
cdKey
(
CustomDimensions
.
hotEventTargetPlatform
),
getNameForTargetPlatform
(
TargetPlatform
.
android_arm
))
getNameForTargetPlatform
(
TargetPlatform
.
android_arm
))
,
);
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
Usage:
()
=>
MockUsage
(),
Usage:
()
=>
MockUsage
(),
...
...
packages/flutter_tools/test/general.shard/resident_web_runner_test.dart
View file @
89427d67
...
@@ -155,7 +155,10 @@ void main() {
...
@@ -155,7 +155,10 @@ void main() {
expect
(
result
.
code
,
0
);
expect
(
result
.
code
,
0
);
// ensure that analytics are sent.
// ensure that analytics are sent.
verify
(
Usage
.
instance
.
sendEvent
(
'hot'
,
'restart'
,
parameters:
<
String
,
String
>{
verify
(
Usage
.
instance
.
sendEvent
(
'hot'
,
'restart'
,
parameters:
<
String
,
String
>{
'cd27'
:
'web-javascript'
,
'cd28'
:
null
,
'cd29'
:
'false'
,
'cd30'
:
'true'
'cd27'
:
'web-javascript'
,
'cd28'
:
null
,
'cd29'
:
'false'
,
'cd30'
:
'true'
,
})).
called
(
1
);
})).
called
(
1
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
Usage:
()
=>
MockFlutterUsage
(),
Usage:
()
=>
MockFlutterUsage
(),
...
@@ -179,7 +182,10 @@ void main() {
...
@@ -179,7 +182,10 @@ void main() {
expect
(
result
.
code
,
0
);
expect
(
result
.
code
,
0
);
// ensure that analytics are sent.
// ensure that analytics are sent.
verify
(
Usage
.
instance
.
sendEvent
(
'hot'
,
'restart'
,
parameters:
<
String
,
String
>{
verify
(
Usage
.
instance
.
sendEvent
(
'hot'
,
'restart'
,
parameters:
<
String
,
String
>{
'cd27'
:
'web-javascript'
,
'cd28'
:
null
,
'cd29'
:
'false'
,
'cd30'
:
'true'
'cd27'
:
'web-javascript'
,
'cd28'
:
null
,
'cd29'
:
'false'
,
'cd30'
:
'true'
,
})).
called
(
1
);
})).
called
(
1
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
Usage:
()
=>
MockFlutterUsage
(),
Usage:
()
=>
MockFlutterUsage
(),
...
...
packages/flutter_tools/test/general.shard/runner/flutter_command_test.dart
View file @
89427d67
...
@@ -149,7 +149,7 @@ void main() {
...
@@ -149,7 +149,7 @@ void main() {
'flutter'
,
'flutter'
,
'dummy'
,
'dummy'
,
const
Duration
(
milliseconds:
1000
),
const
Duration
(
milliseconds:
1000
),
null
null
,
],
],
);
);
},
},
...
...
packages/flutter_tools/test/general.shard/runner/runner_test.dart
View file @
89427d67
...
@@ -134,13 +134,18 @@ class CrashingUsage implements Usage {
...
@@ -134,13 +134,18 @@ class CrashingUsage implements Usage {
_impl
.
sendCommand
(
command
,
parameters:
parameters
);
_impl
.
sendCommand
(
command
,
parameters:
parameters
);
@override
@override
void
sendEvent
(
String
category
,
String
parameter
,
{
void
sendEvent
(
Map
<
String
,
String
>
parameters
String
category
,
String
parameter
,
{
Map
<
String
,
String
>
parameters
,
})
=>
_impl
.
sendEvent
(
category
,
parameter
,
parameters:
parameters
);
})
=>
_impl
.
sendEvent
(
category
,
parameter
,
parameters:
parameters
);
@override
@override
void
sendTiming
(
String
category
,
String
variableName
,
Duration
duration
,
{
void
sendTiming
(
String
label
String
category
,
String
variableName
,
Duration
duration
,
{
String
label
,
})
=>
_impl
.
sendTiming
(
category
,
variableName
,
duration
,
label:
label
);
})
=>
_impl
.
sendTiming
(
category
,
variableName
,
duration
,
label:
label
);
@override
@override
...
...
packages/flutter_tools/test/general.shard/web/chrome_test.dart
View file @
89427d67
...
@@ -55,7 +55,7 @@ void main() {
...
@@ -55,7 +55,7 @@ void main() {
'--no-default-browser-check'
,
'--no-default-browser-check'
,
'--disable-default-apps'
,
'--disable-default-apps'
,
'--disable-translate'
,
'--disable-translate'
,
'example_url'
'example_url'
,
])).
thenAnswer
((
Invocation
invocation
)
async
{
])).
thenAnswer
((
Invocation
invocation
)
async
{
return
FakeProcess
(
return
FakeProcess
(
exitCode:
Completer
<
int
>().
future
,
exitCode:
Completer
<
int
>().
future
,
...
...
packages/flutter_tools/test/general.shard/web/web_fs_test.dart
View file @
89427d67
...
@@ -81,7 +81,7 @@ void main() {
...
@@ -81,7 +81,7 @@ void main() {
bool
enableDebugExtension
})
async
{
bool
enableDebugExtension
})
async
{
return
mockDwds
;
return
mockDwds
;
},
},
}
}
,
);
);
});
});
...
...
packages/flutter_tools/test/general.shard/windows/visual_studio_test.dart
View file @
89427d67
...
@@ -43,7 +43,7 @@ void main() {
...
@@ -43,7 +43,7 @@ void main() {
'isPrerelease'
:
false
,
'isPrerelease'
:
false
,
'catalog'
:
<
String
,
dynamic
>{
'catalog'
:
<
String
,
dynamic
>{
'productDisplayVersion'
:
'15.9.12'
,
'productDisplayVersion'
:
'15.9.12'
,
}
}
,
};
};
// A version of a response that doesn't include certain installation status
// A version of a response that doesn't include certain installation status
...
@@ -54,7 +54,7 @@ void main() {
...
@@ -54,7 +54,7 @@ void main() {
'installationVersion'
:
'15.9.28307.665'
,
'installationVersion'
:
'15.9.28307.665'
,
'catalog'
:
<
String
,
dynamic
>{
'catalog'
:
<
String
,
dynamic
>{
'productDisplayVersion'
:
'15.9.12'
,
'productDisplayVersion'
:
'15.9.12'
,
}
}
,
};
};
// Arguments for a vswhere query to search for an installation with the required components.
// Arguments for a vswhere query to search for an installation with the required components.
...
...
packages/flutter_tools/test/general.shard/windows/visual_studio_validator_test.dart
View file @
89427d67
...
@@ -112,7 +112,7 @@ void main() {
...
@@ -112,7 +112,7 @@ void main() {
final
ValidationMessage
expectedMessage
=
ValidationMessage
.
error
(
final
ValidationMessage
expectedMessage
=
ValidationMessage
.
error
(
userMessages
.
visualStudioMissing
(
userMessages
.
visualStudioMissing
(
visualStudio
.
workloadDescription
,
visualStudio
.
workloadDescription
,
visualStudio
.
necessaryComponentDescriptions
(
validator
.
majorVersion
)
visualStudio
.
necessaryComponentDescriptions
(
validator
.
majorVersion
)
,
)
)
);
);
expect
(
result
.
messages
.
contains
(
expectedMessage
),
true
);
expect
(
result
.
messages
.
contains
(
expectedMessage
),
true
);
...
...
packages/flutter_tools/test/src/mocks.dart
View file @
89427d67
...
@@ -40,7 +40,7 @@ class MockApplicationPackageStore extends ApplicationPackageStore {
...
@@ -40,7 +40,7 @@ class MockApplicationPackageStore extends ApplicationPackageStore {
versionCode:
1
,
versionCode:
1
,
launchActivity:
'io.flutter.android.mock.MockActivity'
,
launchActivity:
'io.flutter.android.mock.MockActivity'
,
),
),
iOS:
BuildableIOSApp
(
MockIosProject
(),
MockIosProject
.
bundleId
)
iOS:
BuildableIOSApp
(
MockIosProject
(),
MockIosProject
.
bundleId
)
,
);
);
}
}
...
...
packages/flutter_tools/test/src/testbed.dart
View file @
89427d67
...
@@ -34,7 +34,7 @@ final Map<Type, Generator> _testbedDefaults = <Type, Generator>{
...
@@ -34,7 +34,7 @@ final Map<Type, Generator> _testbedDefaults = <Type, Generator>{
OperatingSystemUtils:
()
=>
FakeOperatingSystemUtils
(),
OperatingSystemUtils:
()
=>
FakeOperatingSystemUtils
(),
OutputPreferences:
()
=>
OutputPreferences
(
showColor:
false
),
// configures BufferLogger to avoid color codes.
OutputPreferences:
()
=>
OutputPreferences
(
showColor:
false
),
// configures BufferLogger to avoid color codes.
Usage:
()
=>
NoOpUsage
(),
// prevent addition of analytics from burdening test mocks
Usage:
()
=>
NoOpUsage
(),
// prevent addition of analytics from burdening test mocks
FlutterVersion:
()
=>
FakeFlutterVersion
()
// prevent requirement to mock git for test runner.
FlutterVersion:
()
=>
FakeFlutterVersion
()
,
// prevent requirement to mock git for test runner.
};
};
/// Manages interaction with the tool injection and runner system.
/// Manages interaction with the tool injection and runner system.
...
@@ -110,7 +110,7 @@ class Testbed {
...
@@ -110,7 +110,7 @@ class Testbed {
final
Timer
result
=
parent
.
createPeriodicTimer
(
zone
,
period
,
timer
);
final
Timer
result
=
parent
.
createPeriodicTimer
(
zone
,
period
,
timer
);
timers
[
result
]
=
StackTrace
.
current
;
timers
[
result
]
=
StackTrace
.
current
;
return
result
;
return
result
;
}
}
,
),
),
body:
()
async
{
body:
()
async
{
Cache
.
flutterRoot
=
''
;
Cache
.
flutterRoot
=
''
;
...
...
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