Bug 1065186 - Fix up test suite to not rely on COWed Arrays. r=gabor

This commit is contained in:
Bobby Holley 2014-10-16 14:12:36 +02:00
Родитель 0e773b6fc0
Коммит 7186eed046
3 изменённых файлов: 4 добавлений и 27 удалений

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

@ -40,20 +40,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1065185
endMonitor();
break;
case 2:
doMonitor([/access to property 0/i]);
window[0].wrappedJSObject.probe = [42];
is(window[0].eval('probe[0]'), undefined, "Element undefined");
is(window[0].eval('probe.length'), undefined, "Length undefined");
endMonitor();
break;
case 3:
doMonitor([/access to property length/i]);
window[0].wrappedJSObject.probe = { a: 'verboten', b: [42], __exposedProps__: { 'b' : 'r' }};
is(window[0].eval('probe.b.length'), undefined, "Length undefined");
is(window[0].eval('probe.a'), undefined, "property undefined");
endMonitor();
break;
case 4:
SimpleTest.finish();
break;
default:

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

@ -25,8 +25,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=760109
// Check that COWs for objects with standard prototypes use the standard
// prototype in the home compartment.
ok(Object.getPrototypeOf(chromeArray) === Array.prototype,
"Array prototype remapped properly");
var protoProto = Object.getPrototypeOf(Object.getPrototypeOf(chromeObject));
ok(protoProto === Object.prototype,
"Object prototype remapped properly");
@ -38,7 +36,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=760109
// though we'd also be able to find it on Object.prototype. Some recent
// refactoring has made it possible to do the right thing here.
is(typeof chromeObject.constructor, "undefined", "Object constructor does what we expect");
ok(chromeArray.constructor === Array, "Array constructor remapped properly");
}
// We use a constructor to create the test object so that there's an
@ -54,12 +51,6 @@ 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.chromeObject = new SomeConstructor();
sb.ok = ok;
sb.is = is;

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

@ -33,14 +33,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=866823
ok(iwin.wrappedJSObject.eval('waiver == window'), "Waivers disappear same-compartment");
// Make sure that COW prototype always happens.
sb.arrayProto = Array.prototype;
ok(Cu.evalInSandbox('arrayProto == Array.prototype', sb),
sb.objProto = Object.prototype;
ok(Cu.evalInSandbox('objProto == Object.prototype', sb),
"Prototype remapping should happen even when the object isn't used as a prototype");
// Make sure that prototype remapping happens even for nsEP.
var sbEP = new Cu.Sandbox(['http://example.org']);
sb.epArrayProto = sbEP.Array.prototype;
ok(Cu.evalInSandbox('epArrayProto == Array.prototype', sb),
sb.epObjProto = sbEP.Object.prototype;
ok(Cu.evalInSandbox('epObjProto == Object.prototype', sb),
"Prototype remapping should happen for all non-subsuming access");
SimpleTest.finish();