Bug 857356 - Fix in-content XBL tests. r=bz
authorBobby Holley <bobbyholley@gmail.com>
Thu, 09 May 2013 09:16:02 -0700
changeset 131398 d8d4867f71c1725b193f9d6d20e5eea084d6459e
parent 131397 52bd3c5ba8fda5baf01e9344fc883b9aacc8d45a
child 131399 a8fe89875091e3cd235cb378628cfe3020f6e05e
push id24658
push useremorley@mozilla.com
push dateFri, 10 May 2013 08:13:26 +0000
treeherdermozilla-central@08be63954b6b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
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
--- 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");
           // Hand things off to content. Content will call us back.
         <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" />
             return "method:" + arg;
         <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});