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
bfda885a
Commit
bfda885a
authored
Aug 16, 2017
by
xster
Committed by
GitHub
Aug 16, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a typo in the saved certificate error message (#11640)
parent
70fe6f4c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
1 deletion
+69
-1
code_signing.dart
packages/flutter_tools/lib/src/ios/code_signing.dart
+1
-1
code_signing_test.dart
packages/flutter_tools/test/ios/code_signing_test.dart
+68
-0
No files found.
packages/flutter_tools/lib/src/ios/code_signing.dart
View file @
bfda885a
...
...
@@ -203,7 +203,7 @@ Future<String> _chooseSigningIdentity(List<String> validCodeSigningIdentities, b
throwToolExit
(
'Aborted. Code signing is required to build a deployable iOS app.'
);
}
else
{
final
String
selectedCert
=
validCodeSigningIdentities
[
int
.
parse
(
choice
)
-
1
];
printStatus
(
'Certificate choice "
$s
avedCertChoice
" saved'
);
printStatus
(
'Certificate choice "
$s
electedCert
" saved'
);
config
.
setValue
(
'ios-signing-cert'
,
selectedCert
);
return
selectedCert
;
}
...
...
packages/flutter_tools/test/ios/code_signing_test.dart
View file @
bfda885a
...
...
@@ -338,6 +338,74 @@ void main() {
ProcessManager:
()
=>
mockProcessManager
,
Config:
()
=>
mockConfig
,
});
testUsingContext
(
'Test invalid saved certificate shows error and prompts again'
,
()
async
{
when
(
mockProcessManager
.
runSync
(<
String
>[
'which'
,
'security'
]))
.
thenReturn
(
exitsHappy
);
when
(
mockProcessManager
.
runSync
(<
String
>[
'which'
,
'openssl'
]))
.
thenReturn
(
exitsHappy
);
when
(
mockProcessManager
.
runSync
(
argThat
(
contains
(
'find-identity'
)),
environment:
any
,
workingDirectory:
any
,
)).
thenReturn
(
new
ProcessResult
(
1
,
// pid
0
,
// exitCode
'''
1) 86f7e437faa5a7fce15d1ddcb9eaeaea377667b8 "iPhone Developer: Profile 1 (1111AAAA11)"
2) da4b9237bacccdf19c0760cab7aec4a8359010b0 "iPhone Developer: Profile 2 (2222BBBB22)"
3) 5bf1fd927dfb8679496a2e6cf00cbe50c1c87145 "iPhone Developer: Profile 3 (3333CCCC33)"
3 valid identities found'''
,
''
));
mockTerminalStdInStream
=
new
Stream
<
String
>.
fromFuture
(
new
Future
<
String
>.
value
(
'3'
));
when
(
mockProcessManager
.
runSync
(
<
String
>[
'security'
,
'find-certificate'
,
'-c'
,
'3333CCCC33'
,
'-p'
],
environment:
any
,
workingDirectory:
any
,
)).
thenReturn
(
new
ProcessResult
(
1
,
// pid
0
,
// exitCode
'This is a mock certificate'
,
''
,
));
final
MockProcess
mockOpenSslProcess
=
new
MockProcess
();
final
MockStdIn
mockOpenSslStdIn
=
new
MockStdIn
();
final
MockStream
mockOpenSslStdErr
=
new
MockStream
();
when
(
mockProcessManager
.
start
(
argThat
(
contains
(
'openssl'
)),
environment:
any
,
workingDirectory:
any
,
)).
thenReturn
(
new
Future
<
Process
>.
value
(
mockOpenSslProcess
));
when
(
mockOpenSslProcess
.
stdin
).
thenReturn
(
mockOpenSslStdIn
);
when
(
mockOpenSslProcess
.
stdout
).
thenReturn
(
new
Stream
<
List
<
int
>>.
fromFuture
(
new
Future
<
List
<
int
>>.
value
(
UTF8
.
encode
(
'subject= /CN=iPhone Developer: Profile 3 (3333CCCC33)/OU=4444DDDD44/O=My Team/C=US'
))
));
when
(
mockOpenSslProcess
.
stderr
).
thenReturn
(
mockOpenSslStdErr
);
when
(
mockOpenSslProcess
.
exitCode
).
thenReturn
(
0
);
when
(
mockConfig
.
getValue
(
'ios-signing-cert'
)).
thenReturn
(
'iPhone Developer: Invalid Profile'
);
final
String
developmentTeam
=
await
getCodeSigningIdentityDevelopmentTeam
(
iosApp:
app
);
expect
(
testLogger
.
errorText
,
contains
(
'Saved signing certificate "iPhone Developer: Invalid Profile" is not a valid development certificate'
)
);
expect
(
testLogger
.
statusText
,
contains
(
'Certificate choice "iPhone Developer: Profile 3 (3333CCCC33)"'
)
);
expect
(
developmentTeam
,
'4444DDDD44'
);
verify
(
config
.
setValue
(
'ios-signing-cert'
,
'iPhone Developer: Profile 3 (3333CCCC33)'
));
},
overrides:
<
Type
,
Generator
>{
ProcessManager:
()
=>
mockProcessManager
,
Config:
()
=>
mockConfig
,
AnsiTerminal:
()
=>
testTerminal
,
});
});
}
...
...
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