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
8c253280
Unverified
Commit
8c253280
authored
Dec 02, 2019
by
Emmanuel Garcia
Committed by
GitHub
Dec 02, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle case where lastLogcatTimestamp is null (#45937)
parent
c59151b1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
android_device.dart
packages/flutter_tools/lib/src/android/android_device.dart
+7
-1
android_device_test.dart
...tools/test/general.shard/android/android_device_test.dart
+18
-0
No files found.
packages/flutter_tools/lib/src/android/android_device.dart
View file @
8c253280
...
...
@@ -1009,7 +1009,13 @@ class _AdbLogReader extends DeviceLogReader {
void
_start
()
{
final
String
lastTimestamp
=
device
.
lastLogcatTimestamp
;
// Start the adb logcat process and filter the most recent logs since `lastTimestamp`.
final
List
<
String
>
args
=
<
String
>[
'logcat'
,
'-v'
,
'time'
,
'-T'
,
lastTimestamp
];
final
List
<
String
>
args
=
<
String
>[
'logcat'
,
'-v'
,
'time'
,
'-T'
,
lastTimestamp
??
''
,
// Empty `-T` means the timestamp of the logcat command invocation.
];
processUtils
.
start
(
device
.
adbCommandForDevice
(
args
)).
then
<
void
>((
Process
process
)
{
_process
=
process
;
// We expect logcat streams to occasionally contain invalid utf-8,
...
...
packages/flutter_tools/test/general.shard/android/android_device_test.dart
View file @
8c253280
...
...
@@ -707,6 +707,24 @@ flutter:
AndroidSdk:
()
=>
mockAndroidSdk
,
ProcessManager:
()
=>
mockProcessManager
,
});
testUsingContext
(
'calls adb logcat with expected flags when the device logs are empty'
,
()
async
{
when
(
mockAndroidSdk
.
adbPath
).
thenReturn
(
'adb'
);
when
(
mockProcessManager
.
runSync
(<
String
>[
'adb'
,
'-s'
,
'1234'
,
'shell'
,
'-x'
,
'logcat'
,
'-v'
,
'time'
,
'-t'
,
'1'
]))
.
thenReturn
(
ProcessResult
(
0
,
0
,
''
,
''
));
when
(
mockProcessManager
.
start
(
argThat
(
contains
(
'logcat'
))))
.
thenAnswer
((
_
)
=>
Future
<
Process
>.
value
(
createMockProcess
()));
final
AndroidDevice
device
=
AndroidDevice
(
'1234'
);
final
DeviceLogReader
logReader
=
device
.
getLogReader
();
logReader
.
logLines
.
listen
((
_
)
{});
verify
(
mockProcessManager
.
start
(
const
<
String
>[
'adb'
,
'-s'
,
'1234'
,
'logcat'
,
'-v'
,
'time'
,
'-T'
,
''
]))
.
called
(
1
);
},
overrides:
<
Type
,
Generator
>{
AndroidSdk:
()
=>
mockAndroidSdk
,
ProcessManager:
()
=>
mockProcessManager
,
});
});
test
(
'Can parse adb shell dumpsys info'
,
()
{
...
...
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