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
Родитель 9a7f22486b
Коммит 5327d43243
3 изменённых файлов: 47 добавлений и 1 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -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;
});
});

Просмотреть файл

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