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
d6440156
Unverified
Commit
d6440156
authored
Jun 21, 2019
by
Jonah Williams
Committed by
GitHub
Jun 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "set web device name to Chrome (#34856)" (#34884)
parent
19d7925f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
23 deletions
+9
-23
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
+3
-17
No files found.
packages/flutter_tools/lib/src/web/web_device.dart
View file @
d6440156
...
...
@@ -27,9 +27,9 @@ class WebApplicationPackage extends ApplicationPackage {
Directory
get
webSourcePath
=>
flutterProject
.
directory
.
childDirectory
(
'web'
);
}
class
Chrome
Device
extends
Device
{
Chrome
Device
()
:
super
(
'
chrome
'
,
class
Web
Device
extends
Device
{
Web
Device
()
:
super
(
'
web
'
,
category:
Category
.
web
,
platformType:
PlatformType
.
web
,
ephemeral:
false
,
...
...
@@ -74,7 +74,7 @@ class ChromeDevice extends Device {
bool
isSupported
()
=>
flutterWebEnabled
&&
canFindChrome
();
@override
String
get
name
=>
'
Chrome
'
;
String
get
name
=>
'
web
'
;
@override
DevicePortForwarder
get
portForwarder
=>
const
NoOpDevicePortForwarder
();
...
...
@@ -143,9 +143,9 @@ class ChromeDevice extends Device {
}
class
WebDevices
extends
PollingDeviceDiscovery
{
WebDevices
()
:
super
(
'
chrome
'
);
WebDevices
()
:
super
(
'
web
'
);
final
ChromeDevice
_webDevice
=
Chrome
Device
();
final
WebDevice
_webDevice
=
Web
Device
();
@override
bool
get
canListAnything
=>
flutterWebEnabled
;
...
...
packages/flutter_tools/test/web/devices_test.dart
View file @
d6440156
...
...
@@ -13,7 +13,7 @@ import '../src/common.dart';
import
'../src/context.dart'
;
void
main
(
)
{
group
(
Chrome
Device
,
()
{
group
(
Web
Device
,
()
{
MockChromeLauncher
mockChromeLauncher
;
MockPlatform
mockPlatform
;
MockProcessManager
mockProcessManager
;
...
...
@@ -26,27 +26,13 @@ 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
ChromeDevice
webDevice
=
Chrome
Device
();
final
WebDevice
webDevice
=
Web
Device
();
expect
(
webDevice
.
isSupported
(),
true
);
expect
(
await
webDevice
.
sdkNameAndVersion
,
'ABC'
);
...
...
@@ -67,7 +53,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
ChromeDevice
webDevice
=
Chrome
Device
();
final
WebDevice
webDevice
=
Web
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