ipc/ipdl/test/cxx/TestSyncWakeup.h

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

     1 #ifndef mozilla__ipdltest_TestSyncWakeup_h
     2 #define mozilla__ipdltest_TestSyncWakeup_h 1
     4 #include "mozilla/_ipdltest/IPDLUnitTests.h"
     6 #include "mozilla/_ipdltest/PTestSyncWakeupParent.h"
     7 #include "mozilla/_ipdltest/PTestSyncWakeupChild.h"
     9 namespace mozilla {
    10 namespace _ipdltest {
    13 class TestSyncWakeupParent :
    14     public PTestSyncWakeupParent
    15 {
    16 public:
    17     TestSyncWakeupParent();
    18     virtual ~TestSyncWakeupParent();
    20     static bool RunTestInProcesses() { return true; }
    21     static bool RunTestInThreads() { return true; }
    23     void Main();
    25 protected:
    26     virtual bool AnswerStackFrame() MOZ_OVERRIDE;
    28     virtual bool RecvSync1() MOZ_OVERRIDE;
    30     virtual bool RecvSync2() MOZ_OVERRIDE;
    32     virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
    33     {
    34         if (NormalShutdown != why)
    35             fail("unexpected destruction!");  
    36         passed("ok");
    37         QuitParent();
    38     }
    39 };
    42 class TestSyncWakeupChild :
    43     public PTestSyncWakeupChild
    44 {
    45 public:
    46     TestSyncWakeupChild();
    47     virtual ~TestSyncWakeupChild();
    49 protected:
    50     virtual bool RecvStart() MOZ_OVERRIDE;
    52     virtual bool RecvNote1() MOZ_OVERRIDE;
    54     virtual bool AnswerStackFrame() MOZ_OVERRIDE;
    56     virtual bool RecvNote2() MOZ_OVERRIDE;
    58     virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
    59     {
    60         if (NormalShutdown != why)
    61             fail("unexpected destruction!");
    62         QuitChild();
    63     }
    65 private:
    66     bool mDone;
    67 };
    70 } // namespace _ipdltest
    71 } // namespace mozilla
    74 #endif // ifndef mozilla__ipdltest_TestSyncWakeup_h

mercurial