Migrate application_package to null safety (#83956)
This commit is contained in:
@@ -381,6 +381,17 @@ void main() {
|
||||
|
||||
expect(iosApp, null);
|
||||
}, overrides: overrides);
|
||||
|
||||
testUsingContext('returns null when there with no product identifier', () async {
|
||||
globals.fs.file('pubspec.yaml').createSync();
|
||||
globals.fs.file('.packages').createSync();
|
||||
final Directory project = globals.fs.directory('ios/Runner.xcodeproj')..createSync(recursive: true);
|
||||
project.childFile('project.pbxproj').createSync();
|
||||
final BuildableIOSApp iosApp = await IOSApp.fromIosProject(
|
||||
FlutterProject.fromDirectory(globals.fs.currentDirectory).ios, null) as BuildableIOSApp;
|
||||
|
||||
expect(iosApp, null);
|
||||
}, overrides: overrides);
|
||||
});
|
||||
|
||||
group('FuchsiaApp', () {
|
||||
|
||||
@@ -30,14 +30,17 @@ const Map<String, String> kDyLdLibEntry = <String, String>{
|
||||
void main() {
|
||||
Artifacts artifacts;
|
||||
String iosDeployPath;
|
||||
FileSystem fileSystem;
|
||||
Directory bundleDirectory;
|
||||
|
||||
setUp(() {
|
||||
artifacts = Artifacts.test();
|
||||
fileSystem = MemoryFileSystem.test();
|
||||
bundleDirectory = fileSystem.directory('bundle');
|
||||
iosDeployPath = artifacts.getHostArtifact(HostArtifact.iosDeploy).path;
|
||||
});
|
||||
|
||||
testWithoutContext('IOSDevice.installApp calls ios-deploy correctly with USB', () async {
|
||||
final FileSystem fileSystem = MemoryFileSystem.test();
|
||||
final IOSApp iosApp = PrebuiltIOSApp(
|
||||
projectBundleId: 'app',
|
||||
bundleDir: fileSystem.currentDirectory,
|
||||
@@ -68,7 +71,6 @@ void main() {
|
||||
});
|
||||
|
||||
testWithoutContext('IOSDevice.installApp calls ios-deploy correctly with network', () async {
|
||||
final FileSystem fileSystem = MemoryFileSystem.test();
|
||||
final IOSApp iosApp = PrebuiltIOSApp(
|
||||
projectBundleId: 'app',
|
||||
bundleDir: fileSystem.currentDirectory,
|
||||
@@ -98,7 +100,7 @@ void main() {
|
||||
});
|
||||
|
||||
testWithoutContext('IOSDevice.uninstallApp calls ios-deploy correctly', () async {
|
||||
final IOSApp iosApp = PrebuiltIOSApp(projectBundleId: 'app');
|
||||
final IOSApp iosApp = PrebuiltIOSApp(projectBundleId: 'app', bundleDir: bundleDirectory);
|
||||
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
||||
FakeCommand(command: <String>[
|
||||
iosDeployPath,
|
||||
@@ -121,7 +123,7 @@ void main() {
|
||||
|
||||
group('isAppInstalled', () {
|
||||
testWithoutContext('catches ProcessException from ios-deploy', () async {
|
||||
final IOSApp iosApp = PrebuiltIOSApp(projectBundleId: 'app');
|
||||
final IOSApp iosApp = PrebuiltIOSApp(projectBundleId: 'app', bundleDir: bundleDirectory);
|
||||
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
||||
FakeCommand(command: <String>[
|
||||
iosDeployPath,
|
||||
@@ -145,7 +147,7 @@ void main() {
|
||||
});
|
||||
|
||||
testWithoutContext('returns true when app is installed', () async {
|
||||
final IOSApp iosApp = PrebuiltIOSApp(projectBundleId: 'app');
|
||||
final IOSApp iosApp = PrebuiltIOSApp(projectBundleId: 'app', bundleDir: bundleDirectory);
|
||||
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
||||
FakeCommand(command: <String>[
|
||||
iosDeployPath,
|
||||
@@ -169,7 +171,7 @@ void main() {
|
||||
});
|
||||
|
||||
testWithoutContext('returns false when app is not installed', () async {
|
||||
final IOSApp iosApp = PrebuiltIOSApp(projectBundleId: 'app');
|
||||
final IOSApp iosApp = PrebuiltIOSApp(projectBundleId: 'app', bundleDir: bundleDirectory);
|
||||
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
||||
FakeCommand(command: <String>[
|
||||
iosDeployPath,
|
||||
@@ -195,7 +197,7 @@ void main() {
|
||||
});
|
||||
|
||||
testWithoutContext('returns false on command timeout or other error', () async {
|
||||
final IOSApp iosApp = PrebuiltIOSApp(projectBundleId: 'app');
|
||||
final IOSApp iosApp = PrebuiltIOSApp(projectBundleId: 'app', bundleDir: bundleDirectory);
|
||||
const String stderr = '2020-03-26 17:48:43.484 ios-deploy[21518:5501783] [ !! ] Timed out waiting for device';
|
||||
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
||||
FakeCommand(command: <String>[
|
||||
@@ -224,7 +226,6 @@ void main() {
|
||||
});
|
||||
|
||||
testWithoutContext('IOSDevice.installApp catches ProcessException from ios-deploy', () async {
|
||||
final FileSystem fileSystem = MemoryFileSystem.test();
|
||||
final IOSApp iosApp = PrebuiltIOSApp(
|
||||
projectBundleId: 'app',
|
||||
bundleDir: fileSystem.currentDirectory,
|
||||
@@ -249,7 +250,7 @@ void main() {
|
||||
});
|
||||
|
||||
testWithoutContext('IOSDevice.uninstallApp catches ProcessException from ios-deploy', () async {
|
||||
final IOSApp iosApp = PrebuiltIOSApp(projectBundleId: 'app');
|
||||
final IOSApp iosApp = PrebuiltIOSApp(projectBundleId: 'app', bundleDir: bundleDirectory);
|
||||
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
|
||||
FakeCommand(command: <String>[
|
||||
iosDeployPath,
|
||||
|
||||
@@ -93,6 +93,7 @@ void main() {
|
||||
final IOSApp iosApp = PrebuiltIOSApp(
|
||||
projectBundleId: 'app',
|
||||
bundleName: 'Runner',
|
||||
bundleDir: MemoryFileSystem.test().directory('bundle'),
|
||||
);
|
||||
|
||||
device.portForwarder = devicePortForwarder;
|
||||
|
||||
Reference in New Issue
Block a user