Index: test/browsers/chromium.js |
diff --git a/test/browsers/chromium.js b/test/browsers/chromium.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9ac4c57818f6ca7086f3197e857e97a799e5c01e |
--- /dev/null |
+++ b/test/browsers/chromium.js |
@@ -0,0 +1,50 @@ |
+/* |
+ * This file is part of Adblock Plus <https://adblockplus.org/>, |
+ * Copyright (C) 2006-present eyeo GmbH |
+ * |
+ * Adblock Plus is free software: you can redistribute it and/or modify |
+ * it under the terms of the GNU General Public License version 3 as |
+ * published by the Free Software Foundation. |
+ * |
+ * Adblock Plus is distributed in the hope that it will be useful, |
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
+ * GNU General Public License for more details. |
+ * |
+ * You should have received a copy of the GNU General Public License |
+ * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
+ */ |
+ |
+"use strict"; |
+ |
+// The Chromium version is a build number, quite obscure. |
+// Chromium 63.0.3239.x is 508578 |
+// Chromium 65.0.3325.0 is 530368 |
+// We currently want Chromiun 63, as we still support it and that's the |
+// loweset version that supports WebDriver. |
+const CHROMIUM_REVISION = 508578; |
+ |
+const webdriver = require("selenium-webdriver"); |
+const chrome = require("selenium-webdriver/chrome"); |
+const {ensureChromium} = require("../../adblockpluscore/test/runners/" + |
+ "chromium_download"); |
+ |
+exports.platform = "chrome"; |
+ |
+exports.ensureBrowser = function() |
+{ |
+ return ensureChromium(CHROMIUM_REVISION); |
+}; |
+ |
+exports.getDriver = function(browserBinary, devenvPathAbsolute) |
Sebastian Noack
2018/09/01 12:26:34
Nit: I don't think that the path is absolute is an
tlucas
2018/09/01 14:46:44
Done.
|
+{ |
+ let options = new chrome.Options() |
+ .setChromeBinaryPath(browserBinary) |
+ .addArguments("--no-sandbox") |
+ .addArguments(`load-extension=${devenvPathAbsolute}`); |
+ |
+ return new webdriver.Builder() |
+ .forBrowser("chrome") |
+ .setChromeOptions(options) |
+ .build(); |
+}; |