зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 4 changesets (bug 1635494) for failures on test_process_kill.js. CLOSED TREE
Backed out changeset 67a16c6149f7 (bug 1635494) Backed out changeset 862a5dcbe7a5 (bug 1635494) Backed out changeset 36e670cd1653 (bug 1635494) Backed out changeset 19c4d55874d9 (bug 1635494)
This commit is contained in:
Родитель
e92e60d175
Коммит
aec7461c96
|
@ -1918,7 +1918,6 @@ dependencies = [
|
|||
"nserror",
|
||||
"nsstring",
|
||||
"prefs_parser",
|
||||
"processtools",
|
||||
"profiler_helper",
|
||||
"remote",
|
||||
"rlbox_lucet_sandbox",
|
||||
|
@ -3744,16 +3743,6 @@ version = "0.1.1"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9f566249236c6ca4340f7ca78968271f0ed2b0f234007a61b66f9ecd0af09260"
|
||||
|
||||
[[package]]
|
||||
name = "processtools"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"kernel32-sys",
|
||||
"libc",
|
||||
"nserror",
|
||||
"xpcom",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "profiler_helper"
|
||||
version = "0.1.0"
|
||||
|
|
|
@ -10,7 +10,6 @@ html {
|
|||
body {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
#process-table {
|
||||
-moz-user-select: none;
|
||||
font-size: 1em;
|
||||
|
@ -49,19 +48,13 @@ td:nth-child(1) {
|
|||
/* At least one column needs to have a flexible width,
|
||||
so no width specified for td:nth-child(2) */
|
||||
td:nth-child(3) {
|
||||
width: 10%;
|
||||
width: 10%;
|
||||
}
|
||||
td:nth-child(4) {
|
||||
width: 10%;
|
||||
width: 10%;
|
||||
}
|
||||
td:nth-child(5) {
|
||||
width: 10%;
|
||||
}
|
||||
td:nth-child(6) {
|
||||
width: 10%;
|
||||
}
|
||||
td:nth-child(7) {
|
||||
width: 16px;
|
||||
width: 10%;
|
||||
}
|
||||
|
||||
#process-thead > tr {
|
||||
|
@ -80,8 +73,7 @@ td:nth-child(7) {
|
|||
}
|
||||
td {
|
||||
padding: 5px 10px;
|
||||
min-height: 1.5em;
|
||||
max-height: 1.5em;
|
||||
min-height: 2em;
|
||||
color: var(--in-content-text-color);
|
||||
max-width: 70vw;
|
||||
overflow: hidden;
|
||||
|
@ -175,31 +167,3 @@ td {
|
|||
#process-tbody > tr.thread {
|
||||
font-size-adjust: 0.5;
|
||||
}
|
||||
|
||||
.killing {
|
||||
opacity: 0.3;
|
||||
transition-property: opacity;
|
||||
transition-duration: 1s;
|
||||
}
|
||||
|
||||
.killed {
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
/* icons */
|
||||
.close-icon {
|
||||
background: url("chrome://global/skin/icons/delete.svg") no-repeat center;
|
||||
opacity: 0;
|
||||
}
|
||||
tr:-moz-any([selected], :hover) > .close-icon {
|
||||
opacity: 1;
|
||||
}
|
||||
.close-icon:hover {
|
||||
background-color: var(--in-content-button-background);
|
||||
}
|
||||
.browser > .close-icon:hover {
|
||||
background-color: red;
|
||||
transition-property: background-color;
|
||||
transition-duration: 1s;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,13 +5,6 @@
|
|||
# Page title
|
||||
about-processes-title = Process Manager
|
||||
|
||||
## Tooltips
|
||||
|
||||
about-processes-shutdown-process =
|
||||
.title = Kill process
|
||||
about-processes-shutdown-browser =
|
||||
.title = Kill the entire browser
|
||||
|
||||
## Column headers
|
||||
|
||||
about-processes-column-id = Id
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
<td class="clickable" id="column-cpu-user" data-l10n-id="about-processes-column-cpu-user"></td> <!-- CPU user. -->
|
||||
<td class="clickable" id="column-cpu-kernel" data-l10n-id="about-processes-column-cpu-kernel"></td> <!-- CPU kernel. -->
|
||||
<td class="clickable" id="column-cpu-threads" data-l10n-id="about-processes-column-threads"></td>
|
||||
<td id="column-kill"></td><!-- Kill button. -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="process-tbody"></tbody>
|
||||
|
|
|
@ -229,10 +229,7 @@ var State = {
|
|||
|
||||
var View = {
|
||||
_fragment: document.createDocumentFragment(),
|
||||
// Processes that we killed during the previous iteration.
|
||||
_killedRecently: [],
|
||||
async commit() {
|
||||
this._killedRecently.length = 0;
|
||||
let tbody = document.getElementById("process-tbody");
|
||||
|
||||
// Force translation to happen before we insert the new content in the DOM
|
||||
|
@ -260,9 +257,6 @@ var View = {
|
|||
appendProcessRow(data, isOpen) {
|
||||
let row = document.createElement("tr");
|
||||
row.classList.add("process");
|
||||
if (data.type == "browser") {
|
||||
row.classList.add("browser");
|
||||
}
|
||||
|
||||
// Column: pid / twisty image
|
||||
{
|
||||
|
@ -335,40 +329,6 @@ var View = {
|
|||
classes: ["numberOfThreads"],
|
||||
});
|
||||
|
||||
// Column: Kill button – but not for all processes.
|
||||
let killButton = this._addCell(row, {
|
||||
content: "",
|
||||
classes: ["action-icon"],
|
||||
});
|
||||
|
||||
if (data.type == "socket") {
|
||||
// We can't kill this process. Let's not pretend that we can.
|
||||
// Don't display the kill button.
|
||||
} else if (this._killedRecently.some(pid => pid == data.pid)) {
|
||||
// We're racing between the "kill" action and the visual refresh.
|
||||
// In a few cases, we could end up with the visual refresh showing
|
||||
// a process as un-killed while we actually just killed it.
|
||||
//
|
||||
// We still want to display the process in case something actually
|
||||
// went bad and the user needs the information to realize this.
|
||||
// But we also want to make it visible that the process is being
|
||||
// killed.
|
||||
row.classList.add("killed");
|
||||
} else {
|
||||
// Otherwise, let's display the kill button.
|
||||
killButton.classList.add("close-icon");
|
||||
if (data.type == "browser") {
|
||||
document.l10n.setAttributes(
|
||||
killButton,
|
||||
"about-processes-shutdown-browser"
|
||||
);
|
||||
} else {
|
||||
document.l10n.setAttributes(
|
||||
killButton,
|
||||
"about-processes-shutdown-process"
|
||||
);
|
||||
}
|
||||
}
|
||||
this._fragment.appendChild(row);
|
||||
return row;
|
||||
},
|
||||
|
@ -431,21 +391,13 @@ var View = {
|
|||
classes: ["numberOfThreads"],
|
||||
});
|
||||
|
||||
// Column: Buttons (empty)
|
||||
this._addCell(row, {
|
||||
content: "",
|
||||
classes: [],
|
||||
});
|
||||
|
||||
this._fragment.appendChild(row);
|
||||
return row;
|
||||
},
|
||||
|
||||
_addCell(row, { content, classes }) {
|
||||
let elt = document.createElement("td");
|
||||
if (content) {
|
||||
this._setTextAndTooltip(elt, content);
|
||||
}
|
||||
this._setTextAndTooltip(elt, content);
|
||||
elt.classList.add(...classes);
|
||||
row.appendChild(elt);
|
||||
return elt;
|
||||
|
@ -589,13 +541,19 @@ var Control = {
|
|||
tbody.addEventListener("click", event => {
|
||||
this._updateLastMouseEvent();
|
||||
|
||||
// Handle showing or hiding subitems of a row.
|
||||
let target = event.target;
|
||||
if (target.classList.contains("twisty")) {
|
||||
// Handle showing or hiding subitems of a row.
|
||||
this._handleTwisty(target);
|
||||
return;
|
||||
} else if (target.classList.contains("close-icon")) {
|
||||
this._handleClose(target);
|
||||
let row = target.parentNode.parentNode;
|
||||
let id = row.process.pid;
|
||||
if (target.classList.toggle("open")) {
|
||||
this._openItems.add(id);
|
||||
this._showChildren(row);
|
||||
View.insertAfterRow(row);
|
||||
} else {
|
||||
this._openItems.delete(id);
|
||||
this._removeSubtree(row);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -798,34 +756,6 @@ var Control = {
|
|||
return order;
|
||||
});
|
||||
},
|
||||
|
||||
_handleTwisty(target) {
|
||||
let row = target.parentNode.parentNode;
|
||||
let id = row.process.pid;
|
||||
if (target.classList.toggle("open")) {
|
||||
this._openItems.add(id);
|
||||
this._showChildren(row);
|
||||
View.insertAfterRow(row);
|
||||
} else {
|
||||
this._openItems.delete(id);
|
||||
this._removeSubtree(row);
|
||||
}
|
||||
},
|
||||
|
||||
_handleClose(target) {
|
||||
const ProcessTools = Cc["@mozilla.org/processtools-service;1"].getService(
|
||||
Ci.nsIProcessToolsService
|
||||
);
|
||||
let row = target.parentNode;
|
||||
let pid = row.process.pid;
|
||||
ProcessTools.kill(pid);
|
||||
|
||||
row.classList.add("killing");
|
||||
target.classList.remove("close-icon");
|
||||
// Make sure that the user can't click twice on the kill button.
|
||||
// Otherwise, chaos might ensure. Plus we risk crashing under Windows.
|
||||
View._killedRecently.push(pid);
|
||||
},
|
||||
};
|
||||
|
||||
window.onload = async function() {
|
||||
|
|
|
@ -56,7 +56,6 @@ DIRS += [
|
|||
'perfmonitoring',
|
||||
'pictureinpicture',
|
||||
'places',
|
||||
'processtools',
|
||||
'processsingleton',
|
||||
'promiseworker',
|
||||
'prompts',
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
[package]
|
||||
name = "processtools"
|
||||
version = "0.1.0"
|
||||
authors = ["David Teller <dteller@mozilla.com>"]
|
||||
|
||||
[dependencies]
|
||||
nserror = { path = "../../../xpcom/rust/nserror" }
|
||||
xpcom = { path = "../../../xpcom/rust/xpcom" }
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
kernel32-sys = "0.2"
|
||||
|
||||
[target.'cfg(unix)'.dependencies]
|
||||
libc = "0.2"
|
|
@ -1,33 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
#include "mozilla/StaticPtr.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "ProcessToolsService.h"
|
||||
|
||||
// This anonymous namespace prevents outside C++ code from improperly accessing
|
||||
// these implementation details.
|
||||
namespace {
|
||||
extern "C" {
|
||||
// Implemented in Rust.
|
||||
void new_process_tools_service(nsIProcessToolsService** result);
|
||||
}
|
||||
|
||||
static mozilla::StaticRefPtr<nsIProcessToolsService> sProcessToolsService;
|
||||
} // namespace
|
||||
|
||||
already_AddRefed<nsIProcessToolsService> GetProcessToolsService() {
|
||||
nsCOMPtr<nsIProcessToolsService> processToolsService;
|
||||
|
||||
if (sProcessToolsService) {
|
||||
processToolsService = sProcessToolsService;
|
||||
} else {
|
||||
new_process_tools_service(getter_AddRefs(processToolsService));
|
||||
sProcessToolsService = processToolsService;
|
||||
mozilla::ClearOnShutdown(&sProcessToolsService);
|
||||
}
|
||||
|
||||
return processToolsService.forget();
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsIProcessToolsService.h"
|
||||
|
||||
already_AddRefed<nsIProcessToolsService> GetProcessToolsService();
|
|
@ -1,10 +0,0 @@
|
|||
Classes = [
|
||||
{
|
||||
'cid': '{79A13656-A472-4713-B0E1-AB39A15CF790}',
|
||||
'contract_ids': ["@mozilla.org/processtools-service;1"],
|
||||
'type': 'nsIProcessToolsService',
|
||||
'constructor': 'GetProcessToolsService',
|
||||
'singleton': True,
|
||||
'headers': ['ProcessToolsService.h'],
|
||||
}
|
||||
]
|
|
@ -1,30 +0,0 @@
|
|||
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
||||
# vim: set filetype=python:
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
with Files('**'):
|
||||
BUG_COMPONENT = ('Core', 'DOM: Content Processes')
|
||||
|
||||
XPIDL_MODULE = 'toolkit_processtools'
|
||||
|
||||
XPCOM_MANIFESTS += [
|
||||
'components.conf',
|
||||
]
|
||||
|
||||
XPIDL_SOURCES += [
|
||||
'nsIProcessToolsService.idl',
|
||||
]
|
||||
|
||||
EXPORTS += [
|
||||
'ProcessToolsService.h',
|
||||
]
|
||||
|
||||
UNIFIED_SOURCES += [
|
||||
'ProcessToolsService.cpp',
|
||||
]
|
||||
|
||||
FINAL_LIBRARY = 'xul'
|
||||
|
||||
XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell/xpcshell.ini']
|
|
@ -1,35 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
[scriptable, uuid(1341f571-ebed-4305-b264-4d8fc3b6b11c)]
|
||||
interface nsIProcessToolsService: nsISupports {
|
||||
/**
|
||||
* Kill a process running on this system.
|
||||
*
|
||||
* Does not cause a crash report to be generated and sent.
|
||||
*
|
||||
* # Note
|
||||
*
|
||||
* `pid` is the unique-to-the-system process identifier, as
|
||||
* obtained with attribute `pid` of this service.
|
||||
*
|
||||
* Under Un*ix, that's what you obtain with `getpid()`, etc.
|
||||
* Under Windows, that's what you obtain with `GetCurrentProcessId()`,
|
||||
* NOT the same thing as the process `HANDLE`.
|
||||
*
|
||||
* # Failure
|
||||
*
|
||||
* Under Windows, if two processes race to `kill()` a third process,
|
||||
* or two threads race to `kill()` a process there is a (small) window
|
||||
* during which this can cause a crash in the losing process.
|
||||
*/
|
||||
void kill(in unsigned long long pid);
|
||||
|
||||
/**
|
||||
* The pid for the current process.
|
||||
*/
|
||||
readonly attribute unsigned long long pid;
|
||||
};
|
|
@ -1,94 +0,0 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
extern crate kernel32;
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
extern crate libc;
|
||||
|
||||
extern crate nserror;
|
||||
extern crate xpcom;
|
||||
|
||||
use std::convert::TryInto;
|
||||
|
||||
use nserror::{nsresult, NS_ERROR_FAILURE, NS_OK};
|
||||
use xpcom::{interfaces::nsIProcessToolsService, xpcom, xpcom_method, RefPtr};
|
||||
|
||||
#[no_mangle]
|
||||
pub unsafe extern "C" fn new_process_tools_service(result: *mut *const nsIProcessToolsService) {
|
||||
let service: RefPtr<ProcessToolsService> = ProcessToolsService::new();
|
||||
RefPtr::new(service.coerce::<nsIProcessToolsService>()).forget(&mut *result);
|
||||
}
|
||||
|
||||
// Implementation note:
|
||||
//
|
||||
// We're following the strategy employed by the `kvstore`.
|
||||
// See https://searchfox.org/mozilla-central/rev/a87a1c3b543475276e6d57a7a80cb02f3e42b6ed/toolkit/components/kvstore/src/lib.rs#78
|
||||
|
||||
#[derive(xpcom)]
|
||||
#[refcnt = "atomic"]
|
||||
#[xpimplements(nsIProcessToolsService)]
|
||||
pub struct InitProcessToolsService {}
|
||||
|
||||
impl ProcessToolsService {
|
||||
pub fn new() -> RefPtr<ProcessToolsService> {
|
||||
ProcessToolsService::allocate(InitProcessToolsService {})
|
||||
}
|
||||
|
||||
// Method `kill`.
|
||||
|
||||
xpcom_method!(
|
||||
kill => Kill(id: u64)
|
||||
);
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
pub fn kill(&self, pid: u64) -> Result<(), nsresult> {
|
||||
let handle = unsafe {
|
||||
kernel32::OpenProcess(
|
||||
/* dwDesiredAccess: delete */ 0x00010000,
|
||||
/* bInheritHandle: false */ 0,
|
||||
/* dwProcessId */ pid.try_into().unwrap(),
|
||||
)
|
||||
};
|
||||
if handle.is_null() {
|
||||
return Err(NS_ERROR_FAILURE);
|
||||
}
|
||||
|
||||
if unsafe { kernel32::TerminateProcess(handle, 0) } == 0 {
|
||||
return Err(NS_ERROR_FAILURE);
|
||||
}
|
||||
let _ = unsafe { kernel32::CloseHandle(handle) };
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
pub fn kill(&self, pid: u64) -> Result<(), nsresult> {
|
||||
let pid = pid.try_into().or(Err(NS_ERROR_FAILURE))?;
|
||||
let result = unsafe { libc::kill(pid, libc::SIGKILL) };
|
||||
if result == 0 {
|
||||
Ok(())
|
||||
} else {
|
||||
Err(NS_ERROR_FAILURE)
|
||||
}
|
||||
}
|
||||
|
||||
// Attribute `pid`
|
||||
|
||||
xpcom_method!(
|
||||
get_pid => GetPid() -> u64
|
||||
);
|
||||
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
pub fn get_pid(&self) -> Result<u64, nsresult> {
|
||||
let pid = unsafe { libc::getpid() } as u64;
|
||||
Ok(pid)
|
||||
}
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
pub fn get_pid(&self) -> Result<u64, nsresult> {
|
||||
let pid = unsafe { kernel32::GetCurrentProcessId() } as u64;
|
||||
Ok(pid)
|
||||
}
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
/* eslint-disable mozilla/no-arbitrary-setTimeout */
|
||||
"use strict";
|
||||
|
||||
const { AppConstants } = ChromeUtils.import(
|
||||
"resource://gre/modules/AppConstants.jsm"
|
||||
);
|
||||
const { setTimeout } = ChromeUtils.import("resource://gre/modules/Timer.jsm");
|
||||
|
||||
const { Subprocess } = ChromeUtils.import(
|
||||
"resource://gre/modules/Subprocess.jsm"
|
||||
);
|
||||
|
||||
const ProcessTools = Cc["@mozilla.org/processtools-service;1"].getService(
|
||||
Ci.nsIProcessToolsService
|
||||
);
|
||||
|
||||
const env = Cc["@mozilla.org/process/environment;1"].getService(
|
||||
Ci.nsIEnvironment
|
||||
);
|
||||
|
||||
let PYTHON;
|
||||
|
||||
// Find Python.
|
||||
add_task(async function setup() {
|
||||
PYTHON = await Subprocess.pathSearch(env.get("PYTHON"));
|
||||
});
|
||||
|
||||
// Ensure that killing a process... kills the process.
|
||||
add_task(async function test_subprocess_kill() {
|
||||
// We launch Python, as it's a long-running process and it exists
|
||||
// on all desktop platforms on which we run tests.
|
||||
let proc = await Subprocess.call({
|
||||
command: PYTHON,
|
||||
arguments: [],
|
||||
});
|
||||
|
||||
let isTerminated = false;
|
||||
|
||||
proc.wait().then(() => {
|
||||
isTerminated = true;
|
||||
});
|
||||
|
||||
await new Promise(resolve => setTimeout(resolve, 100));
|
||||
Assert.ok(
|
||||
!isTerminated,
|
||||
"We haven't killed the process yet, it should still be running."
|
||||
);
|
||||
|
||||
// Time to kill the process.
|
||||
ProcessTools.kill(proc.pid);
|
||||
|
||||
await new Promise(resolve => setTimeout(resolve, 100));
|
||||
Assert.ok(
|
||||
isTerminated,
|
||||
"We have killed the process already, it shouldn't be running anymore."
|
||||
);
|
||||
});
|
|
@ -1,6 +0,0 @@
|
|||
[DEFAULT]
|
||||
firefox-appdir = browser
|
||||
skip-if = os == 'android'
|
||||
subprocess = true
|
||||
|
||||
[test_process_kill.js]
|
|
@ -205,14 +205,10 @@ async function do_content_crash(setup, callback) {
|
|||
do_get_profile();
|
||||
await makeFakeAppDir();
|
||||
await sendCommandAsync('load("' + headfile.path.replace(/\\/g, "/") + '");');
|
||||
if (setup) {
|
||||
await sendCommandAsync(setup);
|
||||
}
|
||||
await sendCommandAsync(setup);
|
||||
await sendCommandAsync('load("' + tailfile.path.replace(/\\/g, "/") + '");');
|
||||
await spinEventLoop();
|
||||
|
||||
let minidump = getMinidump();
|
||||
let id = minidump.leafName.slice(0, -4);
|
||||
let id = getMinidump().leafName.slice(0, -4);
|
||||
await Services.crashmanager.ensureCrashIsPresent(id);
|
||||
try {
|
||||
await handleMinidump(callback);
|
||||
|
|
|
@ -1,44 +0,0 @@
|
|||
// Test that calling Services.processtools.kill doesn't create a crash report.
|
||||
add_task(async function run_test() {
|
||||
if (!("@mozilla.org/toolkit/crash-reporter;1" in Cc)) {
|
||||
dump(
|
||||
"INFO | test_kill.js | Can't test crashreporter in a non-libxul build.\n"
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
// Let's launch a child process and kill it (from within, it's simpler).
|
||||
|
||||
do_load_child_test_harness();
|
||||
|
||||
// Setting the minidump path won't work in the child, so we need to do
|
||||
// that here.
|
||||
let crashReporter = Cc["@mozilla.org/toolkit/crash-reporter;1"].getService(
|
||||
Ci.nsICrashReporter
|
||||
);
|
||||
crashReporter.minidumpPath = do_get_tempdir();
|
||||
let headfile = do_get_file("../unit/crasher_subprocess_head.js");
|
||||
const CRASH_THEN_WAIT =
|
||||
"const ProcessTools = Cc['@mozilla.org/processtools-service;1'].getService(Ci.nsIProcessToolsService);\
|
||||
console.log('Child process commiting ritual self-sacrifice');\
|
||||
ProcessTools.kill(ProcessTools.pid);\
|
||||
console.error('Oops, I should be dead');\
|
||||
while (true) {} ;";
|
||||
do_get_profile();
|
||||
await makeFakeAppDir();
|
||||
await sendCommandAsync('load("' + headfile.path.replace(/\\/g, "/") + '");');
|
||||
await sendCommandAsync(CRASH_THEN_WAIT);
|
||||
|
||||
// Let's wait a little to give the child process a chance to create a minidump.
|
||||
let { setTimeout } = ChromeUtils.import("resource://gre/modules/Timer.jsm");
|
||||
// eslint-disable-next-line mozilla/no-arbitrary-setTimeout
|
||||
await new Promise(resolve => setTimeout(resolve, 100));
|
||||
|
||||
// Now make sure that we have no minidump.
|
||||
let minidump = getMinidump();
|
||||
Assert.equal(
|
||||
minidump,
|
||||
null,
|
||||
`There should be no minidump ${minidump == null ? "null" : minidump.path}`
|
||||
);
|
||||
});
|
|
@ -62,6 +62,7 @@ add_task(async function run_test() {
|
|||
Assert.ok(Number(extra[label]) >= 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
true
|
||||
);
|
||||
});
|
||||
|
|
|
@ -16,7 +16,6 @@ support-files =
|
|||
[test_crash_after_js_large_allocation_failure_reporting.js]
|
||||
[test_crash_oom.js]
|
||||
[test_oom_annotation.js]
|
||||
[test_kill.js]
|
||||
|
||||
[test_crash_abort.js]
|
||||
skip-if = os == 'win'
|
||||
|
@ -110,4 +109,3 @@ head = head_crashreporter.js head_win64cfi.js
|
|||
skip-if = !(os == 'win' && bits == 64 && processor == 'x86_64')
|
||||
reason = Windows test specific to the x86-64 architecture
|
||||
support-files = test_crash_win64cfi_not_a_pe.exe
|
||||
|
||||
|
|
|
@ -66,8 +66,6 @@ fluent = { version = "0.11" , features = ["fluent-pseudo"] }
|
|||
fluent-ffi = { path = "../../../../intl/l10n/rust/fluent-ffi" }
|
||||
firefox-accounts-bridge = { path = "../../../../services/fxaccounts/rust-bridge/firefox-accounts-bridge", optional=true }
|
||||
|
||||
processtools = { path = "../../../components/processtools" }
|
||||
|
||||
[target.'cfg(not(target_os = "android"))'.dependencies]
|
||||
viaduct = { git = "https://github.com/mozilla/application-services", rev = "61dcc364ac0d6d0816ab88a494bbf20d824b009b"}
|
||||
webext_storage_bridge = { path = "../../../components/extensions/storage/webext_storage_bridge" }
|
||||
|
|
|
@ -40,7 +40,6 @@ extern crate netwerk_helper;
|
|||
extern crate nserror;
|
||||
extern crate nsstring;
|
||||
extern crate prefs_parser;
|
||||
extern crate processtools;
|
||||
#[cfg(feature = "gecko_profiler")]
|
||||
extern crate profiler_helper;
|
||||
extern crate rsdparsa_capi;
|
||||
|
|
Загрузка…
Ссылка в новой задаче