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