in packages/web_drivers/lib/chrome_driver_installer.dart [67:105]
Future<void> _installDriver() async {
// If this method is called, clean the previous installations.
if (isInstalled) {
installation.deleteSync(recursive: true);
}
// Figure out which driver version to install if it's not given during
// initialization.
if (chromeDriverVersion.isEmpty) {
final int chromeVersion = await _querySystemChromeVersion();
if (chromeVersion < 74) {
throw Exception('Unsupported Chrome version: $chromeVersion');
}
final YamlMap browserLock = DriverLock.instance.configuration;
final YamlMap chromeDrivers = browserLock['chrome'];
final String? chromeDriverVersion = chromeDrivers[chromeVersion];
if (chromeDriverVersion == null) {
throw Exception(
'No known chromedriver version for Chrome version $chromeVersion.\n'
'Known versions are:\n${chromeDrivers.entries.map((e) => '${e.key}: ${e.value}').join('\n')}',
);
} else {
this.chromeDriverVersion = chromeDriverVersion;
}
}
try {
driverDownload = await _downloadDriver();
} catch (e) {
throw Exception(
'Failed to download chrome driver $chromeDriverVersion. $e');
} finally {
client.close();
}
await _uncompress();
}