Bug 1242907 - Fix broken about:crashes due to typo in ContentCrashHandlers.jsm. r=mconley

This commit is contained in:
Birunthan Mohanathas 2016-02-03 18:21:27 +02:00
parent 5b883e889a
commit d9c52b88f5
3 changed files with 47 additions and 1 deletions

View File

@ -543,3 +543,5 @@ skip-if = !e10s || !crashreporter
skip-if = !e10s || !crashreporter
[browser_aboutTabCrashed_showForm.js]
skip-if = !e10s || !crashreporter
[browser_aboutTabCrashed_withoutDump.js]
skip-if = !e10s

View File

@ -0,0 +1,44 @@
"use strict";
const PAGE = "data:text/html,<html><body>A%20regular,%20everyday,%20normal%20page.";
/**
* Monkey patches TabCrashHandler.getDumpID to return null in order to test
* about:tabcrashed when a dump is not available.
*/
add_task(function* setup() {
let originalGetDumpID = TabCrashHandler.getDumpID;
TabCrashHandler.getDumpID = function(browser) { return null; };
registerCleanupFunction(() => {
TabCrashHandler.getDumpID = originalGetDumpID;
});
});
/**
* Tests tab crash page when a dump is not available.
*/
add_task(function* test_without_dump() {
return BrowserTestUtils.withNewTab({
gBrowser,
url: PAGE,
}, function*(browser) {
let tab = gBrowser.getTabForBrowser(browser);
yield BrowserTestUtils.crashBrowser(browser);
let tabRemovedPromise = BrowserTestUtils.removeTab(tab, { dontRemove: true });
yield ContentTask.spawn(browser, null, function*() {
let doc = content.document;
ok(!doc.documentElement.classList.contains("crashDumpAvailable"),
"doesn't have crash dump");
let container = doc.getElementById("crash-reporter-container");
ok(container, "has crash-reporter-container");
ok(container.hidden, "crash-reporter-container is hidden");
doc.getElementById("closeTab").click();
});
yield tabRemovedPromise;
});
});

View File

@ -228,7 +228,7 @@ this.TabCrashHandler = {
let dumpID = this.getDumpID(browser);
if (!dumpID) {
message.target.sendAsyncMessge("SetCrashReportAvailable", {
message.target.sendAsyncMessage("SetCrashReportAvailable", {
hasReport: false,
});
return;