File tree Expand file tree Collapse file tree 3 files changed +23
-9
lines changed Expand file tree Collapse file tree 3 files changed +23
-9
lines changed Original file line number Diff line number Diff line change @@ -45,13 +45,27 @@ class TestBrowser {
4545 final binaries = [
4646 '/usr/bin/google-chrome' ,
4747 ];
48- for (final binary in binaries) {
49- if (File (binary).existsSync ()) return binary;
50- }
5148
52- // sanity check for CI
53- if (Platform .environment['CI' ] == 'true' ) {
54- throw StateError ('Could not detect chrome binary while running in CI.' );
49+ for (final binary in binaries) {
50+ if (File (binary).existsSync ()) {
51+ // Get the local chrome's main version
52+ final pr = await Process .run (binary, ['--version' ])
53+ .timeout (Duration (seconds: 5 ));
54+ final output = pr.stdout.toString ();
55+ final mainVersion = output
56+ .split (' ' )
57+ .expand ((p) => p.split ('.' ))
58+ .map (int .tryParse)
59+ .whereType <int >()
60+ .firstOrNull;
61+ // No version string, better not running it.
62+ if (mainVersion == null ) continue ;
63+ // Main version is after the currently supported version, will fail.
64+ // https://github.com/xvrh/puppeteer-dart/issues/364
65+ if (mainVersion >= 132 ) continue ;
66+
67+ return binary;
68+ }
5569 }
5670
5771 // Otherwise let puppeteer download a chrome in the local .dart_tool directory:
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ dependencies:
1212 http : ^1.0.0
1313 path : ^1.8.0
1414 pub_semver : ^2.0.0
15- puppeteer : 3.12 .0
15+ puppeteer : 3.16 .0
1616 oauth2 : ^2.0.0
1717
1818dev_dependencies :
Original file line number Diff line number Diff line change @@ -690,10 +690,10 @@ packages:
690690 dependency: transitive
691691 description:
692692 name: puppeteer
693- sha256: de3f921154e5d336b14cdc05b674ac3db5701a5338f3cb0042868a5146f16e67
693+ sha256: "7a990c68d33882b642214c351f66492d9a738afa4226a098ab70642357337fa2"
694694 url: "https://pub.dev"
695695 source: hosted
696- version: "3.12 .0"
696+ version: "3.16 .0"
697697 retry:
698698 dependency: transitive
699699 description:
You can’t perform that action at this time.
0 commit comments