icecat: add release icecat-140.6.0-1gnu1 for ecne
This commit is contained in:
parent
618c9f4145
commit
7d0f5dab3b
3382 changed files with 457689 additions and 569094 deletions
|
|
@ -36,7 +36,7 @@ let readAll = async function (pipe) {
|
|||
return result.join("");
|
||||
};
|
||||
|
||||
add_task(async function setup() {
|
||||
add_setup(async function setup() {
|
||||
PYTHON = await Subprocess.pathSearch(Services.env.get("PYTHON"));
|
||||
|
||||
PYTHON_BIN = PathUtils.filename(PYTHON);
|
||||
|
|
@ -421,6 +421,79 @@ add_task(async function test_subprocess_eof() {
|
|||
equal(exitCode, 0, "Got expected exit code");
|
||||
});
|
||||
|
||||
// Regression test for bug 1983138.
|
||||
add_task(async function test_subprocess_stdin_closed_by_program() {
|
||||
// On Windows, the actual python.exe that runs the script is a child of the
|
||||
// python.exe of the virtualenv, and closing stdin from that child does not
|
||||
// propagate back, which would cause the proc.stdin.write() call below to
|
||||
// succeed unexpectedly.
|
||||
//
|
||||
// To avoid this issue, use the real Python, see getRealPythonExecutable.
|
||||
let proc = await Subprocess.call({
|
||||
command: await getRealPythonExecutable(PYTHON),
|
||||
arguments: ["-u", TEST_SCRIPT, "close_stdin_and_wait_forever"],
|
||||
});
|
||||
|
||||
info("Waiting for program to notify us via stdout after closing stdin");
|
||||
|
||||
equal(
|
||||
await read(proc.stdout),
|
||||
"stdin_closed",
|
||||
"Spawned process closed stdin"
|
||||
);
|
||||
|
||||
// This is the most interesting part - write() should reject with an error.
|
||||
await Assert.rejects(
|
||||
proc.stdin.write("a"),
|
||||
function (e) {
|
||||
equal(
|
||||
e.errorCode,
|
||||
Subprocess.ERROR_END_OF_FILE,
|
||||
"Got the expected error code"
|
||||
);
|
||||
return /File closed/.test(e.message);
|
||||
},
|
||||
"Promise should be rejected after program closed stdin"
|
||||
);
|
||||
|
||||
let { exitCode } = await proc.kill();
|
||||
|
||||
// On UNIX platforms, our subprocess.kill() implementation sends SIGTERM,
|
||||
// which Python handles and exiting with -15. On Windows, we send SIGKILL
|
||||
// which the program cannot even handle and the exit code is -9.
|
||||
const expectedExitCode = AppConstants.platform == "win" ? -9 : -15;
|
||||
equal(exitCode, expectedExitCode, "Got expected exit code");
|
||||
});
|
||||
|
||||
// Regression test for bug 1983138.
|
||||
add_task(async function test_subprocess_stdout_closed_by_program() {
|
||||
// On Windows, the actual python.exe that runs the script is a child of the
|
||||
// python.exe of the virtualenv, and closing stdout from that child does not
|
||||
// propagate back, which would cause the proc.stdout.readString() call (via
|
||||
// read) below to never resolve.
|
||||
//
|
||||
// To avoid this issue, use the real Python, see getRealPythonExecutable.
|
||||
let proc = await Subprocess.call({
|
||||
command: await getRealPythonExecutable(PYTHON),
|
||||
arguments: ["-u", TEST_SCRIPT, "close_pipes_and_wait_for_stdin"],
|
||||
});
|
||||
|
||||
// This is the most interesting part - readString() should resolve.
|
||||
equal(
|
||||
await proc.stdout.readString(),
|
||||
"",
|
||||
"stdout read should resolve to empty string upon close"
|
||||
);
|
||||
|
||||
let { exitCode } = await proc.kill();
|
||||
|
||||
// On UNIX platforms, our subprocess.kill() implementation sends SIGTERM,
|
||||
// which Python handles and exiting with -15. On Windows, we send SIGKILL
|
||||
// which the program cannot even handle and the exit code is -9.
|
||||
const expectedExitCode = AppConstants.platform == "win" ? -9 : -15;
|
||||
equal(exitCode, expectedExitCode, "Got expected exit code");
|
||||
});
|
||||
|
||||
add_task(async function test_subprocess_invalid_json() {
|
||||
let proc = await Subprocess.call({
|
||||
command: PYTHON,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue