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
6b3f9583
Unverified
Commit
6b3f9583
authored
Feb 24, 2023
by
Christopher Fujino
Committed by
GitHub
Feb 24, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
show web-server in flutter devices (#121373)
[flutter_tools] show web-server in flutter devices
parent
f9b0be05
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
32 deletions
+3
-32
flutter_command_runner.dart
.../flutter_tools/lib/src/runner/flutter_command_runner.dart
+0
-10
web_device.dart
packages/flutter_tools/lib/src/web/web_device.dart
+2
-4
devices_test.dart
...es/flutter_tools/test/general.shard/web/devices_test.dart
+1
-18
No files found.
packages/flutter_tools/lib/src/runner/flutter_command_runner.dart
View file @
6b3f9583
...
...
@@ -18,7 +18,6 @@ import '../cache.dart';
import
'../convert.dart'
;
import
'../globals.dart'
as
globals
;
import
'../tester/flutter_tester.dart'
;
import
'../web/web_device.dart'
;
class
FlutterCommandRunner
extends
CommandRunner
<
void
>
{
FlutterCommandRunner
({
bool
verboseHelp
=
false
})
:
super
(
...
...
@@ -112,11 +111,6 @@ class FlutterCommandRunner extends CommandRunner<void> {
hide:
!
verboseHelp
,
help:
'List the special "flutter-tester" device in device listings. '
'This headless device is used to test Flutter tooling.'
);
argParser
.
addFlag
(
'show-web-server-device'
,
negatable:
false
,
hide:
!
verboseHelp
,
help:
'List the special "web-server" device in device listings.'
,
);
}
@override
...
...
@@ -215,10 +209,6 @@ class FlutterCommandRunner extends CommandRunner<void> {
||
topLevelResults
[
'device-id'
]
==
FlutterTesterDevices
.
kTesterDeviceId
)
{
FlutterTesterDevices
.
showFlutterTesterDevice
=
true
;
}
if
(((
topLevelResults
[
'show-web-server-device'
]
as
bool
?)
??
false
)
||
topLevelResults
[
'device-id'
]
==
WebServerDevice
.
kWebServerDeviceId
)
{
WebServerDevice
.
showWebServerDevice
=
true
;
}
// Set up the tooling configuration.
final
EngineBuildPaths
?
engineBuildPaths
=
await
globals
.
localEngineLocator
?.
findEnginePath
(
...
...
packages/flutter_tools/lib/src/web/web_device.dart
View file @
6b3f9583
...
...
@@ -111,7 +111,7 @@ abstract class ChromiumDevice extends Device {
Future
<
String
?>
get
emulatorId
async
=>
null
;
@override
bool
isSupported
()
=>
chromeLauncher
.
canFindExecutable
();
bool
isSupported
()
=>
chromeLauncher
.
canFindExecutable
();
@override
DevicePortForwarder
?
get
portForwarder
=>
const
NoOpDevicePortForwarder
();
...
...
@@ -357,8 +357,7 @@ class WebDevices extends PollingDeviceDiscovery {
}
final
MicrosoftEdgeDevice
?
edgeDevice
=
_edgeDevice
;
return
<
Device
>[
if
(
WebServerDevice
.
showWebServerDevice
)
_webServerDevice
,
_webServerDevice
,
if
(
_chromeDevice
.
isSupported
())
_chromeDevice
,
if
(
edgeDevice
!=
null
&&
await
edgeDevice
.
_meetsVersionConstraint
())
...
...
@@ -392,7 +391,6 @@ class WebServerDevice extends Device {
);
static
const
String
kWebServerDeviceId
=
'web-server'
;
static
bool
showWebServerDevice
=
false
;
final
Logger
_logger
;
...
...
packages/flutter_tools/test/general.shard/web/devices_test.dart
View file @
6b3f9583
...
...
@@ -189,8 +189,7 @@ void main() {
isNot
(
contains
(
isA
<
GoogleChromeDevice
>())));
});
testWithoutContext
(
'Web Server device is listed if enabled via showWebServerDevice'
,
()
async
{
WebServerDevice
.
showWebServerDevice
=
true
;
testWithoutContext
(
'Web Server device is listed'
,
()
async
{
final
WebDevices
webDevices
=
WebDevices
(
featureFlags:
TestFeatureFlags
(
isWebEnabled:
true
),
fileSystem:
MemoryFileSystem
.
test
(),
...
...
@@ -205,22 +204,6 @@ void main() {
contains
(
isA
<
WebServerDevice
>()));
});
testWithoutContext
(
'Web Server device is not listed if disabled via showWebServerDevice'
,
()
async
{
WebServerDevice
.
showWebServerDevice
=
false
;
final
WebDevices
webDevices
=
WebDevices
(
featureFlags:
TestFeatureFlags
(
isWebEnabled:
true
),
fileSystem:
MemoryFileSystem
.
test
(),
logger:
BufferLogger
.
test
(),
platform:
FakePlatform
(
environment:
<
String
,
String
>{}
),
processManager:
FakeProcessManager
.
any
(),
);
expect
(
await
webDevices
.
pollingGetDevices
(),
isNot
(
contains
(
isA
<
WebServerDevice
>())));
});
testWithoutContext
(
'Chrome invokes version command on non-Windows platforms'
,
()
async
{
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
const
FakeCommand
(
...
...
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