Bug 1213795, Part 1: Don't fire timers in the Nuwa process to fix test case test_NuwaProcessDeadlock.html. r=khuey

This commit is contained in:
Cervantes Yu 2015-10-19 14:32:12 +08:00
parent 8d471ca9f6
commit 5016e195a3
3 changed files with 12 additions and 7 deletions

View File

@ -16,7 +16,7 @@ skip-if = buildapp == 'b2g' || buildapp == 'mulet'
[test_NuwaProcessCreation.html]
skip-if = toolkit != 'gonk'
[test_NuwaProcessDeadlock.html]
skip-if = true # bug 1166923
skip-if = toolkit != 'gonk'
[test_child_docshell.html]
skip-if = toolkit == 'cocoa' # disabled due to hangs, see changeset 6852e7c47edf
[test_CrashService_crash.html]

View File

@ -14,6 +14,9 @@ Test if Nuwa process created successfully.
function runTest()
{
info("Shut down processes by disabling process prelaunch");
SpecialPowers.setBoolPref('dom.ipc.processPrelaunch.enabled', false);
info("Launch the Nuwa process");
let cpmm = SpecialPowers.Cc["@mozilla.org/childprocessmessagemanager;1"]
.getService(SpecialPowers.Ci.nsISyncMessageSender);
@ -22,12 +25,11 @@ function runTest()
receiveMessage: function receiveMessage(msg) {
msg = SpecialPowers.wrap(msg);
if (msg.name == 'TEST-ONLY:nuwa-ready') {
ok(true, "Got nuwa-ready");
is(seenNuwaReady, false, "Already received nuwa ready");
is(seenNuwaReady, false, "The Nuwa process is launched");
seenNuwaReady = true;
} else if (msg.name == 'TEST-ONLY:nuwa-add-new-process') {
ok(true, "Got nuwa-add-new-process");
is(seenNuwaReady, true, "Receive nuwa-add-new-process before nuwa-ready");
is(seenNuwaReady, true, "The preallocated process is launched from the Nuwa process");
shutdown();
}
}
@ -51,12 +53,11 @@ function runTest()
function setup()
{
info("Set up preferences for testing deadlock in the Nuwa process.");
info("Set up preferences for testing the Nuwa process.");
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({
'set': [
['dom.ipc.processPrelaunch.enabled', false],
['dom.ipc.preallocatedProcessManager.testMode', true],
['dom.ipc.processPrelaunch.testMode', true] // For testing deadlock
]

View File

@ -430,7 +430,11 @@ TimerThread::Run()
bool forceRunThisTimer = forceRunNextTimer;
forceRunNextTimer = false;
if (mSleeping) {
if (mSleeping
#ifdef MOZ_NUWA_PROCESS
|| IsNuwaProcess() // Don't fire timers or deadlock will result.
#endif
) {
// Sleep for 0.1 seconds while not firing timers.
uint32_t milliseconds = 100;
if (ChaosMode::isActive(ChaosFeature::TimerScheduling)) {