This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +50
-3
lines changed Expand file tree Collapse file tree 5 files changed +50
-3
lines changed Original file line number Diff line number Diff line change @@ -273,6 +273,8 @@ targets:
273
273
{"download_emsdk": true}
274
274
dependencies : >-
275
275
[
276
+ {"dependency": "chrome_and_driver", "version": "version:107.0"},
277
+ {"dependency": "firefox", "version": "version:83.0"},
276
278
{"dependency": "goldctl", "version": "git_revision:3a77d0b12c697a840ca0c7705208e8622dc94603"}
277
279
]
278
280
timeout : 60
@@ -501,6 +503,10 @@ targets:
501
503
gclient_variables : >-
502
504
{"download_emsdk": true}
503
505
gcs_goldens_bucket : flutter_logs
506
+ dependencies : >-
507
+ [
508
+ {"dependency": "chrome_and_driver", "version": "version:107.0"}
509
+ ]
504
510
timeout : 60
505
511
runIf :
506
512
- DEPS
Original file line number Diff line number Diff line change @@ -153,6 +153,20 @@ We test with Firefox on LUCI in the Linux Web Engine builder. The process for
153
153
rolling Firefox is even easier than Chromium. Simply update ` browser_lock.yaml `
154
154
with the latest version of Firefox, and run ` browser_roller.dart ` .
155
155
156
+ #### .ci.yaml
157
+
158
+ After rolling Chrome and/or Firefox, also update the CI dependencies in
159
+ ` .ci.yaml ` to make use of the new versions. The lines look like
160
+
161
+ ``` yaml
162
+ dependencies : >-
163
+ [
164
+ {"dependency": "chrome_and_driver", "version": "version:107.0"},
165
+ {"dependency": "firefox", "version": "version:83.0"},
166
+ {"dependency": "goldctl", "version": "git_revision:3a77d0b12c697a840ca0c7705208e8622dc94603"}
167
+ ]
168
+ ` ` `
169
+
156
170
##### **browser_roller.dart**
157
171
158
172
The script has the following command-line options:
Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ import 'common.dart';
15
15
import 'environment.dart' ;
16
16
import 'exceptions.dart' ;
17
17
18
+ const String _chromeExecutableVar = 'CHROME_EXECUTABLE' ;
19
+
18
20
/// Returns the installation of Chrome, installing it if necessary.
19
21
///
20
22
/// If [requestedVersion] is null, uses the version specified on the
@@ -33,6 +35,18 @@ Future<BrowserInstallation> getOrInstallChrome(
33
35
}) async {
34
36
infoLog ?? = io.stdout;
35
37
38
+ // When running on LUCI, if we specify the "chrome_and_driver" dependency,
39
+ // then the bot will download Chrome from CIPD and place it in a cache and
40
+ // set the environment variable CHROME_EXECUTABLE.
41
+ if (io.Platform .environment.containsKey (_chromeExecutableVar)) {
42
+ infoLog.writeln ('Using Chrome from $_chromeExecutableVar variable: '
43
+ '${io .Platform .environment [_chromeExecutableVar ]}' );
44
+ return BrowserInstallation (
45
+ version: 'cipd' ,
46
+ executable: io.Platform .environment[_chromeExecutableVar]! ,
47
+ );
48
+ }
49
+
36
50
if (requestedVersion == 'system' ) {
37
51
return BrowserInstallation (
38
52
version: 'system' ,
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ class FirefoxEnvironment implements BrowserEnvironment {
22
22
23
23
@override
24
24
Future <Browser > launchBrowserInstance (Uri url, {bool debug = false }) async {
25
- return Firefox (url, this , debug: debug);
25
+ return Firefox (url, _installation , debug: debug);
26
26
}
27
27
28
28
@override
@@ -56,8 +56,7 @@ class FirefoxEnvironment implements BrowserEnvironment {
56
56
class Firefox extends Browser {
57
57
/// Starts a new instance of Firefox open to the given [url] , which may be a
58
58
/// [Uri] or a [String] .
59
- factory Firefox (Uri url, FirefoxEnvironment firefoxEnvironment, {bool debug = false }) {
60
- final BrowserInstallation installation = firefoxEnvironment._installation;
59
+ factory Firefox (Uri url, BrowserInstallation installation, {bool debug = false }) {
61
60
final Completer <Uri > remoteDebuggerCompleter = Completer <Uri >.sync ();
62
61
return Firefox ._(BrowserProcess (() async {
63
62
// Using a profile on opening will prevent popups related to profiles.
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ import 'common.dart';
11
11
import 'environment.dart' ;
12
12
import 'exceptions.dart' ;
13
13
14
+ const String _firefoxExecutableVar = 'FIREFOX_EXECUTABLE' ;
15
+
14
16
/// Returns the installation of Firefox, installing it if necessary.
15
17
///
16
18
/// If [requestedVersion] is null, uses the version specified on the
@@ -36,6 +38,18 @@ Future<BrowserInstallation> getOrInstallFirefox(
36
38
37
39
infoLog ?? = io.stdout;
38
40
41
+ // When running on LUCI, if we specify the "firefox" dependency, then the
42
+ // bot will download Firefox from CIPD and place it in a cache and set the
43
+ // environment variable FIREFOX_EXECUTABLE.
44
+ if (io.Platform .environment.containsKey (_firefoxExecutableVar)) {
45
+ infoLog.writeln ('Using Firefox from $_firefoxExecutableVar variable: '
46
+ '${io .Platform .environment [_firefoxExecutableVar ]}' );
47
+ return BrowserInstallation (
48
+ version: 'cipd' ,
49
+ executable: io.Platform .environment[_firefoxExecutableVar]! ,
50
+ );
51
+ }
52
+
39
53
if (requestedVersion == 'system' ) {
40
54
return BrowserInstallation (
41
55
version: 'system' ,
You can’t perform that action at this time.
0 commit comments