Bug 857356 - Fix in-content XBL tests. r=bz
authorBobby Holley <bobbyholley@gmail.com>
Thu, 09 May 2013 09:16:02 -0700
changeset 142345 d8d4867f71c1725b193f9d6d20e5eea084d6459e
parent 142344 52bd3c5ba8fda5baf01e9344fc883b9aacc8d45a
child 142346 a8fe89875091e3cd235cb378628cfe3020f6e05e
push id2579
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 18:52:47 +0000
treeherdermozilla-beta@b69b7de8a05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs857356
milestone23.0a1
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
Bug 857356 - Fix in-content XBL tests. r=bz
content/xbl/test/file_bug821850.xhtml
--- a/content/xbl/test/file_bug821850.xhtml
+++ b/content/xbl/test/file_bug821850.xhtml
@@ -35,41 +35,35 @@ https://bugzilla.mozilla.org/show_bug.cg
           // Make sure we're Xraying.
           ok(Cu.isXrayWrapper(window), "Window is Xrayed");
           ok(Cu.isXrayWrapper(document), "Document is Xrayed");
 
           var bound = document.getElementById('bound');
           ok(bound, "bound is non-null");
           is(bound.method('baz'), "method:baz", "Xray methods work");
           is(bound.prop, "propVal", "Property Xrays work");
-          is(bound.primitiveField, 2, "Field Xrays work");
-          is(bound.objectField.bar.a, 1, "Field Xrays work on objects");
-          is(bound.contentField.foo, 10, "Field Xrays work on content objects");
-          var hole = bound.contentField.rabbit.hole;
-          ok(hole.win === XPCNativeWrapper.unwrap(window), "Xray vision remains waived when hitting a native object");
-          ok(!Cu.isXrayWrapper(hole.win), "Xray is waived");
+          is(bound.primitiveField, undefined, "Xrays don't show fields");
+          is(bound.wrappedJSObject.primitiveField, 2, "Waiving Xrays show fields");
 
           // This gets invoked by an event handler.
           window.finish = function() {
             // Content messed with stuff. Make sure we still see the right thing.
             is(bound.method('bay'), "method:bay", "Xray methods work");
             is(bound.wrappedJSObject.method('bay'), "hah", "Xray waived methods work");
             is(bound.prop, "set:someOtherVal", "Xray props work");
             is(bound.wrappedJSObject.prop, "redefined", "Xray waived props work");
-            is(bound.primitiveField, 321, "Can't do anything about redefined fields");
+            is(bound.wrappedJSObject.primitiveField, 321, "Can't do anything about redefined fields");
 
             SimpleTest.finish();
           }
 
           // Hand things off to content. Content will call us back.
           win.go();
         </constructor>
         <field name="primitiveField">2</field>
-        <field name="objectField">({ foo: 2, bar: {a: 1} })</field>
-        <field name="contentField">XPCNativeWrapper.unwrap(window).contentVal</field>
         <method name="method">
           <parameter name="arg" />
           <body>
             return "method:" + arg;
           </body>
         </method>
         <method name="passMeAJSObject">
           <parameter name="arg" />
@@ -122,18 +116,16 @@ https://bugzilla.mozilla.org/show_bug.cg
     is(typeof window.globalExpando, "object", "Can see global object");
     checkThrows(function() window.globalExpando.win);
     is(window.functionExpando(), "called", "XBL functions are callable");
     checkThrows(function() window.functionExpando.prop);
 
     // Inspect the bound element.
     var bound = document.getElementById('bound');
     is(bound.primitiveField, 2, "Can see primitive fields");
-    is(typeof bound.objectField, "object", "objectField exists");
-    checkThrows(function() bound.objectField.foo);
     is(bound.method("foo"), "method:foo", "Can invoke XBL method from content");
     is(bound.prop, "propVal", "Can access properties from content");
     bound.prop = "someOtherVal";
     is(bound.prop, "set:someOtherVal", "Can set properties from content");
 
     // Make sure we can't pass JS objects to the XBL scope.
     var proto = bound.__proto__;
     proto.passMeAJSObject({prop: 2});