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

Side by Side Diff: test/runners/chromium_process.js

Issue 29720661: Issue 6391 - Allow running the browser unit tests with Firefox (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Move the _process.js files. Remove the need for index.html Created March 14, 2018, 1:42 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
« no previous file with comments | « package.json ('k') | test/runners/firefox_process.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 89
90 if (!buildTypes.hasOwnProperty(platform)) 90 if (!buildTypes.hasOwnProperty(platform))
91 { 91 {
92 let err = new Error(`Cannot run browser tests, ${platform} is unsupported`); 92 let err = new Error(`Cannot run browser tests, ${platform} is unsupported`);
93 return Promise.reject(err); 93 return Promise.reject(err);
94 } 94 }
95 95
96 96
97 return Promise.resolve().then(() => 97 return Promise.resolve().then(() =>
98 { 98 {
99 let snapshotsDir = path.join(__dirname, "chromium-snapshots"); 99 let snapshotsDir = path.join(__dirname, "..", "..", "chromium-snapshots");
100 let chromiumDir = path.join(snapshotsDir, 100 let chromiumDir = path.join(snapshotsDir,
101 `chromium-${platform}-${CHROMIUM_REVISION}`); 101 `chromium-${platform}-${CHROMIUM_REVISION}`);
102 if (fs.existsSync(chromiumDir)) 102 if (fs.existsSync(chromiumDir))
103 return chromiumDir; 103 return chromiumDir;
104 104
105 if (!fs.existsSync(path.dirname(chromiumDir))) 105 if (!fs.existsSync(path.dirname(chromiumDir)))
106 fs.mkdirSync(path.dirname(chromiumDir)); 106 fs.mkdirSync(path.dirname(chromiumDir));
107 107
108 let [dir, fileName] = buildTypes[platform]; 108 let [dir, fileName] = buildTypes[platform];
109 let archive = path.join(snapshotsDir, "download-cache", 109 let archive = path.join(snapshotsDir, "download-cache",
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 } 249 }
250 250
251 function runScript(script, scriptName, scriptArgs) 251 function runScript(script, scriptName, scriptArgs)
252 { 252 {
253 return connectRemoteInterface().then(async client => 253 return connectRemoteInterface().then(async client =>
254 { 254 {
255 try 255 try
256 { 256 {
257 let {Runtime, Log, Console} = client; 257 let {Runtime, Log, Console} = client;
258 258
259 console.log("\nTests in Chromium\n");
260
259 await Log.enable(); 261 await Log.enable();
260 Log.entryAdded(({entry}) => 262 Log.entryAdded(({entry}) =>
261 { 263 {
262 reportMessage(entry.text, entry.level); 264 reportMessage(entry.text, entry.level);
263 }); 265 });
264 266
265 await Console.enable(); 267 await Console.enable();
266 Console.messageAdded(({message}) => 268 Console.messageAdded(({message}) =>
267 { 269 {
268 reportMessage(message.text, message.level); 270 reportMessage(message.text, message.level);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 { 318 {
317 child.kill(); 319 child.kill();
318 return result; 320 return result;
319 }).catch(error => 321 }).catch(error =>
320 { 322 {
321 child.kill(); 323 child.kill();
322 throw error; 324 throw error;
323 }); 325 });
324 }); 326 });
325 }; 327 };
OLDNEW
« no previous file with comments | « package.json ('k') | test/runners/firefox_process.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld