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
a56c5e51
Unverified
Commit
a56c5e51
authored
May 24, 2022
by
Jenn Magder
Committed by
GitHub
May 24, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate some test files to null safety (#104469)
parent
b3e98a92
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
102 additions
and
121 deletions
+102
-121
android_device_discovery_test.dart
.../general.shard/android/android_device_discovery_test.dart
+3
-5
android_workflow_test.dart
...ols/test/general.shard/android/android_workflow_test.dart
+17
-19
desktop_test.dart
...test/general.shard/build_system/targets/desktop_test.dart
+0
-2
flutter_validator_test.dart
...tter_tools/test/general.shard/flutter_validator_test.dart
+4
-6
ios_device_install_test.dart
...tools/test/general.shard/ios/ios_device_install_test.dart
+10
-13
ios_device_logger_test.dart
..._tools/test/general.shard/ios/ios_device_logger_test.dart
+7
-9
ios_device_start_prebuilt_test.dart
...est/general.shard/ios/ios_device_start_prebuilt_test.dart
+10
-12
linux_device_test.dart
...ter_tools/test/general.shard/linux/linux_device_test.dart
+0
-2
macos_ipad_device_test.dart
...ools/test/general.shard/macos/macos_ipad_device_test.dart
+21
-13
utils.dart
packages/flutter_tools/test/general.shard/runner/utils.dart
+6
-8
update_packages_test.dart
...lutter_tools/test/general.shard/update_packages_test.dart
+3
-5
windows_device_test.dart
...tools/test/general.shard/windows/windows_device_test.dart
+4
-6
cache_test.dart
...ages/flutter_tools/test/integration.shard/cache_test.dart
+9
-11
migrate_command_test.dart
...er_tools/test/integration.shard/migrate_command_test.dart
+6
-8
fakes.dart
packages/flutter_tools/test/src/fakes.dart
+1
-1
web_driver_service_test.dart
...flutter_tools/test/web.shard/web_driver_service_test.dart
+1
-1
No files found.
packages/flutter_tools/test/general.shard/android/android_device_discovery_test.dart
View file @
a56c5e51
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'package:file/memory.dart'
;
import
'package:file/memory.dart'
;
import
'package:flutter_tools/src/android/android_device_discovery.dart'
;
import
'package:flutter_tools/src/android/android_device_discovery.dart'
;
import
'package:flutter_tools/src/android/android_sdk.dart'
;
import
'package:flutter_tools/src/android/android_sdk.dart'
;
...
@@ -15,11 +13,11 @@ import 'package:flutter_tools/src/device.dart';
...
@@ -15,11 +13,11 @@ import 'package:flutter_tools/src/device.dart';
import
'package:test/fake.dart'
;
import
'package:test/fake.dart'
;
import
'../../src/common.dart'
;
import
'../../src/common.dart'
;
import
'../../src/
context
.dart'
;
import
'../../src/
fake_process_manager
.dart'
;
import
'../../src/fakes.dart'
;
import
'../../src/fakes.dart'
;
void
main
(
)
{
void
main
(
)
{
AndroidWorkflow
androidWorkflow
;
late
AndroidWorkflow
androidWorkflow
;
setUp
(()
{
setUp
(()
{
androidWorkflow
=
AndroidWorkflow
(
androidWorkflow
=
AndroidWorkflow
(
...
@@ -243,5 +241,5 @@ class FakeAndroidSdk extends Fake implements AndroidSdk {
...
@@ -243,5 +241,5 @@ class FakeAndroidSdk extends Fake implements AndroidSdk {
FakeAndroidSdk
([
this
.
adbPath
=
'adb'
]);
FakeAndroidSdk
([
this
.
adbPath
=
'adb'
]);
@override
@override
final
String
adbPath
;
final
String
?
adbPath
;
}
}
packages/flutter_tools/test/general.shard/android/android_workflow_test.dart
View file @
a56c5e51
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'package:file/memory.dart'
;
import
'package:file/memory.dart'
;
import
'package:flutter_tools/src/android/android_sdk.dart'
;
import
'package:flutter_tools/src/android/android_sdk.dart'
;
import
'package:flutter_tools/src/android/android_studio.dart'
;
import
'package:flutter_tools/src/android/android_studio.dart'
;
...
@@ -18,15 +16,15 @@ import 'package:flutter_tools/src/doctor_validator.dart';
...
@@ -18,15 +16,15 @@ import 'package:flutter_tools/src/doctor_validator.dart';
import
'package:test/fake.dart'
;
import
'package:test/fake.dart'
;
import
'../../src/common.dart'
;
import
'../../src/common.dart'
;
import
'../../src/
context
.dart'
;
import
'../../src/
fake_process_manager
.dart'
;
import
'../../src/fakes.dart'
;
import
'../../src/fakes.dart'
;
void
main
(
)
{
void
main
(
)
{
FakeAndroidSdk
sdk
;
late
FakeAndroidSdk
sdk
;
Logger
logger
;
late
Logger
logger
;
MemoryFileSystem
fileSystem
;
late
MemoryFileSystem
fileSystem
;
FakeProcessManager
processManager
;
late
FakeProcessManager
processManager
;
FakeStdio
stdio
;
late
FakeStdio
stdio
;
setUp
(()
{
setUp
(()
{
sdk
=
FakeAndroidSdk
();
sdk
=
FakeAndroidSdk
();
...
@@ -532,31 +530,31 @@ Review licenses that have not been accepted (y/N)?
...
@@ -532,31 +530,31 @@ Review licenses that have not been accepted (y/N)?
class
FakeAndroidSdk
extends
Fake
implements
AndroidSdk
{
class
FakeAndroidSdk
extends
Fake
implements
AndroidSdk
{
@override
@override
String
sdkManagerPath
;
String
?
sdkManagerPath
;
@override
@override
String
sdkManagerVersion
;
String
?
sdkManagerVersion
;
@override
@override
String
adbPath
;
String
?
adbPath
;
@override
@override
bool
licensesAvailable
;
bool
licensesAvailable
=
false
;
@override
@override
bool
platformToolsAvailable
;
bool
platformToolsAvailable
=
false
;
@override
@override
bool
cmdlineToolsAvailable
;
bool
cmdlineToolsAvailable
=
false
;
@override
@override
Directory
directory
;
Directory
directory
=
MemoryFileSystem
.
test
().
directory
(
'/foo/bar'
)
;
@override
@override
AndroidSdkVersion
latestVersion
;
AndroidSdkVersion
?
latestVersion
;
@override
@override
String
emulatorPath
;
String
?
emulatorPath
;
@override
@override
List
<
String
>
validateSdkWellFormed
()
=>
<
String
>[];
List
<
String
>
validateSdkWellFormed
()
=>
<
String
>[];
...
@@ -567,10 +565,10 @@ class FakeAndroidSdk extends Fake implements AndroidSdk {
...
@@ -567,10 +565,10 @@ class FakeAndroidSdk extends Fake implements AndroidSdk {
class
FakeAndroidSdkVersion
extends
Fake
implements
AndroidSdkVersion
{
class
FakeAndroidSdkVersion
extends
Fake
implements
AndroidSdkVersion
{
@override
@override
int
sdkLevel
;
int
sdkLevel
=
0
;
@override
@override
Version
buildToolsVersion
;
Version
buildToolsVersion
=
Version
(
0
,
0
,
0
)
;
@override
@override
String
get
buildToolsVersionName
=>
''
;
String
get
buildToolsVersionName
=>
''
;
...
...
packages/flutter_tools/test/general.shard/build_system/targets/desktop_test.dart
View file @
a56c5e51
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'package:file/memory.dart'
;
import
'package:file/memory.dart'
;
import
'package:file_testing/file_testing.dart'
;
import
'package:file_testing/file_testing.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
...
...
packages/flutter_tools/test/general.shard/flutter_validator_test.dart
View file @
a56c5e51
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'package:file/memory.dart'
;
import
'package:file/memory.dart'
;
import
'package:flutter_tools/src/artifacts.dart'
;
import
'package:flutter_tools/src/artifacts.dart'
;
import
'package:flutter_tools/src/base/os.dart'
;
import
'package:flutter_tools/src/base/os.dart'
;
...
@@ -20,9 +18,9 @@ import '../src/fakes.dart';
...
@@ -20,9 +18,9 @@ import '../src/fakes.dart';
/// Matches a doctor validation result.
/// Matches a doctor validation result.
Matcher
_matchDoctorValidation
(
{
Matcher
_matchDoctorValidation
(
{
ValidationType
validationType
,
required
ValidationType
validationType
,
String
statusInfo
,
required
String
statusInfo
,
dynamic
messages
required
Object
messages
})
{
})
{
return
const
TypeMatcher
<
ValidationResult
>()
return
const
TypeMatcher
<
ValidationResult
>()
.
having
((
ValidationResult
result
)
=>
result
.
type
,
'type'
,
validationType
)
.
having
((
ValidationResult
result
)
=>
result
.
type
,
'type'
,
validationType
)
...
@@ -235,7 +233,7 @@ void main() {
...
@@ -235,7 +233,7 @@ void main() {
}
}
class
FakeOperatingSystemUtils
extends
Fake
implements
OperatingSystemUtils
{
class
FakeOperatingSystemUtils
extends
Fake
implements
OperatingSystemUtils
{
FakeOperatingSystemUtils
({
this
.
name
});
FakeOperatingSystemUtils
({
required
this
.
name
});
@override
@override
final
String
name
;
final
String
name
;
...
...
packages/flutter_tools/test/general.shard/ios/ios_device_install_test.dart
View file @
a56c5e51
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'package:file/memory.dart'
;
import
'package:file/memory.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'
;
...
@@ -17,7 +15,6 @@ import 'package:flutter_tools/src/ios/devices.dart';
...
@@ -17,7 +15,6 @@ import 'package:flutter_tools/src/ios/devices.dart';
import
'package:flutter_tools/src/ios/ios_deploy.dart'
;
import
'package:flutter_tools/src/ios/ios_deploy.dart'
;
import
'package:flutter_tools/src/ios/iproxy.dart'
;
import
'package:flutter_tools/src/ios/iproxy.dart'
;
import
'package:flutter_tools/src/ios/mac.dart'
;
import
'package:flutter_tools/src/ios/mac.dart'
;
import
'package:meta/meta.dart'
;
import
'../../src/common.dart'
;
import
'../../src/common.dart'
;
import
'../../src/fake_process_manager.dart'
;
import
'../../src/fake_process_manager.dart'
;
...
@@ -28,10 +25,10 @@ const Map<String, String> kDyLdLibEntry = <String, String>{
...
@@ -28,10 +25,10 @@ const Map<String, String> kDyLdLibEntry = <String, String>{
};
};
void
main
(
)
{
void
main
(
)
{
Artifacts
artifacts
;
late
Artifacts
artifacts
;
String
iosDeployPath
;
late
String
iosDeployPath
;
FileSystem
fileSystem
;
late
FileSystem
fileSystem
;
Directory
bundleDirectory
;
late
Directory
bundleDirectory
;
setUp
(()
{
setUp
(()
{
artifacts
=
Artifacts
.
test
();
artifacts
=
Artifacts
.
test
();
...
@@ -319,11 +316,11 @@ void main() {
...
@@ -319,11 +316,11 @@ void main() {
}
}
IOSDevice
setUpIOSDevice
(
{
IOSDevice
setUpIOSDevice
(
{
@
required
ProcessManager
processManager
,
required
ProcessManager
processManager
,
FileSystem
fileSystem
,
FileSystem
?
fileSystem
,
Logger
logger
,
Logger
?
logger
,
IOSDeviceConnectionInterface
interfaceType
,
IOSDeviceConnectionInterface
?
interfaceType
,
Artifacts
artifacts
,
Artifacts
?
artifacts
,
})
{
})
{
logger
??=
BufferLogger
.
test
();
logger
??=
BufferLogger
.
test
();
final
FakePlatform
platform
=
FakePlatform
(
final
FakePlatform
platform
=
FakePlatform
(
...
@@ -360,6 +357,6 @@ IOSDevice setUpIOSDevice({
...
@@ -360,6 +357,6 @@ IOSDevice setUpIOSDevice({
cache:
cache
,
cache:
cache
,
),
),
iProxy:
IProxy
.
test
(
logger:
logger
,
processManager:
processManager
),
iProxy:
IProxy
.
test
(
logger:
logger
,
processManager:
processManager
),
interfaceType:
interfaceType
,
interfaceType:
interfaceType
??
IOSDeviceConnectionInterface
.
usb
,
);
);
}
}
packages/flutter_tools/test/general.shard/ios/ios_device_logger_test.dart
View file @
a56c5e51
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'dart:async'
;
import
'dart:async'
;
import
'package:flutter_tools/src/artifacts.dart'
;
import
'package:flutter_tools/src/artifacts.dart'
;
...
@@ -24,11 +22,11 @@ import '../../src/fake_process_manager.dart';
...
@@ -24,11 +22,11 @@ import '../../src/fake_process_manager.dart';
import
'../../src/fake_vm_services.dart'
;
import
'../../src/fake_vm_services.dart'
;
void
main
(
)
{
void
main
(
)
{
FakeProcessManager
processManager
;
late
FakeProcessManager
processManager
;
Artifacts
artifacts
;
late
Artifacts
artifacts
;
Cache
fakeCache
;
late
Cache
fakeCache
;
BufferLogger
logger
;
late
BufferLogger
logger
;
String
ideviceSyslogPath
;
late
String
ideviceSyslogPath
;
setUp
(()
{
setUp
(()
{
processManager
=
FakeProcessManager
.
empty
();
processManager
=
FakeProcessManager
.
empty
();
...
@@ -328,8 +326,8 @@ Runner(libsystem_asl.dylib)[297] <Notice>: libMobileGestalt
...
@@ -328,8 +326,8 @@ Runner(libsystem_asl.dylib)[297] <Notice>: libMobileGestalt
),
),
useSyslog:
false
,
useSyslog:
false
,
);
);
Object
exception
;
Object
?
exception
;
StackTrace
trace
;
StackTrace
?
trace
;
await
asyncGuard
(
await
asyncGuard
(
()
async
{
()
async
{
await
logReader
.
linesController
.
close
();
await
logReader
.
linesController
.
close
();
...
...
packages/flutter_tools/test/general.shard/ios/ios_device_start_prebuilt_test.dart
View file @
a56c5e51
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'dart:async'
;
import
'dart:async'
;
import
'dart:convert'
;
import
'dart:convert'
;
...
@@ -66,8 +64,8 @@ const FakeCommand kLaunchDebugCommand = FakeCommand(command: <String>[
...
@@ -66,8 +64,8 @@ const FakeCommand kLaunchDebugCommand = FakeCommand(command: <String>[
// The command used to actually launch the app and attach the debugger with args in debug.
// The command used to actually launch the app and attach the debugger with args in debug.
FakeCommand
attachDebuggerCommand
(
{
FakeCommand
attachDebuggerCommand
(
{
IOSink
stdin
,
IOSink
?
stdin
,
Completer
<
void
>
/*?*/
completer
,
Completer
<
void
>
?
completer
,
})
{
})
{
return
FakeCommand
(
return
FakeCommand
(
command:
const
<
String
>[
command:
const
<
String
>[
...
@@ -359,10 +357,10 @@ void main() {
...
@@ -359,10 +357,10 @@ void main() {
IOSDevice
setUpIOSDevice
(
{
IOSDevice
setUpIOSDevice
(
{
String
sdkVersion
=
'13.0.1'
,
String
sdkVersion
=
'13.0.1'
,
FileSystem
fileSystem
,
FileSystem
?
fileSystem
,
Logger
logger
,
Logger
?
logger
,
ProcessManager
processManager
,
ProcessManager
?
processManager
,
IOSDeploy
iosDeploy
,
IOSDeploy
?
iosDeploy
,
})
{
})
{
final
Artifacts
artifacts
=
Artifacts
.
test
();
final
Artifacts
artifacts
=
Artifacts
.
test
();
final
FakePlatform
macPlatform
=
FakePlatform
(
final
FakePlatform
macPlatform
=
FakePlatform
(
...
@@ -377,24 +375,24 @@ IOSDevice setUpIOSDevice({
...
@@ -377,24 +375,24 @@ IOSDevice setUpIOSDevice({
],
],
processManager:
FakeProcessManager
.
any
(),
processManager:
FakeProcessManager
.
any
(),
);
);
logger
??=
BufferLogger
.
test
();
return
IOSDevice
(
'123'
,
return
IOSDevice
(
'123'
,
name:
'iPhone 1'
,
name:
'iPhone 1'
,
sdkVersion:
sdkVersion
,
sdkVersion:
sdkVersion
,
fileSystem:
fileSystem
??
MemoryFileSystem
.
test
(),
fileSystem:
fileSystem
??
MemoryFileSystem
.
test
(),
platform:
macPlatform
,
platform:
macPlatform
,
iProxy:
IProxy
.
test
(
logger:
logger
,
processManager:
processManager
??
FakeProcessManager
.
any
()),
iProxy:
IProxy
.
test
(
logger:
logger
,
processManager:
processManager
??
FakeProcessManager
.
any
()),
logger:
logger
??
BufferLogger
.
test
()
,
logger:
logger
,
iosDeploy:
iosDeploy
??
iosDeploy:
iosDeploy
??
IOSDeploy
(
IOSDeploy
(
logger:
logger
??
BufferLogger
.
test
()
,
logger:
logger
,
platform:
macPlatform
,
platform:
macPlatform
,
processManager:
processManager
??
FakeProcessManager
.
any
(),
processManager:
processManager
??
FakeProcessManager
.
any
(),
artifacts:
artifacts
,
artifacts:
artifacts
,
cache:
cache
,
cache:
cache
,
),
),
iMobileDevice:
IMobileDevice
(
iMobileDevice:
IMobileDevice
(
logger:
logger
??
BufferLogger
.
test
()
,
logger:
logger
,
processManager:
processManager
??
FakeProcessManager
.
any
(),
processManager:
processManager
??
FakeProcessManager
.
any
(),
artifacts:
artifacts
,
artifacts:
artifacts
,
cache:
cache
,
cache:
cache
,
...
...
packages/flutter_tools/test/general.shard/linux/linux_device_test.dart
View file @
a56c5e51
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
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/logger.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
...
...
packages/flutter_tools/test/general.shard/macos/macos_ipad_device_test.dart
View file @
a56c5e51
...
@@ -2,22 +2,21 @@
...
@@ -2,22 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'package:file/memory.dart'
;
import
'package:file/memory.dart'
;
import
'package:flutter_tools/src/application_package.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
import
'package:flutter_tools/src/base/os.dart'
;
import
'package:flutter_tools/src/base/os.dart'
;
import
'package:flutter_tools/src/base/platform.dart'
;
import
'package:flutter_tools/src/base/platform.dart'
;
import
'package:flutter_tools/src/build_info.dart'
;
import
'package:flutter_tools/src/build_info.dart'
;
import
'package:flutter_tools/src/desktop_device.dart'
;
import
'package:flutter_tools/src/desktop_device.dart'
;
import
'package:flutter_tools/src/device.dart'
;
import
'package:flutter_tools/src/device.dart'
;
import
'package:flutter_tools/src/ios/application_package.dart'
;
import
'package:flutter_tools/src/ios/ios_workflow.dart'
;
import
'package:flutter_tools/src/ios/ios_workflow.dart'
;
import
'package:flutter_tools/src/macos/macos_ipad_device.dart'
;
import
'package:flutter_tools/src/macos/macos_ipad_device.dart'
;
import
'package:meta/meta.dart'
;
import
'package:test/fake.dart'
;
import
'package:test/fake.dart'
;
import
'../../src/common.dart'
;
import
'../../src/common.dart'
;
import
'../../src/
context
.dart'
;
import
'../../src/
fake_process_manager
.dart'
;
import
'../../src/fakes.dart'
;
import
'../../src/fakes.dart'
;
void
main
(
)
{
void
main
(
)
{
...
@@ -125,25 +124,34 @@ void main() {
...
@@ -125,25 +124,34 @@ void main() {
expect
(
device
.
portForwarder
,
isNot
(
isNull
));
expect
(
device
.
portForwarder
,
isNot
(
isNull
));
expect
(
await
device
.
targetPlatform
,
TargetPlatform
.
darwin
);
expect
(
await
device
.
targetPlatform
,
TargetPlatform
.
darwin
);
expect
(
await
device
.
installApp
(
null
),
isTrue
);
expect
(
await
device
.
installApp
(
FakeApplicationPackage
()
),
isTrue
);
expect
(
await
device
.
isAppInstalled
(
null
),
isTrue
);
expect
(
await
device
.
isAppInstalled
(
FakeApplicationPackage
()
),
isTrue
);
expect
(
await
device
.
isLatestBuildInstalled
(
null
),
isTrue
);
expect
(
await
device
.
isLatestBuildInstalled
(
FakeApplicationPackage
()
),
isTrue
);
expect
(
await
device
.
uninstallApp
(
null
),
isTrue
);
expect
(
await
device
.
uninstallApp
(
FakeApplicationPackage
()
),
isTrue
);
expect
(
device
.
isSupported
(),
isTrue
);
expect
(
device
.
isSupported
(),
isTrue
);
expect
(
device
.
getLogReader
(),
isA
<
DesktopLogReader
>());
expect
(
device
.
getLogReader
(),
isA
<
DesktopLogReader
>());
expect
(
await
device
.
stopApp
(
null
),
isFalse
);
expect
(
await
device
.
stopApp
(
FakeIOSApp
()
),
isFalse
);
await
expectLater
(()
=>
device
.
startApp
(
null
,
debuggingOptions:
null
),
throwsA
(
isA
<
UnimplementedError
>()));
await
expectLater
(
await
expectLater
(()
=>
device
.
buildForDevice
(
null
,
buildInfo:
BuildInfo
.
debug
),
throwsA
(
isA
<
UnimplementedError
>()));
()
=>
device
.
startApp
(
expect
(
device
.
executablePathForDevice
(
null
,
null
),
null
);
FakeIOSApp
(),
debuggingOptions:
DebuggingOptions
.
disabled
(
BuildInfo
.
debug
),
),
throwsA
(
isA
<
UnimplementedError
>()),
);
await
expectLater
(()
=>
device
.
buildForDevice
(
FakeIOSApp
(),
buildInfo:
BuildInfo
.
debug
),
throwsA
(
isA
<
UnimplementedError
>()));
expect
(
device
.
executablePathForDevice
(
FakeIOSApp
(),
BuildMode
.
debug
),
null
);
});
});
}
}
class
FakeIOSWorkflow
extends
Fake
implements
IOSWorkflow
{
class
FakeIOSWorkflow
extends
Fake
implements
IOSWorkflow
{
FakeIOSWorkflow
({
@
required
this
.
canListDevices
});
FakeIOSWorkflow
({
required
this
.
canListDevices
});
@override
@override
final
bool
canListDevices
;
final
bool
canListDevices
;
}
}
class
FakeApplicationPackage
extends
Fake
implements
ApplicationPackage
{}
class
FakeIOSApp
extends
Fake
implements
IOSApp
{}
packages/flutter_tools/test/general.shard/runner/utils.dart
View file @
a56c5e51
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'package:flutter_tools/src/runner/flutter_command.dart'
;
import
'package:flutter_tools/src/runner/flutter_command.dart'
;
typedef
CommandFunction
=
Future
<
FlutterCommandResult
>
Function
();
typedef
CommandFunction
=
Future
<
FlutterCommandResult
>
Function
();
...
@@ -17,11 +15,11 @@ class DummyFlutterCommand extends FlutterCommand {
...
@@ -17,11 +15,11 @@ class DummyFlutterCommand extends FlutterCommand {
this
.
commandFunction
,
this
.
commandFunction
,
this
.
packagesPath
,
this
.
packagesPath
,
this
.
fileSystemScheme
,
this
.
fileSystemScheme
,
this
.
fileSystemRoots
,
this
.
fileSystemRoots
=
const
<
String
>[]
,
});
});
final
bool
noUsagePath
;
final
bool
noUsagePath
;
final
CommandFunction
commandFunction
;
final
CommandFunction
?
commandFunction
;
@override
@override
final
bool
shouldUpdateCache
;
final
bool
shouldUpdateCache
;
...
@@ -30,21 +28,21 @@ class DummyFlutterCommand extends FlutterCommand {
...
@@ -30,21 +28,21 @@ class DummyFlutterCommand extends FlutterCommand {
String
get
description
=>
'does nothing'
;
String
get
description
=>
'does nothing'
;
@override
@override
Future
<
String
>
get
usagePath
=>
noUsagePath
?
null
:
super
.
usagePath
;
Future
<
String
?>
get
usagePath
async
=>
noUsagePath
?
null
:
super
.
usagePath
;
@override
@override
final
String
name
;
final
String
name
;
@override
@override
Future
<
FlutterCommandResult
>
runCommand
()
async
{
Future
<
FlutterCommandResult
>
runCommand
()
async
{
return
commandFunction
==
null
?
FlutterCommandResult
.
fail
()
:
await
commandFunction
();
return
commandFunction
==
null
?
FlutterCommandResult
.
fail
()
:
await
commandFunction
!
();
}
}
@override
@override
final
String
packagesPath
;
final
String
?
packagesPath
;
@override
@override
final
String
fileSystemScheme
;
final
String
?
fileSystemScheme
;
@override
@override
final
List
<
String
>
fileSystemRoots
;
final
List
<
String
>
fileSystemRoots
;
...
...
packages/flutter_tools/test/general.shard/update_packages_test.dart
View file @
a56c5e51
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'package:file/memory.dart'
;
import
'package:file/memory.dart'
;
import
'package:file_testing/file_testing.dart'
;
import
'package:file_testing/file_testing.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
import
'package:flutter_tools/src/base/file_system.dart'
;
...
@@ -79,9 +77,9 @@ dependencies:
...
@@ -79,9 +77,9 @@ dependencies:
'''
;
'''
;
void
main
(
)
{
void
main
(
)
{
FileSystem
fileSystem
;
late
FileSystem
fileSystem
;
Directory
flutterSdk
;
late
Directory
flutterSdk
;
Directory
flutter
;
late
Directory
flutter
;
setUp
(()
{
setUp
(()
{
fileSystem
=
MemoryFileSystem
.
test
();
fileSystem
=
MemoryFileSystem
.
test
();
...
...
packages/flutter_tools/test/general.shard/windows/windows_device_test.dart
View file @
a56c5e51
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
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/logger.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
...
@@ -17,7 +15,7 @@ import 'package:flutter_tools/src/windows/windows_workflow.dart';
...
@@ -17,7 +15,7 @@ import 'package:flutter_tools/src/windows/windows_workflow.dart';
import
'package:test/fake.dart'
;
import
'package:test/fake.dart'
;
import
'../../src/common.dart'
;
import
'../../src/common.dart'
;
import
'../../src/
context
.dart'
;
import
'../../src/
fake_process_manager
.dart'
;
import
'../../src/fakes.dart'
;
import
'../../src/fakes.dart'
;
void
main
(
)
{
void
main
(
)
{
...
@@ -118,9 +116,9 @@ FlutterProject setUpFlutterProject(Directory directory) {
...
@@ -118,9 +116,9 @@ FlutterProject setUpFlutterProject(Directory directory) {
}
}
WindowsDevice
setUpWindowsDevice
(
{
WindowsDevice
setUpWindowsDevice
(
{
FileSystem
fileSystem
,
FileSystem
?
fileSystem
,
Logger
logger
,
Logger
?
logger
,
ProcessManager
processManager
,
ProcessManager
?
processManager
,
})
{
})
{
return
WindowsDevice
(
return
WindowsDevice
(
fileSystem:
fileSystem
??
MemoryFileSystem
.
test
(),
fileSystem:
fileSystem
??
MemoryFileSystem
.
test
(),
...
...
packages/flutter_tools/test/integration.shard/cache_test.dart
View file @
a56c5e51
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'dart:io'
as
io
show
ProcessSignal
;
import
'dart:io'
as
io
show
ProcessSignal
;
import
'package:file/file.dart'
;
import
'package:file/file.dart'
;
...
@@ -17,7 +15,7 @@ import 'package:process/process.dart';
...
@@ -17,7 +15,7 @@ import 'package:process/process.dart';
import
'package:test/fake.dart'
;
import
'package:test/fake.dart'
;
import
'../src/common.dart'
;
import
'../src/common.dart'
;
import
'../src/
context
.dart'
;
import
'../src/
fake_process_manager
.dart'
;
import
'../src/fakes.dart'
;
import
'../src/fakes.dart'
;
import
'test_utils.dart'
;
import
'test_utils.dart'
;
...
@@ -32,14 +30,14 @@ void main() {
...
@@ -32,14 +30,14 @@ void main() {
}
}
testWithoutContext
(
testWithoutContext
(
'should log a message to stderr when lock is not acquired'
,
()
async
{
'should log a message to stderr when lock is not acquired'
,
()
async
{
final
String
oldRoot
=
Cache
.
flutterRoot
;
final
String
?
oldRoot
=
Cache
.
flutterRoot
;
final
Directory
tempDir
=
fileSystem
.
systemTempDirectory
.
createTempSync
(
'cache_test.'
);
final
Directory
tempDir
=
fileSystem
.
systemTempDirectory
.
createTempSync
(
'cache_test.'
);
final
BufferLogger
logger
=
BufferLogger
(
final
BufferLogger
logger
=
BufferLogger
(
terminal:
Terminal
.
test
(
supportsColor:
false
,
supportsEmoji:
false
),
terminal:
Terminal
.
test
(
supportsColor:
false
,
supportsEmoji:
false
),
outputPreferences:
OutputPreferences
(),
outputPreferences:
OutputPreferences
(),
);
);
logger
.
fatalWarnings
=
true
;
logger
.
fatalWarnings
=
true
;
Process
process
;
Process
?
process
;
try
{
try
{
Cache
.
flutterRoot
=
tempDir
.
absolute
.
path
;
Cache
.
flutterRoot
=
tempDir
.
absolute
.
path
;
final
Cache
cache
=
Cache
.
test
(
final
Cache
cache
=
Cache
.
test
(
...
@@ -48,10 +46,10 @@ void main() {
...
@@ -48,10 +46,10 @@ void main() {
logger:
logger
,
logger:
logger
,
);
);
final
File
cacheFile
=
fileSystem
.
file
(
fileSystem
.
path
final
File
cacheFile
=
fileSystem
.
file
(
fileSystem
.
path
.
join
(
Cache
.
flutterRoot
,
'bin'
,
'cache'
,
'lockfile'
))
.
join
(
Cache
.
flutterRoot
!
,
'bin'
,
'cache'
,
'lockfile'
))
..
createSync
(
recursive:
true
);
..
createSync
(
recursive:
true
);
final
File
script
=
fileSystem
.
file
(
fileSystem
.
path
final
File
script
=
fileSystem
.
file
(
fileSystem
.
path
.
join
(
Cache
.
flutterRoot
,
'bin'
,
'cache'
,
'test_lock.dart'
));
.
join
(
Cache
.
flutterRoot
!
,
'bin'
,
'cache'
,
'test_lock.dart'
));
script
.
writeAsStringSync
(
r''
'
script
.
writeAsStringSync
(
r''
'
import '
dart:
async
';
import '
dart:
async
';
import '
dart:
io
';
import '
dart:
io
';
...
@@ -113,7 +111,7 @@ Future<void> main(List<String> args) async {
...
@@ -113,7 +111,7 @@ Future<void> main(List<String> args) async {
});
});
testWithoutContext
(
testWithoutContext
(
'should log a warning message for unknown version '
,
()
async
{
'should log a warning message for unknown version '
,
()
async
{
final
String
oldRoot
=
Cache
.
flutterRoot
;
final
String
?
oldRoot
=
Cache
.
flutterRoot
;
final
Directory
tempDir
=
fileSystem
.
systemTempDirectory
.
createTempSync
(
'cache_test.'
);
final
Directory
tempDir
=
fileSystem
.
systemTempDirectory
.
createTempSync
(
'cache_test.'
);
final
BufferLogger
logger
=
BufferLogger
(
final
BufferLogger
logger
=
BufferLogger
(
terminal:
Terminal
.
test
(
supportsColor:
false
,
supportsEmoji:
false
),
terminal:
Terminal
.
test
(
supportsColor:
false
,
supportsEmoji:
false
),
...
@@ -164,8 +162,8 @@ Future<void> main(List<String> args) async {
...
@@ -164,8 +162,8 @@ Future<void> main(List<String> args) async {
}
}
class
FakeArtifactUpdater
extends
Fake
implements
ArtifactUpdater
{
class
FakeArtifactUpdater
extends
Fake
implements
ArtifactUpdater
{
void
Function
(
String
,
Uri
,
Directory
)
onDownloadZipArchive
;
void
Function
(
String
,
Uri
,
Directory
)
?
onDownloadZipArchive
;
void
Function
(
String
,
Uri
,
Directory
)
onDownloadZipTarball
;
void
Function
(
String
,
Uri
,
Directory
)
?
onDownloadZipTarball
;
@override
@override
Future
<
void
>
downloadZippedTarball
(
String
message
,
Uri
url
,
Directory
location
)
async
{
Future
<
void
>
downloadZippedTarball
(
String
message
,
Uri
url
,
Directory
location
)
async
{
...
@@ -189,7 +187,7 @@ class FakeVersionlessArtifact extends CachedArtifact {
...
@@ -189,7 +187,7 @@ class FakeVersionlessArtifact extends CachedArtifact {
);
);
@override
@override
String
get
version
=>
null
;
String
?
get
version
=>
null
;
@override
@override
Future
<
void
>
updateInner
(
ArtifactUpdater
artifactUpdater
,
FileSystem
fileSystem
,
OperatingSystemUtils
operatingSystemUtils
)
async
{
}
Future
<
void
>
updateInner
(
ArtifactUpdater
artifactUpdater
,
FileSystem
fileSystem
,
OperatingSystemUtils
operatingSystemUtils
)
async
{
}
...
...
packages/flutter_tools/test/integration.shard/migrate_command_test.dart
View file @
a56c5e51
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// found in the LICENSE file.
// @dart = 2.8
import
'package:file/file.dart'
;
import
'package:file/file.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/logger.dart'
;
import
'package:flutter_tools/src/base/logger.dart'
;
...
@@ -15,12 +13,12 @@ import 'package:flutter_tools/src/migrate/migrate_utils.dart';
...
@@ -15,12 +13,12 @@ import 'package:flutter_tools/src/migrate/migrate_utils.dart';
import
'../src/common.dart'
;
import
'../src/common.dart'
;
void
main
(
)
{
void
main
(
)
{
BufferLogger
logger
;
late
BufferLogger
logger
;
FileSystem
fileSystem
;
late
FileSystem
fileSystem
;
Directory
projectRoot
;
late
Directory
projectRoot
;
String
projectRootPath
;
late
String
projectRootPath
;
ProcessUtils
processUtils
;
late
ProcessUtils
processUtils
;
MigrateUtils
utils
;
late
MigrateUtils
utils
;
setUpAll
(()
async
{
setUpAll
(()
async
{
fileSystem
=
globals
.
localFileSystem
;
fileSystem
=
globals
.
localFileSystem
;
...
...
packages/flutter_tools/test/src/fakes.dart
View file @
a56c5e51
...
@@ -360,7 +360,7 @@ class FakeFlutterVersion implements FlutterVersion {
...
@@ -360,7 +360,7 @@ class FakeFlutterVersion implements FlutterVersion {
final
String
engineRevisionShort
;
final
String
engineRevisionShort
;
@override
@override
final
String
repositoryUrl
;
final
String
?
repositoryUrl
;
@override
@override
final
String
frameworkVersion
;
final
String
frameworkVersion
;
...
...
packages/flutter_tools/test/web.shard/web_driver_service_test.dart
View file @
a56c5e51
...
@@ -11,7 +11,7 @@ import 'package:flutter_tools/src/drive/web_driver_service.dart';
...
@@ -11,7 +11,7 @@ import 'package:flutter_tools/src/drive/web_driver_service.dart';
import
'package:package_config/package_config_types.dart'
;
import
'package:package_config/package_config_types.dart'
;
import
'../src/common.dart'
;
import
'../src/common.dart'
;
import
'../src/
context
.dart'
;
import
'../src/
fake_process_manager
.dart'
;
void
main
(
)
{
void
main
(
)
{
testWithoutContext
(
'WebDriverService catches SocketExceptions cleanly and includes link to documentation'
,
()
async
{
testWithoutContext
(
'WebDriverService catches SocketExceptions cleanly and includes link to documentation'
,
()
async
{
...
...
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