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

Side by Side Diff: test/browser/chrome.js

Issue 29866577: Issue 6887 - add Chrome to "npm test" (Closed)
Patch Set: Created Aug. 27, 2018, 3:09 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /*
Sebastian Noack 2018/08/27 19:56:15 For the directory name "browsers" (plural) seems m
tlucas 2018/08/28 08:18:13 Done.
2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 /* eslint-env mocha */
Sebastian Noack 2018/08/27 19:56:15 Is this necessary? I don't see any describe()/it/e
tlucas 2018/08/28 08:18:13 Done.
19
20 "use strict";
21
22 const CHROMIUM_REVISION = 508578;
Sebastian Noack 2018/08/27 19:56:15 We might want to add a comment which Chrome versio
tlucas 2018/08/28 08:18:13 Copied the comment from adblockpluscore/test/runne
23
24 const path = require("path");
25 const webdriver = require("selenium-webdriver");
26 const chrome = require("selenium-webdriver/chrome");
27 const {ensureChromium} = require("../../adblockpluscore/test/runners/" +
28 "chromium_download");
29
30 exports.platform = "chrome";
31
32 exports.getDriver = function()
33 {
34 let driver;
35
36 return ensureChromium(CHROMIUM_REVISION).then(chromiumPath =>
Sebastian Noack 2018/08/27 19:56:15 Are we going to download a Google Chrome or Chromi
tlucas 2018/08/28 08:18:14 Done.
37 {
38 let devenv = path.resolve("./devenv.chrome");
Sebastian Noack 2018/08/27 19:56:15 Is path.resolve() necessary here?
tlucas 2018/08/28 08:18:14 Yes, "load-extension" (below) requires an absolute
39
40 let options = new chrome.Options()
41 .setChromeBinaryPath(chromiumPath)
42 .addArguments("--no-sandbox")
43 .addArguments(`load-extension=${devenv}`);
44
45 driver = new webdriver.Builder()
Sebastian Noack 2018/08/27 19:56:15 If you just return driver here, that would make th
tlucas 2018/08/28 08:18:14 Done.
46 .forBrowser("chrome")
47 .setChromeOptions(options)
48 .build();
49 }).then(() => driver);
50 };
OLDNEW

Powered by Google App Engine
This is Rietveld