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

Delta Between Two Patch Sets: test/runners/chromium_process.js

Issue 29891680: Issue 6986 - Don't use chromium remote interface on Windows (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Left Patch Set: Donc run headless on Windows Created Sept. 27, 2018, 5 p.m.
Right Patch Set: Removed the changes in chrome_remote_interface Created Nov. 9, 2018, 8:02 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 | « no previous file | test_runner.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 15 matching lines...) Expand all
26 26
27 // The Chromium version is a build number, quite obscure. 27 // The Chromium version is a build number, quite obscure.
28 // Chromium 63.0.3239.x is 508578 28 // Chromium 63.0.3239.x is 508578
29 // Chromium 65.0.3325.0 is 530368 29 // Chromium 65.0.3325.0 is 530368
30 // We currently want Chromiun 63, as we still support it and that's the 30 // We currently want Chromiun 63, as we still support it and that's the
31 // loweset version that supports WebDriver. 31 // loweset version that supports WebDriver.
32 const CHROMIUM_REVISION = 508578; 32 const CHROMIUM_REVISION = 508578;
33 33
34 function runScript(chromiumPath, script, scriptName, scriptArgs) 34 function runScript(chromiumPath, script, scriptName, scriptArgs)
35 { 35 {
36 let {platform} = process;
Sebastian Noack 2018/09/28 15:37:00 Nit: This doesn't seem to be worth a temporary var
hub 2018/09/28 15:56:35 Done.
37 const options = new chrome.Options() 36 const options = new chrome.Options()
38 // Disabling sandboxing is needed on some system configurations 37 // Disabling sandboxing is needed on some system configurations
39 // like Debian 9. 38 // like Debian 9.
40 .addArguments("--no-sandbox") 39 .addArguments("--no-sandbox")
41 .setChromeBinaryPath(chromiumPath); 40 .setChromeBinaryPath(chromiumPath);
42 // Headless doesn't seem to work on Windows. 41 // Headless doesn't seem to work on Windows.
43 if (platform != "win32") 42 if (process.platform != "win32")
44 options.headless(); 43 options.headless();
45 44
46 const driver = new Builder() 45 const driver = new Builder()
47 .forBrowser("chrome") 46 .forBrowser("chrome")
48 .setChromeOptions(options) 47 .setChromeOptions(options)
49 .build(); 48 .build();
50 49
51 return executeScript(driver, "Chromium (WebDriver)", 50 return executeScript(driver, "Chromium (WebDriver)",
52 script, scriptName, scriptArgs); 51 script, scriptName, scriptArgs);
53 } 52 }
54 53
55 module.exports = function(script, scriptName, ...scriptArgs) 54 module.exports = function(script, scriptName, ...scriptArgs)
56 { 55 {
57 return ensureChromium(CHROMIUM_REVISION) 56 return ensureChromium(CHROMIUM_REVISION)
58 .then(chromiumPath => runScript(chromiumPath, script, scriptName, scriptArgs )); 57 .then(chromiumPath => runScript(chromiumPath, script, scriptName, scriptArgs ));
59 }; 58 };
LEFTRIGHT
« no previous file | test_runner.js » ('j') | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld