mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-08 20:56:04 +00:00
Update testloader.js #96
This commit is contained in:
parent
5ffdea15de
commit
dddfa3cc47
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"description": "WelsonJS test profile for Miscellaneous",
|
"description": "WelsonJS test profile (test-misc.json)",
|
||||||
"date": "2023-11-07",
|
"date": "2024-01-04",
|
||||||
"revision": "20231107r1",
|
"revision": "HEAD",
|
||||||
"authors": [
|
"authors": [
|
||||||
"Namhyeon Go <gnh1201@gmail.com>"
|
"Namhyeon Go <gnh1201@gmail.com>"
|
||||||
],
|
],
|
||||||
|
@ -53,6 +53,11 @@
|
||||||
"id": "sharedmemory",
|
"id": "sharedmemory",
|
||||||
"description": "Write and read a text on the (named) shared memory",
|
"description": "Write and read a text on the (named) shared memory",
|
||||||
"tags": ["Windows System", "IPC(Inter-Process Communication)"]
|
"tags": ["Windows System", "IPC(Inter-Process Communication)"]
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
"id": "sharedmemory_listener",
|
||||||
|
"description": "Read a text form the (named) shared memory, Repeatly",
|
||||||
|
"tags": ["Windows System", "IPC(Inter-Process Communication)"]
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -858,6 +858,26 @@ var test_implements = {
|
||||||
console.log("Closing the shared memory...");
|
console.log("Closing the shared memory...");
|
||||||
|
|
||||||
console.log("Done");
|
console.log("Done");
|
||||||
|
},
|
||||||
|
|
||||||
|
"sharedmemory_listener": function() {
|
||||||
|
var Toolkit = require("lib/toolkit");
|
||||||
|
var mem;
|
||||||
|
var memName = Toolkit.prompt("Input the shared memory name");
|
||||||
|
|
||||||
|
if (!memName) {
|
||||||
|
console.log("Aborted.");
|
||||||
|
} else {
|
||||||
|
mem = new Toolkit.NamedSharedMemory(memName);
|
||||||
|
console.log("Listening the shared memory:", memName);
|
||||||
|
while (true) {
|
||||||
|
var message = mem.readText(memName);
|
||||||
|
if (!!message) {
|
||||||
|
console.log(memName + ": " + message);
|
||||||
|
}
|
||||||
|
sleep(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user