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
66768f8c
Unverified
Commit
66768f8c
authored
Mar 12, 2021
by
Jenn Magder
Committed by
GitHub
Mar 12, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove mocks from web devices test (#77968)
parent
d637b187
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
2 additions
and
33 deletions
+2
-33
attach_test.dart
...utter_tools/test/commands.shard/hermetic/attach_test.dart
+0
-2
fuchsia_device_test.dart
...tools/test/general.shard/fuchsia/fuchsia_device_test.dart
+0
-2
fuchsia_pm_test.dart
...ter_tools/test/general.shard/fuchsia/fuchsia_pm_test.dart
+0
-3
devfs_web_test.dart
.../flutter_tools/test/general.shard/web/devfs_web_test.dart
+0
-2
devices_test.dart
...es/flutter_tools/test/general.shard/web/devices_test.dart
+2
-24
No files found.
packages/flutter_tools/test/commands.shard/hermetic/attach_test.dart
View file @
66768f8c
...
@@ -19,7 +19,6 @@ import 'package:flutter_tools/src/commands/attach.dart';
...
@@ -19,7 +19,6 @@ import 'package:flutter_tools/src/commands/attach.dart';
import
'package:flutter_tools/src/device.dart'
;
import
'package:flutter_tools/src/device.dart'
;
import
'package:flutter_tools/src/globals.dart'
as
globals
;
import
'package:flutter_tools/src/globals.dart'
as
globals
;
import
'package:flutter_tools/src/ios/devices.dart'
;
import
'package:flutter_tools/src/ios/devices.dart'
;
import
'package:flutter_tools/src/mdns_discovery.dart'
;
import
'package:flutter_tools/src/project.dart'
;
import
'package:flutter_tools/src/project.dart'
;
import
'package:flutter_tools/src/resident_runner.dart'
;
import
'package:flutter_tools/src/resident_runner.dart'
;
import
'package:flutter_tools/src/run_hot.dart'
;
import
'package:flutter_tools/src/run_hot.dart'
;
...
@@ -718,7 +717,6 @@ void main() {
...
@@ -718,7 +717,6 @@ void main() {
class
MockHotRunner
extends
Mock
implements
HotRunner
{}
class
MockHotRunner
extends
Mock
implements
HotRunner
{}
class
MockHotRunnerFactory
extends
Mock
implements
HotRunnerFactory
{}
class
MockHotRunnerFactory
extends
Mock
implements
HotRunnerFactory
{}
class
MockIOSDevice
extends
Mock
implements
IOSDevice
{}
class
MockIOSDevice
extends
Mock
implements
IOSDevice
{}
class
MockMDnsObservatoryDiscovery
extends
Mock
implements
MDnsObservatoryDiscovery
{}
class
MockPortForwarder
extends
Mock
implements
DevicePortForwarder
{}
class
MockPortForwarder
extends
Mock
implements
DevicePortForwarder
{}
class
StreamLogger
extends
Logger
{
class
StreamLogger
extends
Logger
{
...
...
packages/flutter_tools/test/general.shard/fuchsia/fuchsia_device_test.dart
View file @
66768f8c
...
@@ -1277,8 +1277,6 @@ class FuchsiaModulePackage extends ApplicationPackage {
...
@@ -1277,8 +1277,6 @@ class FuchsiaModulePackage extends ApplicationPackage {
final
String
name
;
final
String
name
;
}
}
class
MockFuchsiaArtifacts
extends
Mock
implements
FuchsiaArtifacts
{}
class
MockProcessManager
extends
Mock
implements
ProcessManager
{}
class
MockProcessManager
extends
Mock
implements
ProcessManager
{}
class
MockProcessResult
extends
Mock
implements
ProcessResult
{}
class
MockProcessResult
extends
Mock
implements
ProcessResult
{}
...
...
packages/flutter_tools/test/general.shard/fuchsia/fuchsia_pm_test.dart
View file @
66768f8c
...
@@ -7,7 +7,6 @@
...
@@ -7,7 +7,6 @@
import
'package:file/memory.dart'
;
import
'package:file/memory.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/io.dart'
;
import
'package:flutter_tools/src/base/io.dart'
;
import
'package:flutter_tools/src/base/process.dart'
;
import
'package:flutter_tools/src/fuchsia/fuchsia_pm.dart'
;
import
'package:flutter_tools/src/fuchsia/fuchsia_pm.dart'
;
import
'package:flutter_tools/src/fuchsia/fuchsia_sdk.dart'
;
import
'package:flutter_tools/src/fuchsia/fuchsia_sdk.dart'
;
import
'package:mockito/mockito.dart'
;
import
'package:mockito/mockito.dart'
;
...
@@ -74,6 +73,4 @@ void main() {
...
@@ -74,6 +73,4 @@ void main() {
}
}
class
MockFuchsiaArtifacts
extends
Mock
implements
FuchsiaArtifacts
{}
class
MockFuchsiaArtifacts
extends
Mock
implements
FuchsiaArtifacts
{}
class
MockProcessUtils
extends
Mock
implements
ProcessUtils
{}
class
MockProcess
extends
Mock
implements
Process
{}
class
MockProcessManager
extends
Mock
implements
ProcessManager
{}
class
MockProcessManager
extends
Mock
implements
ProcessManager
{}
packages/flutter_tools/test/general.shard/web/devfs_web_test.dart
View file @
66768f8c
...
@@ -6,7 +6,6 @@
...
@@ -6,7 +6,6 @@
import
'dart:io'
hide
Directory
,
File
;
import
'dart:io'
hide
Directory
,
File
;
import
'package:dwds/dwds.dart'
;
import
'package:flutter_tools/src/artifacts.dart'
;
import
'package:flutter_tools/src/artifacts.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/platform.dart'
;
import
'package:flutter_tools/src/base/platform.dart'
;
...
@@ -1084,4 +1083,3 @@ void main() {
...
@@ -1084,4 +1083,3 @@ void main() {
class
MockHttpServer
extends
Mock
implements
HttpServer
{}
class
MockHttpServer
extends
Mock
implements
HttpServer
{}
class
MockResidentCompiler
extends
Mock
implements
ResidentCompiler
{}
class
MockResidentCompiler
extends
Mock
implements
ResidentCompiler
{}
class
MockDwds
extends
Mock
implements
Dwds
{}
packages/flutter_tools/test/general.shard/web/devices_test.dart
View file @
66768f8c
...
@@ -11,7 +11,6 @@ import 'package:flutter_tools/src/build_info.dart';
...
@@ -11,7 +11,6 @@ import 'package:flutter_tools/src/build_info.dart';
import
'package:flutter_tools/src/device.dart'
;
import
'package:flutter_tools/src/device.dart'
;
import
'package:flutter_tools/src/web/chrome.dart'
;
import
'package:flutter_tools/src/web/chrome.dart'
;
import
'package:flutter_tools/src/web/web_device.dart'
;
import
'package:flutter_tools/src/web/web_device.dart'
;
import
'package:mockito/mockito.dart'
;
import
'../../src/common.dart'
;
import
'../../src/common.dart'
;
import
'../../src/context.dart'
;
import
'../../src/context.dart'
;
...
@@ -126,8 +125,8 @@ void main() {
...
@@ -126,8 +125,8 @@ void main() {
});
});
testWithoutContext
(
'Chrome device is not listed when Chrome cannot be run'
,
()
async
{
testWithoutContext
(
'Chrome device is not listed when Chrome cannot be run'
,
()
async
{
final
MockProcessManager
processManager
=
MockProcessManager
(
);
final
FakeProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[]
);
when
(
processManager
.
canRun
(
any
)).
thenReturn
(
false
)
;
processManager
.
excludedExecutables
=
<
String
>{
kLinuxExecutable
}
;
final
WebDevices
webDevices
=
WebDevices
(
final
WebDevices
webDevices
=
WebDevices
(
featureFlags:
TestFeatureFlags
(
isWebEnabled:
true
),
featureFlags:
TestFeatureFlags
(
isWebEnabled:
true
),
fileSystem:
MemoryFileSystem
.
test
(),
fileSystem:
MemoryFileSystem
.
test
(),
...
@@ -143,24 +142,6 @@ void main() {
...
@@ -143,24 +142,6 @@ void main() {
isNot
(
contains
(
isA
<
GoogleChromeDevice
>())));
isNot
(
contains
(
isA
<
GoogleChromeDevice
>())));
});
});
testWithoutContext
(
'Edge device is not listed when Edge cannot be run'
,
()
async
{
final
MockProcessManager
processManager
=
MockProcessManager
();
when
(
processManager
.
canRun
(
any
)).
thenReturn
(
false
);
final
WebDevices
webDevices
=
WebDevices
(
featureFlags:
TestFeatureFlags
(
isWebEnabled:
true
),
fileSystem:
MemoryFileSystem
.
test
(),
logger:
BufferLogger
.
test
(),
platform:
FakePlatform
(
operatingSystem:
'linux'
,
environment:
<
String
,
String
>{}
),
processManager:
processManager
,
);
expect
(
await
webDevices
.
pollingGetDevices
(),
isNot
(
contains
(
isA
<
MicrosoftEdgeDevice
>())));
});
testWithoutContext
(
'Web Server device is listed if enabled via showWebServerDevice'
,
()
async
{
testWithoutContext
(
'Web Server device is listed if enabled via showWebServerDevice'
,
()
async
{
WebServerDevice
.
showWebServerDevice
=
true
;
WebServerDevice
.
showWebServerDevice
=
true
;
final
WebDevices
webDevices
=
WebDevices
(
final
WebDevices
webDevices
=
WebDevices
(
...
@@ -329,6 +310,3 @@ void main() {
...
@@ -329,6 +310,3 @@ void main() {
expect
((
await
macosWebDevices
.
pollingGetDevices
()).
whereType
<
MicrosoftEdgeDevice
>(),
isEmpty
);
expect
((
await
macosWebDevices
.
pollingGetDevices
()).
whereType
<
MicrosoftEdgeDevice
>(),
isEmpty
);
});
});
}
}
// This is used to set `canRun` to false in a test.
class
MockProcessManager
extends
Mock
implements
ProcessManager
{}
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