зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1508992 - Enable ESLint for dom/plugins/test/unit (Automatic Changes). r=qdot
Differential Revision: https://phabricator.services.mozilla.com/D22365 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
4c895e2d7e
Коммит
e3317e4347
|
@ -15,7 +15,7 @@ function allow_all_plugins() {
|
|||
}
|
||||
|
||||
// Finds the test plugin library
|
||||
function get_test_plugin(secondplugin=false) {
|
||||
function get_test_plugin(secondplugin = false) {
|
||||
for (let dir of gDirSvc.get("APluginsDL", Ci.nsISimpleEnumerator)) {
|
||||
let name = get_platform_specific_plugin_name(secondplugin);
|
||||
let plugin = dir.clone();
|
||||
|
@ -29,7 +29,7 @@ function get_test_plugin(secondplugin=false) {
|
|||
}
|
||||
|
||||
// Finds the test nsIPluginTag
|
||||
function get_test_plugintag(aName="Test Plug-in") {
|
||||
function get_test_plugintag(aName = "Test Plug-in") {
|
||||
var name = aName || "Test Plug-in";
|
||||
var host = Cc["@mozilla.org/plugin/host;1"].
|
||||
getService(Ci.nsIPluginHost);
|
||||
|
@ -55,27 +55,21 @@ function do_get_profile_startup() {
|
|||
let dirSvc = Cc["@mozilla.org/file/directory_service;1"]
|
||||
.getService(Ci.nsIProperties);
|
||||
let provider = {
|
||||
getFile: function(prop, persistent) {
|
||||
getFile(prop, persistent) {
|
||||
persistent.value = true;
|
||||
if (prop == "ProfDS") {
|
||||
return file.clone();
|
||||
}
|
||||
throw Cr.NS_ERROR_FAILURE;
|
||||
},
|
||||
QueryInterface: function(iid) {
|
||||
if (iid.equals(Ci.nsIDirectoryServiceProvider) ||
|
||||
iid.equals(Ci.nsISupports)) {
|
||||
return this;
|
||||
}
|
||||
throw Cr.NS_ERROR_NO_INTERFACE;
|
||||
}
|
||||
QueryInterface: ChromeUtils.generateQI(["nsIDirectoryServiceProvider"]),
|
||||
};
|
||||
dirSvc.QueryInterface(Ci.nsIDirectoryService)
|
||||
.registerProvider(provider);
|
||||
return file.clone();
|
||||
}
|
||||
|
||||
function get_platform_specific_plugin_name(secondplugin=false) {
|
||||
function get_platform_specific_plugin_name(secondplugin = false) {
|
||||
if (secondplugin) {
|
||||
if (gIsWindows) return "npsecondtest.dll";
|
||||
if (gIsOSX) return "SecondTest.plugin";
|
||||
|
@ -92,7 +86,7 @@ function get_platform_specific_plugin_suffix() {
|
|||
if (gIsWindows) return ".dll";
|
||||
else if (gIsOSX) return ".plugin";
|
||||
else if (gIsLinux) return ".so";
|
||||
else return null;
|
||||
return null;
|
||||
}
|
||||
|
||||
function get_test_plugin_no_symlink() {
|
||||
|
|
|
@ -23,7 +23,7 @@ function run_test() {
|
|||
function get_status_for_type(type) {
|
||||
try {
|
||||
return pluginHost.getStateForType(type);
|
||||
} catch(ex) {
|
||||
} catch (ex) {
|
||||
// If the type is not allowed, then nsIPluginHost.getStateForType throws
|
||||
// NS_ERROR_NOT_AVAILABLE, for which we return undefined to make it easier
|
||||
// to write assertions about the API.
|
||||
|
|
|
@ -8,12 +8,12 @@ const XULAPPINFO_CID = Components.ID("{c763b610-9d49-455a-bbd2-ede71682a1ac}");
|
|||
|
||||
var gAppInfo = null;
|
||||
|
||||
function createAppInfo(ID, name, version, platformVersion="1.0") {
|
||||
function createAppInfo(ID, name, version, platformVersion = "1.0") {
|
||||
let tmp = {};
|
||||
ChromeUtils.import("resource://testing-common/AppInfo.jsm", tmp);
|
||||
tmp.updateAppInfo({
|
||||
ID, name, version, platformVersion,
|
||||
crashReporter: true
|
||||
crashReporter: true,
|
||||
});
|
||||
gAppInfo = tmp.getAppInfo();
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ function run_test() {
|
|||
let testNames = [
|
||||
pluginName + "2",
|
||||
pluginName.toUpperCase() + "_11_5_42_2323",
|
||||
pluginName + "-5.2.7"
|
||||
pluginName + "-5.2.7",
|
||||
];
|
||||
testNames.forEach(function(leafName) {
|
||||
dump("Checking " + leafName + ".\n");
|
||||
|
|
Загрузка…
Ссылка в новой задаче