tests fix

This commit is contained in:
antelle 2021-04-14 20:41:45 +02:00
parent ae932e5710
commit 27b116798e
No known key found for this signature in database
GPG Key ID: 63C9777AAB7C563C
2 changed files with 14 additions and 4 deletions

View File

@ -56,7 +56,6 @@ std::string keeweb_pipe_name() {
#endif
uv_os_free_passwd(&user_info);
}
std::cout << pipe_name;
return pipe_name;
}
@ -103,6 +102,8 @@ void stdin_read_cb(uv_stream_t *, ssize_t nread, const uv_buf_t *buf) {
state.pending_to_keeweb.emplace(
uv_buf_init(buf->base, static_cast<decltype(uv_buf_t::len)>(nread)));
process_keeweb_queue();
} else if (nread == UV_EOF) {
quit_on_error();
} else if (nread < 0) {
std::cerr << "STDIN read error: " << uv_err_name(static_cast<int>(nread)) << std::endl;
quit_on_error();
@ -191,6 +192,8 @@ void keeweb_pipe_read_cb(uv_stream_t *, ssize_t nread, const uv_buf_t *buf) {
state.pending_to_stdout.emplace(
uv_buf_init(buf->base, static_cast<decltype(uv_buf_t::len)>(nread)));
process_stdout_queue();
} else if (nread == UV_EOF) {
close_keeweb_pipe();
} else if (nread < 0) {
std::cerr << "KeeWeb read error: " << uv_err_name(static_cast<int>(nread)) << std::endl;
close_keeweb_pipe();

View File

@ -6,12 +6,19 @@ import childProcess from 'child_process';
import { expect } from 'chai';
describe('KeeWeb extension native module host', function () {
const sockPath = path.join(os.tmpdir(), 'keeweb-browser.sock');
const hostPath = 'build/keeweb-native-messaging-host';
const extensionOrigin = 'chrome-extension://enjifmdnhaddmajefhfaoglcfdobkcpj';
const extensionOrigin = 'keeweb-connect@keeweb.info';
const userInfo = os.userInfo();
let sockPath;
if (process.platform === 'win32') {
sockPath = `\\\\.pipe\\keeweb-browser-${userInfo.username}`;
} else {
sockPath = path.join(os.tmpdir(), `keeweb-browser-${userInfo.uid}.sock`);
}
let server;
let serverConnection = undefined;
let serverConnection;
this.timeout(5000);