Bug 1532941 - Enable ESLint for uriloader (manual changes). r=Standard8,qdot

Differential Revision: https://phabricator.services.mozilla.com/D22478

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Syeda Asra Arshia Qadri 2019-03-13 20:50:11 +00:00
Родитель f6fb4db71e
Коммит 7ed6903635
10 изменённых файлов: 23 добавлений и 30 удалений

Просмотреть файл

@ -27,8 +27,6 @@ netwerk/test/browser/**
netwerk/test/mochitests/**
netwerk/test/unit*/**
tools/update-packaging/**
uriloader/exthandler/**
uriloader/exthandler/tests/mochitest/**
xpfe/**
# We currently have no js files in these directories, so we ignore them by

Просмотреть файл

@ -0,0 +1,8 @@
"use strict";
module.exports = {
"extends": [
"plugin:mozilla/browser-test",
"plugin:mozilla/mochitest-test",
]
};

Просмотреть файл

@ -60,7 +60,6 @@ add_task(async function simple_navigation() {
// opens with target="_blank" (i.e. a new tab) and ensures that we
// automatically open and close that tab.
async function testNewTab(browser) {
let targetURL = browser.currentURI.spec;
let dialogAppeared = promiseHelperAppDialog();
let tabOpened = BrowserTestUtils.waitForEvent(gBrowser.tabContainer, "TabOpen").then((event) => {
return [ event.target, BrowserTestUtils.waitForTabClosing(event.target) ];

Просмотреть файл

@ -17,8 +17,7 @@ function test() {
"handlerApp.xhtml?uri=%s";
// set up the uri to test with
var ioService = Cc["@mozilla.org/network/io-service;1"].
getService(SpecialPowers.Ci.nsIIOService);
var ioService = Services.io;
var uri = ioService.newURI(testURI);
// create a window, and launch the handler in it
@ -43,8 +42,7 @@ function test() {
localHandler.name = "Test Local Handler App";
// get a local app that we know will be there and do something sane
var osString = Cc["@mozilla.org/xre/app-info;1"].
getService(SpecialPowers.Ci.nsIXULRuntime).OS;
var osString = Services.appinfo.OS;
var dirSvc = Cc["@mozilla.org/file/directory_service;1"].
getService(SpecialPowers.Ci.nsIDirectoryServiceProvider);

Просмотреть файл

@ -6,7 +6,7 @@ const HELPERAPP_DIALOG_CID =
const FAKE_CID = Cc["@mozilla.org/uuid-generator;1"].
getService(Ci.nsIUUIDGenerator).generateUUID();
/* eslint-env mozilla/frame-script */
function HelperAppLauncherDialog() {}
HelperAppLauncherDialog.prototype = {
show(aLauncher, aWindowContext, aReason) {

Просмотреть файл

@ -11,18 +11,16 @@ function run_test() {
// its length to make sure this hasn't happened.
var badMimeType = "text/plainÿ";
Assert.equal(badMimeType.length, 11);
try {
var type = Cc["@mozilla.org/mime;1"].
getService(Ci.nsIMIMEService).
getFromTypeAndExtension(badMimeType, "txt");
Cc["@mozilla.org/mime;1"].
getService(Ci.nsIMIMEService).
getFromTypeAndExtension(badMimeType, "txt");
} catch (e) {
if (!(e instanceof Ci.nsIException) ||
e.result != Cr.NS_ERROR_NOT_AVAILABLE) {
throw e;
}
// This is an expected exception, thrown if the type can't be determined
} finally {
}
// Not crashing is good enough
Assert.equal(true, true);

Просмотреть файл

@ -14,8 +14,7 @@ function run_test() {
const mimeService = Cc["@mozilla.org/mime;1"].
getService(Ci.nsIMIMEService);
const categoryManager = Cc["@mozilla.org/categorymanager;1"].
getService(Ci.nsICategoryManager);
const categoryManager = Services.catMan;
// --- Test procedure ---

Просмотреть файл

@ -121,14 +121,14 @@ function run_test() {
const kMockCID = Components.ID("{9b23dfe9-296b-4740-ba1c-d39c9a16e55e}");
const kWindowsRegKeyContractID = "@mozilla.org/windows-registry-key;1";
const kWindowsRegKeyClassName = "nsWindowsRegKey";
function registerMockWindowsRegKeyFactory() {
mockWindowsRegKeyFactory = {
createInstance(aOuter, aIid) {
if (aOuter != null)
throw Cr.NS_ERROR_NO_AGGREGATION;
// XXX Bug 1533719 - originalWindowsRegKeyFactory is undefined.
// eslint-disable-next-line no-undef
var innerKey = originalWindowsRegKeyFactory.createInstance(null, aIid);
var key = new MockWindowsRegKey(innerKey);
@ -171,9 +171,9 @@ function run_test() {
try {
// Try and get the MIME type associated with the extension. If this
// operation does not throw an unexpected exception, the test succeeds.
var type = Cc["@mozilla.org/mime;1"].
getService(Ci.nsIMIMEService).
getTypeFromExtension(".txt");
Cc["@mozilla.org/mime;1"].
getService(Ci.nsIMIMEService).
getTypeFromExtension(".txt");
} catch (e) {
if (!(e instanceof Ci.nsIException) ||
e.result != Cr.NS_ERROR_NOT_AVAILABLE) {

Просмотреть файл

@ -15,11 +15,7 @@ function run_test() {
const protoSvc = Cc["@mozilla.org/uriloader/external-protocol-service;1"].
getService(Ci.nsIExternalProtocolService);
const prefSvc = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefService);
const ioService = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
const prefSvc = Services.prefs;
const env = Cc["@mozilla.org/process/environment;1"].
getService(Ci.nsIEnvironment);
@ -243,10 +239,9 @@ function run_test() {
handlerTypes.splice(handlerTypes.indexOf(handler.type), 1);
}
Assert.equal(handlerTypes.length, 0);
// Make sure the handler service's remove method removes a handler record.
handlerSvc.remove(handlerInfo2);
handlers = handlerSvc.enumerate();
let handlers = handlerSvc.enumerate();
while (handlers.hasMoreElements())
Assert.notEqual(handlers.getNext().QueryInterface(Ci.nsIHandlerInfo).type,
handlerInfo2.type);

Просмотреть файл

@ -68,9 +68,7 @@ function run_test() {
}
// set up the uri to test with
var ioService =
Cc["@mozilla.org/network/io-service;1"]
.getService(Ci.nsIIOService);
var ioService = Services.io;
// set up the local handler object
var localHandler =