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
c82fc132
Unverified
Commit
c82fc132
authored
May 01, 2019
by
Jonah Williams
Committed by
GitHub
May 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add stderr to log processor for desktop (#31874)
parent
b5e206e5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
12 deletions
+18
-12
desktop.dart
packages/flutter_tools/lib/src/desktop.dart
+9
-5
macos_device_test.dart
packages/flutter_tools/test/macos/macos_device_test.dart
+9
-7
No files found.
packages/flutter_tools/lib/src/desktop.dart
View file @
c82fc132
...
...
@@ -53,17 +53,21 @@ Future<bool> killProcess(String executable) async {
}
class
DesktopLogReader
extends
DeviceLogReader
{
final
StreamController
<
String
>
_inputController
=
StreamController
<
String
>.
broadcast
();
final
StreamController
<
List
<
int
>>
_inputController
=
StreamController
<
List
<
int
>
>.
broadcast
();
void
initializeProcess
(
Process
process
)
{
_inputController
.
addStream
(
process
.
stdout
.
transform
(
utf8
.
decoder
)
.
transform
(
const
LineSplitter
()));
process
.
stdout
.
listen
(
_inputController
.
add
);
process
.
stderr
.
listen
(
_inputController
.
add
);
process
.
exitCode
.
then
((
int
result
)
{
_inputController
.
close
();
});
}
@override
Stream
<
String
>
get
logLines
{
return
_inputController
.
stream
;
return
_inputController
.
stream
.
transform
(
utf8
.
decoder
)
.
transform
(
const
LineSplitter
());
}
@override
...
...
packages/flutter_tools/test/macos/macos_device_test.dart
View file @
c82fc132
...
...
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:async'
;
import
'dart:convert'
;
import
'package:file/memory.dart'
;
...
...
@@ -20,6 +21,7 @@ import 'package:flutter_tools/src/macos/macos_device.dart';
import
'../src/common.dart'
;
import
'../src/context.dart'
;
import
'../src/mocks.dart'
;
void
main
(
)
{
group
(
MacOSDevice
,
()
{
...
...
@@ -69,21 +71,21 @@ tester 17193 0.0 0.2 4791128 37820 ?? S 2:27PM 0:00.09 /Applica
final
MockFileSystem
mockFileSystem
=
MockFileSystem
();
final
MockProcessManager
mockProcessManager
=
MockProcessManager
();
final
MockFile
mockFile
=
MockFile
();
final
MockProcess
mockProcess
=
MockProcess
();
when
(
macOSApp
.
executable
(
any
)).
thenReturn
(
'test'
);
when
(
mockFileSystem
.
file
(
'test'
)).
thenReturn
(
mockFile
);
when
(
mockFile
.
existsSync
()).
thenReturn
(
true
);
when
(
mockProcessManager
.
start
(<
String
>[
'test'
])).
thenAnswer
((
Invocation
invocation
)
async
{
return
mockProcess
;
return
FakeProcess
(
exitCode:
Completer
<
int
>().
future
,
stdout:
Stream
<
List
<
int
>>.
fromIterable
(<
List
<
int
>>[
utf8
.
encode
(
'Observatory listening on http://127.0.0.1/0
\n
'
),
]),
stderr:
const
Stream
<
List
<
int
>>.
empty
(),
);
});
when
(
mockProcessManager
.
run
(
any
)).
thenAnswer
((
Invocation
invocation
)
async
{
return
ProcessResult
(
0
,
1
,
''
,
''
);
});
when
(
mockProcess
.
stdout
).
thenAnswer
((
Invocation
invocation
)
{
return
Stream
<
List
<
int
>>.
fromIterable
(<
List
<
int
>>[
utf8
.
encode
(
'Observatory listening on http://127.0.0.1/0'
),
]);
});
testUsingContext
(
'Can run from prebuilt application'
,
()
async
{
final
LaunchResult
result
=
await
device
.
startApp
(
macOSApp
,
prebuiltApplication:
true
);
...
...
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