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
3bd4c69f
Unverified
Commit
3bd4c69f
authored
Jan 28, 2020
by
Jonah Williams
Committed by
GitHub
Jan 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Sanitize host before calling pm (#49591)" (#49623)
This reverts commit
c592b546
.
parent
c592b546
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
99 deletions
+6
-99
fuchsia_device.dart
packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart
+6
-2
fuchsia_pm.dart
packages/flutter_tools/lib/src/fuchsia/fuchsia_pm.dart
+0
-4
fuchsia_utils.dart
packages/flutter_tools/lib/src/fuchsia/fuchsia_utils.dart
+0
-13
fuchsia_pm_test.dart
...ter_tools/test/general.shard/fuchsia/fuchsia_pm_test.dart
+0
-80
No files found.
packages/flutter_tools/lib/src/fuchsia/fuchsia_device.dart
View file @
3bd4c69f
...
...
@@ -27,7 +27,6 @@ import 'application_package.dart';
import
'fuchsia_build.dart'
;
import
'fuchsia_pm.dart'
;
import
'fuchsia_sdk.dart'
;
import
'fuchsia_utils.dart'
;
import
'fuchsia_workflow.dart'
;
import
'tiles_ctl.dart'
;
...
...
@@ -514,7 +513,12 @@ class FuchsiaDevice extends Device {
void
clearLogs
()
{}
bool
get
ipv6
{
return
isIPv6Address
(
id
);
try
{
Uri
.
parseIPv6Address
(
id
);
return
true
;
}
on
FormatException
{
return
false
;
}
}
/// List the ports currently running a dart observatory.
...
...
packages/flutter_tools/lib/src/fuchsia/fuchsia_pm.dart
View file @
3bd4c69f
...
...
@@ -10,7 +10,6 @@ import '../convert.dart';
import
'../globals.dart'
as
globals
;
import
'fuchsia_sdk.dart'
;
import
'fuchsia_utils.dart'
;
/// This is a basic wrapper class for the Fuchsia SDK's `pm` tool.
class
FuchsiaPM
{
...
...
@@ -110,9 +109,6 @@ class FuchsiaPM {
if
(
fuchsiaArtifacts
.
pm
==
null
)
{
throwToolExit
(
'Fuchsia pm tool not found'
);
}
if
(
isIPv6Address
(
host
.
split
(
'%'
).
first
))
{
host
=
'[
${host.replaceAll('%', '%25')}
]'
;
}
final
List
<
String
>
command
=
<
String
>[
fuchsiaArtifacts
.
pm
.
path
,
'serve'
,
...
...
packages/flutter_tools/lib/src/fuchsia/fuchsia_utils.dart
deleted
100644 → 0
View file @
c592b546
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/// Returns [true] if [address] is an IPv6 address.
bool
isIPv6Address
(
String
address
)
{
try
{
Uri
.
parseIPv6Address
(
address
);
return
true
;
}
on
FormatException
{
return
false
;
}
}
packages/flutter_tools/test/general.shard/fuchsia/fuchsia_pm_test.dart
deleted
100644 → 0
View file @
c592b546
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:async'
;
import
'package:flutter_tools/src/base/context.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/io.dart'
;
import
'package:flutter_tools/src/base/process.dart'
;
import
'package:flutter_tools/src/fuchsia/fuchsia_pm.dart'
;
import
'package:flutter_tools/src/fuchsia/fuchsia_sdk.dart'
;
import
'package:mockito/mockito.dart'
;
import
'../../src/common.dart'
;
import
'../../src/context.dart'
;
import
'../../src/mocks.dart'
;
void
main
(
)
{
group
(
'FuchsiaPM'
,
()
{
MockFile
pm
;
MockProcessUtils
mockProcessUtils
;
MockFuchsiaArtifacts
mockFuchsiaArtifacts
;
setUp
(()
{
pm
=
MockFile
();
when
(
pm
.
path
).
thenReturn
(
'pm'
);
mockFuchsiaArtifacts
=
MockFuchsiaArtifacts
();
when
(
mockFuchsiaArtifacts
.
pm
).
thenReturn
(
pm
);
mockProcessUtils
=
MockProcessUtils
();
});
testUsingContext
(
'serve - IPv4 address'
,
()
async
{
when
(
mockProcessUtils
.
start
(
any
)).
thenAnswer
((
_
)
{
return
Future
<
Process
>.
value
(
createMockProcess
());
});
await
FuchsiaPM
().
serve
(
'<repo>'
,
'127.0.0.1'
,
43819
);
verify
(
mockProcessUtils
.
start
(<
String
>[
'pm'
,
'serve'
,
'-repo'
,
'<repo>'
,
'-l'
,
'127.0.0.1:43819'
,
])).
called
(
1
);
},
overrides:
<
Type
,
Generator
>{
FuchsiaArtifacts:
()
=>
mockFuchsiaArtifacts
,
ProcessUtils:
()
=>
mockProcessUtils
,
});
testUsingContext
(
'serve - IPv6 address'
,
()
async
{
when
(
mockProcessUtils
.
start
(
any
)).
thenAnswer
((
_
)
{
return
Future
<
Process
>.
value
(
createMockProcess
());
});
await
FuchsiaPM
().
serve
(
'<repo>'
,
'fe80::ec4:7aff:fecc:ea8f%eno2'
,
43819
);
verify
(
mockProcessUtils
.
start
(<
String
>[
'pm'
,
'serve'
,
'-repo'
,
'<repo>'
,
'-l'
,
'[fe80::ec4:7aff:fecc:ea8f%25eno2]:43819'
,
])).
called
(
1
);
},
overrides:
<
Type
,
Generator
>{
FuchsiaArtifacts:
()
=>
mockFuchsiaArtifacts
,
ProcessUtils:
()
=>
mockProcessUtils
,
});
});
}
class
MockFuchsiaArtifacts
extends
Mock
implements
FuchsiaArtifacts
{}
class
MockProcessUtils
extends
Mock
implements
ProcessUtils
{}
class
MockFile
extends
Mock
implements
File
{}
class
MockProcess
extends
Mock
implements
Process
{}
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