зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1129321 - Remove nonstandard let blocks from browser. r=ttaubert
This commit is contained in:
Родитель
562649fe82
Коммит
6d54bd3f21
|
@ -51,25 +51,28 @@ Object.keys(requiredSize).forEach(prop => {
|
|||
gBrowser.contentWindow[prop] = requiredSize[prop];
|
||||
}
|
||||
});
|
||||
let (screenHeight = {}, screenWidth = {}) {
|
||||
Cc["@mozilla.org/gfx/screenmanager;1"].
|
||||
getService(Ci.nsIScreenManager).
|
||||
primaryScreen.
|
||||
GetAvailRectDisplayPix({}, {}, screenWidth, screenHeight);
|
||||
screenHeight = screenHeight.value;
|
||||
screenWidth = screenWidth.value;
|
||||
if (screenHeight < gBrowser.contentWindow.outerHeight) {
|
||||
info("Warning: Browser outer height is now " +
|
||||
gBrowser.contentWindow.outerHeight + ", which is larger than the " +
|
||||
"available screen height, " + screenHeight +
|
||||
". That may cause problems.");
|
||||
}
|
||||
if (screenWidth < gBrowser.contentWindow.outerWidth) {
|
||||
info("Warning: Browser outer width is now " +
|
||||
gBrowser.contentWindow.outerWidth + ", which is larger than the " +
|
||||
"available screen width, " + screenWidth +
|
||||
". That may cause problems.");
|
||||
}
|
||||
|
||||
let screenHeight = {};
|
||||
let screenWidth = {};
|
||||
Cc["@mozilla.org/gfx/screenmanager;1"].
|
||||
getService(Ci.nsIScreenManager).
|
||||
primaryScreen.
|
||||
GetAvailRectDisplayPix({}, {}, screenWidth, screenHeight);
|
||||
screenHeight = screenHeight.value;
|
||||
screenWidth = screenWidth.value;
|
||||
|
||||
if (screenHeight < gBrowser.contentWindow.outerHeight) {
|
||||
info("Warning: Browser outer height is now " +
|
||||
gBrowser.contentWindow.outerHeight + ", which is larger than the " +
|
||||
"available screen height, " + screenHeight +
|
||||
". That may cause problems.");
|
||||
}
|
||||
|
||||
if (screenWidth < gBrowser.contentWindow.outerWidth) {
|
||||
info("Warning: Browser outer width is now " +
|
||||
gBrowser.contentWindow.outerWidth + ", which is larger than the " +
|
||||
"available screen width, " + screenWidth +
|
||||
". That may cause problems.");
|
||||
}
|
||||
|
||||
registerCleanupFunction(function () {
|
||||
|
|
|
@ -20,7 +20,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "MigrationUtils",
|
|||
let gProfD = do_get_profile();
|
||||
|
||||
// Create a fake XULAppInfo to satisfy the eventual needs of the migrators.
|
||||
let (XULAppInfo = {
|
||||
let XULAppInfo = {
|
||||
// nsIXUlAppInfo
|
||||
get vendor() "Mozilla",
|
||||
get name() "XPCShell",
|
||||
|
@ -48,17 +48,17 @@ let (XULAppInfo = {
|
|||
throw Cr.NS_ERROR_NO_INTERFACE;
|
||||
return this;
|
||||
}
|
||||
}) {
|
||||
const CONTRACT_ID = "@mozilla.org/xre/app-info;1";
|
||||
const CID = Components.ID("7685dac8-3637-4660-a544-928c5ec0e714}");
|
||||
};
|
||||
|
||||
let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
|
||||
registrar.registerFactory(CID, "XULAppInfo", CONTRACT_ID, {
|
||||
createInstance: function (aOuter, aIID) {
|
||||
if (aOuter != null)
|
||||
throw Cr.NS_ERROR_NO_AGGREGATION;
|
||||
return XULAppInfo.QueryInterface(aIID);
|
||||
},
|
||||
QueryInterface: XPCOMUtils.generateQI(Ci.nsIFactory)
|
||||
});
|
||||
}
|
||||
const CONTRACT_ID = "@mozilla.org/xre/app-info;1";
|
||||
const CID = Components.ID("7685dac8-3637-4660-a544-928c5ec0e714}");
|
||||
|
||||
let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
|
||||
registrar.registerFactory(CID, "XULAppInfo", CONTRACT_ID, {
|
||||
createInstance: function (aOuter, aIID) {
|
||||
if (aOuter != null)
|
||||
throw Cr.NS_ERROR_NO_AGGREGATION;
|
||||
return XULAppInfo.QueryInterface(aIID);
|
||||
},
|
||||
QueryInterface: XPCOMUtils.generateQI(Ci.nsIFactory)
|
||||
});
|
||||
|
|
|
@ -11,16 +11,16 @@ XPCOMUtils.defineLazyModuleGetter(this, "PlacesTestUtils",
|
|||
|
||||
// We need to cache this before test runs...
|
||||
let cachedLeftPaneFolderIdGetter;
|
||||
let (getter = PlacesUIUtils.__lookupGetter__("leftPaneFolderId")) {
|
||||
if (!cachedLeftPaneFolderIdGetter && typeof(getter) == "function")
|
||||
cachedLeftPaneFolderIdGetter = getter;
|
||||
let getter = PlacesUIUtils.__lookupGetter__("leftPaneFolderId");
|
||||
if (!cachedLeftPaneFolderIdGetter && typeof(getter) == "function") {
|
||||
cachedLeftPaneFolderIdGetter = getter;
|
||||
}
|
||||
|
||||
// ...And restore it when test ends.
|
||||
registerCleanupFunction(function(){
|
||||
let (getter = PlacesUIUtils.__lookupGetter__("leftPaneFolderId")) {
|
||||
if (cachedLeftPaneFolderIdGetter && typeof(getter) != "function")
|
||||
PlacesUIUtils.__defineGetter__("leftPaneFolderId",
|
||||
cachedLeftPaneFolderIdGetter);
|
||||
let getter = PlacesUIUtils.__lookupGetter__("leftPaneFolderId");
|
||||
if (cachedLeftPaneFolderIdGetter && typeof(getter) != "function") {
|
||||
PlacesUIUtils.__defineGetter__("leftPaneFolderId", cachedLeftPaneFolderIdGetter);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ XPCOMUtils.defineLazyGetter(this, "PlacesUIUtils", function() {
|
|||
const ORGANIZER_FOLDER_ANNO = "PlacesOrganizer/OrganizerFolder";
|
||||
const ORGANIZER_QUERY_ANNO = "PlacesOrganizer/OrganizerQuery";
|
||||
|
||||
// Needed by some test that relies on having an app registered.
|
||||
// Needed by some test that relies on having an app registered.
|
||||
let XULAppInfo = {
|
||||
vendor: "Mozilla",
|
||||
name: "PlacesTest",
|
||||
|
|
|
@ -1841,10 +1841,9 @@ var gApplicationsPane = {
|
|||
return this._getIconURLForSystemDefault(aHandlerInfo);
|
||||
|
||||
case Ci.nsIHandlerInfo.useHelperApp:
|
||||
let (preferredApp = aHandlerInfo.preferredApplicationHandler) {
|
||||
if (this.isValidHandlerApp(preferredApp))
|
||||
return this._getIconURLForHandlerApp(preferredApp);
|
||||
}
|
||||
let preferredApp = aHandlerInfo.preferredApplicationHandler;
|
||||
if (this.isValidHandlerApp(preferredApp))
|
||||
return this._getIconURLForHandlerApp(preferredApp);
|
||||
break;
|
||||
|
||||
// This should never happen, but if preferredAction is set to some weird
|
||||
|
|
|
@ -26,11 +26,10 @@ function test() {
|
|||
}
|
||||
|
||||
// delete existing sessionstore.js, to make sure we're not reading
|
||||
// the mtime of an old one initialy
|
||||
let (sessionStoreJS = getSessionstoreFile()) {
|
||||
if (sessionStoreJS.exists())
|
||||
sessionStoreJS.remove(false);
|
||||
}
|
||||
// the mtime of an old one initially.
|
||||
let sessionStoreJS = getSessionstoreFile();
|
||||
if (sessionStoreJS.exists())
|
||||
sessionStoreJS.remove(false);
|
||||
|
||||
// test content URL
|
||||
const TEST_URL = "data:text/html;charset=utf-8,"
|
||||
|
|
|
@ -13,7 +13,7 @@ let Paths;
|
|||
let SessionFile;
|
||||
|
||||
// We need a XULAppInfo to initialize SessionFile
|
||||
let (XULAppInfo = {
|
||||
let XULAppInfo = {
|
||||
vendor: "Mozilla",
|
||||
name: "SessionRestoreTest",
|
||||
ID: "{230de50e-4cd1-11dc-8314-0800200c9a66}",
|
||||
|
@ -30,20 +30,20 @@ let (XULAppInfo = {
|
|||
Ci.nsIXULAppInfo,
|
||||
Ci.nsIXULRuntime,
|
||||
])
|
||||
}) {
|
||||
let XULAppInfoFactory = {
|
||||
createInstance: function (outer, iid) {
|
||||
if (outer != null)
|
||||
throw Cr.NS_ERROR_NO_AGGREGATION;
|
||||
return XULAppInfo.QueryInterface(iid);
|
||||
}
|
||||
};
|
||||
let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
|
||||
registrar.registerFactory(Components.ID("{fbfae60b-64a4-44ef-a911-08ceb70b9f31}"),
|
||||
"XULAppInfo", "@mozilla.org/xre/app-info;1",
|
||||
XULAppInfoFactory);
|
||||
};
|
||||
|
||||
let XULAppInfoFactory = {
|
||||
createInstance: function (outer, iid) {
|
||||
if (outer != null)
|
||||
throw Cr.NS_ERROR_NO_AGGREGATION;
|
||||
return XULAppInfo.QueryInterface(iid);
|
||||
}
|
||||
};
|
||||
let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
|
||||
registrar.registerFactory(Components.ID("{fbfae60b-64a4-44ef-a911-08ceb70b9f31}"),
|
||||
"XULAppInfo", "@mozilla.org/xre/app-info;1",
|
||||
XULAppInfoFactory);
|
||||
|
||||
function run_test() {
|
||||
run_next_test();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче