Bug 1233497 - Update test_bug1086684.html to not access CPOWs unsafely inside SpecialPowers. r?mrbkap
--- 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");