ipc/ipdl/test/cxx/TestUrgency.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 #ifndef mozilla__ipdltest_TestUrgency_h
     2 #define mozilla__ipdltest_TestUrgency_h 1
     4 #include "mozilla/_ipdltest/IPDLUnitTests.h"
     6 #include "mozilla/_ipdltest/PTestUrgencyParent.h"
     7 #include "mozilla/_ipdltest/PTestUrgencyChild.h"
     9 namespace mozilla {
    10 namespace _ipdltest {
    13 class TestUrgencyParent :
    14     public PTestUrgencyParent
    15 {
    16 public:
    17     TestUrgencyParent();
    18     virtual ~TestUrgencyParent();
    20     static bool RunTestInProcesses() { return true; }
    21     static bool RunTestInThreads() { return true; }
    23     void Main();
    25     bool RecvTest1(uint32_t *value);
    26     bool RecvTest2();
    27     bool RecvTest3(uint32_t *value);
    28     bool RecvTest4_Begin();
    29     bool RecvTest4_NestedSync();
    30     bool RecvFinalTest_Begin();
    32     bool ShouldContinueFromReplyTimeout() MOZ_OVERRIDE
    33     {
    34       return false;
    35     }
    36     virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
    37     {
    38         if (AbnormalShutdown != why)
    39             fail("unexpected destruction!");  
    40         passed("ok");
    41         QuitParent();
    42     }
    44 private:
    45     bool inreply_;
    46 };
    49 class TestUrgencyChild :
    50     public PTestUrgencyChild
    51 {
    52 public:
    53     TestUrgencyChild();
    54     virtual ~TestUrgencyChild();
    56     bool RecvStart();
    57     bool AnswerReply1(uint32_t *reply);
    58     bool AnswerReply2(uint32_t *reply);
    59     bool AnswerTest4_Reenter();
    60     bool AnswerFinalTest_Hang();
    62     virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
    63     {
    64         if (AbnormalShutdown != why)
    65             fail("unexpected destruction!");
    66         QuitChild();
    67     }
    69 private:
    70     uint32_t test_;
    71 };
    74 } // namespace _ipdltest
    75 } // namespace mozilla
    78 #endif // ifndef mozilla__ipdltest_TestUrgency_h

mercurial