Backed out changeset 767ce92ebaf1 (bug 975042)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Fri, 21 Mar 2014 08:47:36 +0100
changeset 193202 460de03b00cdf986806fee827c8b5dae804ecbcb
parent 193201 c902425901af5c33f4e1788118b455b88d541d06
child 193203 7f619d0f71a77f642b72c509dfe0080a83f5ac4f
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs975042
milestone31.0a1
backs out767ce92ebaf150622e5401beac747b34fe76d1fc
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 767ce92ebaf1 (bug 975042)
js/xpconnect/tests/chrome/test_xrayToJS.xul
--- a/js/xpconnect/tests/chrome/test_xrayToJS.xul
+++ b/js/xpconnect/tests/chrome/test_xrayToJS.xul
@@ -27,17 +27,17 @@ https://bugzilla.mozilla.org/show_bug.cg
                         'String', 'RegExp', 'Error', 'InternalError', 'EvalError',
                         'RangeError', 'ReferenceError', 'SyntaxError', 'TypeError',
                         'URIError', 'ArrayBuffer', 'Int8Array', 'Uint8Array',
                         'Int16Array', 'Uint16Array', 'Int32Array', 'Uint32Array',
                         'Float32Array', 'Float64Array', 'Uint8ClampedArray',
                         'WeakMap', 'Map', 'Set'];
 
   function go() {
-    window.iwin = document.getElementById('ifr').contentWindow;
+    var iwin = document.getElementById('ifr').contentWindow;
 
     // Test constructors that can be instantiated with zero arguments.
     for (var c of simpleConstructors) {
       ok(iwin[c], "Constructors appear: " + c);
       is(iwin[c], Cu.unwaiveXrays(iwin.wrappedJSObject[c]),
          "we end up with the appropriate constructor: " + c);
       is(Cu.unwaiveXrays(Cu.waiveXrays(new iwin[c]).constructor), iwin[c],
          "constructor property is set up right: " + c);
@@ -96,75 +96,22 @@ https://bugzilla.mozilla.org/show_bug.cg
     is(doublingProxy[20], 40, "Doubles correctly");
 
     // Test eval.
     var toEval = "({a: 2, b: {foo: 'bar'}, f: function() { return window; }})";
     is(global(iwin.eval(toEval)), iwin, "eval creates objects in the correct global");
     is(iwin.eval(toEval).b.foo, 'bar', "eval-ed object looks right");
     is(iwin.eval(toEval).f(), iwin, "evaled function works right");
 
-    testDate();
-
     // We could also test DataView and Iterator here for completeness, but it's
     // more trouble than it's worth.
 
 
     SimpleTest.finish();
   }
 
-  function filterOut(array, props) {
-    return array.filter(p => props.indexOf(p) == -1);
-  }
 
-  function testXray(classname, xray, xray2, propsToSkip) {
-    propsToSkip = propsToSkip || [];
-    let xrayProto = Object.getPrototypeOf(xray);
-    let localProto = window[classname].prototype;
-    let protoProps = filterOut(Object.getOwnPropertyNames(localProto), propsToSkip).sort();
-    let protoMethods = protoProps.filter(name => typeof localProto[name] == 'function' &&
-                                         name != 'constructor');
-    ok(protoMethods.length > 0, "Need something to test");
-    is(xrayProto, iwin[classname].prototype, "Xray proto is correct");
-    is(xrayProto, xray.__proto__, "Proto accessors agree");
-    is(Object.getPrototypeOf(xrayProto), iwin.Object.prototype, "proto proto is correct");
-    for (let name of protoMethods) {
-      info("Running tests for property: " + name);
-      ok(xrayProto.hasOwnProperty(name), "proto should have the property as own");
-      ok(!xray.hasOwnProperty(name), "instance should not have the property as own");
-      let method = xrayProto[name];
-      is(typeof method, 'function', "Methods from Xrays are functions");
-      is(global(method), window, "Methods from Xrays are local");
-      ok(method instanceof Function, "instanceof works on methods from Xrays");
-      is(xrayProto[name], method, "Holder caching works properly");
-      is(xray[name], method, "Proto props resolve on the instance");
-      let local = localProto[name];
-      is(method.length, local.length, "Function.length identical");
-      if (method.length == 0) {
-        is(xray[name]() + "", local.call(xray) + "",
-           "Xray and local method results stringify identically");
-         is(xray[name]() + "", xray.wrappedJSObject[name]() + "",
-            "Xray and waived method results stringify identically");
-      }
-    }
-    is(Object.getOwnPropertyNames(xrayProto).sort().toSource(),
-       protoProps.toSource(), "getOwnPropertyNames works");
 
-    is(xrayProto.constructor, iwin[classname], "constructor property works");
-
-    xrayProto.expando = 42;
-    is(xray.expando, 42, "Xrayed instances see proto expandos");
-    is(xray2.expando, 42, "Xrayed instances see proto expandos");
-  }
-
-  function testDate() {
-    // toGMTString is handled oddly in the engine. We don't bother to support
-    // it over Xrays.
-    //
-    // We don't yet support self-hosted functions on Xrays. See bug 972987.
-    let propsToSkip = ['toGMTString', 'toLocaleString',
-                       'toLocaleDateString', 'toLocaleTimeString'];
-    testXray('Date', new iwin.Date(), new iwin.Date(), propsToSkip);
-  }
 
   ]]>
   </script>
   <iframe id="ifr" onload="go();" src="http://example.org/tests/js/xpconnect/tests/mochitest/file_empty.html" />
 </window>