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

Delta Between Two Patch Sets: test/browsers/chromium.js

Issue 29866577: Issue 6887 - add Chrome to "npm test" (Closed)
Left Patch Set: Created Aug. 29, 2018, 9:15 a.m.
Right Patch Set: Removed unused this.platform Created Sept. 1, 2018, 3:12 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « test/all.js ('k') | test/browsers/firefox.js » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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
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 };
LEFTRIGHT

Powered by Google App Engine
This is Rietveld