summaryrefslogtreecommitdiffstats
path: root/ipc/ipdl/test/cxx/TestSyncWakeup.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /ipc/ipdl/test/cxx/TestSyncWakeup.cpp
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-adbda400be353e676059e335c3c0aaf99e719475.tar.xz
firefox-adbda400be353e676059e335c3c0aaf99e719475.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ipc/ipdl/test/cxx/TestSyncWakeup.cpp')
-rw-r--r--ipc/ipdl/test/cxx/TestSyncWakeup.cpp106
1 files changed, 0 insertions, 106 deletions
diff --git a/ipc/ipdl/test/cxx/TestSyncWakeup.cpp b/ipc/ipdl/test/cxx/TestSyncWakeup.cpp
deleted file mode 100644
index 90875b702b..0000000000
--- a/ipc/ipdl/test/cxx/TestSyncWakeup.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-#if defined(XP_UNIX)
-# include <unistd.h> // sleep()
-#endif
-
-#include "TestSyncWakeup.h"
-
-#include "IPDLUnitTests.h" // fail etc.
-
-namespace mozilla {
-namespace _ipdltest {
-
-//-----------------------------------------------------------------------------
-// parent
-
-TestSyncWakeupParent::TestSyncWakeupParent() {
- MOZ_COUNT_CTOR(TestSyncWakeupParent);
-}
-
-TestSyncWakeupParent::~TestSyncWakeupParent() {
- MOZ_COUNT_DTOR(TestSyncWakeupParent);
-}
-
-void TestSyncWakeupParent::Main() {
- if (!SendStart()) fail("sending Start()");
-}
-
-mozilla::ipc::IPCResult TestSyncWakeupParent::AnswerStackFrame() {
- if (!CallStackFrame()) fail("calling StackFrame()");
- return IPC_OK();
-}
-
-mozilla::ipc::IPCResult TestSyncWakeupParent::RecvSync1() {
- if (!SendNote1()) fail("sending Note1()");
-
- // XXX ugh ... need to ensure that the async message and sync
- // reply come in "far enough" apart that this test doesn't pass on
- // accident
-#if defined(XP_UNIX)
- // NB: can't use PR_Sleep (i.e. Sleep() on windows) because it's
- // only spec'd to block the current thread, not the current
- // process. We need the IO thread to sleep as well.
- puts(" (sleeping for 5 seconds. sorry!)");
- sleep(5);
-#endif
-
- return IPC_OK();
-}
-
-mozilla::ipc::IPCResult TestSyncWakeupParent::RecvSync2() {
- if (!SendNote2()) fail("sending Note2()");
-
-#if defined(XP_UNIX)
- // see above
- sleep(5);
- puts(" (sleeping for 5 seconds. sorry!)");
-#endif
-
- return IPC_OK();
-}
-
-//-----------------------------------------------------------------------------
-// child
-
-TestSyncWakeupChild::TestSyncWakeupChild() : mDone(false) {
- MOZ_COUNT_CTOR(TestSyncWakeupChild);
-}
-
-TestSyncWakeupChild::~TestSyncWakeupChild() {
- MOZ_COUNT_DTOR(TestSyncWakeupChild);
-}
-
-mozilla::ipc::IPCResult TestSyncWakeupChild::RecvStart() {
- // First test: the parent fires back an async message while
- // replying to a sync one
- if (!SendSync1()) fail("sending Sync()");
-
- // drop back into the event loop to get Note1(), then kick off the
- // second test
- return IPC_OK();
-}
-
-mozilla::ipc::IPCResult TestSyncWakeupChild::RecvNote1() {
- // Second test: the parent fires back an async message while
- // replying to a sync one, with a frame on the RPC stack
- if (!CallStackFrame()) fail("calling StackFrame()");
-
- if (!mDone) fail("should have received Note2()!");
-
- Close();
-
- return IPC_OK();
-}
-
-mozilla::ipc::IPCResult TestSyncWakeupChild::AnswerStackFrame() {
- if (!SendSync2()) fail("sending Sync()");
-
- return IPC_OK();
-}
-
-mozilla::ipc::IPCResult TestSyncWakeupChild::RecvNote2() {
- mDone = true;
- return IPC_OK();
-}
-
-} // namespace _ipdltest
-} // namespace mozilla