Use term wireless instead of network (#124232)

Rename variables, update comments, etc from `network` to `wireless` to keep it more uniform.

Also, move non-overriden messages related to device selection into the file they're used.

Part 7 in breakdown of https://github.com/flutter/flutter/pull/121262.
This commit is contained in:
Victoria Ashworth
2023-04-19 14:59:11 -05:00
committed by GitHub
parent 14e191fa75
commit 48bb3c0bc9
12 changed files with 98 additions and 94 deletions

View File

@@ -235,7 +235,7 @@ void main() {
),
});
testUsingContext('succeeds with iOS device with mDNS network device', () async {
testUsingContext('succeeds with iOS device with mDNS wireless device', () async {
final FakeIOSDevice device = FakeIOSDevice(
logReader: fakeLogReader,
portForwarder: portForwarder,
@@ -307,7 +307,7 @@ void main() {
),
});
testUsingContext('succeeds with iOS device with mDNS network device with debug-port', () async {
testUsingContext('succeeds with iOS device with mDNS wireless device with debug-port', () async {
final FakeIOSDevice device = FakeIOSDevice(
logReader: fakeLogReader,
portForwarder: portForwarder,
@@ -383,7 +383,7 @@ void main() {
),
});
testUsingContext('succeeds with iOS device with mDNS network device with debug-url', () async {
testUsingContext('succeeds with iOS device with mDNS wireless device with debug-url', () async {
final FakeIOSDevice device = FakeIOSDevice(
logReader: fakeLogReader,
portForwarder: portForwarder,

View File

@@ -409,7 +409,7 @@ void main() {
ProcessManager: () => FakeProcessManager.any(),
});
testUsingContext('Port publication not disabled for network device', () async {
testUsingContext('Port publication not disabled for wireless device', () async {
final DriveCommand command = DriveCommand(
fileSystem: fileSystem,
logger: logger,
@@ -421,9 +421,9 @@ void main() {
fileSystem.file('test_driver/main_test.dart').createSync(recursive: true);
fileSystem.file('pubspec.yaml').createSync();
final Device networkDevice = FakeIosDevice()
final Device wirelessDevice = FakeIosDevice()
..connectionInterface = DeviceConnectionInterface.wireless;
fakeDeviceManager.wirelessDevices = <Device>[networkDevice];
fakeDeviceManager.wirelessDevices = <Device>[wirelessDevice];
await expectLater(() => createTestCommandRunner(command).run(<String>[
'drive',
@@ -467,7 +467,7 @@ void main() {
DeviceManager: () => fakeDeviceManager,
});
testUsingContext('Port publication does not default to enabled for network device if flag manually added', () async {
testUsingContext('Port publication does not default to enabled for wireless device if flag manually added', () async {
final DriveCommand command = DriveCommand(
fileSystem: fileSystem,
logger: logger,
@@ -479,9 +479,9 @@ void main() {
fileSystem.file('test_driver/main_test.dart').createSync(recursive: true);
fileSystem.file('pubspec.yaml').createSync();
final Device networkDevice = FakeIosDevice()
final Device wirelessDevice = FakeIosDevice()
..connectionInterface = DeviceConnectionInterface.wireless;
fakeDeviceManager.wirelessDevices = <Device>[networkDevice];
fakeDeviceManager.wirelessDevices = <Device>[wirelessDevice];
await expectLater(() => createTestCommandRunner(command).run(<String>[
'drive',

View File

@@ -228,7 +228,7 @@ void main() {
expect(
testLogger.statusText,
containsIgnoringWhitespace(userMessages.flutterNoSupportedDevices),
containsIgnoringWhitespace('No supported devices connected.'),
);
}, overrides: <Type, Generator>{
DeviceManager: () => testDeviceManager,
@@ -404,11 +404,11 @@ void main() {
expect(
testLogger.statusText,
containsIgnoringWhitespace(userMessages.flutterNoSupportedDevices),
containsIgnoringWhitespace('No supported devices connected.'),
);
expect(
testLogger.statusText,
containsIgnoringWhitespace(userMessages.flutterFoundButUnsupportedDevices),
containsIgnoringWhitespace('The following devices were found, but are not supported by this project:'),
);
expect(
testLogger.statusText,
@@ -831,7 +831,7 @@ void main() {
ProcessManager: () => FakeProcessManager.any(),
});
testUsingContext('with only iOS network device', () async {
testUsingContext('with only iOS wireless device', () async {
final List<Device> devices = <Device>[
FakeIOSDevice(
connectionInterface: DeviceConnectionInterface.wireless,
@@ -875,7 +875,7 @@ void main() {
ProcessManager: () => FakeProcessManager.any(),
});
testUsingContext('with both iOS usb and network devices', () async {
testUsingContext('with both iOS usb and wireless devices', () async {
final List<Device> devices = <Device>[
FakeIOSDevice(
connectionInterface: DeviceConnectionInterface.wireless,

View File

@@ -68,7 +68,7 @@ const FakeCommand kLaunchDebugCommand = FakeCommand(command: <String>[
FakeCommand attachDebuggerCommand({
IOSink? stdin,
Completer<void>? completer,
bool isNetworkDevice = false,
bool isWirelessDevice = false,
}) {
return FakeCommand(
command: <String>[
@@ -82,9 +82,9 @@ FakeCommand attachDebuggerCommand({
'--bundle',
'/',
'--debug',
if (!isNetworkDevice) '--no-wifi',
if (!isWirelessDevice) '--no-wifi',
'--args',
if (isNetworkDevice)
if (isWirelessDevice)
'--enable-dart-profiling --enable-checked-mode --verify-entry-points --vm-service-host=0.0.0.0'
else
'--enable-dart-profiling --enable-checked-mode --verify-entry-points',
@@ -244,7 +244,7 @@ void main() {
final CompleterIOSink stdin = CompleterIOSink();
final Completer<void> completer = Completer<void>();
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[
attachDebuggerCommand(stdin: stdin, completer: completer, isNetworkDevice: true),
attachDebuggerCommand(stdin: stdin, completer: completer, isWirelessDevice: true),
]);
final IOSDevice device = setUpIOSDevice(
processManager: processManager,
@@ -620,7 +620,7 @@ class FakeMDnsVmServiceDiscovery extends Fake implements MDnsVmServiceDiscovery
bool usesIpv6 = false,
int? hostVmservicePort,
required int deviceVmservicePort,
bool isNetworkDevice = false,
bool useDeviceIPAsHost = false,
Duration timeout = Duration.zero,
}) async {
return Uri.tryParse('http://0.0.0.0:1234');

View File

@@ -335,7 +335,7 @@ void main() {
expect(uri.toString(), 'http://127.0.0.1:123/');
});
testWithoutContext('Get network device IP (iPv4)', () async {
testWithoutContext('Get wireless device IP (iPv4)', () async {
final MDnsClient client = FakeMDnsClient(
<PtrResourceRecord>[
PtrResourceRecord('foo', future, domainName: 'bar'),
@@ -367,12 +367,12 @@ void main() {
final Uri? uri = await portDiscovery.getVMServiceUriForAttach(
'bar',
device,
isNetworkDevice: true,
useDeviceIPAsHost: true,
);
expect(uri.toString(), 'http://111.111.111.111:1234/xyz/');
});
testWithoutContext('Get network device IP (iPv6)', () async {
testWithoutContext('Get wireless device IP (iPv6)', () async {
final MDnsClient client = FakeMDnsClient(
<PtrResourceRecord>[
PtrResourceRecord('foo', future, domainName: 'bar'),
@@ -404,7 +404,7 @@ void main() {
final Uri? uri = await portDiscovery.getVMServiceUriForAttach(
'bar',
device,
isNetworkDevice: true,
useDeviceIPAsHost: true,
);
expect(uri.toString(), 'http://[1111:1111:1111:1111:1111:1111:1111:1111]:1234/xyz/');
});
@@ -557,7 +557,7 @@ void main() {
expect(uri.toString(), 'http://127.0.0.1:123/');
});
testWithoutContext('Get network device IP (iPv4)', () async {
testWithoutContext('Get wireless device IP (iPv4)', () async {
final MDnsClient client = FakeMDnsClient(
<PtrResourceRecord>[
PtrResourceRecord('foo', future, domainName: 'bar'),
@@ -588,13 +588,13 @@ void main() {
final Uri? uri = await portDiscovery.getVMServiceUriForLaunch(
'bar',
device,
isNetworkDevice: true,
useDeviceIPAsHost: true,
deviceVmservicePort: 1234,
);
expect(uri.toString(), 'http://111.111.111.111:1234/xyz/');
});
testWithoutContext('Get network device IP (iPv6)', () async {
testWithoutContext('Get wireless device IP (iPv6)', () async {
final MDnsClient client = FakeMDnsClient(
<PtrResourceRecord>[
PtrResourceRecord('foo', future, domainName: 'bar'),
@@ -625,7 +625,7 @@ void main() {
final Uri? uri = await portDiscovery.getVMServiceUriForLaunch(
'bar',
device,
isNetworkDevice: true,
useDeviceIPAsHost: true,
deviceVmservicePort: 1234,
);
expect(uri.toString(), 'http://[1111:1111:1111:1111:1111:1111:1111:1111]:1234/xyz/');
@@ -755,7 +755,7 @@ void main() {
final MDnsVmServiceDiscoveryResult? result = await portDiscovery.firstMatchingVmService(
client,
applicationId: 'srv-foo',
isNetworkDevice: true,
useDeviceIPAsHost: true,
);
expect(result?.domainName, 'srv-foo');
expect(result?.port, 111);
@@ -792,7 +792,7 @@ void main() {
final MDnsVmServiceDiscoveryResult? result = await portDiscovery.firstMatchingVmService(
client,
applicationId: 'srv-foo',
isNetworkDevice: true,
useDeviceIPAsHost: true,
);
expect(result?.domainName, 'srv-foo');
expect(result?.port, 111);
@@ -829,7 +829,7 @@ void main() {
final MDnsVmServiceDiscoveryResult? result = await portDiscovery.firstMatchingVmService(
client,
applicationId: 'srv-foo',
isNetworkDevice: true,
useDeviceIPAsHost: true,
);
expect(result?.domainName, 'srv-foo');
expect(result?.port, 111);