photosgallery/viewframework/commandhandlers/commandhandlerupnp/tsrc/t_glxupnprenderer/src/t_glxupnprenderer.cpp
changeset 0 4e91876724a2
child 18 bcb43dc84c44
equal deleted inserted replaced
-1:000000000000 0:4e91876724a2
       
     1 /*
       
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  CommandHandlerUpNP unit test cases for upnp renderer
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 //  CLASS HEADER
       
    22 #include "t_glxupnprenderer.h"
       
    23 
       
    24 //  EXTERNAL INCLUDES
       
    25 #include <digia/eunit/eunitmacros.h>
       
    26 #include <digia/eunit/eunitdecorators.h>
       
    27 
       
    28 //  INTERNAL INCLUDES
       
    29 #include "glxupnprenderer.h"
       
    30 #include <upnpshowcommand.h>
       
    31 
       
    32 // CONSTRUCTION
       
    33 t_glxupnprenderer* t_glxupnprenderer::NewL()
       
    34     {
       
    35     t_glxupnprenderer* self = t_glxupnprenderer::NewLC();
       
    36     CleanupStack::Pop();
       
    37 
       
    38     return self;
       
    39     }
       
    40 
       
    41 t_glxupnprenderer* t_glxupnprenderer::NewLC()
       
    42     {
       
    43     t_glxupnprenderer* self = new( ELeave ) t_glxupnprenderer();
       
    44     CleanupStack::PushL( self );
       
    45 
       
    46     self->ConstructL();
       
    47 
       
    48     return self;
       
    49     }
       
    50 
       
    51 // Destructor (virtual by CBase)
       
    52 t_glxupnprenderer::~t_glxupnprenderer()
       
    53     {
       
    54     }
       
    55 
       
    56 // Default constructor
       
    57 t_glxupnprenderer::t_glxupnprenderer()
       
    58     {
       
    59     }
       
    60 
       
    61 // Second phase construct
       
    62 void t_glxupnprenderer::ConstructL()
       
    63     {
       
    64     // The ConstructL from the base class CEUnitTestSuiteClass must be called.
       
    65     // It generates the test case table.
       
    66     CEUnitTestSuiteClass::ConstructL();
       
    67     }
       
    68 
       
    69 //  METHODS
       
    70 
       
    71 
       
    72 void t_glxupnprenderer::T_StartShowingL(  )
       
    73     {
       
    74     GlxUpnpRenderer::StartShowingL();
       
    75     }
       
    76     
       
    77 
       
    78 void t_glxupnprenderer::T_StopShowingL(  )
       
    79     {
       
    80     GlxUpnpRenderer::StopShowingL();
       
    81     }
       
    82     
       
    83 
       
    84 void t_glxupnprenderer::T_TestL(  )
       
    85     {
       
    86     
       
    87     }
       
    88     
       
    89 void t_glxupnprenderer::T_Status_Active(  )
       
    90     {
       
    91     //The pointer is created so it is active    
       
    92     T_StartShowingL();        
       
    93     EUNIT_ASSERT_EQUALS(NGlxUpnpRenderer::EActive,GlxUpnpRenderer::Status())
       
    94     T_StopShowingL();     
       
    95     }
       
    96     
       
    97  void t_glxupnprenderer::T_Status_Active_Renderer(  )
       
    98     {
       
    99     //UPNPShowComamndAvailable as Available
       
   100     T_StartShowingL();    
       
   101     CUpnpShowCommand::SetUpIsAvailable(ETrue);    
       
   102     //If it is available and the pointer is created then EActive
       
   103     EUNIT_ASSERT_EQUALS(NGlxUpnpRenderer::EActive,GlxUpnpRenderer::Status())    
       
   104     T_StopShowingL();    
       
   105     }
       
   106         
       
   107  
       
   108  void t_glxupnprenderer::T_Status_AvailableNotActive(  )
       
   109     {
       
   110     //UPNPShowComamndAvailable as Available
       
   111     CUpnpShowCommand::SetUpIsAvailable(ETrue);    
       
   112     //If it is available and the pointer is not created then EAvailableNotActive
       
   113     EUNIT_ASSERT_EQUALS(NGlxUpnpRenderer::EAvailableNotActive,GlxUpnpRenderer::Status())    
       
   114     }
       
   115     
       
   116 
       
   117 void t_glxupnprenderer::T_Status_NotAvailable(  )
       
   118     {    
       
   119     //UPNPShowComamndAvailable not available
       
   120     CUpnpShowCommand::SetUpIsAvailable(EFalse);     
       
   121     EUNIT_ASSERT_EQUALS(NGlxUpnpRenderer::ENotAvailable,GlxUpnpRenderer::Status())       
       
   122     }
       
   123 
       
   124     
       
   125 void t_glxupnprenderer::T_ShowVideoL(  )
       
   126     {
       
   127     GlxUpnpRenderer::ShowVideoL();
       
   128     }
       
   129     
       
   130     
       
   131 void t_glxupnprenderer::TearDown(  )  
       
   132     {
       
   133     
       
   134     }
       
   135         
       
   136 //  TEST TABLE
       
   137 EUNIT_BEGIN_TEST_TABLE(
       
   138     t_glxupnprenderer,
       
   139     "Testing the GlxUpnpRenderer.",
       
   140     "UNIT" )
       
   141 
       
   142 EUNIT_TEST(
       
   143     "Creation of Impl",
       
   144     "GlxUpnpRenderer",
       
   145     "StartShowingL",
       
   146     "UNIT",
       
   147     T_StartShowingL, T_TestL, T_StopShowingL)
       
   148     
       
   149 EUNIT_TEST(
       
   150     "Status-Active",
       
   151     "GlxUpnpRenderer",
       
   152     "Status",
       
   153     "UNIT",
       
   154     T_Status_Active, T_TestL, TearDown)
       
   155     
       
   156 EUNIT_TEST(
       
   157     "Status-Active-Renderer",
       
   158     "GlxUpnpRenderer",
       
   159     "Status",
       
   160     "UNIT",
       
   161     T_Status_Active_Renderer, T_TestL, TearDown)    
       
   162     
       
   163 EUNIT_TEST(
       
   164     "Status-AvailableNotActive",
       
   165     "GlxUpnpRenderer",
       
   166     "Status",
       
   167     "UNIT",
       
   168     T_Status_AvailableNotActive, T_TestL, TearDown)
       
   169     
       
   170 EUNIT_TEST(
       
   171     "Status-NotAvailable",
       
   172     "GlxUpnpRenderer",
       
   173     "Status",
       
   174     "UNIT",
       
   175     T_Status_NotAvailable, T_TestL, TearDown) 
       
   176 
       
   177     
       
   178 EUNIT_TEST(
       
   179     "ShowVideo",
       
   180     "GlxUpnpRenderer",
       
   181     "ShowVideoL",
       
   182     "UNIT",
       
   183     T_ShowVideoL,T_TestL,TearDown)    
       
   184  
       
   185 
       
   186 EUNIT_END_TEST_TABLE
       
   187 
       
   188 //  END OF FILE