Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: test/all.js

Issue 29891666: Noissue - Enable tests to run on other browser versions (Closed)
Patch Set: Created Sept. 25, 2018, 7:37 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« README.md ('K') | « README.md ('k') | test/browsers/chromium.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/all.js
===================================================================
--- a/test/all.js
+++ b/test/all.js
@@ -21,6 +21,24 @@
const path = require("path");
const {exec} = require("child_process");
+function getBrowserBinary(module, browser)
+{
+ let spec = process.env[`${browser.toUpperCase()}_BINARY`];
+ let version = module.oldestCompatibleVersion;
+
+ if (spec)
+ {
+ if (spec == "installed")
+ return Promise.resolve("");
+ if (spec.startswith("path:"))
+ return Promise.resolve(spec.substr(5));
+ if (spec.startsWith("download:"))
+ version = spec.substr(9);
tlucas 2018/09/26 08:20:16 Are we ok with not checking whether someone tries
Sebastian Noack 2018/09/26 11:00:20 I am. Since this needs to be explicitly requested,
+ }
+
+ return module.ensureBrowser(version);
+}
+
for (let browser of glob.sync("./test/browsers/*.js"))
{
let module = require(path.resolve(browser));
@@ -32,7 +50,7 @@
before(function()
{
return Promise.all([
- module.ensureBrowser(),
+ getBrowserBinary(module, path.basename(browser, ".js")),
new Promise((resolve, reject) =>
{
exec(
« README.md ('K') | « README.md ('k') | test/browsers/chromium.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld