mirror of
https://github.com/gnh1201/welsonjs.git
synced 2024-11-26 15:31:42 +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",
|
||||
"date": "2023-11-07",
|
||||
"revision": "20231107r1",
|
||||
"description": "WelsonJS test profile (test-misc.json)",
|
||||
"date": "2024-01-04",
|
||||
"revision": "HEAD",
|
||||
"authors": [
|
||||
"Namhyeon Go <gnh1201@gmail.com>"
|
||||
],
|
||||
|
@ -53,6 +53,11 @@
|
|||
"id": "sharedmemory",
|
||||
"description": "Write and read a text on the (named) shared memory",
|
||||
"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("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