Unverified Commit 7c7ae991 authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Use `hasNoRemainingExpectations` matcher for fake process manager in tool tests (#108649)

parent 4085cb88
...@@ -16,6 +16,7 @@ import 'package:flutter_tools/src/version.dart'; ...@@ -16,6 +16,7 @@ import 'package:flutter_tools/src/version.dart';
import '../../src/common.dart'; import '../../src/common.dart';
import '../../src/context.dart'; import '../../src/context.dart';
import '../../src/fake_process_manager.dart';
import '../../src/fakes.dart'; import '../../src/fakes.dart';
import '../../src/test_build_system.dart'; import '../../src/test_build_system.dart';
...@@ -535,7 +536,7 @@ void main() { ...@@ -535,7 +536,7 @@ void main() {
output, output,
fakeProcessManager, fakeProcessManager,
); );
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}); });
testWithoutContext('created with symbols', () async { testWithoutContext('created with symbols', () async {
...@@ -577,7 +578,7 @@ void main() { ...@@ -577,7 +578,7 @@ void main() {
output, output,
fakeProcessManager, fakeProcessManager,
); );
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}); });
}); });
} }
...@@ -23,6 +23,7 @@ import 'package:flutter_tools/src/reporting/reporting.dart'; ...@@ -23,6 +23,7 @@ import 'package:flutter_tools/src/reporting/reporting.dart';
import '../../src/common.dart'; import '../../src/common.dart';
import '../../src/context.dart'; import '../../src/context.dart';
import '../../src/fake_process_manager.dart';
import '../../src/fakes.dart'; import '../../src/fakes.dart';
import '../../src/test_flutter_command_runner.dart'; import '../../src/test_flutter_command_runner.dart';
...@@ -366,7 +367,7 @@ STDERR STUFF ...@@ -366,7 +367,7 @@ STDERR STUFF
const <String>['build', 'macos', '--debug', '--no-pub'] const <String>['build', 'macos', '--debug', '--no-pub']
); );
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
FileSystem: () => fileSystem, FileSystem: () => fileSystem,
ProcessManager: () => fakeProcessManager, ProcessManager: () => fakeProcessManager,
......
...@@ -65,7 +65,7 @@ void main() { ...@@ -65,7 +65,7 @@ void main() {
expect(await androidDevices.pollingGetDevices(), isEmpty); expect(await androidDevices.pollingGetDevices(), isEmpty);
expect(await androidDevices.getDiagnostics(), isEmpty); expect(await androidDevices.getDiagnostics(), isEmpty);
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}); });
testWithoutContext('AndroidDevices returns empty device list and diagnostics on null Android SDK', () async { testWithoutContext('AndroidDevices returns empty device list and diagnostics on null Android SDK', () async {
......
...@@ -14,6 +14,7 @@ import 'package:flutter_tools/src/globals.dart' as globals; ...@@ -14,6 +14,7 @@ import 'package:flutter_tools/src/globals.dart' as globals;
import '../../src/common.dart'; import '../../src/common.dart';
import '../../src/context.dart'; import '../../src/context.dart';
import '../../src/fake_process_manager.dart';
const String home = '/home/me'; const String home = '/home/me';
...@@ -65,7 +66,7 @@ void main() { ...@@ -65,7 +66,7 @@ void main() {
return message.isError && message.message.contains('ProcessException'); return message.isError && message.message.contains('ProcessException');
}).isNotEmpty, true); }).isNotEmpty, true);
} }
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
FileSystem: () => fileSystem, FileSystem: () => fileSystem,
ProcessManager: () => fakeProcessManager, ProcessManager: () => fakeProcessManager,
......
...@@ -18,6 +18,7 @@ import 'package:flutter_tools/src/project.dart'; ...@@ -18,6 +18,7 @@ import 'package:flutter_tools/src/project.dart';
import '../../src/common.dart'; import '../../src/common.dart';
import '../../src/context.dart'; import '../../src/context.dart';
import '../../src/fake_process_manager.dart';
import '../../src/fakes.dart'; import '../../src/fakes.dart';
void main() { void main() {
...@@ -670,7 +671,7 @@ assembleFooTest ...@@ -670,7 +671,7 @@ assembleFooTest
'└─────────────────────────────────────────────────────────────────────────────────────────────────┘\n' '└─────────────────────────────────────────────────────────────────────────────────────────────────┘\n'
) )
); );
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
GradleUtils: () => FakeGradleUtils(), GradleUtils: () => FakeGradleUtils(),
Platform: () => fakePlatform('android'), Platform: () => fakePlatform('android'),
...@@ -709,7 +710,7 @@ assembleProfile ...@@ -709,7 +710,7 @@ assembleProfile
'└───────────────────────────────────────────────────────────────────────────────────────────────┘\n' '└───────────────────────────────────────────────────────────────────────────────────────────────┘\n'
) )
); );
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
GradleUtils: () => FakeGradleUtils(), GradleUtils: () => FakeGradleUtils(),
Platform: () => fakePlatform('android'), Platform: () => fakePlatform('android'),
......
...@@ -25,6 +25,7 @@ import 'package:test/fake.dart'; ...@@ -25,6 +25,7 @@ import 'package:test/fake.dart';
import '../src/common.dart'; import '../src/common.dart';
import '../src/context.dart'; import '../src/context.dart';
import '../src/fake_process_manager.dart';
import '../src/fakes.dart'; import '../src/fakes.dart';
void main() { void main() {
...@@ -86,7 +87,7 @@ void main() { ...@@ -86,7 +87,7 @@ void main() {
expect(applicationPackage.name, 'app.apk'); expect(applicationPackage.name, 'app.apk');
expect(applicationPackage, isA<PrebuiltApplicationPackage>()); expect(applicationPackage, isA<PrebuiltApplicationPackage>());
expect((applicationPackage as PrebuiltApplicationPackage).applicationPackage.path, apkFile.path); expect((applicationPackage as PrebuiltApplicationPackage).applicationPackage.path, apkFile.path);
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: overrides); }, overrides: overrides);
testUsingContext('Licenses available, build tools not, apk exists', () async { testUsingContext('Licenses available, build tools not, apk exists', () async {
...@@ -108,7 +109,7 @@ void main() { ...@@ -108,7 +109,7 @@ void main() {
buildInfo: null, buildInfo: null,
applicationBinary: globals.fs.file('app.apk'), applicationBinary: globals.fs.file('app.apk'),
); );
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: overrides); }, overrides: overrides);
testUsingContext('Licenses available, build tools available, does not call gradle dependencies', () async { testUsingContext('Licenses available, build tools available, does not call gradle dependencies', () async {
...@@ -119,7 +120,7 @@ void main() { ...@@ -119,7 +120,7 @@ void main() {
TargetPlatform.android_arm, TargetPlatform.android_arm,
buildInfo: null, buildInfo: null,
); );
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: overrides); }, overrides: overrides);
testWithoutContext('returns null when failed to extract manifest', () async { testWithoutContext('returns null when failed to extract manifest', () async {
...@@ -136,7 +137,7 @@ void main() { ...@@ -136,7 +137,7 @@ void main() {
); );
expect(androidApk, isNull); expect(androidApk, isNull);
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}); });
}); });
......
...@@ -115,7 +115,7 @@ void main() { ...@@ -115,7 +115,7 @@ void main() {
]); ]);
await const DebugUniversalFramework().build(environment); await const DebugUniversalFramework().build(environment);
expect(processManager.hasRemainingExpectations, isFalse); expect(processManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
FileSystem: () => fileSystem, FileSystem: () => fileSystem,
ProcessManager: () => processManager, ProcessManager: () => processManager,
...@@ -152,7 +152,7 @@ void main() { ...@@ -152,7 +152,7 @@ void main() {
]); ]);
await const DebugUniversalFramework().build(environment); await const DebugUniversalFramework().build(environment);
expect(processManager.hasRemainingExpectations, isFalse); expect(processManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
FileSystem: () => fileSystem, FileSystem: () => fileSystem,
ProcessManager: () => processManager, ProcessManager: () => processManager,
...@@ -207,7 +207,7 @@ void main() { ...@@ -207,7 +207,7 @@ void main() {
); );
await const DebugIosApplicationBundle().build(environment); await const DebugIosApplicationBundle().build(environment);
expect(processManager.hasRemainingExpectations, isFalse); expect(processManager, hasNoRemainingExpectations);
expect(frameworkDirectoryBinary, exists); expect(frameworkDirectoryBinary, exists);
expect(frameworkDirectory.childFile('Info.plist'), exists); expect(frameworkDirectory.childFile('Info.plist'), exists);
......
...@@ -373,7 +373,7 @@ void main() { ...@@ -373,7 +373,7 @@ void main() {
); );
await const DebugMacOSFramework().build(environment); await const DebugMacOSFramework().build(environment);
expect(processManager.hasRemainingExpectations, isFalse); expect(processManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
FileSystem: () => fileSystem, FileSystem: () => fileSystem,
ProcessManager: () => processManager, ProcessManager: () => processManager,
...@@ -405,7 +405,7 @@ void main() { ...@@ -405,7 +405,7 @@ void main() {
); );
await const DebugMacOSFramework().build(environment); await const DebugMacOSFramework().build(environment);
expect(processManager.hasRemainingExpectations, isFalse); expect(processManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
FileSystem: () => fileSystem, FileSystem: () => fileSystem,
ProcessManager: () => processManager, ProcessManager: () => processManager,
...@@ -469,7 +469,7 @@ void main() { ...@@ -469,7 +469,7 @@ void main() {
]); ]);
await const CompileMacOSFramework().build(environment); await const CompileMacOSFramework().build(environment);
expect(processManager.hasRemainingExpectations, isFalse); expect(processManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
FileSystem: () => fileSystem, FileSystem: () => fileSystem,
......
...@@ -12,6 +12,7 @@ import 'package:flutter_tools/src/version.dart'; ...@@ -12,6 +12,7 @@ import 'package:flutter_tools/src/version.dart';
import '../src/common.dart'; import '../src/common.dart';
import '../src/context.dart'; import '../src/context.dart';
import '../src/fake_process_manager.dart';
import '../src/test_flutter_command_runner.dart'; import '../src/test_flutter_command_runner.dart';
void main() { void main() {
...@@ -71,7 +72,7 @@ void main() { ...@@ -71,7 +72,7 @@ void main() {
); );
await runner.run(<String>['channel']); await runner.run(<String>['channel']);
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
expect(testLogger.errorText, hasLength(0)); expect(testLogger.errorText, hasLength(0));
// format the status text for a simpler assertion. // format the status text for a simpler assertion.
final Iterable<String> rows = testLogger.statusText final Iterable<String> rows = testLogger.statusText
...@@ -95,7 +96,7 @@ void main() { ...@@ -95,7 +96,7 @@ void main() {
); );
await runner.run(<String>['channel']); await runner.run(<String>['channel']);
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
expect(rows, containsAllInOrder(kOfficialChannels)); expect(rows, containsAllInOrder(kOfficialChannels));
expect(testLogger.errorText, hasLength(0)); expect(testLogger.errorText, hasLength(0));
// format the status text for a simpler assertion. // format the status text for a simpler assertion.
...@@ -119,7 +120,7 @@ void main() { ...@@ -119,7 +120,7 @@ void main() {
); );
await runner.run(<String>['channel']); await runner.run(<String>['channel']);
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
expect(testLogger.errorText, hasLength(0)); expect(testLogger.errorText, hasLength(0));
// check if available official channels are in order of stability // check if available official channels are in order of stability
int prev = -1; int prev = -1;
...@@ -153,7 +154,7 @@ void main() { ...@@ -153,7 +154,7 @@ void main() {
final CommandRunner<void> runner = createTestCommandRunner(command); final CommandRunner<void> runner = createTestCommandRunner(command);
await runner.run(<String>['channel']); await runner.run(<String>['channel']);
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
expect(testLogger.errorText, hasLength(0)); expect(testLogger.errorText, hasLength(0));
// format the status text for a simpler assertion. // format the status text for a simpler assertion.
...@@ -184,7 +185,7 @@ void main() { ...@@ -184,7 +185,7 @@ void main() {
final CommandRunner<void> runner = createTestCommandRunner(command); final CommandRunner<void> runner = createTestCommandRunner(command);
await runner.run(<String>['channel']); await runner.run(<String>['channel']);
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
expect(testLogger.errorText, hasLength(0)); expect(testLogger.errorText, hasLength(0));
// format the status text for a simpler assertion. // format the status text for a simpler assertion.
...@@ -217,7 +218,7 @@ void main() { ...@@ -217,7 +218,7 @@ void main() {
final CommandRunner<void> runner = createTestCommandRunner(command); final CommandRunner<void> runner = createTestCommandRunner(command);
await runner.run(<String>['channel', 'beta']); await runner.run(<String>['channel', 'beta']);
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
expect( expect(
testLogger.statusText, testLogger.statusText,
containsIgnoringWhitespace("Switching to flutter channel 'beta'..."), containsIgnoringWhitespace("Switching to flutter channel 'beta'..."),
...@@ -238,7 +239,7 @@ void main() { ...@@ -238,7 +239,7 @@ void main() {
await runner.run(<String>['channel', 'stable']); await runner.run(<String>['channel', 'stable']);
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
FileSystem: () => MemoryFileSystem.test(), FileSystem: () => MemoryFileSystem.test(),
ProcessManager: () => fakeProcessManager, ProcessManager: () => fakeProcessManager,
...@@ -272,7 +273,7 @@ void main() { ...@@ -272,7 +273,7 @@ void main() {
"from this channel, run 'flutter upgrade'"), "from this channel, run 'flutter upgrade'"),
); );
expect(testLogger.errorText, hasLength(0)); expect(testLogger.errorText, hasLength(0));
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
FileSystem: () => MemoryFileSystem.test(), FileSystem: () => MemoryFileSystem.test(),
ProcessManager: () => fakeProcessManager, ProcessManager: () => fakeProcessManager,
...@@ -314,7 +315,7 @@ void main() { ...@@ -314,7 +315,7 @@ void main() {
expect(testLogger.statusText, isNot(contains('A new version of Flutter'))); expect(testLogger.statusText, isNot(contains('A new version of Flutter')));
expect(testLogger.errorText, hasLength(0)); expect(testLogger.errorText, hasLength(0));
expect(versionCheckFile.existsSync(), isFalse); expect(versionCheckFile.existsSync(), isFalse);
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
FileSystem: () => MemoryFileSystem.test(), FileSystem: () => MemoryFileSystem.test(),
ProcessManager: () => fakeProcessManager, ProcessManager: () => fakeProcessManager,
......
...@@ -17,6 +17,7 @@ import 'package:test/fake.dart'; ...@@ -17,6 +17,7 @@ import 'package:test/fake.dart';
import '../src/common.dart'; import '../src/common.dart';
import '../src/context.dart'; import '../src/context.dart';
import '../src/fake_process_manager.dart';
import '../src/fakes.dart'; import '../src/fakes.dart';
const FakeEmulator emulator1 = FakeEmulator('Nexus_5', 'Nexus 5', 'Google'); const FakeEmulator emulator1 = FakeEmulator('Nexus_5', 'Nexus 5', 'Google');
...@@ -329,7 +330,7 @@ void main() { ...@@ -329,7 +330,7 @@ void main() {
const Emulator emulator = IOSEmulator('ios'); const Emulator emulator = IOSEmulator('ios');
await emulator.launch(); await emulator.launch();
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
ProcessManager: () => fakeProcessManager, ProcessManager: () => fakeProcessManager,
Xcode: () => xcode, Xcode: () => xcode,
......
...@@ -95,7 +95,7 @@ void main() { ...@@ -95,7 +95,7 @@ void main() {
}), }),
]); ]);
await device.start('example.dill'); await device.start('example.dill');
expect(processManager.hasRemainingExpectations, isFalse); expect(processManager, hasNoRemainingExpectations);
}); });
group('The FLUTTER_TEST environment variable is passed to the test process', () { group('The FLUTTER_TEST environment variable is passed to the test process', () {
...@@ -144,7 +144,7 @@ void main() { ...@@ -144,7 +144,7 @@ void main() {
processManager.addCommand(flutterTestCommand('true')); processManager.addCommand(flutterTestCommand('true'));
await device.start('example.dill'); await device.start('example.dill');
expect(processManager.hasRemainingExpectations, isFalse); expect(processManager, hasNoRemainingExpectations);
}); });
testUsingContext('as true when set to true', () async { testUsingContext('as true when set to true', () async {
...@@ -152,7 +152,7 @@ void main() { ...@@ -152,7 +152,7 @@ void main() {
processManager.addCommand(flutterTestCommand('true')); processManager.addCommand(flutterTestCommand('true'));
await device.start('example.dill'); await device.start('example.dill');
expect(processManager.hasRemainingExpectations, isFalse); expect(processManager, hasNoRemainingExpectations);
}); });
testUsingContext('as false when set to false', () async { testUsingContext('as false when set to false', () async {
...@@ -160,7 +160,7 @@ void main() { ...@@ -160,7 +160,7 @@ void main() {
processManager.addCommand(flutterTestCommand('false')); processManager.addCommand(flutterTestCommand('false'));
await device.start('example.dill'); await device.start('example.dill');
expect(processManager.hasRemainingExpectations, isFalse); expect(processManager, hasNoRemainingExpectations);
}); });
testUsingContext('unchanged when set', () async { testUsingContext('unchanged when set', () async {
...@@ -168,7 +168,7 @@ void main() { ...@@ -168,7 +168,7 @@ void main() {
processManager.addCommand(flutterTestCommand('neither true nor false')); processManager.addCommand(flutterTestCommand('neither true nor false'));
await device.start('example.dill'); await device.start('example.dill');
expect(processManager.hasRemainingExpectations, isFalse); expect(processManager, hasNoRemainingExpectations);
}); });
}); });
......
...@@ -78,7 +78,7 @@ void main() { ...@@ -78,7 +78,7 @@ void main() {
'1234', '1234',
IOSDeviceConnectionInterface.usb, IOSDeviceConnectionInterface.usb,
), throwsA(anything)); ), throwsA(anything));
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}); });
testWithoutContext('idevicescreenshot captures and returns USB screenshot', () async { testWithoutContext('idevicescreenshot captures and returns USB screenshot', () async {
...@@ -101,7 +101,7 @@ void main() { ...@@ -101,7 +101,7 @@ void main() {
'1234', '1234',
IOSDeviceConnectionInterface.usb, IOSDeviceConnectionInterface.usb,
); );
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}); });
testWithoutContext('idevicescreenshot captures and returns network screenshot', () async { testWithoutContext('idevicescreenshot captures and returns network screenshot', () async {
...@@ -124,7 +124,7 @@ void main() { ...@@ -124,7 +124,7 @@ void main() {
'1234', '1234',
IOSDeviceConnectionInterface.network, IOSDeviceConnectionInterface.network,
); );
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}); });
}); });
}); });
......
...@@ -22,6 +22,7 @@ import 'package:test/fake.dart'; ...@@ -22,6 +22,7 @@ import 'package:test/fake.dart';
import '../../src/common.dart'; import '../../src/common.dart';
import '../../src/context.dart'; import '../../src/context.dart';
import '../../src/fake_process_manager.dart';
import '../../src/fakes.dart'; import '../../src/fakes.dart';
final Platform macosPlatform = FakePlatform( final Platform macosPlatform = FakePlatform(
...@@ -361,7 +362,7 @@ void main() { ...@@ -361,7 +362,7 @@ void main() {
final File screenshot = MemoryFileSystem.test().file('screenshot.png'); final File screenshot = MemoryFileSystem.test().file('screenshot.png');
await deviceUnderTest.takeScreenshot(screenshot); await deviceUnderTest.takeScreenshot(screenshot);
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}); });
}); });
...@@ -389,7 +390,7 @@ void main() { ...@@ -389,7 +390,7 @@ void main() {
'/Library/Logs/CoreSimulator/x/system.log', '/Library/Logs/CoreSimulator/x/system.log',
])); ]));
await launchDeviceSystemLogTool(device); await launchDeviceSystemLogTool(device);
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}, },
overrides: <Type, Generator>{ overrides: <Type, Generator>{
ProcessManager: () => fakeProcessManager, ProcessManager: () => fakeProcessManager,
...@@ -428,7 +429,7 @@ void main() { ...@@ -428,7 +429,7 @@ void main() {
])); ]));
await launchDeviceUnifiedLogging(device, 'My Super Awesome App'); await launchDeviceUnifiedLogging(device, 'My Super Awesome App');
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}, },
overrides: <Type, Generator>{ overrides: <Type, Generator>{
ProcessManager: () => fakeProcessManager, ProcessManager: () => fakeProcessManager,
...@@ -461,7 +462,7 @@ void main() { ...@@ -461,7 +462,7 @@ void main() {
])); ]));
await launchDeviceUnifiedLogging(device, null); await launchDeviceUnifiedLogging(device, null);
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}, },
overrides: <Type, Generator>{ overrides: <Type, Generator>{
ProcessManager: () => fakeProcessManager, ProcessManager: () => fakeProcessManager,
...@@ -514,7 +515,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text''' ...@@ -514,7 +515,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text'''
expect(lines, <String>[ expect(lines, <String>[
'flutter: The Dart VM service is listening on http://127.0.0.1:64213/1Uoeu523990=/', 'flutter: The Dart VM service is listening on http://127.0.0.1:64213/1Uoeu523990=/',
]); ]);
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
ProcessManager: () => fakeProcessManager, ProcessManager: () => fakeProcessManager,
FileSystem: () => fileSystem, FileSystem: () => fileSystem,
...@@ -551,7 +552,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text''' ...@@ -551,7 +552,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text'''
'))))))))))', '))))))))))',
'#0 Object.noSuchMethod (dart:core-patch/dart:core/object_patch.dart:46)', '#0 Object.noSuchMethod (dart:core-patch/dart:core/object_patch.dart:46)',
]); ]);
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
ProcessManager: () => fakeProcessManager, ProcessManager: () => fakeProcessManager,
FileSystem: () => fileSystem, FileSystem: () => fileSystem,
...@@ -604,7 +605,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text''' ...@@ -604,7 +605,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text'''
' and goes...', ' and goes...',
'Single line message, not the part of the above', 'Single line message, not the part of the above',
]); ]);
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
ProcessManager: () => fakeProcessManager, ProcessManager: () => fakeProcessManager,
FileSystem: () => fileSystem, FileSystem: () => fileSystem,
...@@ -670,7 +671,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text''' ...@@ -670,7 +671,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text'''
'Single line message', 'Multi line message\n continues...\n continues...', 'Single line message', 'Multi line message\n continues...\n continues...',
'Single line message, not the part of the above', 'Single line message, not the part of the above',
]); ]);
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
ProcessManager: () => fakeProcessManager, ProcessManager: () => fakeProcessManager,
FileSystem: () => fileSystem, FileSystem: () => fileSystem,
...@@ -711,7 +712,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text''' ...@@ -711,7 +712,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text'''
final List<String> lines = await logReader.logLines.toList(); final List<String> lines = await logReader.logLines.toList();
expect(lines, isEmpty); expect(lines, isEmpty);
expect(logger.errorText, contains('Logger returned non-JSON response')); expect(logger.errorText, contains('Logger returned non-JSON response'));
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
ProcessManager: () => fakeProcessManager, ProcessManager: () => fakeProcessManager,
FileSystem: () => fileSystem, FileSystem: () => fileSystem,
...@@ -813,7 +814,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text''' ...@@ -813,7 +814,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text'''
expect(phone3.category, 'com.apple.CoreSimulator.SimRuntime.iOS-16-0'); expect(phone3.category, 'com.apple.CoreSimulator.SimRuntime.iOS-16-0');
expect(phone3.name, 'iPhone 13'); expect(phone3.name, 'iPhone 13');
expect(phone3.udid, 'iPhone 13-UDID'); expect(phone3.udid, 'iPhone 13-UDID');
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}); });
testWithoutContext('getConnectedDevices handles bad simctl output', () async { testWithoutContext('getConnectedDevices handles bad simctl output', () async {
...@@ -833,7 +834,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text''' ...@@ -833,7 +834,7 @@ Dec 20 17:04:32 md32-11-vm1 Another App[88374]: Ignore this text'''
final List<BootedSimDevice> devices = await simControl.getConnectedDevices(); final List<BootedSimDevice> devices = await simControl.getConnectedDevices();
expect(devices, isEmpty); expect(devices, isEmpty);
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}); });
testWithoutContext('sdkMajorVersion defaults to 11 when sdkNameAndVersion is junk', () async { testWithoutContext('sdkMajorVersion defaults to 11 when sdkNameAndVersion is junk', () async {
......
...@@ -20,6 +20,7 @@ import 'package:test/fake.dart'; ...@@ -20,6 +20,7 @@ import 'package:test/fake.dart';
import '../../src/common.dart'; import '../../src/common.dart';
import '../../src/context.dart'; import '../../src/context.dart';
import '../../src/fake_process_manager.dart';
void main() { void main() {
late BufferLogger logger; late BufferLogger logger;
...@@ -70,7 +71,7 @@ void main() { ...@@ -70,7 +71,7 @@ void main() {
); );
expect(xcode.isSimctlInstalled, isTrue); expect(xcode.isSimctlInstalled, isTrue);
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}); });
testWithoutContext('isSimctlInstalled is true when simctl list fails', () { testWithoutContext('isSimctlInstalled is true when simctl list fails', () {
...@@ -92,7 +93,7 @@ void main() { ...@@ -92,7 +93,7 @@ void main() {
); );
expect(xcode.isSimctlInstalled, isFalse); expect(xcode.isSimctlInstalled, isFalse);
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}); });
group('macOS', () { group('macOS', () {
...@@ -111,10 +112,11 @@ void main() { ...@@ -111,10 +112,11 @@ void main() {
fakeProcessManager.addCommand(const FakeCommand( fakeProcessManager.addCommand(const FakeCommand(
command: <String>['/usr/bin/xcode-select', '--print-path'], command: <String>['/usr/bin/xcode-select', '--print-path'],
stdout: xcodePath, stdout: xcodePath,
)); ),
);
expect(xcode.xcodeSelectPath, xcodePath); expect(xcode.xcodeSelectPath, xcodePath);
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}); });
testWithoutContext('xcodeSelectPath returns null when xcode-select is not installed', () { testWithoutContext('xcodeSelectPath returns null when xcode-select is not installed', () {
...@@ -124,7 +126,7 @@ void main() { ...@@ -124,7 +126,7 @@ void main() {
)); ));
expect(xcode.xcodeSelectPath, isNull); expect(xcode.xcodeSelectPath, isNull);
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
fakeProcessManager.addCommand(FakeCommand( fakeProcessManager.addCommand(FakeCommand(
command: const <String>['/usr/bin/xcode-select', '--print-path'], command: const <String>['/usr/bin/xcode-select', '--print-path'],
...@@ -132,7 +134,7 @@ void main() { ...@@ -132,7 +134,7 @@ void main() {
)); ));
expect(xcode.xcodeSelectPath, isNull); expect(xcode.xcodeSelectPath, isNull);
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}); });
testWithoutContext('version checks fail when version is less than minimum', () { testWithoutContext('version checks fail when version is less than minimum', () {
...@@ -186,7 +188,7 @@ void main() { ...@@ -186,7 +188,7 @@ void main() {
xcodeProjectInterpreter.isInstalled = false; xcodeProjectInterpreter.isInstalled = false;
expect(xcode.isInstalledAndMeetsVersionCheck, isFalse); expect(xcode.isInstalledAndMeetsVersionCheck, isFalse);
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}); });
testWithoutContext('isInstalledAndMeetsVersionCheck is false when version not satisfied', () { testWithoutContext('isInstalledAndMeetsVersionCheck is false when version not satisfied', () {
...@@ -194,7 +196,7 @@ void main() { ...@@ -194,7 +196,7 @@ void main() {
xcodeProjectInterpreter.version = Version(10, 2, 0); xcodeProjectInterpreter.version = Version(10, 2, 0);
expect(xcode.isInstalledAndMeetsVersionCheck, isFalse); expect(xcode.isInstalledAndMeetsVersionCheck, isFalse);
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}); });
testWithoutContext('isInstalledAndMeetsVersionCheck is true when macOS and installed and version is satisfied', () { testWithoutContext('isInstalledAndMeetsVersionCheck is true when macOS and installed and version is satisfied', () {
...@@ -202,7 +204,7 @@ void main() { ...@@ -202,7 +204,7 @@ void main() {
xcodeProjectInterpreter.version = Version(13, null, null); xcodeProjectInterpreter.version = Version(13, null, null);
expect(xcode.isInstalledAndMeetsVersionCheck, isTrue); expect(xcode.isInstalledAndMeetsVersionCheck, isTrue);
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}); });
testWithoutContext('eulaSigned is false when clang output indicates EULA not yet accepted', () { testWithoutContext('eulaSigned is false when clang output indicates EULA not yet accepted', () {
...@@ -216,7 +218,7 @@ void main() { ...@@ -216,7 +218,7 @@ void main() {
]); ]);
expect(xcode.eulaSigned, isFalse); expect(xcode.eulaSigned, isFalse);
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}); });
testWithoutContext('eulaSigned is false when clang is not installed', () { testWithoutContext('eulaSigned is false when clang is not installed', () {
...@@ -241,7 +243,7 @@ void main() { ...@@ -241,7 +243,7 @@ void main() {
], ],
); );
expect(xcode.eulaSigned, isTrue); expect(xcode.eulaSigned, isTrue);
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}); });
testWithoutContext('SDK name', () { testWithoutContext('SDK name', () {
...@@ -259,7 +261,7 @@ void main() { ...@@ -259,7 +261,7 @@ void main() {
)); ));
expect(await xcode.sdkLocation(EnvironmentType.physical), sdkroot); expect(await xcode.sdkLocation(EnvironmentType.physical), sdkroot);
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}); });
testWithoutContext('--show-sdk-path fails', () async { testWithoutContext('--show-sdk-path fails', () async {
...@@ -271,7 +273,7 @@ void main() { ...@@ -271,7 +273,7 @@ void main() {
expect(() async => xcode.sdkLocation(EnvironmentType.physical), expect(() async => xcode.sdkLocation(EnvironmentType.physical),
throwsToolExit(message: 'Could not find SDK location')); throwsToolExit(message: 'Could not find SDK location'));
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}); });
}); });
}); });
...@@ -490,7 +492,7 @@ void main() { ...@@ -490,7 +492,7 @@ void main() {
expect(devices[2].name, 'iPad 2'); expect(devices[2].name, 'iPad 2');
expect(await devices[2].sdkNameAndVersion, 'iOS 10.1 14C54'); expect(await devices[2].sdkNameAndVersion, 'iOS 10.1 14C54');
expect(devices[2].cpuArchitecture, DarwinArch.arm64); // Defaults to arm64 for unknown architecture. expect(devices[2].cpuArchitecture, DarwinArch.arm64); // Defaults to arm64 for unknown architecture.
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
Platform: () => macPlatform, Platform: () => macPlatform,
Artifacts: () => Artifacts.test(), Artifacts: () => Artifacts.test(),
...@@ -511,7 +513,7 @@ void main() { ...@@ -511,7 +513,7 @@ void main() {
stdout: '[]', stdout: '[]',
)); ));
await xcdevice.getAvailableIOSDevices(timeout: const Duration(seconds: 20)); await xcdevice.getAvailableIOSDevices(timeout: const Duration(seconds: 20));
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}); });
testUsingContext('ignores "Preparing debugger support for iPhone" error', () async { testUsingContext('ignores "Preparing debugger support for iPhone" error', () async {
...@@ -546,7 +548,7 @@ void main() { ...@@ -546,7 +548,7 @@ void main() {
final List<IOSDevice> devices = await xcdevice.getAvailableIOSDevices(); final List<IOSDevice> devices = await xcdevice.getAvailableIOSDevices();
expect(devices, hasLength(1)); expect(devices, hasLength(1));
expect(devices[0].id, '43ad2fda7991b34fe1acbda82f9e2fd3d6ddc9f7'); expect(devices[0].id, '43ad2fda7991b34fe1acbda82f9e2fd3d6ddc9f7');
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
Platform: () => macPlatform, Platform: () => macPlatform,
Artifacts: () => Artifacts.test(), Artifacts: () => Artifacts.test(),
...@@ -589,7 +591,7 @@ void main() { ...@@ -589,7 +591,7 @@ void main() {
final List<IOSDevice> devices = await xcdevice.getAvailableIOSDevices(); final List<IOSDevice> devices = await xcdevice.getAvailableIOSDevices();
expect(devices[0].cpuArchitecture, DarwinArch.armv7); expect(devices[0].cpuArchitecture, DarwinArch.armv7);
expect(devices[1].cpuArchitecture, DarwinArch.arm64); expect(devices[1].cpuArchitecture, DarwinArch.arm64);
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
Platform: () => macPlatform, Platform: () => macPlatform,
Artifacts: () => Artifacts.test(), Artifacts: () => Artifacts.test(),
...@@ -694,7 +696,7 @@ void main() { ...@@ -694,7 +696,7 @@ void main() {
await xcdevice.getAvailableIOSDevices(); await xcdevice.getAvailableIOSDevices();
final List<String> errors = await xcdevice.getDiagnostics(); final List<String> errors = await xcdevice.getDiagnostics();
expect(errors, hasLength(1)); expect(errors, hasLength(1));
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
Platform: () => macPlatform, Platform: () => macPlatform,
}); });
...@@ -836,7 +838,7 @@ void main() { ...@@ -836,7 +838,7 @@ void main() {
expect(errors[2], 'Error: Xcode pairing error. (code -13)'); expect(errors[2], 'Error: Xcode pairing error. (code -13)');
expect(errors[3], 'Error: iPhone is busy: Preparing debugger support for iPhone. Xcode will continue when iPhone is finished. (code -10)'); expect(errors[3], 'Error: iPhone is busy: Preparing debugger support for iPhone. Xcode will continue when iPhone is finished. (code -10)');
expect(errors, isNot(contains('Xcode will continue'))); expect(errors, isNot(contains('Xcode will continue')));
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
Platform: () => macPlatform, Platform: () => macPlatform,
}); });
......
...@@ -18,6 +18,7 @@ import 'package:flutter_tools/src/tester/flutter_tester.dart'; ...@@ -18,6 +18,7 @@ import 'package:flutter_tools/src/tester/flutter_tester.dart';
import '../../src/common.dart'; import '../../src/common.dart';
import '../../src/context.dart'; import '../../src/context.dart';
import '../../src/fake_process_manager.dart';
import '../../src/fakes.dart'; import '../../src/fakes.dart';
import '../../src/test_build_system.dart'; import '../../src/test_build_system.dart';
...@@ -167,7 +168,7 @@ Hello! ...@@ -167,7 +168,7 @@ Hello!
expect(result.started, isTrue); expect(result.started, isTrue);
expect(result.observatoryUri, observatoryUri); expect(result.observatoryUri, observatoryUri);
expect(logLines.last, 'Hello!'); expect(logLines.last, 'Hello!');
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: startOverrides); }, overrides: startOverrides);
testUsingContext('performs a build and starts in debug mode with track-widget-creation', () async { testUsingContext('performs a build and starts in debug mode with track-widget-creation', () async {
...@@ -200,7 +201,7 @@ Hello! ...@@ -200,7 +201,7 @@ Hello!
expect(result.started, isTrue); expect(result.started, isTrue);
expect(result.observatoryUri, observatoryUri); expect(result.observatoryUri, observatoryUri);
expect(logLines.last, 'Hello!'); expect(logLines.last, 'Hello!');
expect(fakeProcessManager.hasRemainingExpectations, isFalse); expect(fakeProcessManager, hasNoRemainingExpectations);
}, overrides: startOverrides); }, overrides: startOverrides);
}); });
} }
......
...@@ -121,7 +121,7 @@ void main() { ...@@ -121,7 +121,7 @@ void main() {
expect(flutterVersion.getBranchName(redactUnknownBranches: true), channel); expect(flutterVersion.getBranchName(redactUnknownBranches: true), channel);
expect(testLogger.statusText, isEmpty); expect(testLogger.statusText, isEmpty);
expect(processManager.hasRemainingExpectations, isFalse); expect(processManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
FlutterVersion: () => FlutterVersion(clock: _testClock), FlutterVersion: () => FlutterVersion(clock: _testClock),
ProcessManager: () => processManager, ProcessManager: () => processManager,
...@@ -428,7 +428,7 @@ void main() { ...@@ -428,7 +428,7 @@ void main() {
expect(flutterVersion.getBranchName(), 'feature-branch'); expect(flutterVersion.getBranchName(), 'feature-branch');
expect(flutterVersion.getVersionString(redactUnknownBranches: true), '[user-branch]/1234abcd'); expect(flutterVersion.getVersionString(redactUnknownBranches: true), '[user-branch]/1234abcd');
expect(flutterVersion.getBranchName(redactUnknownBranches: true), '[user-branch]'); expect(flutterVersion.getBranchName(redactUnknownBranches: true), '[user-branch]');
expect(processManager.hasRemainingExpectations, isFalse); expect(processManager, hasNoRemainingExpectations);
}, overrides: <Type, Generator>{ }, overrides: <Type, Generator>{
FlutterVersion: () => FlutterVersion(clock: _testClock), FlutterVersion: () => FlutterVersion(clock: _testClock),
ProcessManager: () => processManager, ProcessManager: () => processManager,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment