Bug 724286 - Fix TelemetryTimestamps, AddonManagerPrivate global scope pollution and whitelist __SSi. r=dietrich

This commit is contained in:
Dão Gottwald 2012-02-05 21:22:57 +01:00
Родитель dfae6bcec1
Коммит e8ed468174
5 изменённых файлов: 19 добавлений и 7 удалений

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

@ -137,8 +137,9 @@ __defineGetter__("gPrefService", function() {
});
__defineGetter__("AddonManager", function() {
Cu.import("resource://gre/modules/AddonManager.jsm");
return this.AddonManager;
let tmp = {};
Cu.import("resource://gre/modules/AddonManager.jsm", tmp);
return this.AddonManager = tmp.AddonManager;
});
__defineSetter__("AddonManager", function (val) {
delete this.AddonManager;
@ -1503,7 +1504,9 @@ function prepareForStartup() {
}
function delayedStartup(isLoadingBlank, mustLoadSidebar) {
Cu.import("resource:///modules/TelemetryTimestamps.jsm");
let tmp = {};
Cu.import("resource:///modules/TelemetryTimestamps.jsm", tmp);
let TelemetryTimestamps = tmp.TelemetryTimestamps;
TelemetryTimestamps.add("delayedStartupStarted");
gDelayedStartupTimeoutId = null;

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

@ -11,7 +11,9 @@ function getSimpleMeasurementsFromTelemetryPing() {
function test() {
// Test the module logic
Cu.import("resource:///modules/TelemetryTimestamps.jsm");
let tmp = {};
Cu.import("resource:///modules/TelemetryTimestamps.jsm", tmp);
let TelemetryTimestamps = tmp.TelemetryTimestamps;
let now = Date.now();
TelemetryTimestamps.add("foo");
ok(TelemetryTimestamps.get().foo, "foo was added");

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

@ -95,7 +95,7 @@ Tester.prototype = {
this._cs.registerListener(this);
this._globalProperties = Object.keys(window);
this._globalPropertyWhitelist = ["navigator", "constructor", "Application",
"__SS_tabsToRestore", "webConsoleCommandController",
"__SS_tabsToRestore", "__SSi", "webConsoleCommandController",
// Temporarily added to whitelist for Fennec tests:
"AddonUpdateChecker",

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

@ -4,6 +4,11 @@
Components.utils.import("resource://gre/modules/NetUtil.jsm");
let tmp = {};
Components.utils.import("resource://gre/modules/AddonManager.jsm", tmp);
let AddonManager = tmp.AddonManager;
let AddonManagerPrivate = tmp.AddonManagerPrivate;
var pathParts = gTestPath.split("/");
// Drop the test filename
pathParts.splice(pathParts.length - 1, pathParts.length);

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

@ -1,6 +1,8 @@
const TEST_ROOT = "http://example.com/browser/toolkit/mozapps/plugins/tests/";
Components.utils.import("resource://gre/modules/AddonManager.jsm");
let tmp = {};
Components.utils.import("resource://gre/modules/AddonManager.jsm", tmp);
let AddonManager = tmp.AddonManager;
var gPFS;