LEFT | RIGHT |
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 13 matching lines...) Expand all Loading... |
24 // loweset version that supports WebDriver. | 24 // loweset version that supports WebDriver. |
25 const CHROMIUM_REVISION = 508578; | 25 const CHROMIUM_REVISION = 508578; |
26 | 26 |
27 const webdriver = require("selenium-webdriver"); | 27 const webdriver = require("selenium-webdriver"); |
28 const chrome = require("selenium-webdriver/chrome"); | 28 const chrome = require("selenium-webdriver/chrome"); |
29 const {ensureChromium} = require("../../adblockpluscore/test/runners/" + | 29 const {ensureChromium} = require("../../adblockpluscore/test/runners/" + |
30 "chromium_download"); | 30 "chromium_download"); |
31 | 31 |
32 exports.platform = "chrome"; | 32 exports.platform = "chrome"; |
33 | 33 |
34 exports.getDriver = function(devenvPathAbsolute) | 34 exports.ensureBrowser = function() |
35 { | 35 { |
36 return ensureChromium(CHROMIUM_REVISION).then(chromiumPath => | 36 return ensureChromium(CHROMIUM_REVISION); |
37 { | 37 }; |
38 let options = new chrome.Options() | |
39 .setChromeBinaryPath(chromiumPath) | |
40 .addArguments("--no-sandbox") | |
41 .addArguments(`load-extension=${devenvPathAbsolute}`); | |
42 | 38 |
43 return new webdriver.Builder() | 39 exports.getDriver = function(browserBinary, devenvPath) |
44 .forBrowser("chrome") | 40 { |
45 .setChromeOptions(options) | 41 let options = new chrome.Options() |
46 .build(); | 42 .setChromeBinaryPath(browserBinary) |
47 }); | 43 .addArguments("--no-sandbox") |
| 44 .addArguments(`load-extension=${devenvPath}`); |
| 45 |
| 46 return new webdriver.Builder() |
| 47 .forBrowser("chrome") |
| 48 .setChromeOptions(options) |
| 49 .build(); |
48 }; | 50 }; |
LEFT | RIGHT |