Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions pkg/pub_integration/lib/src/test_browser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,27 @@ class TestBrowser {
final binaries = [
'/usr/bin/google-chrome',
];
for (final binary in binaries) {
if (File(binary).existsSync()) return binary;
}

// sanity check for CI
if (Platform.environment['CI'] == 'true') {
throw StateError('Could not detect chrome binary while running in CI.');
for (final binary in binaries) {
if (File(binary).existsSync()) {
// Get the local chrome's main version
final pr = await Process.run(binary, ['--version'])
.timeout(Duration(seconds: 5));
final output = pr.stdout.toString();
final mainVersion = output
.split(' ')
.expand((p) => p.split('.'))
.map(int.tryParse)
.whereType<int>()
.firstOrNull;
// No version string, better not running it.
if (mainVersion == null) continue;
// Main version is after the currently supported version, will fail.
// https://github.com/xvrh/puppeteer-dart/issues/364
if (mainVersion >= 132) continue;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't we all soon only have versions after this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe, I don't really know. We probably will, when we upgrade the puppeteer version next time.


return binary;
}
}

// Otherwise let puppeteer download a chrome in the local .dart_tool directory:
Expand Down
2 changes: 1 addition & 1 deletion pkg/pub_integration/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies:
http: ^1.0.0
path: ^1.8.0
pub_semver: ^2.0.0
puppeteer: 3.12.0
puppeteer: 3.16.0
oauth2: ^2.0.0

dev_dependencies:
Expand Down
4 changes: 2 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -690,10 +690,10 @@ packages:
dependency: transitive
description:
name: puppeteer
sha256: de3f921154e5d336b14cdc05b674ac3db5701a5338f3cb0042868a5146f16e67
sha256: "7a990c68d33882b642214c351f66492d9a738afa4226a098ab70642357337fa2"
url: "https://pub.dev"
source: hosted
version: "3.12.0"
version: "3.16.0"
retry:
dependency: transitive
description:
Expand Down
Loading