ipc/ipdl/test/cxx/TestCrashCleanup.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_TestCrashCleanup_h
     2 #define mozilla__ipdltest_TestCrashCleanup_h 1
     4 #include "mozilla/_ipdltest/IPDLUnitTests.h"
     6 #include "mozilla/_ipdltest/PTestCrashCleanupParent.h"
     7 #include "mozilla/_ipdltest/PTestCrashCleanupChild.h"
     9 namespace mozilla {
    10 namespace _ipdltest {
    13 class TestCrashCleanupParent :
    14     public PTestCrashCleanupParent
    15 {
    16 public:
    17     TestCrashCleanupParent();
    18     virtual ~TestCrashCleanupParent();
    20     static bool RunTestInProcesses() { return true; }
    21     static bool RunTestInThreads() { return false; }
    23     void Main();
    25 protected:    
    26     virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
    27     {
    28         if (AbnormalShutdown != why)
    29             fail("unexpected destruction!");
    30         mCleanedUp = true;
    31     }
    33     bool mCleanedUp;
    34 };
    37 class TestCrashCleanupChild :
    38     public PTestCrashCleanupChild
    39 {
    40 public:
    41     TestCrashCleanupChild();
    42     virtual ~TestCrashCleanupChild();
    44 protected:
    45     virtual bool AnswerDIEDIEDIE() MOZ_OVERRIDE;
    47     virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
    48     {
    49         fail("should have 'crashed'!");
    50     }
    51 };
    54 } // namespace _ipdltest
    55 } // namespace mozilla
    58 #endif // ifndef mozilla__ipdltest_TestCrashCleanup_h

mercurial