Backed out changeset 4bc1cf097ca1 (bug 952963)

This commit is contained in:
Gijs Kruitbosch 2014-01-02 22:10:50 +00:00
Родитель 39714aa9a0
Коммит 5617653a6c
3 изменённых файлов: 2 добавлений и 57 удалений

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

@ -2889,8 +2889,7 @@ function WidgetGroupWrapper(aWidget) {
});
this.__defineGetter__("areaType", function() {
let areaProps = gAreas.get(aWidget.currentArea);
return areaProps && areaProps.get("type");
return gAreas.get(aWidget.currentArea).get("type");
});
Object.freeze(this);
@ -2991,8 +2990,7 @@ function XULWidgetGroupWrapper(aWidgetId) {
return null;
}
let areaProps = gAreas.get(placement.area);
return areaProps && areaProps.get("type");
return gAreas.get(placement.area).get("type");
});
this.__defineGetter__("instances", function() {

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

@ -50,5 +50,4 @@ skip-if = os == "mac"
[browser_945739_showInPrivateBrowsing_customize_mode.js]
[browser_947987_removable_default.js]
[browser_948985_non_removable_defaultArea.js]
[browser_952963_areaType_getter_no_area.js]
[browser_panel_toggle.js]

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

@ -1,52 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const kToolbarName = "test-unregisterArea-areaType";
const kUnregisterAreaTestWidget = "test-widget-for-unregisterArea-areaType";
const kTestWidget = "test-widget-no-area-areaType";
registerCleanupFunction(removeCustomToolbars);
function checkAreaType(widget) {
try {
is(widget.areaType, null, "areaType should be null");
} catch (ex) {
info("Fetching areaType threw: " + ex);
ok(false, "areaType getter shouldn't throw.");
}
}
// widget wrappers in unregisterArea'd areas and nowhere shouldn't throw when checking areaTypes.
add_task(function() {
// Using the ID before it's been created will imply a XUL wrapper; we'll test
// an API-based wrapper below
let toolbarNode = createToolbarWithPlacements(kToolbarName, [kUnregisterAreaTestWidget]);
CustomizableUI.unregisterArea(kToolbarName);
toolbarNode.remove();
let w = CustomizableUI.getWidget(kUnregisterAreaTestWidget);
checkAreaType(w);
w = CustomizableUI.getWidget(kTestWidget);
checkAreaType(w);
let spec = {id: kUnregisterAreaTestWidget, type: 'button', removable: true,
label: "areaType test", tooltiptext: "areaType test"};
CustomizableUI.createWidget(spec);
let toolbarNode = createToolbarWithPlacements(kToolbarName, [kUnregisterAreaTestWidget]);
CustomizableUI.unregisterArea(kToolbarName);
toolbarNode.remove();
w = CustomizableUI.getWidget(spec.id);
checkAreaType(w);
CustomizableUI.removeWidgetFromArea(kUnregisterAreaTestWidget);
checkAreaType(w);
//XXXgijs: ensure cleanup function doesn't barf:
gAddedToolbars.delete(kToolbarName);
});
add_task(function asyncCleanup() {
yield resetCustomization();
});