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
da7670c2
Unverified
Commit
da7670c2
authored
Jun 05, 2018
by
Keerti Parthasarathy
Committed by
GitHub
Jun 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes for test failures in Dart 2 mode (#18122)
parent
12eeb94c
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
60 additions
and
42 deletions
+60
-42
android_workflow.dart
packages/flutter_tools/lib/src/android/android_workflow.dart
+1
-1
fingerprint.dart
packages/flutter_tools/lib/src/base/fingerprint.dart
+2
-2
devfs.dart
packages/flutter_tools/lib/src/devfs.dart
+4
-2
android_device_test.dart
packages/flutter_tools/test/android/android_device_test.dart
+1
-1
android_sdk_test.dart
packages/flutter_tools/test/android/android_sdk_test.dart
+4
-2
build_test.dart
packages/flutter_tools/test/base/build_test.dart
+1
-1
daemon_test.dart
packages/flutter_tools/test/commands/daemon_test.dart
+1
-1
cocoapods_test.dart
packages/flutter_tools/test/ios/cocoapods_test.dart
+4
-4
code_signing_test.dart
packages/flutter_tools/test/ios/code_signing_test.dart
+14
-13
mac_test.dart
packages/flutter_tools/test/ios/mac_test.dart
+1
-1
simulators_test.dart
packages/flutter_tools/test/ios/simulators_test.dart
+5
-5
xcodeproj_test.dart
packages/flutter_tools/test/ios/xcodeproj_test.dart
+4
-4
flutter_command_test.dart
packages/flutter_tools/test/runner/flutter_command_test.dart
+18
-5
No files found.
packages/flutter_tools/lib/src/android/android_workflow.dart
View file @
da7670c2
...
@@ -237,7 +237,7 @@ class AndroidWorkflow extends DoctorValidator implements Workflow {
...
@@ -237,7 +237,7 @@ class AndroidWorkflow extends DoctorValidator implements Workflow {
);
);
process
.
stdin
.
addStream
(
stdin
);
process
.
stdin
.
addStream
(
stdin
);
await
waitGroup
<
Null
>(<
Future
<
Null
>>[
await
waitGroup
<
void
>(<
Future
<
void
>>[
stdout
.
addStream
(
process
.
stdout
),
stdout
.
addStream
(
process
.
stdout
),
stderr
.
addStream
(
process
.
stderr
),
stderr
.
addStream
(
process
.
stderr
),
]);
]);
...
...
packages/flutter_tools/lib/src/base/fingerprint.dart
View file @
da7670c2
...
@@ -120,8 +120,8 @@ class Fingerprint {
...
@@ -120,8 +120,8 @@ class Fingerprint {
final
String
version
=
content
[
'version'
];
final
String
version
=
content
[
'version'
];
if
(
version
!=
FlutterVersion
.
instance
.
frameworkRevision
)
if
(
version
!=
FlutterVersion
.
instance
.
frameworkRevision
)
throw
new
ArgumentError
(
'Incompatible fingerprint version:
$version
'
);
throw
new
ArgumentError
(
'Incompatible fingerprint version:
$version
'
);
_checksums
=
content
[
'files'
]
??
<
String
,
String
>{};
_checksums
=
content
[
'files'
]
?.
cast
<
String
,
String
>()
??
<
String
,
String
>{};
_properties
=
content
[
'properties'
]
??
<
String
,
String
>{};
_properties
=
content
[
'properties'
]
?.
cast
<
String
,
String
>()
??
<
String
,
String
>{};
}
}
Map
<
String
,
String
>
_checksums
;
Map
<
String
,
String
>
_checksums
;
...
...
packages/flutter_tools/lib/src/devfs.dart
View file @
da7670c2
...
@@ -441,7 +441,8 @@ class DevFS {
...
@@ -441,7 +441,8 @@ class DevFS {
_entries
.
forEach
((
Uri
deviceUri
,
DevFSContent
content
)
{
_entries
.
forEach
((
Uri
deviceUri
,
DevFSContent
content
)
{
if
(!
content
.
_exists
)
{
if
(!
content
.
_exists
)
{
final
Future
<
Map
<
String
,
dynamic
>>
operation
=
final
Future
<
Map
<
String
,
dynamic
>>
operation
=
_operations
.
deleteFile
(
fsName
,
deviceUri
);
_operations
.
deleteFile
(
fsName
,
deviceUri
)
.
then
((
dynamic
v
)
=>
v
?.
cast
<
String
,
dynamic
>());
if
(
operation
!=
null
)
if
(
operation
!=
null
)
_pendingOperations
.
add
(
operation
);
_pendingOperations
.
add
(
operation
);
toRemove
.
add
(
deviceUri
);
toRemove
.
add
(
deviceUri
);
...
@@ -533,7 +534,8 @@ class DevFS {
...
@@ -533,7 +534,8 @@ class DevFS {
// Make service protocol requests for each.
// Make service protocol requests for each.
dirtyEntries
.
forEach
((
Uri
deviceUri
,
DevFSContent
content
)
{
dirtyEntries
.
forEach
((
Uri
deviceUri
,
DevFSContent
content
)
{
final
Future
<
Map
<
String
,
dynamic
>>
operation
=
final
Future
<
Map
<
String
,
dynamic
>>
operation
=
_operations
.
writeFile
(
fsName
,
deviceUri
,
content
);
_operations
.
writeFile
(
fsName
,
deviceUri
,
content
)
.
then
((
dynamic
v
)
=>
v
?.
cast
<
String
,
dynamic
>());
if
(
operation
!=
null
)
if
(
operation
!=
null
)
_pendingOperations
.
add
(
operation
);
_pendingOperations
.
add
(
operation
);
});
});
...
...
packages/flutter_tools/test/android/android_device_test.dart
View file @
da7670c2
...
@@ -88,7 +88,7 @@ Use the 'android' tool to install them:
...
@@ -88,7 +88,7 @@ Use the 'android' tool to install them:
setUp
(()
{
setUp
(()
{
hardware
=
'unknown'
;
hardware
=
'unknown'
;
buildCharacteristics
=
'unused'
;
buildCharacteristics
=
'unused'
;
when
(
mockProcessManager
.
run
(
a
rgThat
(
contains
(
'getprop'
)),
when
(
mockProcessManager
.
run
(
typedA
rgThat
(
contains
(
'getprop'
)),
stderrEncoding:
anyNamed
(
'stderrEncoding'
),
stderrEncoding:
anyNamed
(
'stderrEncoding'
),
stdoutEncoding:
anyNamed
(
'stdoutEncoding'
))).
thenAnswer
((
_
)
{
stdoutEncoding:
anyNamed
(
'stdoutEncoding'
))).
thenAnswer
((
_
)
{
final
StringBuffer
buf
=
new
StringBuffer
()
final
StringBuffer
buf
=
new
StringBuffer
()
...
...
packages/flutter_tools/test/android/android_sdk_test.dart
View file @
da7670c2
...
@@ -73,7 +73,8 @@ void main() {
...
@@ -73,7 +73,8 @@ void main() {
final
AndroidSdk
sdk
=
AndroidSdk
.
locateAndroidSdk
();
final
AndroidSdk
sdk
=
AndroidSdk
.
locateAndroidSdk
();
when
(
processManager
.
canRun
(
sdk
.
sdkManagerPath
)).
thenReturn
(
true
);
when
(
processManager
.
canRun
(
sdk
.
sdkManagerPath
)).
thenReturn
(
true
);
when
(
processManager
.
runSync
(<
String
>[
sdk
.
sdkManagerPath
,
'--version'
],
environment:
argThat
(
isNotNull
)))
when
(
processManager
.
runSync
(<
String
>[
sdk
.
sdkManagerPath
,
'--version'
],
environment:
typedArgThat
(
isNotNull
,
named:
'environment'
)))
.
thenReturn
(
new
ProcessResult
(
1
,
0
,
'26.1.1
\n
'
,
''
));
.
thenReturn
(
new
ProcessResult
(
1
,
0
,
'26.1.1
\n
'
,
''
));
expect
(
sdk
.
sdkManagerVersion
,
'26.1.1'
);
expect
(
sdk
.
sdkManagerVersion
,
'26.1.1'
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
...
@@ -87,7 +88,8 @@ void main() {
...
@@ -87,7 +88,8 @@ void main() {
final
AndroidSdk
sdk
=
AndroidSdk
.
locateAndroidSdk
();
final
AndroidSdk
sdk
=
AndroidSdk
.
locateAndroidSdk
();
when
(
processManager
.
canRun
(
sdk
.
sdkManagerPath
)).
thenReturn
(
true
);
when
(
processManager
.
canRun
(
sdk
.
sdkManagerPath
)).
thenReturn
(
true
);
when
(
processManager
.
runSync
(<
String
>[
sdk
.
sdkManagerPath
,
'--version'
],
environment:
argThat
(
isNotNull
)))
when
(
processManager
.
runSync
(<
String
>[
sdk
.
sdkManagerPath
,
'--version'
],
environment:
typedArgThat
(
isNotNull
,
named:
'environment'
)))
.
thenReturn
(
new
ProcessResult
(
1
,
1
,
'26.1.1
\n
'
,
'Mystery error'
));
.
thenReturn
(
new
ProcessResult
(
1
,
1
,
'26.1.1
\n
'
,
'Mystery error'
));
expect
(
sdk
.
sdkManagerVersion
,
isNull
);
expect
(
sdk
.
sdkManagerVersion
,
isNull
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
...
...
packages/flutter_tools/test/base/build_test.dart
View file @
da7670c2
...
@@ -120,7 +120,7 @@ void main() {
...
@@ -120,7 +120,7 @@ void main() {
GenSnapshot:
()
=>
genSnapshot
,
GenSnapshot:
()
=>
genSnapshot
,
};
};
Future
<
Null
>
writeFingerprint
({
Map
<
String
,
String
>
files
=
const
<
String
,
String
>{}
})
{
Future
<
void
>
writeFingerprint
({
Map
<
String
,
String
>
files
=
const
<
String
,
String
>{}
})
{
return
fs
.
file
(
'output.snapshot.d.fingerprint'
).
writeAsString
(
json
.
encode
(<
String
,
dynamic
>{
return
fs
.
file
(
'output.snapshot.d.fingerprint'
).
writeAsString
(
json
.
encode
(<
String
,
dynamic
>{
'version'
:
kVersion
,
'version'
:
kVersion
,
'properties'
:
<
String
,
String
>{
'properties'
:
<
String
,
String
>{
...
...
packages/flutter_tools/test/commands/daemon_test.dart
View file @
da7670c2
...
@@ -61,7 +61,7 @@ void main() {
...
@@ -61,7 +61,7 @@ void main() {
});
});
expect
(
response
[
'id'
],
isNull
);
expect
(
response
[
'id'
],
isNull
);
expect
(
response
[
'event'
],
'daemon.logMessage'
);
expect
(
response
[
'event'
],
'daemon.logMessage'
);
final
Map
<
String
,
String
>
logMessage
=
response
[
'params'
];
final
Map
<
String
,
String
>
logMessage
=
response
[
'params'
]
.
cast
<
String
,
String
>()
;
expect
(
logMessage
[
'level'
],
'error'
);
expect
(
logMessage
[
'level'
],
'error'
);
expect
(
logMessage
[
'message'
],
'daemon.logMessage test'
);
expect
(
logMessage
[
'message'
],
'daemon.logMessage test'
);
responses
.
close
();
responses
.
close
();
...
...
packages/flutter_tools/test/ios/cocoapods_test.dart
View file @
da7670c2
...
@@ -142,7 +142,7 @@ void main() {
...
@@ -142,7 +142,7 @@ void main() {
testUsingContext
(
'creates swift Podfile if swift'
,
()
{
testUsingContext
(
'creates swift Podfile if swift'
,
()
{
when
(
mockXcodeProjectInterpreter
.
isInstalled
).
thenReturn
(
true
);
when
(
mockXcodeProjectInterpreter
.
isInstalled
).
thenReturn
(
true
);
when
(
mockXcodeProjectInterpreter
.
getBuildSettings
(
any
,
any
)).
thenReturn
(<
String
,
String
>{
when
(
mockXcodeProjectInterpreter
.
getBuildSettings
(
typed
(
any
),
typed
(
any
)
)).
thenReturn
(<
String
,
String
>{
'SWIFT_VERSION'
:
'4.0'
,
'SWIFT_VERSION'
:
'4.0'
,
});
});
...
@@ -204,7 +204,7 @@ void main() {
...
@@ -204,7 +204,7 @@ void main() {
iosEngineDir:
'engine/path'
,
iosEngineDir:
'engine/path'
,
);
);
verifyNever
(
mockProcessManager
.
run
(
verifyNever
(
mockProcessManager
.
run
(
a
rgThat
(
containsAllInOrder
(<
String
>[
'pod'
,
'install'
])),
typedA
rgThat
(
containsAllInOrder
(<
String
>[
'pod'
,
'install'
])),
workingDirectory:
anyNamed
(
'workingDirectory'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
environment:
anyNamed
(
'environment'
),
environment:
anyNamed
(
'environment'
),
));
));
...
@@ -226,7 +226,7 @@ void main() {
...
@@ -226,7 +226,7 @@ void main() {
}
catch
(
e
)
{
}
catch
(
e
)
{
expect
(
e
,
const
isInstanceOf
<
ToolExit
>());
expect
(
e
,
const
isInstanceOf
<
ToolExit
>());
verifyNever
(
mockProcessManager
.
run
(
verifyNever
(
mockProcessManager
.
run
(
a
rgThat
(
containsAllInOrder
(<
String
>[
'pod'
,
'install'
])),
typedA
rgThat
(
containsAllInOrder
(<
String
>[
'pod'
,
'install'
])),
workingDirectory:
anyNamed
(
'workingDirectory'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
environment:
anyNamed
(
'environment'
),
environment:
anyNamed
(
'environment'
),
));
));
...
@@ -437,7 +437,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
...
@@ -437,7 +437,7 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
);
);
expect
(
didInstall
,
isFalse
);
expect
(
didInstall
,
isFalse
);
verifyNever
(
mockProcessManager
.
run
(
verifyNever
(
mockProcessManager
.
run
(
a
rgThat
(
containsAllInOrder
(<
String
>[
'pod'
,
'install'
])),
typedA
rgThat
(
containsAllInOrder
(<
String
>[
'pod'
,
'install'
])),
workingDirectory:
anyNamed
(
'workingDirectory'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
environment:
anyNamed
(
'environment'
),
environment:
anyNamed
(
'environment'
),
));
));
...
...
packages/flutter_tools/test/ios/code_signing_test.dart
View file @
da7670c2
...
@@ -72,11 +72,12 @@ void main() {
...
@@ -72,11 +72,12 @@ void main() {
when
(
mockProcessManager
.
runSync
(<
String
>[
'which'
,
'openssl'
]))
when
(
mockProcessManager
.
runSync
(<
String
>[
'which'
,
'openssl'
]))
.
thenReturn
(
exitsHappy
);
.
thenReturn
(
exitsHappy
);
when
(
mockProcessManager
.
runSync
(
when
(
mockProcessManager
.
runSync
(
a
rgThat
(
contains
(
'find-identity'
)),
typedA
rgThat
(
contains
(
'find-identity'
)),
environment:
anyNamed
(
'environment'
),
environment:
anyNamed
(
'environment'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
)).
thenReturn
(
exitsHappy
);
)).
thenReturn
(
exitsHappy
);
Map
<
String
,
String
>
signingConfigs
;
Map
<
String
,
String
>
signingConfigs
;
try
{
try
{
signingConfigs
=
await
getCodeSigningIdentityDevelopmentTeam
(
iosApp:
app
);
signingConfigs
=
await
getCodeSigningIdentityDevelopmentTeam
(
iosApp:
app
);
...
@@ -96,7 +97,7 @@ void main() {
...
@@ -96,7 +97,7 @@ void main() {
when
(
mockProcessManager
.
runSync
(<
String
>[
'which'
,
'openssl'
]))
when
(
mockProcessManager
.
runSync
(<
String
>[
'which'
,
'openssl'
]))
.
thenReturn
(
exitsHappy
);
.
thenReturn
(
exitsHappy
);
when
(
mockProcessManager
.
runSync
(
when
(
mockProcessManager
.
runSync
(
a
rgThat
(
contains
(
'find-identity'
)),
typedA
rgThat
(
contains
(
'find-identity'
)),
environment:
anyNamed
(
'environment'
),
environment:
anyNamed
(
'environment'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
)).
thenReturn
(
new
ProcessResult
(
)).
thenReturn
(
new
ProcessResult
(
...
@@ -123,7 +124,7 @@ void main() {
...
@@ -123,7 +124,7 @@ void main() {
final
MockStream
mockStdErr
=
new
MockStream
();
final
MockStream
mockStdErr
=
new
MockStream
();
when
(
mockProcessManager
.
start
(
when
(
mockProcessManager
.
start
(
a
rgThat
(
contains
(
'openssl'
)),
typedA
rgThat
(
contains
(
'openssl'
)),
environment:
anyNamed
(
'environment'
),
environment:
anyNamed
(
'environment'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
)).
thenAnswer
((
Invocation
invocation
)
=>
new
Future
<
Process
>.
value
(
mockProcess
));
)).
thenAnswer
((
Invocation
invocation
)
=>
new
Future
<
Process
>.
value
(
mockProcess
));
...
@@ -155,7 +156,7 @@ void main() {
...
@@ -155,7 +156,7 @@ void main() {
when
(
mockProcessManager
.
runSync
(<
String
>[
'which'
,
'openssl'
]))
when
(
mockProcessManager
.
runSync
(<
String
>[
'which'
,
'openssl'
]))
.
thenReturn
(
exitsHappy
);
.
thenReturn
(
exitsHappy
);
when
(
mockProcessManager
.
runSync
(
when
(
mockProcessManager
.
runSync
(
a
rgThat
(
contains
(
'find-identity'
)),
typedA
rgThat
(
contains
(
'find-identity'
)),
environment:
anyNamed
(
'environment'
),
environment:
anyNamed
(
'environment'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
)).
thenReturn
(
new
ProcessResult
(
)).
thenReturn
(
new
ProcessResult
(
...
@@ -182,7 +183,7 @@ void main() {
...
@@ -182,7 +183,7 @@ void main() {
final
MockStream
mockStdErr
=
new
MockStream
();
final
MockStream
mockStdErr
=
new
MockStream
();
when
(
mockProcessManager
.
start
(
when
(
mockProcessManager
.
start
(
a
rgThat
(
contains
(
'openssl'
)),
typedA
rgThat
(
contains
(
'openssl'
)),
environment:
anyNamed
(
'environment'
),
environment:
anyNamed
(
'environment'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
)).
thenAnswer
((
Invocation
invocation
)
=>
new
Future
<
Process
>.
value
(
mockProcess
));
)).
thenAnswer
((
Invocation
invocation
)
=>
new
Future
<
Process
>.
value
(
mockProcess
));
...
@@ -218,7 +219,7 @@ void main() {
...
@@ -218,7 +219,7 @@ void main() {
when
(
mockProcessManager
.
runSync
(<
String
>[
'which'
,
'openssl'
]))
when
(
mockProcessManager
.
runSync
(<
String
>[
'which'
,
'openssl'
]))
.
thenReturn
(
exitsHappy
);
.
thenReturn
(
exitsHappy
);
when
(
mockProcessManager
.
runSync
(
when
(
mockProcessManager
.
runSync
(
a
rgThat
(
contains
(
'find-identity'
)),
typedA
rgThat
(
contains
(
'find-identity'
)),
environment:
anyNamed
(
'environment'
),
environment:
anyNamed
(
'environment'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
)).
thenReturn
(
new
ProcessResult
(
)).
thenReturn
(
new
ProcessResult
(
...
@@ -249,7 +250,7 @@ void main() {
...
@@ -249,7 +250,7 @@ void main() {
final
MockStream
mockOpenSslStdErr
=
new
MockStream
();
final
MockStream
mockOpenSslStdErr
=
new
MockStream
();
when
(
mockProcessManager
.
start
(
when
(
mockProcessManager
.
start
(
a
rgThat
(
contains
(
'openssl'
)),
typedA
rgThat
(
contains
(
'openssl'
)),
environment:
anyNamed
(
'environment'
),
environment:
anyNamed
(
'environment'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
)).
thenAnswer
((
Invocation
invocation
)
=>
new
Future
<
Process
>.
value
(
mockOpenSslProcess
));
)).
thenAnswer
((
Invocation
invocation
)
=>
new
Future
<
Process
>.
value
(
mockOpenSslProcess
));
...
@@ -292,7 +293,7 @@ void main() {
...
@@ -292,7 +293,7 @@ void main() {
when
(
mockProcessManager
.
runSync
(<
String
>[
'which'
,
'openssl'
]))
when
(
mockProcessManager
.
runSync
(<
String
>[
'which'
,
'openssl'
]))
.
thenReturn
(
exitsHappy
);
.
thenReturn
(
exitsHappy
);
when
(
mockProcessManager
.
runSync
(
when
(
mockProcessManager
.
runSync
(
a
rgThat
(
contains
(
'find-identity'
)),
typedA
rgThat
(
contains
(
'find-identity'
)),
environment:
anyNamed
(
'environment'
),
environment:
anyNamed
(
'environment'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
)).
thenReturn
(
new
ProcessResult
(
)).
thenReturn
(
new
ProcessResult
(
...
@@ -323,7 +324,7 @@ void main() {
...
@@ -323,7 +324,7 @@ void main() {
final
MockStream
mockOpenSslStdErr
=
new
MockStream
();
final
MockStream
mockOpenSslStdErr
=
new
MockStream
();
when
(
mockProcessManager
.
start
(
when
(
mockProcessManager
.
start
(
a
rgThat
(
contains
(
'openssl'
)),
typedA
rgThat
(
contains
(
'openssl'
)),
environment:
anyNamed
(
'environment'
),
environment:
anyNamed
(
'environment'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
)).
thenAnswer
((
Invocation
invocation
)
=>
new
Future
<
Process
>.
value
(
mockOpenSslProcess
));
)).
thenAnswer
((
Invocation
invocation
)
=>
new
Future
<
Process
>.
value
(
mockOpenSslProcess
));
...
@@ -360,7 +361,7 @@ void main() {
...
@@ -360,7 +361,7 @@ void main() {
when
(
mockProcessManager
.
runSync
(<
String
>[
'which'
,
'openssl'
]))
when
(
mockProcessManager
.
runSync
(<
String
>[
'which'
,
'openssl'
]))
.
thenReturn
(
exitsHappy
);
.
thenReturn
(
exitsHappy
);
when
(
mockProcessManager
.
runSync
(
when
(
mockProcessManager
.
runSync
(
a
rgThat
(
contains
(
'find-identity'
)),
typedA
rgThat
(
contains
(
'find-identity'
)),
environment:
anyNamed
(
'environment'
),
environment:
anyNamed
(
'environment'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
)).
thenReturn
(
new
ProcessResult
(
)).
thenReturn
(
new
ProcessResult
(
...
@@ -389,7 +390,7 @@ void main() {
...
@@ -389,7 +390,7 @@ void main() {
final
MockStream
mockOpenSslStdErr
=
new
MockStream
();
final
MockStream
mockOpenSslStdErr
=
new
MockStream
();
when
(
mockProcessManager
.
start
(
when
(
mockProcessManager
.
start
(
a
rgThat
(
contains
(
'openssl'
)),
typedA
rgThat
(
contains
(
'openssl'
)),
environment:
anyNamed
(
'environment'
),
environment:
anyNamed
(
'environment'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
)).
thenAnswer
((
Invocation
invocation
)
=>
new
Future
<
Process
>.
value
(
mockOpenSslProcess
));
)).
thenAnswer
((
Invocation
invocation
)
=>
new
Future
<
Process
>.
value
(
mockOpenSslProcess
));
...
@@ -430,7 +431,7 @@ void main() {
...
@@ -430,7 +431,7 @@ void main() {
when
(
mockProcessManager
.
runSync
(<
String
>[
'which'
,
'openssl'
]))
when
(
mockProcessManager
.
runSync
(<
String
>[
'which'
,
'openssl'
]))
.
thenReturn
(
exitsHappy
);
.
thenReturn
(
exitsHappy
);
when
(
mockProcessManager
.
runSync
(
when
(
mockProcessManager
.
runSync
(
a
rgThat
(
contains
(
'find-identity'
)),
typedA
rgThat
(
contains
(
'find-identity'
)),
environment:
anyNamed
(
'environment'
),
environment:
anyNamed
(
'environment'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
)).
thenReturn
(
new
ProcessResult
(
)).
thenReturn
(
new
ProcessResult
(
...
@@ -462,7 +463,7 @@ void main() {
...
@@ -462,7 +463,7 @@ void main() {
final
MockStream
mockOpenSslStdErr
=
new
MockStream
();
final
MockStream
mockOpenSslStdErr
=
new
MockStream
();
when
(
mockProcessManager
.
start
(
when
(
mockProcessManager
.
start
(
a
rgThat
(
contains
(
'openssl'
)),
typedA
rgThat
(
contains
(
'openssl'
)),
environment:
anyNamed
(
'environment'
),
environment:
anyNamed
(
'environment'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
)).
thenAnswer
((
Invocation
invocation
)
=>
new
Future
<
Process
>.
value
(
mockOpenSslProcess
));
)).
thenAnswer
((
Invocation
invocation
)
=>
new
Future
<
Process
>.
value
(
mockOpenSslProcess
));
...
...
packages/flutter_tools/test/ios/mac_test.dart
View file @
da7670c2
...
@@ -82,7 +82,7 @@ void main() {
...
@@ -82,7 +82,7 @@ void main() {
testUsingContext
(
'idevicescreenshot captures and returns screenshot'
,
()
async
{
testUsingContext
(
'idevicescreenshot captures and returns screenshot'
,
()
async
{
when
(
mockOutputFile
.
path
).
thenReturn
(
outputPath
);
when
(
mockOutputFile
.
path
).
thenReturn
(
outputPath
);
when
(
mockProcessManager
.
run
(
any
,
environment:
null
,
workingDirectory:
null
)).
thenAnswer
(
when
(
mockProcessManager
.
run
(
typed
(
any
)
,
environment:
null
,
workingDirectory:
null
)).
thenAnswer
(
(
Invocation
invocation
)
=>
new
Future
<
ProcessResult
>.
value
(
new
ProcessResult
(
4
,
0
,
''
,
''
)));
(
Invocation
invocation
)
=>
new
Future
<
ProcessResult
>.
value
(
new
ProcessResult
(
4
,
0
,
''
,
''
)));
await
iMobileDevice
.
takeScreenshot
(
mockOutputFile
);
await
iMobileDevice
.
takeScreenshot
(
mockOutputFile
);
...
...
packages/flutter_tools/test/ios/simulators_test.dart
View file @
da7670c2
...
@@ -175,7 +175,7 @@ void main() {
...
@@ -175,7 +175,7 @@ void main() {
mockProcessManager
=
new
MockProcessManager
();
mockProcessManager
=
new
MockProcessManager
();
// Let everything else return exit code 0 so process.dart doesn't crash.
// Let everything else return exit code 0 so process.dart doesn't crash.
when
(
when
(
mockProcessManager
.
run
(
any
,
environment:
null
,
workingDirectory:
null
)
mockProcessManager
.
run
(
typed
(
any
)
,
environment:
null
,
workingDirectory:
null
)
).
thenAnswer
((
Invocation
invocation
)
=>
).
thenAnswer
((
Invocation
invocation
)
=>
new
Future
<
ProcessResult
>.
value
(
new
ProcessResult
(
2
,
0
,
''
,
''
))
new
Future
<
ProcessResult
>.
value
(
new
ProcessResult
(
2
,
0
,
''
,
''
))
);
);
...
@@ -229,7 +229,7 @@ void main() {
...
@@ -229,7 +229,7 @@ void main() {
setUp
(()
{
setUp
(()
{
mockProcessManager
=
new
MockProcessManager
();
mockProcessManager
=
new
MockProcessManager
();
when
(
mockProcessManager
.
start
(
any
,
environment:
null
,
workingDirectory:
null
))
when
(
mockProcessManager
.
start
(
typed
(
any
)
,
environment:
null
,
workingDirectory:
null
))
.
thenAnswer
((
Invocation
invocation
)
=>
new
Future
<
Process
>.
value
(
new
MockProcess
()));
.
thenAnswer
((
Invocation
invocation
)
=>
new
Future
<
Process
>.
value
(
new
MockProcess
()));
});
});
...
@@ -237,7 +237,7 @@ void main() {
...
@@ -237,7 +237,7 @@ void main() {
final
IOSSimulator
device
=
new
IOSSimulator
(
'x'
,
name:
'iPhone SE'
,
category:
'iOS 9.3'
);
final
IOSSimulator
device
=
new
IOSSimulator
(
'x'
,
name:
'iPhone SE'
,
category:
'iOS 9.3'
);
await
launchDeviceLogTool
(
device
);
await
launchDeviceLogTool
(
device
);
expect
(
expect
(
verify
(
mockProcessManager
.
start
(
captureAny
,
environment:
null
,
workingDirectory:
null
)).
captured
.
single
,
verify
(
mockProcessManager
.
start
(
typed
(
captureAny
)
,
environment:
null
,
workingDirectory:
null
)).
captured
.
single
,
contains
(
'tail'
),
contains
(
'tail'
),
);
);
},
},
...
@@ -249,7 +249,7 @@ void main() {
...
@@ -249,7 +249,7 @@ void main() {
final
IOSSimulator
device
=
new
IOSSimulator
(
'x'
,
name:
'iPhone SE'
,
category:
'iOS 11.0'
);
final
IOSSimulator
device
=
new
IOSSimulator
(
'x'
,
name:
'iPhone SE'
,
category:
'iOS 11.0'
);
await
launchDeviceLogTool
(
device
);
await
launchDeviceLogTool
(
device
);
expect
(
expect
(
verify
(
mockProcessManager
.
start
(
captureAny
,
environment:
null
,
workingDirectory:
null
)).
captured
.
single
,
verify
(
mockProcessManager
.
start
(
typed
(
captureAny
)
,
environment:
null
,
workingDirectory:
null
)).
captured
.
single
,
contains
(
'/usr/bin/log'
),
contains
(
'/usr/bin/log'
),
);
);
},
},
...
@@ -271,7 +271,7 @@ void main() {
...
@@ -271,7 +271,7 @@ void main() {
final
IOSSimulator
device
=
new
IOSSimulator
(
'x'
,
name:
'iPhone SE'
,
category:
'iOS 9.3'
);
final
IOSSimulator
device
=
new
IOSSimulator
(
'x'
,
name:
'iPhone SE'
,
category:
'iOS 9.3'
);
await
launchSystemLogTool
(
device
);
await
launchSystemLogTool
(
device
);
expect
(
expect
(
verify
(
mockProcessManager
.
start
(
captureAny
,
environment:
null
,
workingDirectory:
null
)).
captured
.
single
,
verify
(
mockProcessManager
.
start
(
typed
(
captureAny
)
,
environment:
null
,
workingDirectory:
null
)).
captured
.
single
,
contains
(
'tail'
),
contains
(
'tail'
),
);
);
},
},
...
...
packages/flutter_tools/test/ios/xcodeproj_test.dart
View file @
da7670c2
...
@@ -282,7 +282,7 @@ Information about project "Runner":
...
@@ -282,7 +282,7 @@ Information about project "Runner":
}
}
testUsingOsxContext
(
'sets ARCHS=armv7 when armv7 local engine is set'
,
()
async
{
testUsingOsxContext
(
'sets ARCHS=armv7 when armv7 local engine is set'
,
()
async
{
when
(
mockArtifacts
.
getArtifactPath
(
Artifact
.
flutterFramework
,
TargetPlatform
.
ios
,
any
)).
thenReturn
(
'engine'
);
when
(
mockArtifacts
.
getArtifactPath
(
Artifact
.
flutterFramework
,
TargetPlatform
.
ios
,
typed
(
any
)
)).
thenReturn
(
'engine'
);
when
(
mockArtifacts
.
engineOutPath
).
thenReturn
(
fs
.
path
.
join
(
'out'
,
'ios_profile_arm'
));
when
(
mockArtifacts
.
engineOutPath
).
thenReturn
(
fs
.
path
.
join
(
'out'
,
'ios_profile_arm'
));
const
BuildInfo
buildInfo
=
const
BuildInfo
(
BuildMode
.
debug
,
null
,
const
BuildInfo
buildInfo
=
const
BuildInfo
(
BuildMode
.
debug
,
null
,
previewDart2:
true
,
previewDart2:
true
,
...
@@ -302,7 +302,7 @@ Information about project "Runner":
...
@@ -302,7 +302,7 @@ Information about project "Runner":
});
});
testUsingOsxContext
(
'sets TRACK_WIDGET_CREATION=true when trackWidgetCreation is true'
,
()
async
{
testUsingOsxContext
(
'sets TRACK_WIDGET_CREATION=true when trackWidgetCreation is true'
,
()
async
{
when
(
mockArtifacts
.
getArtifactPath
(
Artifact
.
flutterFramework
,
TargetPlatform
.
ios
,
any
)).
thenReturn
(
'engine'
);
when
(
mockArtifacts
.
getArtifactPath
(
Artifact
.
flutterFramework
,
TargetPlatform
.
ios
,
typed
(
any
)
)).
thenReturn
(
'engine'
);
when
(
mockArtifacts
.
engineOutPath
).
thenReturn
(
fs
.
path
.
join
(
'out'
,
'ios_profile_arm'
));
when
(
mockArtifacts
.
engineOutPath
).
thenReturn
(
fs
.
path
.
join
(
'out'
,
'ios_profile_arm'
));
const
BuildInfo
buildInfo
=
const
BuildInfo
(
BuildMode
.
debug
,
null
,
const
BuildInfo
buildInfo
=
const
BuildInfo
(
BuildMode
.
debug
,
null
,
previewDart2:
true
,
previewDart2:
true
,
...
@@ -323,7 +323,7 @@ Information about project "Runner":
...
@@ -323,7 +323,7 @@ Information about project "Runner":
});
});
testUsingOsxContext
(
'does not set TRACK_WIDGET_CREATION when trackWidgetCreation is false'
,
()
async
{
testUsingOsxContext
(
'does not set TRACK_WIDGET_CREATION when trackWidgetCreation is false'
,
()
async
{
when
(
mockArtifacts
.
getArtifactPath
(
Artifact
.
flutterFramework
,
TargetPlatform
.
ios
,
any
)).
thenReturn
(
'engine'
);
when
(
mockArtifacts
.
getArtifactPath
(
Artifact
.
flutterFramework
,
TargetPlatform
.
ios
,
typed
(
any
)
)).
thenReturn
(
'engine'
);
when
(
mockArtifacts
.
engineOutPath
).
thenReturn
(
fs
.
path
.
join
(
'out'
,
'ios_profile_arm'
));
when
(
mockArtifacts
.
engineOutPath
).
thenReturn
(
fs
.
path
.
join
(
'out'
,
'ios_profile_arm'
));
const
BuildInfo
buildInfo
=
const
BuildInfo
(
BuildMode
.
debug
,
null
,
const
BuildInfo
buildInfo
=
const
BuildInfo
(
BuildMode
.
debug
,
null
,
previewDart2:
true
,
previewDart2:
true
,
...
@@ -343,7 +343,7 @@ Information about project "Runner":
...
@@ -343,7 +343,7 @@ Information about project "Runner":
});
});
testUsingOsxContext
(
'sets ARCHS=armv7 when armv7 local engine is set'
,
()
async
{
testUsingOsxContext
(
'sets ARCHS=armv7 when armv7 local engine is set'
,
()
async
{
when
(
mockArtifacts
.
getArtifactPath
(
Artifact
.
flutterFramework
,
TargetPlatform
.
ios
,
any
)).
thenReturn
(
'engine'
);
when
(
mockArtifacts
.
getArtifactPath
(
Artifact
.
flutterFramework
,
TargetPlatform
.
ios
,
typed
(
any
)
)).
thenReturn
(
'engine'
);
when
(
mockArtifacts
.
engineOutPath
).
thenReturn
(
fs
.
path
.
join
(
'out'
,
'ios_profile'
));
when
(
mockArtifacts
.
engineOutPath
).
thenReturn
(
fs
.
path
.
join
(
'out'
,
'ios_profile'
));
const
BuildInfo
buildInfo
=
const
BuildInfo
(
BuildMode
.
debug
,
null
,
const
BuildInfo
buildInfo
=
const
BuildInfo
(
BuildMode
.
debug
,
null
,
previewDart2:
true
,
previewDart2:
true
,
...
...
packages/flutter_tools/test/runner/flutter_command_test.dart
View file @
da7670c2
...
@@ -60,7 +60,9 @@ void main() {
...
@@ -60,7 +60,9 @@ void main() {
verify
(
clock
.
now
()).
called
(
2
);
verify
(
clock
.
now
()).
called
(
2
);
expect
(
expect
(
verify
(
usage
.
sendTiming
(
captureAny
,
captureAny
,
captureAny
,
label:
captureAny
)).
captured
,
verify
(
usage
.
sendTiming
(
typed
(
captureAny
),
typed
(
captureAny
),
typed
(
captureAny
),
label:
captureAnyNamed
(
'label'
))).
captured
,
<
dynamic
>[
'flutter'
,
'dummy'
,
const
Duration
(
milliseconds:
1000
),
null
]
<
dynamic
>[
'flutter'
,
'dummy'
,
const
Duration
(
milliseconds:
1000
),
null
]
);
);
},
},
...
@@ -77,7 +79,9 @@ void main() {
...
@@ -77,7 +79,9 @@ void main() {
new
DummyFlutterCommand
(
noUsagePath:
true
);
new
DummyFlutterCommand
(
noUsagePath:
true
);
await
flutterCommand
.
run
();
await
flutterCommand
.
run
();
verify
(
clock
.
now
()).
called
(
2
);
verify
(
clock
.
now
()).
called
(
2
);
verifyNever
(
usage
.
sendTiming
(
captureAny
,
captureAny
,
captureAny
,
label:
captureAny
));
verifyNever
(
usage
.
sendTiming
(
typed
(
captureAny
),
typed
(
captureAny
),
typed
(
captureAny
),
label:
captureAnyNamed
(
'label'
)));
},
},
overrides:
<
Type
,
Generator
>{
overrides:
<
Type
,
Generator
>{
Clock:
()
=>
clock
,
Clock:
()
=>
clock
,
...
@@ -101,7 +105,9 @@ void main() {
...
@@ -101,7 +105,9 @@ void main() {
await
flutterCommand
.
run
();
await
flutterCommand
.
run
();
verify
(
clock
.
now
()).
called
(
2
);
verify
(
clock
.
now
()).
called
(
2
);
expect
(
expect
(
verify
(
usage
.
sendTiming
(
captureAny
,
captureAny
,
captureAny
,
label:
captureAny
)).
captured
,
verify
(
usage
.
sendTiming
(
typed
(
captureAny
),
typed
(
captureAny
),
typed
(
captureAny
),
label:
captureAnyNamed
(
'label'
))).
captured
,
<
dynamic
>[
<
dynamic
>[
'flutter'
,
'flutter'
,
'dummy'
,
'dummy'
,
...
@@ -130,8 +136,15 @@ void main() {
...
@@ -130,8 +136,15 @@ void main() {
verify
(
clock
.
now
()).
called
(
2
);
verify
(
clock
.
now
()).
called
(
2
);
expect
(
expect
(
verify
(
usage
.
sendTiming
(
captureAny
,
captureAny
,
captureAny
,
label:
captureAny
)).
captured
,
verify
(
usage
.
sendTiming
(
<
dynamic
>[
'flutter'
,
'dummy'
,
const
Duration
(
milliseconds:
1000
),
'fail'
]
typed
(
captureAny
),
typed
(
captureAny
),
typed
(
captureAny
),
label:
captureAnyNamed
(
'label'
))).
captured
,
<
dynamic
>[
'flutter'
,
'dummy'
,
const
Duration
(
milliseconds:
1000
),
'fail'
]
);
);
}
}
},
},
...
...
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