зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 4b675a7f0743 (bug 1333126)
This commit is contained in:
Родитель
99ee6030a0
Коммит
d2ecd83816
|
@ -1,5 +1,4 @@
|
|||
Cu.import("resource://gre/modules/CrashSubmit.jsm", this);
|
||||
Cu.import("resource://gre/modules/PromiseUtils.jsm");
|
||||
|
||||
const SERVER_URL = "http://example.com/browser/toolkit/crashreporter/test/browser/crashreport.sjs";
|
||||
|
||||
|
@ -7,8 +6,6 @@ var gTestRoot = getRootDirectory(gTestPath).replace("chrome://mochitests/content
|
|||
var gTestBrowser = null;
|
||||
var config = {};
|
||||
|
||||
let gRegisteredCrashObserver = null;
|
||||
|
||||
add_task(async function() {
|
||||
// The test harness sets MOZ_CRASHREPORTER_NO_REPORT, which disables plugin
|
||||
// crash reports. This test needs them enabled. The test also needs a mock
|
||||
|
@ -30,9 +27,6 @@ add_task(async function() {
|
|||
|
||||
registerCleanupFunction(async function() {
|
||||
Services.prefs.clearUserPref("dom.ipc.plugins.timeoutSecs");
|
||||
if (gRegisteredCrashObserver !== null) {
|
||||
Services.obs.removeObserver(gRegisteredCrashObserver, "plugin-crashed");
|
||||
}
|
||||
env.set("MOZ_CRASHREPORTER_NO_REPORT", noReport);
|
||||
env.set("MOZ_CRASHREPORTER_URL", serverUrl);
|
||||
env = null;
|
||||
|
@ -119,25 +113,6 @@ add_task(async function() {
|
|||
});
|
||||
|
||||
add_task(async function() {
|
||||
// Since this test doesn't actually submit a crash report, we can't await
|
||||
// on crashReportStatus. This ensures the crash handling mechanism is
|
||||
// completely finished before exiting the test.
|
||||
let crashObserverDeferred = PromiseUtils.defer();
|
||||
|
||||
gRegisteredCrashObserver = (subject, topic, data) => {
|
||||
if (topic != "plugin-crashed") {
|
||||
return;
|
||||
}
|
||||
let propBag = subject.QueryInterface(Ci.nsIPropertyBag2);
|
||||
let minidumpID = propBag.getPropertyAsAString("pluginDumpID");
|
||||
|
||||
Services.crashmanager.ensureCrashIsPresent(minidumpID).then(() => {
|
||||
crashObserverDeferred.resolve();
|
||||
});
|
||||
};
|
||||
|
||||
Services.obs.addObserver(gRegisteredCrashObserver, "plugin-crashed");
|
||||
|
||||
config = {
|
||||
shouldSubmissionUIBeVisible: false,
|
||||
comment: "",
|
||||
|
@ -166,8 +141,6 @@ add_task(async function() {
|
|||
Assert.equal(!!pleaseSubmit && content.getComputedStyle(pleaseSubmit).display == "block",
|
||||
aConfig.shouldSubmissionUIBeVisible, "Plugin crash UI should not be visible");
|
||||
});
|
||||
|
||||
await crashObserverDeferred.promise;
|
||||
});
|
||||
|
||||
function promisePluginCrashed() {
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
Cu.import("resource://gre/modules/PromiseUtils.jsm");
|
||||
|
||||
/**
|
||||
* With e10s, plugins must run in their own process. This means we have
|
||||
* three processes at a minimum when we're running a plugin:
|
||||
|
@ -81,9 +79,6 @@ function preparePlugin(browser, pluginFallbackState) {
|
|||
});
|
||||
}
|
||||
|
||||
// Allows tests to ensure crash handling is completely finished before exiting.
|
||||
let crashObserverDeferred = PromiseUtils.defer();
|
||||
|
||||
add_task(async function setup() {
|
||||
// Bypass click-to-play
|
||||
setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED);
|
||||
|
@ -113,10 +108,6 @@ add_task(async function setup() {
|
|||
|
||||
pluginDumpFile.remove(false);
|
||||
extraFile.remove(false);
|
||||
|
||||
// Resolve and replace the deferred object so the next test can wait on it
|
||||
crashObserverDeferred.resolve();
|
||||
crashObserverDeferred = PromiseUtils.defer();
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -192,7 +183,6 @@ add_task(async function testChromeHearsPluginCrashFirst() {
|
|||
"Should have been showing crash report UI");
|
||||
});
|
||||
await BrowserTestUtils.closeWindow(win);
|
||||
await crashObserverDeferred.promise;
|
||||
});
|
||||
|
||||
/**
|
||||
|
@ -263,5 +253,4 @@ add_task(async function testContentHearsCrashFirst() {
|
|||
});
|
||||
|
||||
await BrowserTestUtils.closeWindow(win);
|
||||
await crashObserverDeferred.promise;
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче