| OLD | NEW |
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
| 3 * Copyright (C) 2006-present eyeo GmbH | 3 * Copyright (C) 2006-present eyeo GmbH |
| 4 * | 4 * |
| 5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
| 7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
| 8 * | 8 * |
| 9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 const fs = require("fs"); | 22 const fs = require("fs"); |
| 23 const path = require("path"); | 23 const path = require("path"); |
| 24 | 24 |
| 25 const MemoryFS = require("memory-fs"); | 25 const MemoryFS = require("memory-fs"); |
| 26 const nodeunit = require("nodeunit"); | 26 const nodeunit = require("nodeunit"); |
| 27 const webpack = require("webpack"); | 27 const webpack = require("webpack"); |
| 28 | 28 |
| 29 const chromiumRemoteProcess = require("./test/runners/chromium_remote_process"); | 29 const chromiumRemoteProcess = require("./test/runners/chromium_remote_process"); |
| 30 const chromiumProcess = require("./test/runners/chromium_process"); | 30 const chromiumProcess = require("./test/runners/chromium_process"); |
| 31 const edgeProcess = require("./test/runners/edge_process"); |
| 31 const firefoxProcess = require("./test/runners/firefox_process"); | 32 const firefoxProcess = require("./test/runners/firefox_process"); |
| 32 | 33 |
| 33 let unitFiles = []; | 34 let unitFiles = []; |
| 34 let browserFiles = []; | 35 let browserFiles = []; |
| 35 | 36 |
| 36 let runnerDefinitions = { | 37 let runnerDefinitions = { |
| 37 // Chromium with chrome-remote-interface | 38 // Chromium with chrome-remote-interface |
| 38 chromium_remote: chromiumRemoteProcess, | 39 chromium_remote: chromiumRemoteProcess, |
| 39 // Chromium with WebDriver (requires Chromium >= 63.0.3239) | 40 // Chromium with WebDriver (requires Chromium >= 63.0.3239) |
| 40 chromium: chromiumProcess, | 41 chromium: chromiumProcess, |
| 42 edge: edgeProcess, |
| 41 firefox: firefoxProcess | 43 firefox: firefoxProcess |
| 42 }; | 44 }; |
| 43 | 45 |
| 44 function configureRunners() | 46 function configureRunners() |
| 45 { | 47 { |
| 46 let runners = "BROWSER_TEST_RUNNERS" in process.env ? | 48 let runners = "BROWSER_TEST_RUNNERS" in process.env ? |
| 47 process.env.BROWSER_TEST_RUNNERS.split(",") : []; | 49 process.env.BROWSER_TEST_RUNNERS.split(",") : []; |
| 48 | 50 |
| 49 if (runners.length == 0) | 51 if (runners.length == 0) |
| 50 { | 52 { |
| 51 // We default to not using the Chromium remote interface on Windows, | 53 // We default to not using the Chromium remote interface on Windows, |
| 52 // as it fails. | 54 // as it fails. |
| 53 if (process.platform == "win32") | 55 if (process.platform == "win32") |
| 54 return ["chromium", "firefox"]; | 56 return ["chromium", "edge", "firefox"]; |
| 55 return ["chromium_remote", "firefox"]; | 57 return ["chromium_remote", "firefox"]; |
| 56 } | 58 } |
| 57 | 59 |
| 58 return runners.filter(runner => runnerDefinitions.hasOwnProperty(runner)); | 60 return runners.filter(runner => runnerDefinitions.hasOwnProperty(runner)); |
| 59 } | 61 } |
| 60 | 62 |
| 61 let runnerProcesses = configureRunners(); | 63 let runnerProcesses = configureRunners(); |
| 62 | 64 |
| 63 function addTestPaths(testPaths, recurse) | 65 function addTestPaths(testPaths, recurse) |
| 64 { | 66 { |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 | 179 |
| 178 Promise.resolve(runBrowserTests(runnerProcesses)).catch(error => | 180 Promise.resolve(runBrowserTests(runnerProcesses)).catch(error => |
| 179 { | 181 { |
| 180 console.error("Failed running browser tests"); | 182 console.error("Failed running browser tests"); |
| 181 console.error(error); | 183 console.error(error); |
| 182 }).then(() => | 184 }).then(() => |
| 183 { | 185 { |
| 184 if (unitFiles.length) | 186 if (unitFiles.length) |
| 185 nodeunit.reporters.default.run(unitFiles); | 187 nodeunit.reporters.default.run(unitFiles); |
| 186 }); | 188 }); |
| OLD | NEW |