diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:14:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:14:29 +0000 |
commit | fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch) | |
tree | 4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /ipc/ipdl/test/cxx/TestNestedLoops.cpp | |
parent | Releasing progress-linux version 124.0.1-1~progress7.99u1. (diff) | |
download | firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip |
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ipc/ipdl/test/cxx/TestNestedLoops.cpp')
-rw-r--r-- | ipc/ipdl/test/cxx/TestNestedLoops.cpp | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/ipc/ipdl/test/cxx/TestNestedLoops.cpp b/ipc/ipdl/test/cxx/TestNestedLoops.cpp deleted file mode 100644 index 3658d7dfb6..0000000000 --- a/ipc/ipdl/test/cxx/TestNestedLoops.cpp +++ /dev/null @@ -1,78 +0,0 @@ -#include "base/basictypes.h" - -#include "nsThreadUtils.h" - -#include "TestNestedLoops.h" - -#include "IPDLUnitTests.h" // fail etc. - -namespace mozilla { -namespace _ipdltest { - -//----------------------------------------------------------------------------- -// parent - -TestNestedLoopsParent::TestNestedLoopsParent() : mBreakNestedLoop(false) { - MOZ_COUNT_CTOR(TestNestedLoopsParent); -} - -TestNestedLoopsParent::~TestNestedLoopsParent() { - MOZ_COUNT_DTOR(TestNestedLoopsParent); -} - -void TestNestedLoopsParent::Main() { - if (!SendStart()) fail("sending Start"); - - // sigh ... spin for a while to let Nonce arrive - puts(" (sleeping to wait for nonce ... sorry)"); - PR_Sleep(5000); - - // while waiting for the reply to R, we'll receive Nonce - if (!CallR()) fail("calling R"); - - Close(); -} - -mozilla::ipc::IPCResult TestNestedLoopsParent::RecvNonce() { - // if we have an OnMaybeDequeueOne waiting for us (we may not, due - // to the inherent race condition in this test, then this event - // must be ordered after it in the queue - MessageLoop::current()->PostTask(NewNonOwningRunnableMethod( - "_ipdltest::TestNestedLoopsParent::BreakNestedLoop", this, - &TestNestedLoopsParent::BreakNestedLoop)); - - // sigh ... spin for a while to let the reply to R arrive - puts(" (sleeping to wait for reply to R ... sorry)"); - PR_Sleep(5000); - - // sigh ... we have no idea when code might do this - do { - if (!NS_ProcessNextEvent(nullptr, false)) - fail("expected at least one pending event"); - } while (!mBreakNestedLoop); - - return IPC_OK(); -} - -void TestNestedLoopsParent::BreakNestedLoop() { mBreakNestedLoop = true; } - -//----------------------------------------------------------------------------- -// child - -TestNestedLoopsChild::TestNestedLoopsChild() { - MOZ_COUNT_CTOR(TestNestedLoopsChild); -} - -TestNestedLoopsChild::~TestNestedLoopsChild() { - MOZ_COUNT_DTOR(TestNestedLoopsChild); -} - -mozilla::ipc::IPCResult TestNestedLoopsChild::RecvStart() { - if (!SendNonce()) fail("sending Nonce"); - return IPC_OK(); -} - -mozilla::ipc::IPCResult TestNestedLoopsChild::AnswerR() { return IPC_OK(); } - -} // namespace _ipdltest -} // namespace mozilla |