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
5b823cde
Unverified
Commit
5b823cde
authored
Feb 11, 2021
by
Jenn Magder
Committed by
GitHub
Feb 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove dead mock classes (#75757)
parent
9236eefd
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
32 additions
and
64 deletions
+32
-64
android_workflow_test.dart
...ols/test/general.shard/android/android_workflow_test.dart
+0
-2
web_test.dart
...ols/test/general.shard/build_system/targets/web_test.dart
+16
-10
flutter_platform_test.dart
...utter_tools/test/general.shard/flutter_platform_test.dart
+9
-11
devices_test.dart
...es/flutter_tools/test/general.shard/ios/devices_test.dart
+0
-4
ios_device_install_test.dart
...tools/test/general.shard/ios/ios_device_install_test.dart
+0
-4
ios_device_project_test.dart
...tools/test/general.shard/ios/ios_device_project_test.dart
+0
-4
ios_device_start_nonprebuilt_test.dart
.../general.shard/ios/ios_device_start_nonprebuilt_test.dart
+0
-2
xcodeproj_test.dart
.../flutter_tools/test/general.shard/ios/xcodeproj_test.dart
+7
-19
resident_runner_test.dart
...lutter_tools/test/general.shard/resident_runner_test.dart
+0
-2
resident_web_runner_cold_test.dart
...ols/test/general.shard/resident_web_runner_cold_test.dart
+0
-4
resident_web_runner_test.dart
...er_tools/test/general.shard/resident_web_runner_test.dart
+0
-2
No files found.
packages/flutter_tools/test/general.shard/android/android_workflow_test.dart
View file @
5b823cde
...
...
@@ -9,7 +9,6 @@ import 'package:flutter_tools/src/android/android_sdk.dart';
import
'package:flutter_tools/src/android/android_workflow.dart'
;
import
'package:flutter_tools/src/base/io.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/base/os.dart'
;
import
'package:flutter_tools/src/base/platform.dart'
;
import
'package:flutter_tools/src/base/user_messages.dart'
;
import
'package:flutter_tools/src/base/version.dart'
;
...
...
@@ -23,7 +22,6 @@ import '../../src/mocks.dart' show MockAndroidSdk, MockProcess, MockProcessManag
import
'../../src/testbed.dart'
;
class
MockAndroidSdkVersion
extends
Mock
implements
AndroidSdkVersion
{}
class
MockOperatingSystemUtils
extends
Mock
implements
OperatingSystemUtils
{}
void
main
(
)
{
AndroidSdk
sdk
;
...
...
packages/flutter_tools/test/general.shard/build_system/targets/web_test.dart
View file @
5b823cde
...
...
@@ -14,12 +14,10 @@ import 'package:flutter_tools/src/build_system/depfile.dart';
import
'package:flutter_tools/src/build_system/targets/common.dart'
;
import
'package:flutter_tools/src/build_system/targets/web.dart'
;
import
'package:flutter_tools/src/globals.dart'
as
globals
;
import
'package:mockito/mockito.dart'
;
import
'package:process/process.dart'
;
import
'../../../src/common.dart'
;
import
'../../../src/context.dart'
;
import
'../../../src/mocks.dart'
;
import
'../../../src/testbed.dart'
;
const
List
<
String
>
kDart2jsLinuxArgs
=
<
String
>[
...
...
@@ -462,11 +460,21 @@ void main() {
test
(
'Dart2JSTarget produces expected depfile'
,
()
=>
testbed
.
run
(()
async
{
environment
.
defines
[
kBuildMode
]
=
'release'
;
when
(
globals
.
processManager
.
run
(
any
)).
thenAnswer
((
Invocation
invocation
)
async
{
environment
.
buildDir
.
childFile
(
'app.dill.deps'
)
.
writeAsStringSync
(
'file:///a.dart'
);
return
FakeProcessResult
(
exitCode:
0
);
});
processManager
.
addCommand
(
FakeCommand
(
command:
<
String
>[
...
kDart2jsLinuxArgs
,
'-Ddart.vm.product=true'
,
'--no-source-maps'
,
'-o'
,
environment
.
buildDir
.
childFile
(
'app.dill'
).
absolute
.
path
,
'--packages=.packages'
,
'--cfe-only'
,
environment
.
buildDir
.
childFile
(
'main.dart'
).
absolute
.
path
,
],
onRun:
()
{
environment
.
buildDir
.
childFile
(
'app.dill.deps'
)
.
writeAsStringSync
(
'file:///a.dart'
);
},
));
await
const
Dart2JSTarget
().
build
(
environment
);
expect
(
environment
.
buildDir
.
childFile
(
'dart2js.d'
),
exists
);
...
...
@@ -476,7 +484,7 @@ void main() {
expect
(
depfile
.
outputs
.
single
.
path
,
environment
.
buildDir
.
childFile
(
'main.dart.js'
).
absolute
.
path
);
},
overrides:
<
Type
,
Generator
>{
ProcessManager:
()
=>
MockProcessManager
()
,
ProcessManager:
()
=>
processManager
,
}));
test
(
'Dart2JSTarget calls dart2js with Dart defines in release mode'
,
()
=>
testbed
.
run
(()
async
{
...
...
@@ -652,5 +660,3 @@ void main() {
contains
(
'"main.dart.js"'
));
}));
}
class
MockProcessManager
extends
Mock
implements
ProcessManager
{}
packages/flutter_tools/test/general.shard/flutter_platform_test.dart
View file @
5b823cde
...
...
@@ -109,18 +109,18 @@ void main() {
});
group
(
'The FLUTTER_TEST environment variable is passed to the test process'
,
()
{
MockPlatform
mock
Platform
;
FakePlatform
fake
Platform
;
MockProcessManager
mockProcessManager
;
FlutterPlatform
flutterPlatform
;
final
Map
<
Type
,
Generator
>
contextOverrides
=
<
Type
,
Generator
>{
Platform:
()
=>
mock
Platform
,
Platform:
()
=>
fake
Platform
,
ProcessManager:
()
=>
mockProcessManager
,
FileSystem:
()
=>
fileSystem
,
};
setUp
(()
{
mockPlatform
=
MockPlatform
();
when
(
mockPlatform
.
isWindows
).
thenReturn
(
false
);
// Not Windows
fakePlatform
=
FakePlatform
(
operatingSystem:
'linux'
);
mockProcessManager
=
MockProcessManager
();
flutterPlatform
=
TestFlutterPlatform
();
});
...
...
@@ -144,31 +144,31 @@ void main() {
}
testUsingContext
(
'as true when not originally set'
,
()
async
{
when
(
mockPlatform
.
environment
).
thenReturn
(<
String
,
String
>{})
;
fakePlatform
.
environment
=
<
String
,
String
>{}
;
final
Map
<
String
,
String
>
capturedEnvironment
=
await
captureEnvironment
();
expect
(
capturedEnvironment
[
'FLUTTER_TEST'
],
'true'
);
},
overrides:
contextOverrides
);
testUsingContext
(
'as true when set to true'
,
()
async
{
when
(
mockPlatform
.
environment
).
thenReturn
(<
String
,
String
>{
'FLUTTER_TEST'
:
'true'
})
;
fakePlatform
.
environment
=
<
String
,
String
>{
'FLUTTER_TEST'
:
'true'
}
;
final
Map
<
String
,
String
>
capturedEnvironment
=
await
captureEnvironment
();
expect
(
capturedEnvironment
[
'FLUTTER_TEST'
],
'true'
);
},
overrides:
contextOverrides
);
testUsingContext
(
'as false when set to false'
,
()
async
{
when
(
mockPlatform
.
environment
).
thenReturn
(<
String
,
String
>{
'FLUTTER_TEST'
:
'false'
})
;
fakePlatform
.
environment
=
<
String
,
String
>{
'FLUTTER_TEST'
:
'false'
}
;
final
Map
<
String
,
String
>
capturedEnvironment
=
await
captureEnvironment
();
expect
(
capturedEnvironment
[
'FLUTTER_TEST'
],
'false'
);
},
overrides:
contextOverrides
);
testUsingContext
(
'unchanged when set'
,
()
async
{
when
(
mockPlatform
.
environment
).
thenReturn
(<
String
,
String
>{
'FLUTTER_TEST'
:
'neither true nor false'
})
;
fakePlatform
.
environment
=
<
String
,
String
>{
'FLUTTER_TEST'
:
'neither true nor false'
}
;
final
Map
<
String
,
String
>
capturedEnvironment
=
await
captureEnvironment
();
expect
(
capturedEnvironment
[
'FLUTTER_TEST'
],
'neither true nor false'
);
},
overrides:
contextOverrides
);
testUsingContext
(
'as null when set to null'
,
()
async
{
when
(
mockPlatform
.
environment
).
thenReturn
(<
String
,
String
>{
'FLUTTER_TEST'
:
null
})
;
fakePlatform
.
environment
=
<
String
,
String
>{
'FLUTTER_TEST'
:
null
}
;
final
Map
<
String
,
String
>
capturedEnvironment
=
await
captureEnvironment
();
expect
(
capturedEnvironment
[
'FLUTTER_TEST'
],
null
);
},
overrides:
contextOverrides
);
...
...
@@ -279,8 +279,6 @@ class MockProcessManager extends Mock implements ProcessManager {}
class
MockProcess
extends
Mock
implements
Process
{}
class
MockPlatform
extends
Mock
implements
Platform
{}
class
MockHttpServer
extends
Mock
implements
HttpServer
{}
// A FlutterPlatform with enough fields set to load and start a test.
...
...
packages/flutter_tools/test/general.shard/ios/devices_test.dart
View file @
5b823cde
...
...
@@ -25,7 +25,6 @@ import 'package:flutter_tools/src/ios/iproxy.dart';
import
'package:flutter_tools/src/ios/mac.dart'
;
import
'package:flutter_tools/src/macos/xcode.dart'
;
import
'package:mockito/mockito.dart'
;
import
'package:vm_service/vm_service.dart'
;
import
'../../src/common.dart'
;
import
'../../src/context.dart'
;
...
...
@@ -583,8 +582,5 @@ void main() {
}
class
MockIOSApp
extends
Mock
implements
IOSApp
{}
class
MockIMobileDevice
extends
Mock
implements
IMobileDevice
{}
class
MockIOSDeploy
extends
Mock
implements
IOSDeploy
{}
class
MockIOSWorkflow
extends
Mock
implements
IOSWorkflow
{}
class
MockXcdevice
extends
Mock
implements
XCDevice
{}
class
MockVmService
extends
Mock
implements
VmService
{}
packages/flutter_tools/test/general.shard/ios/ios_device_install_test.dart
View file @
5b823cde
...
...
@@ -18,8 +18,6 @@ import 'package:flutter_tools/src/ios/ios_deploy.dart';
import
'package:flutter_tools/src/ios/iproxy.dart'
;
import
'package:flutter_tools/src/ios/mac.dart'
;
import
'package:meta/meta.dart'
;
import
'package:mockito/mockito.dart'
;
import
'package:vm_service/vm_service.dart'
;
import
'../../src/common.dart'
;
import
'../../src/context.dart'
;
...
...
@@ -316,5 +314,3 @@ IOSDevice setUpIOSDevice({
interfaceType:
interfaceType
,
);
}
class
MockVmService
extends
Mock
implements
VmService
{}
packages/flutter_tools/test/general.shard/ios/ios_device_project_test.dart
View file @
5b823cde
...
...
@@ -12,8 +12,6 @@ import 'package:flutter_tools/src/build_info.dart';
import
'package:flutter_tools/src/ios/devices.dart'
;
import
'package:flutter_tools/src/ios/iproxy.dart'
;
import
'package:flutter_tools/src/project.dart'
;
import
'package:mockito/mockito.dart'
;
import
'package:vm_service/vm_service.dart'
;
import
'../../src/common.dart'
;
import
'../../src/context.dart'
;
...
...
@@ -92,5 +90,3 @@ IOSDevice setUpIOSDevice(FileSystem fileSystem) {
interfaceType:
IOSDeviceInterface
.
usb
,
);
}
class
MockVmService
extends
Mock
implements
VmService
{}
packages/flutter_tools/test/general.shard/ios/ios_device_start_nonprebuilt_test.dart
View file @
5b823cde
...
...
@@ -22,7 +22,6 @@ import 'package:flutter_tools/src/macos/xcode.dart';
import
'package:flutter_tools/src/project.dart'
;
import
'package:mockito/mockito.dart'
;
import
'package:fake_async/fake_async.dart'
;
import
'package:vm_service/vm_service.dart'
;
import
'../../src/common.dart'
;
import
'../../src/context.dart'
;
...
...
@@ -350,4 +349,3 @@ IOSDevice setUpIOSDevice({
}
class
MockXcodeProjectInterpreter
extends
Mock
implements
XcodeProjectInterpreter
{}
class
MockVmService
extends
Mock
implements
VmService
{}
packages/flutter_tools/test/general.shard/ios/xcodeproj_test.dart
View file @
5b823cde
...
...
@@ -36,16 +36,13 @@ void main() {
platform
=
FakePlatform
(
operatingSystem:
'macos'
);
final
FileSystem
fileSystem
=
MemoryFileSystem
.
test
();
fileSystem
.
file
(
xcodebuild
).
createSync
(
recursive:
true
);
final
AnsiTerminal
terminal
=
MockAnsiTerminal
();
logger
=
BufferLogger
.
test
(
terminal:
terminal
);
logger
=
BufferLogger
.
test
();
xcodeProjectInterpreter
=
XcodeProjectInterpreter
(
logger:
logger
,
fileSystem:
fileSystem
,
platform:
platform
,
processManager:
processManager
,
terminal:
terminal
,
terminal:
Terminal
.
test
()
,
usage:
null
,
);
});
...
...
@@ -93,23 +90,19 @@ void main() {
FakePlatform
platform
;
FileSystem
fileSystem
;
BufferLogger
logger
;
AnsiTerminal
terminal
;
setUp
(()
{
fakeProcessManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[]);
platform
=
FakePlatform
(
operatingSystem:
'macos'
);
fileSystem
=
MemoryFileSystem
.
test
();
fileSystem
.
file
(
xcodebuild
).
createSync
(
recursive:
true
);
terminal
=
MockAnsiTerminal
();
logger
=
BufferLogger
.
test
(
terminal:
terminal
);
logger
=
BufferLogger
.
test
();
xcodeProjectInterpreter
=
XcodeProjectInterpreter
(
logger:
logger
,
fileSystem:
fileSystem
,
platform:
platform
,
processManager:
fakeProcessManager
,
terminal:
terminal
,
terminal:
Terminal
.
test
()
,
usage:
null
,
);
});
...
...
@@ -226,7 +219,7 @@ void main() {
fileSystem:
fileSystem
,
platform:
platform
,
processManager:
fakeProcessManager
,
terminal:
terminal
,
terminal:
Terminal
.
test
()
,
usage:
TestUsage
(),
);
fileSystem
.
file
(
xcodebuild
).
deleteSync
();
...
...
@@ -430,7 +423,7 @@ void main() {
fileSystem:
fileSystem
,
platform:
platform
,
processManager:
fakeProcessManager
,
terminal:
terminal
,
terminal:
Terminal
.
test
()
,
usage:
TestUsage
(),
);
...
...
@@ -457,7 +450,7 @@ void main() {
fileSystem:
fileSystem
,
platform:
platform
,
processManager:
fakeProcessManager
,
terminal:
terminal
,
terminal:
Terminal
.
test
()
,
usage:
TestUsage
(),
);
...
...
@@ -999,8 +992,3 @@ flutter:
}
class
MockLocalEngineArtifacts
extends
Mock
implements
LocalEngineArtifacts
{}
class
MockXcodeProjectInterpreter
extends
Mock
implements
XcodeProjectInterpreter
{}
class
MockAnsiTerminal
extends
Mock
implements
AnsiTerminal
{
@override
bool
get
supportsColor
=>
false
;
}
packages/flutter_tools/test/general.shard/resident_runner_test.dart
View file @
5b823cde
...
...
@@ -2948,9 +2948,7 @@ class MockDartDevelopmentService extends Mock implements DartDevelopmentService
class
MockVMService
extends
Mock
implements
vm_service
.
VmService
{}
class
MockDevFS
extends
Mock
implements
DevFS
{}
class
MockDeviceLogReader
extends
Mock
implements
DeviceLogReader
{}
class
MockDevicePortForwarder
extends
Mock
implements
DevicePortForwarder
{}
class
MockDevtoolsLauncher
extends
Mock
implements
DevtoolsLauncher
{}
class
MockProcessManager
extends
Mock
implements
ProcessManager
{}
class
MockResidentCompiler
extends
Mock
implements
ResidentCompiler
{}
class
MockDevice
extends
Mock
implements
Device
{}
...
...
packages/flutter_tools/test/general.shard/resident_web_runner_cold_test.dart
View file @
5b823cde
...
...
@@ -6,7 +6,6 @@
import
'dart:async'
;
import
'package:dwds/dwds.dart'
;
import
'package:flutter_tools/src/base/common.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/base/platform.dart'
;
...
...
@@ -23,7 +22,6 @@ import 'package:flutter_tools/src/resident_runner.dart';
import
'package:flutter_tools/src/web/chrome.dart'
;
import
'package:flutter_tools/src/web/web_device.dart'
;
import
'package:mockito/mockito.dart'
;
import
'package:vm_service/vm_service.dart'
;
import
'package:webkit_inspection_protocol/webkit_inspection_protocol.dart'
;
import
'../src/common.dart'
;
...
...
@@ -192,8 +190,6 @@ void main() {
class
MockWebDevFS
extends
Mock
implements
WebDevFS
{}
class
MockWebDevice
extends
Mock
implements
Device
{}
class
MockDebugConnection
extends
Mock
implements
DebugConnection
{}
class
MockVmService
extends
Mock
implements
VmService
{}
class
MockStatus
extends
Mock
implements
Status
{}
class
MockFlutterDevice
extends
Mock
implements
FlutterDevice
{}
class
MockChromeDevice
extends
Mock
implements
ChromiumDevice
{}
...
...
packages/flutter_tools/test/general.shard/resident_web_runner_test.dart
View file @
5b823cde
...
...
@@ -32,7 +32,6 @@ import 'package:flutter_tools/src/web/chrome.dart';
import
'package:flutter_tools/src/web/web_device.dart'
;
import
'package:mockito/mockito.dart'
;
import
'package:vm_service/vm_service.dart'
as
vm_service
;
import
'package:vm_service/vm_service.dart'
;
import
'package:webkit_inspection_protocol/webkit_inspection_protocol.dart'
;
import
'../src/common.dart'
;
...
...
@@ -1649,7 +1648,6 @@ class MockFlutterUsage extends Mock implements Usage {}
class
MockChromeDevice
extends
Mock
implements
ChromiumDevice
{}
class
MockDebugConnection
extends
Mock
implements
DebugConnection
{}
class
MockAppConnection
extends
Mock
implements
AppConnection
{}
class
MockVmService
extends
Mock
implements
VmService
{}
class
MockStatus
extends
Mock
implements
Status
{}
class
MockFlutterDevice
extends
Mock
implements
FlutterDevice
{}
class
MockWebDevFS
extends
Mock
implements
WebDevFS
{}
...
...
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