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
81070893
Unverified
Commit
81070893
authored
Mar 19, 2018
by
Matan Lurey
Committed by
GitHub
Mar 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Dart2 compatibility with flutter_tools' tests. (#15699)
parent
1c04f951
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
22 deletions
+35
-22
cocoapods_test.dart
packages/flutter_tools/test/ios/cocoapods_test.dart
+8
-4
code_signing_test.dart
packages/flutter_tools/test/ios/code_signing_test.dart
+4
-4
devices_test.dart
packages/flutter_tools/test/ios/devices_test.dart
+8
-4
ios_workflow_test.dart
packages/flutter_tools/test/ios/ios_workflow_test.dart
+12
-7
mac_test.dart
packages/flutter_tools/test/ios/mac_test.dart
+3
-3
No files found.
packages/flutter_tools/test/ios/cocoapods_test.dart
View file @
81070893
...
@@ -47,7 +47,7 @@ void main() {
...
@@ -47,7 +47,7 @@ void main() {
<
String
>[
'pod'
,
'install'
,
'--verbose'
],
<
String
>[
'pod'
,
'install'
,
'--verbose'
],
workingDirectory:
'project/ios'
,
workingDirectory:
'project/ios'
,
environment:
<
String
,
String
>{
'FLUTTER_FRAMEWORK_DIR'
:
'engine/path'
,
'COCOAPODS_DISABLE_STATS'
:
'true'
},
environment:
<
String
,
String
>{
'FLUTTER_FRAMEWORK_DIR'
:
'engine/path'
,
'COCOAPODS_DISABLE_STATS'
:
'true'
},
)).
then
Return
(
exitsHappy
);
)).
then
Answer
((
_
)
=>
new
Future
<
ProcessResult
>.
value
(
exitsHappy
)
);
});
});
group
(
'Setup Podfile'
,
()
{
group
(
'Setup Podfile'
,
()
{
...
@@ -177,7 +177,7 @@ void main() {
...
@@ -177,7 +177,7 @@ void main() {
'FLUTTER_FRAMEWORK_DIR'
:
'engine/path'
,
'FLUTTER_FRAMEWORK_DIR'
:
'engine/path'
,
'COCOAPODS_DISABLE_STATS'
:
'true'
,
'COCOAPODS_DISABLE_STATS'
:
'true'
,
},
},
)).
then
Return
(
new
ProcessResult
(
)).
then
Answer
((
_
)
=>
new
Future
<
ProcessResult
>.
value
(
new
ProcessResult
(
1
,
1
,
1
,
1
,
'''
'''
...
@@ -195,7 +195,7 @@ You have either:
...
@@ -195,7 +195,7 @@ You have either:
Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.'''
,
Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.'''
,
''
,
''
,
));
))
)
;
try
{
try
{
await
cocoaPodsUnderTest
.
processPods
(
await
cocoaPodsUnderTest
.
processPods
(
appIosDirectory:
projectUnderTest
,
appIosDirectory:
projectUnderTest
,
...
@@ -360,7 +360,11 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
...
@@ -360,7 +360,11 @@ Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by
'FLUTTER_FRAMEWORK_DIR'
:
'engine/path'
,
'FLUTTER_FRAMEWORK_DIR'
:
'engine/path'
,
'COCOAPODS_DISABLE_STATS'
:
'true'
,
'COCOAPODS_DISABLE_STATS'
:
'true'
,
},
},
)).
thenReturn
(
new
ProcessResult
(
1
,
1
,
'fails for some reason'
,
''
));
)).
thenAnswer
(
(
_
)
=>
new
Future
<
ProcessResult
>.
value
(
new
ProcessResult
(
1
,
1
,
'fails for some reason'
,
''
)
)
);
try
{
try
{
await
cocoaPodsUnderTest
.
processPods
(
await
cocoaPodsUnderTest
.
processPods
(
...
...
packages/flutter_tools/test/ios/code_signing_test.dart
View file @
81070893
...
@@ -189,7 +189,7 @@ void main() {
...
@@ -189,7 +189,7 @@ void main() {
))
))
));
));
when
(
mockOpenSslProcess
.
stderr
).
thenAnswer
((
Invocation
invocation
)
=>
mockOpenSslStdErr
);
when
(
mockOpenSslProcess
.
stderr
).
thenAnswer
((
Invocation
invocation
)
=>
mockOpenSslStdErr
);
when
(
mockOpenSslProcess
.
exitCode
).
then
Return
(
0
);
when
(
mockOpenSslProcess
.
exitCode
).
then
Answer
((
_
)
=>
new
Future
<
int
>.
value
(
0
)
);
final
String
developmentTeam
=
await
getCodeSigningIdentityDevelopmentTeam
(
iosApp:
app
);
final
String
developmentTeam
=
await
getCodeSigningIdentityDevelopmentTeam
(
iosApp:
app
);
...
@@ -259,7 +259,7 @@ void main() {
...
@@ -259,7 +259,7 @@ void main() {
)),
)),
));
));
when
(
mockOpenSslProcess
.
stderr
).
thenAnswer
((
Invocation
invocation
)
=>
mockOpenSslStdErr
);
when
(
mockOpenSslProcess
.
stderr
).
thenAnswer
((
Invocation
invocation
)
=>
mockOpenSslStdErr
);
when
(
mockOpenSslProcess
.
exitCode
).
then
Return
(
0
);
when
(
mockOpenSslProcess
.
exitCode
).
then
Answer
((
_
)
=>
new
Future
<
int
>.
value
(
0
)
);
final
String
developmentTeam
=
await
getCodeSigningIdentityDevelopmentTeam
(
iosApp:
app
,
usesTerminalUi:
false
);
final
String
developmentTeam
=
await
getCodeSigningIdentityDevelopmentTeam
(
iosApp:
app
,
usesTerminalUi:
false
);
...
@@ -321,7 +321,7 @@ void main() {
...
@@ -321,7 +321,7 @@ void main() {
))
))
));
));
when
(
mockOpenSslProcess
.
stderr
).
thenAnswer
((
Invocation
invocation
)
=>
mockOpenSslStdErr
);
when
(
mockOpenSslProcess
.
stderr
).
thenAnswer
((
Invocation
invocation
)
=>
mockOpenSslStdErr
);
when
(
mockOpenSslProcess
.
exitCode
).
then
Return
(
0
);
when
(
mockOpenSslProcess
.
exitCode
).
then
Answer
((
_
)
=>
new
Future
<
int
>.
value
(
0
)
);
when
<
String
>(
mockConfig
.
getValue
(
'ios-signing-cert'
)).
thenReturn
(
'iPhone Developer: Profile 3 (3333CCCC33)'
);
when
<
String
>(
mockConfig
.
getValue
(
'ios-signing-cert'
)).
thenReturn
(
'iPhone Developer: Profile 3 (3333CCCC33)'
);
final
String
developmentTeam
=
await
getCodeSigningIdentityDevelopmentTeam
(
iosApp:
app
);
final
String
developmentTeam
=
await
getCodeSigningIdentityDevelopmentTeam
(
iosApp:
app
);
...
@@ -390,7 +390,7 @@ void main() {
...
@@ -390,7 +390,7 @@ void main() {
))
))
));
));
when
(
mockOpenSslProcess
.
stderr
).
thenAnswer
((
Invocation
invocation
)
=>
mockOpenSslStdErr
);
when
(
mockOpenSslProcess
.
stderr
).
thenAnswer
((
Invocation
invocation
)
=>
mockOpenSslStdErr
);
when
(
mockOpenSslProcess
.
exitCode
).
then
Return
(
0
);
when
(
mockOpenSslProcess
.
exitCode
).
then
Answer
((
_
)
=>
new
Future
<
int
>.
value
(
0
)
);
when
<
String
>(
mockConfig
.
getValue
(
'ios-signing-cert'
)).
thenReturn
(
'iPhone Developer: Invalid Profile'
);
when
<
String
>(
mockConfig
.
getValue
(
'ios-signing-cert'
)).
thenReturn
(
'iPhone Developer: Invalid Profile'
);
final
String
developmentTeam
=
await
getCodeSigningIdentityDevelopmentTeam
(
iosApp:
app
);
final
String
developmentTeam
=
await
getCodeSigningIdentityDevelopmentTeam
(
iosApp:
app
);
...
...
packages/flutter_tools/test/ios/devices_test.dart
View file @
81070893
...
@@ -59,10 +59,14 @@ void main() {
...
@@ -59,10 +59,14 @@ void main() {
98206e7a4afd4aedaff06e687594e089dede3c44
98206e7a4afd4aedaff06e687594e089dede3c44
f577a7903cc54959be2e34bc4f7f80b7009efcf4
f577a7903cc54959be2e34bc4f7f80b7009efcf4
'''
));
'''
));
when
(
iMobileDevice
.
getInfoForDevice
(
'98206e7a4afd4aedaff06e687594e089dede3c44'
,
'DeviceName'
)).
thenReturn
(
'La tele me regarde'
);
when
(
iMobileDevice
.
getInfoForDevice
(
'98206e7a4afd4aedaff06e687594e089dede3c44'
,
'DeviceName'
))
when
(
iMobileDevice
.
getInfoForDevice
(
'98206e7a4afd4aedaff06e687594e089dede3c44'
,
'ProductVersion'
)).
thenReturn
(
'10.3.2'
);
.
thenAnswer
((
_
)
=>
new
Future
<
String
>.
value
(
'La tele me regarde'
));
when
(
iMobileDevice
.
getInfoForDevice
(
'f577a7903cc54959be2e34bc4f7f80b7009efcf4'
,
'DeviceName'
)).
thenReturn
(
'Puits sans fond'
);
when
(
iMobileDevice
.
getInfoForDevice
(
'98206e7a4afd4aedaff06e687594e089dede3c44'
,
'ProductVersion'
))
when
(
iMobileDevice
.
getInfoForDevice
(
'f577a7903cc54959be2e34bc4f7f80b7009efcf4'
,
'ProductVersion'
)).
thenReturn
(
'11.0'
);
.
thenAnswer
((
_
)
=>
new
Future
<
String
>.
value
(
'10.3.2'
));
when
(
iMobileDevice
.
getInfoForDevice
(
'f577a7903cc54959be2e34bc4f7f80b7009efcf4'
,
'DeviceName'
))
.
thenAnswer
((
_
)
=>
new
Future
<
String
>.
value
(
'Puits sans fond'
));
when
(
iMobileDevice
.
getInfoForDevice
(
'f577a7903cc54959be2e34bc4f7f80b7009efcf4'
,
'ProductVersion'
))
.
thenAnswer
((
_
)
=>
new
Future
<
String
>.
value
(
'11.0'
));
final
List
<
IOSDevice
>
devices
=
await
IOSDevice
.
getAttachedDevices
();
final
List
<
IOSDevice
>
devices
=
await
IOSDevice
.
getAttachedDevices
();
expect
(
devices
,
hasLength
(
2
));
expect
(
devices
,
hasLength
(
2
));
expect
(
devices
[
0
].
id
,
'98206e7a4afd4aedaff06e687594e089dede3c44'
);
expect
(
devices
[
0
].
id
,
'98206e7a4afd4aedaff06e687594e089dede3c44'
);
...
...
packages/flutter_tools/test/ios/ios_workflow_test.dart
View file @
81070893
...
@@ -33,8 +33,10 @@ void main() {
...
@@ -33,8 +33,10 @@ void main() {
cocoaPods
=
new
MockCocoaPods
();
cocoaPods
=
new
MockCocoaPods
();
fs
=
new
MemoryFileSystem
();
fs
=
new
MemoryFileSystem
();
when
(
cocoaPods
.
isCocoaPodsInstalledAndMeetsVersionCheck
).
thenReturn
(
true
);
when
(
cocoaPods
.
isCocoaPodsInstalledAndMeetsVersionCheck
)
when
(
cocoaPods
.
isCocoaPodsInitialized
).
thenReturn
(
true
);
.
thenAnswer
((
_
)
=>
new
Future
<
bool
>.
value
(
true
));
when
(
cocoaPods
.
isCocoaPodsInitialized
)
.
thenAnswer
((
_
)
=>
new
Future
<
bool
>.
value
(
true
));
});
});
testUsingContext
(
'Emit missing status when nothing is installed'
,
()
async
{
testUsingContext
(
'Emit missing status when nothing is installed'
,
()
async
{
...
@@ -227,8 +229,9 @@ void main() {
...
@@ -227,8 +229,9 @@ void main() {
.
thenReturn
(
'Xcode 8.2.1
\n
Build version 8C1002
\n
'
);
.
thenReturn
(
'Xcode 8.2.1
\n
Build version 8C1002
\n
'
);
when
(
xcode
.
isInstalledAndMeetsVersionCheck
).
thenReturn
(
true
);
when
(
xcode
.
isInstalledAndMeetsVersionCheck
).
thenReturn
(
true
);
when
(
xcode
.
eulaSigned
).
thenReturn
(
true
);
when
(
xcode
.
eulaSigned
).
thenReturn
(
true
);
when
(
cocoaPods
.
isCocoaPodsInstalledAndMeetsVersionCheck
).
thenReturn
(
false
);
when
(
cocoaPods
.
isCocoaPodsInstalledAndMeetsVersionCheck
)
when
(
cocoaPods
.
hasCocoaPods
).
thenReturn
(
false
);
.
thenAnswer
((
_
)
=>
new
Future
<
bool
>.
value
(
false
));
when
(
cocoaPods
.
hasCocoaPods
).
thenAnswer
((
_
)
=>
new
Future
<
bool
>.
value
(
false
));
when
(
xcode
.
isSimctlInstalled
).
thenReturn
(
true
);
when
(
xcode
.
isSimctlInstalled
).
thenReturn
(
true
);
final
IOSWorkflowTestTarget
workflow
=
new
IOSWorkflowTestTarget
();
final
IOSWorkflowTestTarget
workflow
=
new
IOSWorkflowTestTarget
();
final
ValidationResult
result
=
await
workflow
.
validate
();
final
ValidationResult
result
=
await
workflow
.
validate
();
...
@@ -245,9 +248,11 @@ void main() {
...
@@ -245,9 +248,11 @@ void main() {
.
thenReturn
(
'Xcode 8.2.1
\n
Build version 8C1002
\n
'
);
.
thenReturn
(
'Xcode 8.2.1
\n
Build version 8C1002
\n
'
);
when
(
xcode
.
isInstalledAndMeetsVersionCheck
).
thenReturn
(
true
);
when
(
xcode
.
isInstalledAndMeetsVersionCheck
).
thenReturn
(
true
);
when
(
xcode
.
eulaSigned
).
thenReturn
(
true
);
when
(
xcode
.
eulaSigned
).
thenReturn
(
true
);
when
(
cocoaPods
.
isCocoaPodsInstalledAndMeetsVersionCheck
).
thenReturn
(
false
);
when
(
cocoaPods
.
isCocoaPodsInstalledAndMeetsVersionCheck
)
when
(
cocoaPods
.
hasCocoaPods
).
thenReturn
(
true
);
.
thenAnswer
((
_
)
=>
new
Future
<
bool
>.
value
(
false
));
when
(
cocoaPods
.
cocoaPodsVersionText
).
thenReturn
(
'0.39.0'
);
when
(
cocoaPods
.
hasCocoaPods
).
thenAnswer
((
_
)
=>
new
Future
<
bool
>.
value
(
true
));
when
(
cocoaPods
.
cocoaPodsVersionText
)
.
thenAnswer
((
_
)
=>
new
Future
<
String
>.
value
(
'0.39.0'
));
when
(
xcode
.
isSimctlInstalled
).
thenReturn
(
true
);
when
(
xcode
.
isSimctlInstalled
).
thenReturn
(
true
);
final
IOSWorkflowTestTarget
workflow
=
new
IOSWorkflowTestTarget
();
final
IOSWorkflowTestTarget
workflow
=
new
IOSWorkflowTestTarget
();
final
ValidationResult
result
=
await
workflow
.
validate
();
final
ValidationResult
result
=
await
workflow
.
validate
();
...
...
packages/flutter_tools/test/ios/mac_test.dart
View file @
81070893
...
@@ -41,7 +41,7 @@ void main() {
...
@@ -41,7 +41,7 @@ void main() {
testUsingContext
(
'getAvailableDeviceIDs throws ToolExit when idevice_id returns non-zero'
,
()
async
{
testUsingContext
(
'getAvailableDeviceIDs throws ToolExit when idevice_id returns non-zero'
,
()
async
{
when
(
mockProcessManager
.
run
(<
String
>[
'idevice_id'
,
'-l'
]))
when
(
mockProcessManager
.
run
(<
String
>[
'idevice_id'
,
'-l'
]))
.
then
Return
(
new
ProcessResult
(
1
,
1
,
''
,
'Sad today'
));
.
then
Answer
((
_
)
=>
new
Future
<
ProcessResult
>.
value
(
new
ProcessResult
(
1
,
1
,
''
,
'Sad today'
)
));
expect
(()
async
=>
await
iMobileDevice
.
getAvailableDeviceIDs
(),
throwsToolExit
());
expect
(()
async
=>
await
iMobileDevice
.
getAvailableDeviceIDs
(),
throwsToolExit
());
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
ProcessManager:
()
=>
mockProcessManager
,
ProcessManager:
()
=>
mockProcessManager
,
...
@@ -49,7 +49,7 @@ void main() {
...
@@ -49,7 +49,7 @@ void main() {
testUsingContext
(
'getAvailableDeviceIDs returns idevice_id output when installed'
,
()
async
{
testUsingContext
(
'getAvailableDeviceIDs returns idevice_id output when installed'
,
()
async
{
when
(
mockProcessManager
.
run
(<
String
>[
'idevice_id'
,
'-l'
]))
when
(
mockProcessManager
.
run
(<
String
>[
'idevice_id'
,
'-l'
]))
.
then
Return
(
new
ProcessResult
(
1
,
0
,
'foo'
,
''
));
.
then
Answer
((
_
)
=>
new
Future
<
ProcessResult
>.
value
(
new
ProcessResult
(
1
,
0
,
'foo'
,
''
)
));
expect
(
await
iMobileDevice
.
getAvailableDeviceIDs
(),
'foo'
);
expect
(
await
iMobileDevice
.
getAvailableDeviceIDs
(),
'foo'
);
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
ProcessManager:
()
=>
mockProcessManager
,
ProcessManager:
()
=>
mockProcessManager
,
...
@@ -72,7 +72,7 @@ void main() {
...
@@ -72,7 +72,7 @@ void main() {
when
(
mockProcessManager
.
run
(<
String
>[
'idevicescreenshot'
,
outputPath
],
when
(
mockProcessManager
.
run
(<
String
>[
'idevicescreenshot'
,
outputPath
],
environment:
null
,
environment:
null
,
workingDirectory:
null
workingDirectory:
null
)).
then
Return
(
new
ProcessResult
(
4
,
1
,
''
,
''
));
)).
then
Answer
((
_
)
=>
new
Future
<
ProcessResult
>.
value
(
new
ProcessResult
(
4
,
1
,
''
,
''
)
));
expect
(()
async
=>
await
iMobileDevice
.
takeScreenshot
(
mockOutputFile
),
throwsA
(
anything
));
expect
(()
async
=>
await
iMobileDevice
.
takeScreenshot
(
mockOutputFile
),
throwsA
(
anything
));
},
overrides:
<
Type
,
Generator
>{
},
overrides:
<
Type
,
Generator
>{
...
...
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