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
3411129c
Unverified
Commit
3411129c
authored
Feb 24, 2020
by
Jonah Williams
Committed by
GitHub
Feb 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[flutter_tools] don't fix chrome window size, add more logs (#51346)
parent
7572ec47
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
11 deletions
+30
-11
chrome.dart
packages/flutter_tools/lib/src/web/chrome.dart
+17
-11
chrome_test.dart
...ges/flutter_tools/test/general.shard/web/chrome_test.dart
+13
-0
No files found.
packages/flutter_tools/lib/src/web/chrome.dart
View file @
3411129c
...
...
@@ -138,9 +138,8 @@ class ChromeLauncher {
'--no-default-browser-check'
,
'--disable-default-apps'
,
'--disable-translate'
,
'--window-size=2400,1800'
,
if
(
headless
)
...<
String
>[
'--headless'
,
'--disable-gpu'
,
'--no-sandbox'
],
...<
String
>[
'--headless'
,
'--disable-gpu'
,
'--no-sandbox'
,
'--window-size=2400,1800'
],
url
,
];
...
...
@@ -161,17 +160,24 @@ class ChromeLauncher {
}));
}
process
.
stdout
.
transform
(
utf8
.
decoder
)
.
transform
(
const
LineSplitter
())
.
listen
((
String
line
)
{
globals
.
printTrace
(
'[CHROME]:
$line
'
);
});
// Wait until the DevTools are listening before trying to connect.
await
process
.
stderr
.
transform
(
utf8
.
decoder
)
.
transform
(
const
LineSplitter
())
.
firstWhere
((
String
line
)
=>
line
.
startsWith
(
'DevTools listening'
),
orElse:
(
)
{
return
'Failed to spawn stderr'
;
})
.
timeout
(
const
Duration
(
seconds:
60
),
onTimeout:
()
{
throwToolExit
(
'Unable to connect to Chrome DevTools.'
);
return
null
;
});
.
transform
(
utf8
.
decoder
)
.
transform
(
const
LineSplitter
())
.
map
((
String
line
)
{
globals
.
printTrace
(
'[CHROME]:
$line
'
)
;
return
line
;
})
.
firstWhere
((
String
line
)
=>
line
.
startsWith
(
'DevTools listening'
),
orElse:
()
{
return
'Failed to spawn stderr'
;
});
final
Uri
remoteDebuggerUri
=
await
_getRemoteDebuggerUrl
(
Uri
.
parse
(
'http://localhost:
$port
'
));
return
_connect
(
Chrome
.
_
(
port
,
...
...
packages/flutter_tools/test/general.shard/web/chrome_test.dart
View file @
3411129c
...
...
@@ -72,16 +72,29 @@ void main() {
test
(
'can launch chrome and connect to the devtools'
,
()
=>
testbed
.
run
(()
async
{
await
chromeLauncher
.
launch
(
'example_url'
,
skipCheck:
true
);
final
VerificationResult
result
=
verify
(
globals
.
processManager
.
start
(
captureAny
));
expect
(
result
.
captured
.
single
,
containsAll
(
expectChromeArgs
()));
expect
(
result
.
captured
.
single
,
isNot
(
contains
(
'--window-size=2400,1800'
)));
}));
test
(
'can launch chrome with a custom debug port'
,
()
=>
testbed
.
run
(()
async
{
await
chromeLauncher
.
launch
(
'example_url'
,
skipCheck:
true
,
debugPort:
10000
);
final
VerificationResult
result
=
verify
(
globals
.
processManager
.
start
(
captureAny
));
expect
(
result
.
captured
.
single
,
containsAll
(
expectChromeArgs
(
debugPort:
10000
)));
expect
(
result
.
captured
.
single
,
isNot
(
contains
(
'--window-size=2400,1800'
)));
}));
test
(
'can launch chrome headless'
,
()
=>
testbed
.
run
(()
async
{
await
chromeLauncher
.
launch
(
'example_url'
,
skipCheck:
true
,
headless:
true
);
final
VerificationResult
result
=
verify
(
globals
.
processManager
.
start
(
captureAny
));
expect
(
result
.
captured
.
single
,
containsAll
(
expectChromeArgs
()));
expect
(
result
.
captured
.
single
,
contains
(
'--window-size=2400,1800'
));
}));
test
(
'can seed chrome temp directory with existing preferences'
,
()
=>
testbed
.
run
(()
async
{
final
Directory
dataDir
=
globals
.
fs
.
directory
(
'chrome-stuff'
);
final
File
preferencesFile
=
dataDir
...
...
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