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
f5bce716
Unverified
Commit
f5bce716
authored
Mar 30, 2023
by
Zachary Anderson
Committed by
GitHub
Mar 30, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Serve DevTools when running flutter test (#123607)" (#123810)
This reverts commit
c3de9015
.
parent
7d31fe32
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
61 deletions
+6
-61
flutter_tester_device.dart
...ges/flutter_tools/lib/src/test/flutter_tester_device.dart
+5
-35
test_test.dart
packages/flutter_tools/test/integration.shard/test_test.dart
+1
-26
No files found.
packages/flutter_tools/lib/src/test/flutter_tester_device.dart
View file @
f5bce716
...
@@ -21,7 +21,6 @@ import '../convert.dart';
...
@@ -21,7 +21,6 @@ import '../convert.dart';
import
'../device.dart'
;
import
'../device.dart'
;
import
'../globals.dart'
as
globals
;
import
'../globals.dart'
as
globals
;
import
'../project.dart'
;
import
'../project.dart'
;
import
'../resident_runner.dart'
;
import
'../vmservice.dart'
;
import
'../vmservice.dart'
;
import
'font_config_manager.dart'
;
import
'font_config_manager.dart'
;
...
@@ -73,7 +72,6 @@ class FlutterTesterTestDevice extends TestDevice {
...
@@ -73,7 +72,6 @@ class FlutterTesterTestDevice extends TestDevice {
Process
?
_process
;
Process
?
_process
;
HttpServer
?
_server
;
HttpServer
?
_server
;
DevtoolsLauncher
?
_devToolsLauncher
;
/// Starts the device.
/// Starts the device.
///
///
...
@@ -165,11 +163,9 @@ class FlutterTesterTestDevice extends TestDevice {
...
@@ -165,11 +163,9 @@ class FlutterTesterTestDevice extends TestDevice {
debuggingOptions
.
hostVmServicePort
==
detectedUri
.
port
);
debuggingOptions
.
hostVmServicePort
==
detectedUri
.
port
);
Uri
?
forwardingUri
;
Uri
?
forwardingUri
;
DartDevelopmentService
?
dds
;
if
(
debuggingOptions
.
enableDds
)
{
if
(
debuggingOptions
.
enableDds
)
{
logger
.
printTrace
(
'test
$id
: Starting Dart Development Service'
);
logger
.
printTrace
(
'test
$id
: Starting Dart Development Service'
);
dds
=
await
startDds
(
final
DartDevelopmentService
dds
=
await
startDds
(
detectedUri
,
detectedUri
,
uriConverter:
uriConverter
,
uriConverter:
uriConverter
,
);
);
...
@@ -197,10 +193,10 @@ class FlutterTesterTestDevice extends TestDevice {
...
@@ -197,10 +193,10 @@ class FlutterTesterTestDevice extends TestDevice {
}));
}));
if
(
debuggingOptions
.
startPaused
&&
!
machine
!)
{
if
(
debuggingOptions
.
startPaused
&&
!
machine
!)
{
logger
.
printStatus
(
'The
Dart VM service is listening on
$forwardingUri
'
);
logger
.
printStatus
(
'The
test process has been started.
'
);
await
_startDevTools
(
forwardingUri
,
dds
);
logger
.
printStatus
(
'You can now connect to it using vmService. To connect, load the following Web site in your browser:'
);
logger
.
printStatus
(
''
);
logger
.
printStatus
(
'
$forwardingUri
'
);
logger
.
printStatus
(
'
The test process has been started. Set any relevant breakpoints and
then resume the test in the debugger.'
);
logger
.
printStatus
(
'
You should first set appropriate breakpoints,
then resume the test in the debugger.'
);
}
}
_gotProcessVmServiceUri
.
complete
(
forwardingUri
);
_gotProcessVmServiceUri
.
complete
(
forwardingUri
);
},
},
...
@@ -219,9 +215,6 @@ class FlutterTesterTestDevice extends TestDevice {
...
@@ -219,9 +215,6 @@ class FlutterTesterTestDevice extends TestDevice {
logger
.
printTrace
(
'test
$id
: Terminating flutter_tester process'
);
logger
.
printTrace
(
'test
$id
: Terminating flutter_tester process'
);
_process
?.
kill
(
io
.
ProcessSignal
.
sigkill
);
_process
?.
kill
(
io
.
ProcessSignal
.
sigkill
);
logger
.
printTrace
(
'test
$id
: Shutting down DevTools server'
);
await
_devToolsLauncher
?.
close
();
logger
.
printTrace
(
'test
$id
: Shutting down test harness socket server'
);
logger
.
printTrace
(
'test
$id
: Shutting down test harness socket server'
);
await
_server
?.
close
(
force:
true
);
await
_server
?.
close
(
force:
true
);
await
finished
;
await
finished
;
...
@@ -268,29 +261,6 @@ class FlutterTesterTestDevice extends TestDevice {
...
@@ -268,29 +261,6 @@ class FlutterTesterTestDevice extends TestDevice {
);
);
}
}
Future
<
void
>
_startDevTools
(
Uri
forwardingUri
,
DartDevelopmentService
?
dds
)
async
{
_devToolsLauncher
=
DevtoolsLauncher
.
instance
;
logger
.
printTrace
(
'test
$id
: Serving DevTools...'
);
final
DevToolsServerAddress
?
devToolsServerAddress
=
await
_devToolsLauncher
?.
serve
();
if
(
devToolsServerAddress
==
null
)
{
logger
.
printTrace
(
'test
$id
: Failed to start DevTools'
);
return
;
}
await
_devToolsLauncher
?.
ready
;
logger
.
printTrace
(
'test
$id
: DevTools is being served at
${devToolsServerAddress.uri}
'
);
// Notify the DDS instance that there's a DevTools instance available so it can correctly
// redirect DevTools related requests.
dds
?.
setExternalDevToolsUri
(
devToolsServerAddress
.
uri
!);
final
Uri
devToolsUri
=
devToolsServerAddress
.
uri
!.
replace
(
// Use query instead of queryParameters to avoid unnecessary encoding.
query:
'uri=
$forwardingUri
'
,
);
logger
.
printStatus
(
'The Flutter DevTools debugger and profiler is available at:
$devToolsUri
'
);
}
/// Binds an [HttpServer] serving from `host` on `port`.
/// Binds an [HttpServer] serving from `host` on `port`.
///
///
/// Only intended to be overridden in tests.
/// Only intended to be overridden in tests.
...
...
packages/flutter_tools/test/integration.shard/test_test.dart
View file @
f5bce716
...
@@ -222,7 +222,7 @@ void main() {
...
@@ -222,7 +222,7 @@ void main() {
final
Completer
<
Uri
>
completer
=
Completer
<
Uri
>();
final
Completer
<
Uri
>
completer
=
Completer
<
Uri
>();
final
RegExp
vmServiceUriRegExp
=
RegExp
(
r'((http)?:\/\/)[^\s]+'
);
final
RegExp
vmServiceUriRegExp
=
RegExp
(
r'((http)?:\/\/)[^\s]+'
);
sub
=
process
.
stdout
.
transform
(
utf8
.
decoder
).
listen
((
String
e
)
{
sub
=
process
.
stdout
.
transform
(
utf8
.
decoder
).
listen
((
String
e
)
{
if
(
!
completer
.
isCompleted
&&
vmServiceUriRegExp
.
hasMatch
(
e
))
{
if
(
vmServiceUriRegExp
.
hasMatch
(
e
))
{
completer
.
complete
(
Uri
.
parse
(
vmServiceUriRegExp
.
firstMatch
(
e
)!.
group
(
0
)!));
completer
.
complete
(
Uri
.
parse
(
vmServiceUriRegExp
.
firstMatch
(
e
)!.
group
(
0
)!));
}
}
});
});
...
@@ -237,31 +237,6 @@ void main() {
...
@@ -237,31 +237,6 @@ void main() {
process
.
kill
();
process
.
kill
();
}
}
});
});
testWithoutContext
(
'flutter test should serve DevTools'
,
()
async
{
late
final
Process
process
;
late
final
StreamSubscription
<
String
>
sub
;
try
{
process
=
await
_runFlutterTestConcurrent
(
'trivial'
,
automatedTestsDirectory
,
flutterTestDirectory
,
extraArguments:
const
<
String
>[
'--start-paused'
]);
final
Completer
<
Uri
>
completer
=
Completer
<
Uri
>();
final
RegExp
devToolsUriRegExp
=
RegExp
(
r'The Flutter DevTools debugger and profiler is available at: (http://[^\s]+)'
);
sub
=
process
.
stdout
.
transform
(
utf8
.
decoder
).
listen
((
String
e
)
{
if
(!
completer
.
isCompleted
&&
devToolsUriRegExp
.
hasMatch
(
e
))
{
completer
.
complete
(
Uri
.
parse
(
devToolsUriRegExp
.
firstMatch
(
e
)!.
group
(
1
)!));
}
});
final
Uri
devToolsUri
=
await
completer
.
future
;
final
HttpClient
client
=
HttpClient
();
final
HttpClientRequest
request
=
await
client
.
getUrl
(
devToolsUri
);
final
HttpClientResponse
response
=
await
request
.
close
();
final
String
content
=
await
response
.
transform
(
utf8
.
decoder
).
join
();
expect
(
content
.
contains
(
'DevTools'
),
true
);
}
finally
{
await
sub
.
cancel
();
process
.
kill
();
}
});
}
}
Future
<
void
>
_testFile
(
Future
<
void
>
_testFile
(
...
...
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