Bug 1233497 - Update test_bug1086684.html to not access CPOWs unsafely inside SpecialPowers. r?mrbkap draft
authorMike Conley <mconley@mozilla.com>
Mon, 18 Jan 2016 17:17:29 -0500
changeset 322535 d14ae87795fb63293e4e3cee855ac25e2d066fcd
parent 322534 bb9970905d1890965e739e2ce405273455b64084
child 513126 92cb449dc6445b69e0affd956b43ed6df1ac4874
push id9629
push usermconley@mozilla.com
push dateMon, 18 Jan 2016 22:25:49 +0000
reviewersmrbkap
bugs1233497, 1086684
milestone46.0a1
Bug 1233497 - Update test_bug1086684.html to not access CPOWs unsafely inside SpecialPowers. r?mrbkap
dom/ipc/tests/test_bug1086684.html
--- a/dom/ipc/tests/test_bug1086684.html
+++ b/dom/ipc/tests/test_bug1086684.html
@@ -26,49 +26,49 @@
       function parentReady(message) {
         MockFilePicker.init(content);
         MockFilePicker.returnFiles = [message.data.file];
         MockFilePicker.returnValue = MockFilePicker.returnOK;
 
         let input = content.document.getElementById("f");
         input.addEventListener("change", () => {
           MockFilePicker.cleanup();
-          message.target.sendAsyncMessage("testBug1086684:childDone", { },
-                                          { elt: input });
+          let value = input.value;
+          message.target.sendAsyncMessage("testBug1086684:childDone", { value });
         });
 
         input.focus();
         input.click();
       }
 
       addMessageListener("testBug1086684:parentReady", function(message) {
         parentReady(message);
       });
     }
 
     let test;
     function* testStructure(mm) {
-      let lastResult;
+      let value;
 
       function testDone(msg) {
-        test.next(msg.objects);
+        test.next(msg.data.value);
       }
 
       mm.addMessageListener("testBug1086684:childDone", testDone);
 
       let blob = new Blob([]);
       let file = new File([blob], "helloworld.txt", { type: "text/plain" });
 
       mm.sendAsyncMessage("testBug1086684:parentReady", { file });
-      lastResult = yield;
+      value = yield;
 
       // Note that the "helloworld.txt" passed in above doesn't affect the
       // 'value' getter. Because we're mocking a file using a blob, we ask the
       // blob for its path, which is the empty string.
-      is(SpecialPowers.wrap(lastResult.elt).value, "", "got the right answer and didn't crash");
+      is(value, "", "got the right answer and didn't crash");
 
       SimpleTest.finish();
     }
 
     function runTests() {
       info("Browser prefs set.");
 
       let iframe = document.createElement("iframe");