зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1082450 - Use automation machinery instead of exposedProps in Mock{Color,File}Picker.jsm. r=gabor
This commit is contained in:
Родитель
a1ebfbe84e
Коммит
9d70a1799f
|
@ -14,6 +14,10 @@ const CONTRACT_ID = "@mozilla.org/colorpicker;1";
|
|||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
// Allow stuff from this scope to be accessed from non-privileged scopes. This
|
||||
// would crash if used outside of automation.
|
||||
Cu.forcePermissiveCOWs();
|
||||
|
||||
var registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
|
||||
var oldClassID = "", oldFactory = null;
|
||||
var newClassID = Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator).generateUUID();
|
||||
|
@ -111,15 +115,3 @@ MockColorPickerInstance.prototype = {
|
|||
}.bind(this), 0);
|
||||
}
|
||||
};
|
||||
|
||||
// Expose everything to content. We call reset() here so that all of the
|
||||
// relevant lazy expandos get added.
|
||||
MockColorPicker.reset();
|
||||
function exposeAll(obj) {
|
||||
var props = {};
|
||||
for (var prop in obj)
|
||||
props[prop] = 'rw';
|
||||
obj.__exposedProps__ = props;
|
||||
}
|
||||
exposeAll(MockColorPicker);
|
||||
exposeAll(MockColorPickerInstance.prototype);
|
||||
|
|
|
@ -15,6 +15,10 @@ Cu.import("resource://gre/modules/FileUtils.jsm");
|
|||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
// Allow stuff from this scope to be accessed from non-privileged scopes. This
|
||||
// would crash if used outside of automation.
|
||||
Cu.forcePermissiveCOWs();
|
||||
|
||||
var registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
|
||||
var oldClassID, oldFactory;
|
||||
var newClassID = Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator).generateUUID();
|
||||
|
@ -222,15 +226,3 @@ MockFilePickerInstance.prototype = {
|
|||
}.bind(this), 0);
|
||||
}
|
||||
};
|
||||
|
||||
// Expose everything to content. We call reset() here so that all of the relevant
|
||||
// lazy expandos get added.
|
||||
MockFilePicker.reset();
|
||||
function exposeAll(obj) {
|
||||
var props = {};
|
||||
for (var prop in obj)
|
||||
props[prop] = 'rw';
|
||||
obj.__exposedProps__ = props;
|
||||
}
|
||||
exposeAll(MockFilePicker);
|
||||
exposeAll(MockFilePickerInstance.prototype);
|
||||
|
|
Загрузка…
Ссылка в новой задаче