diff --git a/apps/system/js/app_window.js b/apps/system/js/app_window.js index ea8e2df3dd34..cb8d5e426e0c 100644 --- a/apps/system/js/app_window.js +++ b/apps/system/js/app_window.js @@ -930,7 +930,6 @@ this.inError = true; return; } - this.isCrashed = true; // Send event instead of call crash reporter directly. this.publish('crashed'); @@ -941,6 +940,7 @@ this.frontWindow.kill(); } } else { + this.isCrashed = true; this.kill(evt); } }; diff --git a/apps/system/test/unit/app_window_test.js b/apps/system/test/unit/app_window_test.js index 6b383d71ddee..08d507558a8d 100644 --- a/apps/system/test/unit/app_window_test.js +++ b/apps/system/test/unit/app_window_test.js @@ -1520,10 +1520,11 @@ suite('system/AppWindow', function() { assert.isNull(sheets[1].previousWindow); }); - test('Error event', function() { + test('App crashed and suspending is disabled', function() { var app1 = new AppWindow(fakeAppConfig1); var stubKill = this.sinon.stub(app1, 'kill'); var stubPublish = this.sinon.stub(app1, 'publish'); + AppWindow.SUSPENDING_ENABLED = false; app1.handleEvent({ type: 'mozbrowsererror', detail: { @@ -1535,8 +1536,8 @@ suite('system/AppWindow', function() { assert.isTrue(stubPublish.calledWith('crashed')); }); - test('Destroy only the browser when app crashed and ' + - 'suspending is enabled', + test('App crashed and suspending is enabled' + + 'when app is inactive', function() { var apps = openPopups(2); var app1 = apps[0]; @@ -1553,13 +1554,13 @@ suite('system/AppWindow', function() { type: 'fatal' } }); - assert.isTrue(app1.isCrashed); + assert.isFalse(app1.isCrashed); assert.isTrue(stubDestroyBrowser.called); assert.isTrue(stubKill.called); AppWindow.SUSPENDING_ENABLED = false; }); - test('Kill the app directly even suspending is enabled ' + + test('App crashed and suspending is enabled ' + 'when the app is active', function() { var app1 = new AppWindow(fakeAppConfig1);