Backed out 11 changesets (bug 1065185) for Gaia Python integration test failures on a CLOSED TREE.

Backed out changeset a45d02c3b4e8 (bug 1065185)
Backed out changeset bb7b8b0da990 (bug 1065185)
Backed out changeset 7672d57acbad (bug 1065185)
Backed out changeset fbdb5bead639 (bug 1065185)
Backed out changeset 54d6077015da (bug 1065185)
Backed out changeset e2528549de9d (bug 1065185)
Backed out changeset 981c0b7c897d (bug 1065185)
Backed out changeset 903fbf9bb0c7 (bug 1065185)
Backed out changeset 76e863b63dd8 (bug 1065185)
Backed out changeset 6871aff5d103 (bug 1065185)
Backed out changeset cc213ad991a8 (bug 1065185)
This commit is contained in:
Ryan VanderMeulen 2014-10-01 12:33:30 -04:00
parent b37a790e75
commit 4e1760bcb2
19 changed files with 45 additions and 109 deletions

View File

@ -43,15 +43,8 @@ const BT_PAIRING_REQ = "bluetooth-pairing-request";
const BT_PAIRING_PASSKEY = 123456;
const BT_PAIRING_PINCODE = "ABCDEFG";
// Emulate Promise.jsm semantics.
Promise.defer = function() { return new Deferred(); }
function Deferred() {
this.promise = new Promise(function(resolve, reject) {
this.resolve = resolve;
this.reject = reject;
}.bind(this));
Object.freeze(this);
}
let Promise =
SpecialPowers.Cu.import("resource://gre/modules/Promise.jsm").Promise;
let bluetoothManager;

View File

@ -36,15 +36,8 @@ const BDADDR_LOCAL = "ff:ff:ff:00:00:00";
// A user friendly name for remote BT device.
const REMOTE_DEVICE_NAME = "Remote_BT_Device";
// Emulate Promise.jsm semantics.
Promise.defer = function() { return new Deferred(); }
function Deferred() {
this.promise = new Promise(function(resolve, reject) {
this.resolve = resolve;
this.reject = reject;
}.bind(this));
Object.freeze(this);
}
let Promise =
SpecialPowers.Cu.import("resource://gre/modules/Promise.jsm").Promise;
let bluetoothManager;

View File

@ -3,15 +3,7 @@
const {Cc: Cc, Ci: Ci, Cr: Cr, Cu: Cu} = SpecialPowers;
// Emulate Promise.jsm semantics.
Promise.defer = function() { return new Deferred(); }
function Deferred() {
this.promise = new Promise(function(resolve, reject) {
this.resolve = resolve;
this.reject = reject;
}.bind(this));
Object.freeze(this);
}
let Promise = Cu.import("resource://gre/modules/Promise.jsm").Promise;
const PDU_DCS_CODING_GROUP_BITS = 0xF0;
const PDU_DCS_MSG_CODING_7BITS_ALPHABET = 0x00;

View File

@ -55,10 +55,10 @@ SpecialPowers.pushPrefEnv({'set':[
// Finally, poll for the new crash record.
function tryGetCrash() {
info("Waiting for getCrashes");
crashMan.getCrashes().then(SpecialPowers.wrapCallback(function (crashes) {
crashMan.getCrashes().then(function (crashes) {
if (crashes.length) {
is(crashes.length, 1, "There should be only one record");
var crash = crashes[0];
var crash = SpecialPowers.wrap(crashes[0]);
ok(crash.isOfType(crashMan.PROCESS_TYPE_CONTENT,
crashMan.CRASH_TYPE_CRASH),
"Record should be a content crash");
@ -75,7 +75,7 @@ SpecialPowers.pushPrefEnv({'set':[
else {
setTimeout(tryGetCrash, 1000);
}
}), function (err) {
}, function (err) {
ok(false, "Error getting crashes: " + err);
SimpleTest.finish();
});

View File

@ -3,15 +3,7 @@
const {Cc: Cc, Ci: Ci, Cr: Cr, Cu: Cu} = SpecialPowers;
// Emulate Promise.jsm semantics.
Promise.defer = function() { return new Deferred(); }
function Deferred() {
this.promise = new Promise(function(resolve, reject) {
this.resolve = resolve;
this.reject = reject;
}.bind(this));
Object.freeze(this);
}
let Promise = Cu.import("resource://gre/modules/Promise.jsm").Promise;
/**
* Push a list of preference settings. Never reject.

View File

@ -168,9 +168,11 @@ function expandPermissions(aPerms) {
var perms = [];
aPerms.forEach(function(el) {
var access = permTable[el].access ? "readwrite" : null;
var expanded = expand(el, access);
var expanded = SpecialPowers.unwrap(expand(el, access));
// COW arrays don't behave array-like enough, to allow
// using expanded.slice(0) here.
for (let i = 0; i < expanded.length; i++) {
perms.push(SpecialPowers.unwrap(expanded[i]));
perms.push(expanded[i]);
}
});

View File

@ -69,7 +69,7 @@ function crashAndGetCrashServiceRecord(crashMethodName, callback) {
// the new record.
function tryGetCrash() {
info("Waiting for getCrashes");
crashMan.getCrashes().then(SpecialPowers.wrapCallback(function (crashes) {
crashMan.getCrashes().then(function (crashes) {
if (crashes.length) {
is(crashes.length, 1, "There should be only one record");
var crash = SpecialPowers.wrap(crashes[0]);
@ -86,7 +86,7 @@ function crashAndGetCrashServiceRecord(crashMethodName, callback) {
else {
setTimeout(tryGetCrash, 1000);
}
}), function (err) {
}, function (err) {
ok(false, "Error getting crashes: " + err);
SimpleTest.finish();
});

View File

@ -799,8 +799,7 @@ RILContentHelper.prototype = {
let window = this._windowsMap[message.requestId];
delete this._windowsMap[message.requestId];
let contacts = message.contacts;
let result = new window.Array();
contacts.forEach(function(c) {
let result = contacts.map(function(c) {
let prop = {name: [c.alphaId], tel: [{value: c.number}]};
if (c.email) {
@ -815,7 +814,7 @@ RILContentHelper.prototype = {
let contact = new window.mozContact(prop);
contact.id = c.contactId;
result.push(contact);
return contact;
});
this.fireRequestSuccess(message.requestId, result);

View File

@ -1,16 +1,7 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
// Emulate Promise.jsm semantics.
Promise.defer = function() { return new Deferred(); }
function Deferred() {
this.promise = new Promise(function(resolve, reject) {
this.resolve = resolve;
this.reject = reject;
}.bind(this));
Object.freeze(this);
}
let Promise = SpecialPowers.Cu.import("resource://gre/modules/Promise.jsm").Promise;
let telephony;
let conference;

View File

@ -25,15 +25,8 @@ const TETHERING_SETTING_KEY = "1234567890";
const SETTINGS_RIL_DATA_ENABLED = 'ril.data.enabled';
// Emulate Promise.jsm semantics.
Promise.defer = function() { return new Deferred(); }
function Deferred() {
this.promise = new Promise(function(resolve, reject) {
this.resolve = resolve;
this.reject = reject;
}.bind(this));
Object.freeze(this);
}
let Promise =
SpecialPowers.Cu.import("resource://gre/modules/Promise.jsm").Promise;
let gTestSuite = (function() {
let suite = {};

View File

@ -5,18 +5,10 @@
const {Cc: Cc, Ci: Ci, Cr: Cr, Cu: Cu} = SpecialPowers;
let RIL = SpecialPowers.wrap(SpecialPowers.createBlankObject());
SpecialPowers.Cu.import("resource://gre/modules/ril_consts.js", RIL);
let RIL = {};
Cu.import("resource://gre/modules/ril_consts.js", RIL);
// Emulate Promise.jsm semantics.
Promise.defer = function() { return new Deferred(); }
function Deferred() {
this.promise = new Promise(function(resolve, reject) {
this.resolve = resolve;
this.reject = reject;
}.bind(this));
Object.freeze(this);
}
let Promise = Cu.import("resource://gre/modules/Promise.jsm").Promise;
const MWI_PDU_PREFIX = "0000";
const MWI_PDU_UDH_PREFIX = "0040";

View File

@ -160,7 +160,7 @@ DOMWifiManager.prototype = {
},
_convertWifiNetworks: function(aNetworks) {
let networks = new this._window.Array();
let networks = [];
for (let i in aNetworks) {
networks.push(this._convertWifiNetwork(aNetworks[i]));
}

View File

@ -1,15 +1,7 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
// Emulate Promise.jsm semantics.
Promise.defer = function() { return new Deferred(); }
function Deferred() {
this.promise = new Promise(function(resolve, reject) {
this.resolve = resolve;
this.reject = reject;
}.bind(this));
Object.freeze(this);
}
let Promise = SpecialPowers.Cu.import('resource://gre/modules/Promise.jsm').Promise;
const STOCK_HOSTAPD_NAME = 'goldfish-hostapd';
const HOSTAPD_CONFIG_PATH = '/data/misc/wifi/remote-hostapd/';

View File

@ -80,11 +80,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=760109
const Cu = Components.utils;
var sb = new Cu.Sandbox('http://www.example.org');
sb.chromeArray = ['a', 'b', 'z'];
sb.chromeArray.__exposedProps__ = { length: 'rw' };
for (var i = 0; i < 10; ++i) {
sb.chromeArray.__exposedProps__[i] = 'rw';
}
sb.chromeArray.__exposedProps__ = {};
sb.chromeObject = new SomeConstructor();
sb.ok = ok;
sb.is = is;

View File

@ -7,7 +7,6 @@ function setupChromeSandbox() {
get: function() { return _b; },
set: function(val) { _b = val; } });
this.chromeArr = [4, 2, 1];
this.chromeArr["__exposedProps__"] = { "1": "rw" };
}
function checkDefineThrows(sb, obj, prop, desc) {

View File

@ -248,6 +248,14 @@ ExposedPropertiesOnly::check(JSContext *cx, HandleObject wrapper, HandleId id, W
if (!JS_HasPropertyById(cx, wrappedObject, exposedPropsId, &found))
return false;
// Always permit access to "length" and indexed properties of arrays.
if ((JS_IsArrayObject(cx, wrappedObject) ||
JS_IsTypedArrayObject(wrappedObject)) &&
((JSID_IS_INT(id) && JSID_TO_INT(id) >= 0) ||
(JSID_IS_STRING(id) && JS_FlatStringEqualsAscii(JSID_TO_FLAT_STRING(id), "length")))) {
return true; // Allow
}
// If no __exposedProps__ existed, deny access.
if (!found) {
return false;

View File

@ -412,13 +412,11 @@ let CallWatcherActor = exports.CallWatcherActor = protocol.ActorClass({
* Instruments a function on the specified target object.
*/
function overrideFunction(global, target, name, descriptor, callback) {
// Invoking .apply on an unxrayed content function doesn't work, because
// the arguments array is inaccessible to it. Get Xrays back.
let originalFunc = Cu.unwaiveXrays(target[name]);
let originalFunc = target[name];
Object.defineProperty(target, name, {
value: function(...args) {
let result = Cu.waiveXrays(originalFunc.apply(this, args));
let result = originalFunc.apply(this, args);
if (self._recording) {
let stack = getStack(name);
@ -437,15 +435,13 @@ let CallWatcherActor = exports.CallWatcherActor = protocol.ActorClass({
* Instruments a getter or setter on the specified target object.
*/
function overrideAccessor(global, target, name, descriptor, callback) {
// Invoking .apply on an unxrayed content function doesn't work, because
// the arguments array is inaccessible to it. Get Xrays back.
let originalGetter = Cu.unwaiveXrays(target.__lookupGetter__(name));
let originalSetter = Cu.unwaiveXrays(target.__lookupSetter__(name));
let originalGetter = target.__lookupGetter__(name);
let originalSetter = target.__lookupSetter__(name);
Object.defineProperty(target, name, {
get: function(...args) {
if (!originalGetter) return undefined;
let result = Cu.waiveXrays(originalGetter.apply(this, args));
let result = originalGetter.apply(this, args);
if (self._recording) {
let stack = getStack(name);

View File

@ -492,9 +492,7 @@ let WebGLInstrumenter = {
if (glBreak) return undefined;
}
// Invoking .apply on an unxrayed content function doesn't work, because
// the arguments array is inaccessible to it. Get Xrays back.
let glResult = Cu.waiveXrays(Cu.unwaiveXrays(originalFunc).apply(this, glArgs));
let glResult = originalFunc.apply(this, glArgs);
if (timing >= 0 && !observer.suppressHandlers) {
let glBreak = observer[afterFuncName](glArgs, glResult, cache, proxy);

View File

@ -60,11 +60,11 @@
"http://mochi.test:8888/tests/toolkit/mozapps/extensions/test/mochitest/file_bug687194.xpi"
AddonManager.getInstallForURL(INSTALL_URI, (install) => {
install = SpecialPowers.wrap(install);
install.addListener(SpecialPowers.wrapCallbackObject({
install.addListener({
onInstallEnded: function(install, addon) {
SimpleTest.executeSoon(() => test.next(addon));
}
}));
});
install.install();
}, "application/x-xpinstall");
@ -75,14 +75,14 @@
lastResult = yield;
is(lastResult.threw, false, "able to resolve after the installation");
let listener = SpecialPowers.wrapCallbackObject({
let listener = {
onUninstalled: function(removedAddon) {
if (removedAddon.id === addon.id) {
if (SpecialPowers.wrap(removedAddon).id === addon.id) {
AddonManager.removeAddonListener(listener);
SimpleTest.executeSoon(() => test.next());
}
}
});
};
AddonManager.addAddonListener(listener);
addon.uninstall();