Bug 908213 - Fix CPOWs test failure and make it more robust. r=dvander

This commit is contained in:
Tom Schuster 2013-08-23 19:04:20 -04:00
parent 49d23d9e16
commit 245533bc39
4 changed files with 15 additions and 4 deletions

View File

@ -5,7 +5,10 @@ content.document.title = "Hello, Kitty";
(function start() {
sync_test();
async_test();
sendAsyncMessage("cpows:done", {});
// The sync-ness of this call is important, because otherwise
// we tear down the child's document while we are
// still in the async test in the parent.
sendSyncMessage("cpows:done", {});
}
)();

View File

@ -17,6 +17,11 @@
return opener.wrappedJSObject.ok(condition, message);
}
// Make sure that an error in this file actually causes the test to fail.
window.onerror = function (msg, url, line) {
ok(false, "Error while executing: \n" + msg + "\n" + url + ":" + line);
};
function testCpowMessage(message) {
ok(message.json.check == "ok", "correct json");

View File

@ -21,7 +21,10 @@
}
addLoadEvent(function() {
window.open("cpows_parent.xul", "", "chrome");
// We don't want to set browser.tabs.remote to true, but still have CPOWs enabled.
SpecialPowers.pushPrefEnv({"set": [["dom.ipc.cpows.force-enabled", true]]}, function() {
window.open("cpows_parent.xul", "", "chrome");
});
});
]]></script>
</window>

View File

@ -2339,8 +2339,8 @@ TabChild::InitRenderingState()
// This state can't really change during the lifetime of the child.
sCpowsEnabled = Preferences::GetBool("browser.tabs.remote", false);
if (Preferences::GetBool("dom.ipc.cpows.force-disabled", false))
sCpowsEnabled = false;
if (Preferences::GetBool("dom.ipc.cpows.force-enabled", false))
sCpowsEnabled = true;
return true;
}