@@ -33,6 +33,8 @@ abstract class PlatformBinding {
3333 _instance = _LinuxBinding ();
3434 } else if (io.Platform .isMacOS) {
3535 _instance = _MacBinding ();
36+ } else if (io.Platform .isWindows) {
37+ _instance = _WindowsBinding ();
3638 } else {
3739 throw '${io .Platform .operatingSystem } is not supported' ;
3840 }
@@ -54,6 +56,38 @@ abstract class PlatformBinding {
5456const String _kBaseDownloadUrl =
5557 'https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o' ;
5658
59+ class _WindowsBinding implements PlatformBinding {
60+ @override
61+ int getChromeBuild (YamlMap browserLock) {
62+ final YamlMap chromeMap = browserLock['chrome' ];
63+ return chromeMap['Win' ];
64+ }
65+
66+ @override
67+ String getChromeDownloadUrl (String version) =>
68+ 'https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Win%2F${version }%2Fchrome-win32.zip?alt=media' ;
69+
70+ @override
71+ String getChromeExecutablePath (io.Directory versionDir) =>
72+ path.join (versionDir.path, 'chrome-win32' , 'chrome' );
73+
74+ @override
75+ String getFirefoxDownloadUrl (String version) =>
76+ 'https://download-installer.cdn.mozilla.net/pub/firefox/releases/${version }/win64/en-US/firefox-${version }.exe' ;
77+
78+ @override
79+ String getFirefoxExecutablePath (io.Directory versionDir) =>
80+ path.join (versionDir.path, 'firefox' , 'firefox' );
81+
82+ @override
83+ String getFirefoxLatestVersionUrl () =>
84+ 'https://download.mozilla.org/?product=firefox-latest&os=win&lang=en-US' ;
85+
86+ @override
87+ String getSafariSystemExecutablePath () =>
88+ throw UnsupportedError ('Safari is not supported on Windows' );
89+ }
90+
5791class _LinuxBinding implements PlatformBinding {
5892 @override
5993 int getChromeBuild (YamlMap browserLock) {
0 commit comments