Get the Chrome milestone from the channel. This is the same method from pinned_browser.
()
| 17 | |
| 18 | |
| 19 | def get_chrome_milestone(): |
| 20 | """Get the Chrome milestone from the channel. |
| 21 | |
| 22 | This is the same method from pinned_browser. |
| 23 | """ |
| 24 | parser = argparse.ArgumentParser() |
| 25 | parser.add_argument("--chrome_channel", default="Stable", help="Set the Chrome channel") |
| 26 | args = parser.parse_args() |
| 27 | channel = args.chrome_channel |
| 28 | |
| 29 | r = http.request( |
| 30 | "GET", |
| 31 | "https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions.json", |
| 32 | ) |
| 33 | milestone = json.loads(r.data)["channels"][channel]["version"].split(".")[0] |
| 34 | r = http.request( |
| 35 | "GET", |
| 36 | "https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json", |
| 37 | ) |
| 38 | versions = json.loads(r.data)["versions"] |
| 39 | |
| 40 | return max( |
| 41 | filter(lambda v: v["version"].split(".")[0] == str(milestone), versions), |
| 42 | key=lambda v: parse(v["version"]), |
| 43 | ) |
| 44 | |
| 45 | |
| 46 | def github_get(url): |
no test coverage detected