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
19d7925f
Unverified
Commit
19d7925f
authored
Jun 21, 2019
by
Jonah Williams
Committed by
GitHub
Jun 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
set web device name to Chrome (#34856)
parent
36305256
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
9 deletions
+23
-9
web_device.dart
packages/flutter_tools/lib/src/web/web_device.dart
+6
-6
devices_test.dart
packages/flutter_tools/test/web/devices_test.dart
+17
-3
No files found.
packages/flutter_tools/lib/src/web/web_device.dart
View file @
19d7925f
...
...
@@ -27,9 +27,9 @@ class WebApplicationPackage extends ApplicationPackage {
Directory
get
webSourcePath
=>
flutterProject
.
directory
.
childDirectory
(
'web'
);
}
class
Web
Device
extends
Device
{
Web
Device
()
:
super
(
'
web
'
,
class
Chrome
Device
extends
Device
{
Chrome
Device
()
:
super
(
'
chrome
'
,
category:
Category
.
web
,
platformType:
PlatformType
.
web
,
ephemeral:
false
,
...
...
@@ -74,7 +74,7 @@ class WebDevice extends Device {
bool
isSupported
()
=>
flutterWebEnabled
&&
canFindChrome
();
@override
String
get
name
=>
'
web
'
;
String
get
name
=>
'
Chrome
'
;
@override
DevicePortForwarder
get
portForwarder
=>
const
NoOpDevicePortForwarder
();
...
...
@@ -143,9 +143,9 @@ class WebDevice extends Device {
}
class
WebDevices
extends
PollingDeviceDiscovery
{
WebDevices
()
:
super
(
'
web
'
);
WebDevices
()
:
super
(
'
chrome
'
);
final
WebDevice
_webDevice
=
Web
Device
();
final
ChromeDevice
_webDevice
=
Chrome
Device
();
@override
bool
get
canListAnything
=>
flutterWebEnabled
;
...
...
packages/flutter_tools/test/web/devices_test.dart
View file @
19d7925f
...
...
@@ -13,7 +13,7 @@ import '../src/common.dart';
import
'../src/context.dart'
;
void
main
(
)
{
group
(
Web
Device
,
()
{
group
(
Chrome
Device
,
()
{
MockChromeLauncher
mockChromeLauncher
;
MockPlatform
mockPlatform
;
MockProcessManager
mockProcessManager
;
...
...
@@ -26,13 +26,27 @@ void main() {
return
null
;
});
});
test
(
'Defaults'
,
()
async
{
final
ChromeDevice
device
=
ChromeDevice
();
expect
(
device
.
name
,
'Chrome'
);
expect
(
device
.
id
,
'chrome'
);
expect
(
device
.
supportsHotReload
,
true
);
expect
(
device
.
supportsHotRestart
,
true
);
expect
(
device
.
supportsStartPaused
,
true
);
expect
(
device
.
supportsFlutterExit
,
true
);
expect
(
device
.
supportsScreenshot
,
false
);
expect
(
await
device
.
isLocalEmulator
,
false
);
});
testUsingContext
(
'Invokes version command on non-Windows platforms'
,
()
async
{
when
(
mockPlatform
.
isWindows
).
thenReturn
(
false
);
when
(
mockProcessManager
.
canRun
(
'chrome.foo'
)).
thenReturn
(
true
);
when
(
mockProcessManager
.
run
(<
String
>[
'chrome.foo'
,
'--version'
])).
thenAnswer
((
Invocation
invocation
)
async
{
return
MockProcessResult
(
0
,
'ABC'
);
});
final
WebDevice
webDevice
=
Web
Device
();
final
ChromeDevice
webDevice
=
Chrome
Device
();
expect
(
webDevice
.
isSupported
(),
true
);
expect
(
await
webDevice
.
sdkNameAndVersion
,
'ABC'
);
...
...
@@ -53,7 +67,7 @@ void main() {
])).
thenAnswer
((
Invocation
invocation
)
async
{
return
MockProcessResult
(
0
,
r'HKEY_CURRENT_USER\Software\Google\Chrome\BLBeacon\ version REG_SZ 74.0.0 A'
);
});
final
WebDevice
webDevice
=
Web
Device
();
final
ChromeDevice
webDevice
=
Chrome
Device
();
expect
(
webDevice
.
isSupported
(),
true
);
expect
(
await
webDevice
.
sdkNameAndVersion
,
'Google Chrome 74.0.0'
);
...
...
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