Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Chrome nightly (Chromium trunk) to wpt #24702

Merged
merged 5 commits into from Jul 24, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 12 additions & 7 deletions tools/wpt/browser.py
Expand Up @@ -536,10 +536,13 @@ class Chrome(Browser):
requirements = "requirements_chrome.txt"

def download(self, dest=None, channel=None, rename=None):
raise NotImplementedError
if channel != "nightly":
raise NotImplementedError("We can only download Chrome Nightly (Chromium ToT) for you.")
url_base = self.latest_chromium_snapshot_url()

def install(self, dest=None, channel=None):
raise NotImplementedError
if channel != "nightly":
raise NotImplementedError("We can only install Chrome Nightly (Chromium ToT) for you.")

def platform_string(self):
platform = {
Expand Down Expand Up @@ -575,6 +578,12 @@ def chromium_platform_string(self):

return platform

def latest_chromium_snapshot_url(self):
arch = self.chromium_platform_string()
revision_url = "https://storage.googleapis.com/chromium-browser-snapshots/%s/LAST_CHANGE" % arch
revision = get(revision_url).text.strip()
return "https://storage.googleapis.com/chromium-browser-snapshots/%s/%s/" % arch, revision

def find_binary(self, venv_path=None, channel=None):
if uname[0] == "Linux":
name = "google-chrome"
Expand Down Expand Up @@ -626,11 +635,7 @@ def _chromium_chromedriver_url(self, chrome_version):
get(url)
except requests.RequestException:
# Fall back to the tip-of-tree Chromium build.
revision_url = "https://storage.googleapis.com/chromium-browser-snapshots/%s/LAST_CHANGE" % (
self.chromium_platform_string())
revision = get(revision_url).text.strip()
url = "https://storage.googleapis.com/chromium-browser-snapshots/%s/%s/chromedriver_%s.zip" % (
self.chromium_platform_string(), revision, self.platform_string())
url = "%s/chromedriver_%s.zip" % self.latest_chromium_snapshot_url(), self.platform_string()
return url

def _latest_chromedriver_url(self, chrome_version):
Expand Down
6 changes: 3 additions & 3 deletions tools/wpt/install.py
Expand Up @@ -3,7 +3,7 @@

latest_channels = {
'firefox': 'nightly',
'chrome': 'dev',
'chrome': 'nightly',
'chrome_android': 'dev',
'edgechromium': 'dev',
'safari': 'preview',
Expand All @@ -14,11 +14,11 @@
'stable': 'stable',
'release': 'stable',
'beta': 'beta',
'dev': 'dev',
'canary': 'canary',
'nightly': latest_channels,
'dev': latest_channels,
'preview': latest_channels,
'experimental': latest_channels,
'canary': 'canary',
}

channel_args = argparse.ArgumentParser(add_help=False)
Expand Down