Skip to content

Commit

Permalink
Roll pinned browser versions (#12719)
Browse files Browse the repository at this point in the history
Updated the bidi tests, since the `NavigationId` will never by `null` in a bidi navigation event
  • Loading branch information
shs96c committed Sep 11, 2023
1 parent cd61441 commit 493ccb8
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 41 deletions.
40 changes: 21 additions & 19 deletions common/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ def pin_browsers():

http_archive(
name = "linux_firefox",
url = "https://ftp.mozilla.org/pub/firefox/releases/115.0.3/linux-x86_64/en-US/firefox-115.0.3.tar.bz2",
sha256 = "ee8980afe907fa552b52d573073e298b7878558faff8e8d5a4a7444f4f2d2cca",
url = "https://ftp.mozilla.org/pub/firefox/releases/117.0/linux-x86_64/en-US/firefox-117.0.tar.bz2",
sha256 = "5acf61aed42bbf43dff8fee90c55fd3bcecb1c710b86cdd2c380b5e4db7f3998",
build_file_content = """
filegroup(
name = "files",
Expand All @@ -27,8 +27,8 @@ exports_files(

dmg_archive(
name = "mac_firefox",
url = "https://ftp.mozilla.org/pub/firefox/releases/115.0.3/mac/en-US/Firefox%20115.0.3.dmg",
sha256 = "96b2616d0f95352caad756a200e0b13d20ee300be1d02fdfd3bab17ed6e73fa3",
url = "https://ftp.mozilla.org/pub/firefox/releases/117.0/mac/en-US/Firefox%20117.0.dmg",
sha256 = "eb9fcd6a7ea0feb56d64795367c32a1faea93db113d40b7a6b93e178af56e258",
build_file_content = "exports_files([\"Firefox.app\"])",
)

Expand All @@ -48,32 +48,32 @@ exports_files(

pkg_archive(
name = "mac_edge",
url = "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/1a586fcf-50fb-4714-9994-bef23c695628/MicrosoftEdge-115.0.1901.188.pkg",
sha256 = "c1bd8ab7e5d8972918ef089027515de14c892fb371a5b2c0322acadb46d29be8",
url = "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/a989b093-c982-4d31-95d1-2c439f49b7e7/MicrosoftEdge-116.0.1938.76.pkg",
sha256 = "d8676eb179b94be62e3a088367ae4525c96cd7bd79afdf3571b1e560a96c5643",
move = {
"MicrosoftEdge-115.0.1901.188.pkg/Payload/Microsoft Edge.app": "Edge.app",
"MicrosoftEdge-116.0.1938.76.pkg/Payload/Microsoft Edge.app": "Edge.app",
},
build_file_content = "exports_files([\"Edge.app\"])",
)

http_archive(
name = "linux_edgedriver",
url = "https://msedgedriver.azureedge.net/115.0.1901.188/edgedriver_linux64.zip",
sha256 = "8a5d10f0d6c43ecf1c6c503a301defcf648a46440c32437862add99839bc4446",
url = "https://msedgedriver.azureedge.net/116.0.1938.76/edgedriver_linux64.zip",
sha256 = "85b06da1719907402e4d78a1467e06539185c38b238019b6efb503000f3f04f8",
build_file_content = "exports_files([\"msedgedriver\"])",
)

http_archive(
name = "mac_edgedriver",
url = "https://msedgedriver.azureedge.net/115.0.1901.188/edgedriver_mac64.zip",
sha256 = "934fdf4f620cba11ba039e8e7dc40a7e23d0a49b5896e5ba53f3be1fe7b4e6ef",
url = "https://msedgedriver.azureedge.net/116.0.1938.76/edgedriver_mac64.zip",
sha256 = "3b0b2ba7e7a7e99c78a00a3a830fe72d2c3825d66e592ce3664cff563ddc6828",
build_file_content = "exports_files([\"msedgedriver\"])",
)

http_archive(
name = "linux_chrome",
url = "https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.102/linux64/chrome-linux64.zip",
sha256 = "aebaecf70965f152a743935a95d0013de3e9d96e194106eb13dfc1b9b1c7892c",
url = "https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/linux64/chrome-linux64.zip",
sha256 = "5d8ab1f999071b213d85e46ea4505d99df818b6fd0f8449e79710cb5403ba858",
build_file_content = """
filegroup(
name = "files",
Expand All @@ -89,8 +89,8 @@ exports_files(

http_archive(
name = "mac_chrome",
url = "https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.102/mac-x64/chrome-mac-x64.zip",
sha256 = "76e2fbb782e195259e7e7873ffca0e7270d52066af79a0d401c92d66382420ec",
url = "https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/mac-x64/chrome-mac-x64.zip",
sha256 = "edc8e78f7a4b618037067593b2cb79ff571c16da0b955bc05a500af34b77d2fe",
strip_prefix = "chrome-mac-x64",
patch_cmds = [
"mv 'Google Chrome for Testing.app' Chrome.app",
Expand All @@ -101,14 +101,16 @@ exports_files(

http_archive(
name = "linux_chromedriver",
url = "https://chromedriver.storage.googleapis.com/114.0.5735.90/chromedriver_linux64.zip",
sha256 = "a7787ef8b139170cab4abfca4a0284fd5d006bfd979624b4af25b64d583a6f44",
url = "https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/linux64/chromedriver-linux64.zip",
sha256 = "17d225af124f9483a5d79a547f28f34253d7a1ef603ab7fb5ee185c0e4c71535",
strip_prefix = "chromedriver-linux64",
build_file_content = "exports_files([\"chromedriver\"])",
)

http_archive(
name = "mac_chromedriver",
url = "https://chromedriver.storage.googleapis.com/114.0.5735.90/chromedriver_mac64.zip",
sha256 = "6abdc9d358c2bc4668bef7b23048de2a9dbd3ad82cfbc6dfe322e74d4cff1650",
url = "https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/116.0.5845.96/mac-x64/chromedriver-mac-x64.zip",
sha256 = "3ec691569dc8e98d803cf206c5fd4627e56836c81a5d1c9b7e5644a4e61ffd3f",
strip_prefix = "chromedriver-mac-x64",
build_file_content = "exports_files([\"chromedriver\"])",
)
3 changes: 2 additions & 1 deletion java/test/org/openqa/selenium/bidi/BiDiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ void canNavigateAndListenToErrors()
page = server.whereIs("/bidi/logEntryAdded.html");
NavigationResult info = browsingContext.navigate(page, ReadinessState.COMPLETE);

// If navigation was successful, we expect both the url and navigation id to be set
assertThat(browsingContext.getId()).isNotEmpty();
assertThat(info.getNavigationId()).isNull();
assertThat(info.getNavigationId()).isNotNull();
assertThat(info.getUrl()).contains("/bidi/logEntryAdded.html");

driver.findElement(By.id("jsException")).click();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ void canNavigateToUrl() {
NavigationResult info = browsingContext.navigate(url);

assertThat(browsingContext.getId()).isNotEmpty();
assertThat(info.getNavigationId()).isNull();
assertThat(info.getNavigationId()).isNotNull();
assertThat(info.getUrl()).contains("/bidi/logEntryAdded.html");
}

Expand Down
49 changes: 29 additions & 20 deletions scripts/pinned_browsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,51 +19,60 @@ def calculate_hash(url):
h.update(b)
return h.hexdigest()

def chromedriver():
r = http.request('GET', 'https://chromedriver.storage.googleapis.com/LATEST_RELEASE')
v = r.data.decode('utf-8')
def get_chrome_milestone():
channel = "Stable"
r = http.request('GET', f'https://chromiumdash.appspot.com/fetch_releases?channel={channel}&num=1&platform=Mac,Linux')
all_versions = json.loads(r.data)
# use the same milestone for all chrome releases, so pick the lowest
milestone = min([version["milestone"] for version in all_versions if version["milestone"]])
r = http.request('GET', 'https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json')
versions = json.loads(r.data)["versions"]

return sorted(
filter(lambda v: v['version'].split('.')[0] == str(milestone), versions),
key=lambda v: LegacyVersion(v['version'])
)[-1]

def chromedriver():
content = ""

linux = 'https://chromedriver.storage.googleapis.com/%s/chromedriver_linux64.zip' % v
selected_version = get_chrome_milestone()

drivers = selected_version["downloads"]["chromedriver"]

linux = [d["url"] for d in drivers if d["platform"] == "linux64"][0]
sha = calculate_hash(linux)

content = content + """
http_archive(
name = "linux_chromedriver",
url = "%s",
sha256 = "%s",
strip_prefix = "chromedriver-linux64",
build_file_content = "exports_files([\\"chromedriver\\"])",
)
""" % (linux, sha)

mac = 'https://chromedriver.storage.googleapis.com/%s/chromedriver_mac64.zip' % v
mac = [d["url"] for d in drivers if d["platform"] == "mac-x64"][0]
sha = calculate_hash(mac)
content = content + """
http_archive(
name = "mac_chromedriver",
url = "%s",
sha256 = "%s",
strip_prefix = "chromedriver-mac-x64",
build_file_content = "exports_files([\\"chromedriver\\"])",
)
""" % (mac, sha)

return content

def chrome():
channel = "Stable"
r = http.request('GET', f'https://chromiumdash.appspot.com/fetch_releases?channel={channel}&num=1&platform=Win32,Windows,Mac,Linux')
milestone = json.loads(r.data)[0]["milestone"]

r = http.request('GET', 'https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json')
versions = json.loads(r.data)["versions"]

selected_version = sorted(
filter(lambda v: v['version'].split('.')[0] == str(milestone), versions),
key=lambda v: LegacyVersion(v['version'])
)[-1]
selected_version = get_chrome_milestone()

downloads = selected_version["downloads"]["chrome"]
chrome_downloads = selected_version["downloads"]["chrome"]

linux = [d["url"] for d in downloads if d["platform"] == "linux64"][0]
linux = [d["url"] for d in chrome_downloads if d["platform"] == "linux64"][0]
sha = calculate_hash(linux)

content = """
Expand All @@ -86,7 +95,7 @@ def chrome():
""" % (linux, sha)

mac = [d["url"] for d in downloads if d["platform"] == "mac-x64"][0]
mac = [d["url"] for d in chrome_downloads if d["platform"] == "mac-x64"][0]
sha = calculate_hash(mac)

content += """
Expand All @@ -99,7 +108,7 @@ def chrome():
"mv 'Google Chrome for Testing.app' Chrome.app",
"mv 'Chrome.app/Contents/MacOS/Google Chrome for Testing' Chrome.app/Contents/MacOS/Chrome",
],
build_file_content = "exports_files([\\"Google Chrome for Testing.app\\"])",
build_file_content = "exports_files([\\"Chrome.app\\"])",
)
""" % (mac, sha)
Expand Down

0 comments on commit 493ccb8

Please sign in to comment.