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

Side by Side Diff: test/_common.js

Issue 29887560: Issue 6972 - Use Buffer.from in tests (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created Sept. 21, 2018, 9:08 a.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 | « no previous file | no next file » | 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 25 matching lines...) Expand all
36 addObserver() {} 36 addObserver() {}
37 } 37 }
38 }; 38 };
39 let XPCOMUtils = { 39 let XPCOMUtils = {
40 generateQI() {} 40 generateQI() {}
41 }; 41 };
42 let FileUtils = {}; 42 let FileUtils = {};
43 let resources = {Services, XPCOMUtils, FileUtils}; 43 let resources = {Services, XPCOMUtils, FileUtils};
44 44
45 let globals = { 45 let globals = {
46 atob: data => new Buffer(data, "base64").toString("binary"), 46 atob: data => Buffer.from(data, "base64").toString("binary"),
47 btoa: data => new Buffer(data, "binary").toString("base64"), 47 btoa: data => Buffer.from(data, "binary").toString("base64"),
48 Ci: { 48 Ci: {
49 }, 49 },
50 Cu: { 50 Cu: {
51 import(resource) 51 import(resource)
52 { 52 {
53 let match = /^resource:\/\/gre\/modules\/(.+)\.jsm$/.exec(resource); 53 let match = /^resource:\/\/gre\/modules\/(.+)\.jsm$/.exec(resource);
54 let resourceName = match && match[1]; 54 let resourceName = match && match[1];
55 if (resourceName && resources.hasOwnProperty(resourceName)) 55 if (resourceName && resources.hasOwnProperty(resourceName))
56 return {[resourceName]: resources[resourceName]}; 56 return {[resourceName]: resources[resourceName]};
57 57
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 } 405 }
406 }) 406 })
407 }; 407 };
408 }; 408 };
409 409
410 exports.unexpectedError = function(error) 410 exports.unexpectedError = function(error)
411 { 411 {
412 console.error(error); 412 console.error(error);
413 this.ok(false, "Unexpected error: " + error); 413 this.ok(false, "Unexpected error: " + error);
414 }; 414 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld