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
5907a726
Commit
5907a726
authored
Sep 05, 2018
by
Matteo Crippa
Committed by
Todd Volkert
Sep 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix/ios run simulator (#20262)
parent
6e64cb0a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
5 deletions
+28
-5
protocol_discovery.dart
packages/flutter_tools/lib/src/protocol_discovery.dart
+1
-1
protocol_discovery_test.dart
packages/flutter_tools/test/protocol_discovery_test.dart
+27
-4
No files found.
packages/flutter_tools/lib/src/protocol_discovery.dart
View file @
5907a726
...
...
@@ -60,7 +60,7 @@ class ProtocolDiscovery {
void
_handleLine
(
String
line
)
{
Uri
uri
;
final
RegExp
r
=
new
RegExp
(
'
${RegExp.escape(serviceName)}
listening on (
http://[^
\n
]+)'
);
final
RegExp
r
=
new
RegExp
(
'
${RegExp.escape(serviceName)}
listening on (
(http|
\
/
\
/)[a-zA-Z0-9:/=
\
.
\\
[
\\
]
]+)'
);
final
Match
match
=
r
.
firstMatch
(
line
);
if
(
match
!=
null
)
{
...
...
packages/flutter_tools/test/protocol_discovery_test.dart
View file @
5907a726
...
...
@@ -67,9 +67,9 @@ void main() {
expect
(
'
$uri
'
,
'http://127.0.0.1:3333'
);
});
testUsingContext
(
'discovers uri
even if logs has ESC Ascii
'
,
()
async
{
testUsingContext
(
'discovers uri
with Ascii Esc code
'
,
()
async
{
initialize
();
logReader
.
addLine
(
'Observatory listening on http://127.0.0.1:3333
\
x1b['
);
logReader
.
addLine
(
'Observatory listening on http://127.0.0.1:3333
\
x1b['
);
final
Uri
uri
=
await
discoverer
.
uri
;
expect
(
uri
.
port
,
3333
);
expect
(
'
$uri
'
,
'http://127.0.0.1:3333'
);
...
...
@@ -89,7 +89,9 @@ void main() {
logReader
.
addLine
(
'Observatory not listening...'
);
final
Uri
timeoutUri
=
Uri
.
parse
(
'http://timeout'
);
final
Uri
actualUri
=
await
uriFuture
.
timeout
(
const
Duration
(
milliseconds:
100
),
onTimeout:
()
=>
timeoutUri
);
const
Duration
(
milliseconds:
100
),
onTimeout:
()
=>
timeoutUri
,
);
expect
(
actualUri
,
timeoutUri
);
});
...
...
@@ -196,6 +198,26 @@ void main() {
await
discoverer
.
cancel
();
logReader
.
dispose
();
});
testUsingContext
(
'ipv6 with Ascii Escape code'
,
()
async
{
final
MockDeviceLogReader
logReader
=
new
MockDeviceLogReader
();
final
ProtocolDiscovery
discoverer
=
new
ProtocolDiscovery
.
observatory
(
logReader
,
portForwarder:
new
MockPortForwarder
(
99
),
hostPort:
54777
,
ipv6:
true
,
);
// Get next port future.
final
Future
<
Uri
>
nextUri
=
discoverer
.
uri
;
logReader
.
addLine
(
'I/flutter : Observatory listening on http://[::1]:54777/PTwjm8Ii8qg=/
\
x1b['
);
final
Uri
uri
=
await
nextUri
;
expect
(
uri
.
port
,
54777
);
expect
(
'
$uri
'
,
'http://[::1]:54777/PTwjm8Ii8qg=/'
);
discoverer
.
cancel
();
logReader
.
dispose
();
});
});
});
}
...
...
@@ -207,8 +229,9 @@ class MockPortForwarder extends DevicePortForwarder {
@override
Future
<
int
>
forward
(
int
devicePort
,
{
int
hostPort
})
async
{
hostPort
??=
0
;
if
(
hostPort
==
0
)
if
(
hostPort
==
0
)
{
return
availablePort
;
}
return
hostPort
;
}
...
...
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