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
0a66d8a7
Unverified
Commit
0a66d8a7
authored
Nov 22, 2019
by
Alexandre Ardhuin
Committed by
GitHub
Nov 22, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implicit-casts:false in fuchsia_remote_debug_protocol (#45239)
parent
e2cf2f0f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
19 deletions
+31
-19
analysis_options.yaml
packages/fuchsia_remote_debug_protocol/analysis_options.yaml
+12
-0
dart_vm.dart
...s/fuchsia_remote_debug_protocol/lib/src/dart/dart_vm.dart
+8
-8
ssh_command_runner.dart
...te_debug_protocol/lib/src/runners/ssh_command_runner.dart
+1
-1
ssh_command_runner_test.dart
...ug_protocol/test/src/runners/ssh_command_runner_test.dart
+10
-10
No files found.
packages/fuchsia_remote_debug_protocol/analysis_options.yaml
0 → 100644
View file @
0a66d8a7
# Override the parent analysis_options until all the repo has implicit-casts: false
include
:
../analysis_options.yaml
analyzer
:
strong-mode
:
implicit-casts
:
false
implicit-dynamic
:
false
linter
:
rules
:
avoid_as
:
false
packages/fuchsia_remote_debug_protocol/lib/src/dart/dart_vm.dart
View file @
0a66d8a7
...
...
@@ -171,7 +171,7 @@ class DartVm {
await
invokeRpc
(
'getVM'
,
timeout:
timeout
);
final
List
<
IsolateRef
>
result
=
<
IsolateRef
>[];
for
(
Map
<
String
,
dynamic
>
jsonIsolate
in
jsonVmRef
[
'isolates'
])
{
final
String
name
=
jsonIsolate
[
'name'
];
final
String
name
=
jsonIsolate
[
'name'
]
as
String
;
if
(
pattern
.
matchAsPrefix
(
name
)
!=
null
)
{
_log
.
fine
(
'Found Isolate matching "
$pattern
": "
$name
"'
);
result
.
add
(
IsolateRef
.
_fromJson
(
jsonIsolate
,
this
));
...
...
@@ -197,7 +197,7 @@ class DartVm {
'Peer connection timed out during RPC call'
,
timeout
,
);
});
})
as
Map
<
String
,
dynamic
>
;
return
result
;
}
...
...
@@ -243,11 +243,11 @@ class FlutterView {
/// All other cases return a [FlutterView] instance. The name of the
/// view may be null, but the id will always be set.
factory
FlutterView
.
_fromJson
(
Map
<
String
,
dynamic
>
json
)
{
final
Map
<
String
,
dynamic
>
isolate
=
json
[
'isolate'
];
final
String
id
=
json
[
'id'
];
final
Map
<
String
,
dynamic
>
isolate
=
json
[
'isolate'
]
as
Map
<
String
,
dynamic
>
;
final
String
id
=
json
[
'id'
]
as
String
;
String
name
;
if
(
isolate
!=
null
)
{
name
=
isolate
[
'name'
];
name
=
isolate
[
'name'
]
as
String
;
if
(
name
==
null
)
{
throw
RpcFormatError
(
'Unable to find name for isolate "
$isolate
"'
);
}
...
...
@@ -286,9 +286,9 @@ class IsolateRef {
IsolateRef
.
_
(
this
.
name
,
this
.
number
,
this
.
dartVm
);
factory
IsolateRef
.
_fromJson
(
Map
<
String
,
dynamic
>
json
,
DartVm
dartVm
)
{
final
String
number
=
json
[
'number'
];
final
String
name
=
json
[
'name'
];
final
String
type
=
json
[
'type'
];
final
String
number
=
json
[
'number'
]
as
String
;
final
String
name
=
json
[
'name'
]
as
String
;
final
String
type
=
json
[
'type'
]
as
String
;
if
(
type
==
null
)
{
throw
RpcFormatError
(
'Unable to find type within JSON "
$json
"'
);
}
...
...
packages/fuchsia_remote_debug_protocol/lib/src/runners/ssh_command_runner.dart
View file @
0a66d8a7
...
...
@@ -99,6 +99,6 @@ class SshCommandRunner {
'Command failed:
$command
\n
stdout:
${result.stdout}
\n
stderr:
${result.stderr}
'
);
}
_log
.
fine
(
'SSH command stdout in brackets:[
${result.stdout}
]'
);
return
result
.
stdout
.
split
(
'
\n
'
);
return
(
result
.
stdout
as
String
)
.
split
(
'
\n
'
);
}
}
packages/fuchsia_remote_debug_protocol/test/src/runners/ssh_command_runner_test.dart
View file @
0a66d8a7
...
...
@@ -53,11 +53,11 @@ void main() {
interface: interface,
sshConfigPath: '
/
whatever
',
);
when<
String
>(mockProcessResult.stdout).thenReturn('
somestuff
');
when<
dynamic
>(mockProcessResult.stdout).thenReturn('
somestuff
');
when(mockProcessResult.exitCode).thenReturn(0);
await runner.run('
ls
/
whatever
');
final List<String> passedCommand =
verify(mockProcessManager.run(captureAny)).captured.single;
verify(mockProcessManager.run(captureAny)).captured.single
as List<String>
;
expect(passedCommand, contains('
$ipV6Addr
%
$interface
'));
});
...
...
@@ -67,11 +67,11 @@ void main() {
mockProcessManager
,
address:
ipV6Addr
,
);
when
<
String
>(
mockProcessResult
.
stdout
).
thenReturn
(
'somestuff'
);
when
<
dynamic
>(
mockProcessResult
.
stdout
).
thenReturn
(
'somestuff'
);
when
(
mockProcessResult
.
exitCode
).
thenReturn
(
0
);
await
runner
.
run
(
'ls /whatever'
);
final
List
<
String
>
passedCommand
=
verify
(
mockProcessManager
.
run
(
captureAny
)).
captured
.
single
;
verify
(
mockProcessManager
.
run
(
captureAny
)).
captured
.
single
as
List
<
String
>
;
expect
(
passedCommand
,
contains
(
ipV6Addr
));
});
...
...
@@ -79,7 +79,7 @@ void main() {
const
String
addr
=
'192.168.1.1'
;
runner
=
SshCommandRunner
.
withProcessManager
(
mockProcessManager
,
address:
addr
);
when
<
String
>(
mockProcessResult
.
stdout
).
thenReturn
(
'''this
when
<
dynamic
>(
mockProcessResult
.
stdout
).
thenReturn
(
'''this
has
four
lines'''
);
...
...
@@ -92,7 +92,7 @@ void main() {
const
String
addr
=
'192.168.1.1'
;
runner
=
SshCommandRunner
.
withProcessManager
(
mockProcessManager
,
address:
addr
);
when
<
String
>(
mockProcessResult
.
stdout
).
thenReturn
(
'whatever'
);
when
<
dynamic
>(
mockProcessResult
.
stdout
).
thenReturn
(
'whatever'
);
when
(
mockProcessResult
.
exitCode
).
thenReturn
(
1
);
Future
<
void
>
failingFunction
()
async
{
await
runner
.
run
(
'oihaw'
);
...
...
@@ -109,11 +109,11 @@ void main() {
address:
addr
,
sshConfigPath:
config
,
);
when
<
String
>(
mockProcessResult
.
stdout
).
thenReturn
(
'somestuff'
);
when
<
dynamic
>(
mockProcessResult
.
stdout
).
thenReturn
(
'somestuff'
);
when
(
mockProcessResult
.
exitCode
).
thenReturn
(
0
);
await
runner
.
run
(
'ls /whatever'
);
final
List
<
String
>
passedCommand
=
verify
(
mockProcessManager
.
run
(
captureAny
)).
captured
.
single
;
verify
(
mockProcessManager
.
run
(
captureAny
)).
captured
.
single
as
List
<
String
>
;
expect
(
passedCommand
,
contains
(
'-F'
));
final
int
indexOfFlag
=
passedCommand
.
indexOf
(
'-F'
);
final
String
passedConfig
=
passedCommand
[
indexOfFlag
+
1
];
...
...
@@ -126,11 +126,11 @@ void main() {
mockProcessManager
,
address:
addr
,
);
when
<
String
>(
mockProcessResult
.
stdout
).
thenReturn
(
'somestuff'
);
when
<
dynamic
>(
mockProcessResult
.
stdout
).
thenReturn
(
'somestuff'
);
when
(
mockProcessResult
.
exitCode
).
thenReturn
(
0
);
await
runner
.
run
(
'ls /whatever'
);
final
List
<
String
>
passedCommand
=
verify
(
mockProcessManager
.
run
(
captureAny
)).
captured
.
single
;
verify
(
mockProcessManager
.
run
(
captureAny
)).
captured
.
single
as
List
<
String
>
;
final
int
indexOfFlag
=
passedCommand
.
indexOf
(
'-F'
);
expect
(
indexOfFlag
,
equals
(-
1
));
});
...
...
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