graphicstest/uibench/src/trenderorientation.cpp
author hgs
Fri, 16 Jul 2010 11:45:55 +0300
changeset 116 171fae344dd4
child 136 62bb7c97884c
permissions -rw-r--r--
201026_3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
116
171fae344dd4 201026_3
hgs
parents:
diff changeset
     1
// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
171fae344dd4 201026_3
hgs
parents:
diff changeset
     2
// All rights reserved.
171fae344dd4 201026_3
hgs
parents:
diff changeset
     3
// This component and the accompanying materials are made available
171fae344dd4 201026_3
hgs
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
171fae344dd4 201026_3
hgs
parents:
diff changeset
     5
// which accompanies this distribution, and is available
171fae344dd4 201026_3
hgs
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
171fae344dd4 201026_3
hgs
parents:
diff changeset
     7
//
171fae344dd4 201026_3
hgs
parents:
diff changeset
     8
// Initial Contributors:
171fae344dd4 201026_3
hgs
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
171fae344dd4 201026_3
hgs
parents:
diff changeset
    10
//
171fae344dd4 201026_3
hgs
parents:
diff changeset
    11
// Contributors:
171fae344dd4 201026_3
hgs
parents:
diff changeset
    12
//
171fae344dd4 201026_3
hgs
parents:
diff changeset
    13
// Description:
171fae344dd4 201026_3
hgs
parents:
diff changeset
    14
//
171fae344dd4 201026_3
hgs
parents:
diff changeset
    15
171fae344dd4 201026_3
hgs
parents:
diff changeset
    16
/**
171fae344dd4 201026_3
hgs
parents:
diff changeset
    17
 @file
171fae344dd4 201026_3
hgs
parents:
diff changeset
    18
 @test
171fae344dd4 201026_3
hgs
parents:
diff changeset
    19
 @internalComponent - Internal Nokia test code 
171fae344dd4 201026_3
hgs
parents:
diff changeset
    20
*/
171fae344dd4 201026_3
hgs
parents:
diff changeset
    21
171fae344dd4 201026_3
hgs
parents:
diff changeset
    22
#include <w32std.h>
171fae344dd4 201026_3
hgs
parents:
diff changeset
    23
171fae344dd4 201026_3
hgs
parents:
diff changeset
    24
#include <wspublishandsubscribedata.h>
171fae344dd4 201026_3
hgs
parents:
diff changeset
    25
#include "trenderorientation.h"
171fae344dd4 201026_3
hgs
parents:
diff changeset
    26
171fae344dd4 201026_3
hgs
parents:
diff changeset
    27
const TInt KPublishTimeout  = 1000000;  // 1 second in microseconds
171fae344dd4 201026_3
hgs
parents:
diff changeset
    28
const TInt KNumIterations   = 20;
171fae344dd4 201026_3
hgs
parents:
diff changeset
    29
171fae344dd4 201026_3
hgs
parents:
diff changeset
    30
// Values for the device orientation that we receive via P&S from the Theme Server
171fae344dd4 201026_3
hgs
parents:
diff changeset
    31
// Must match those in renderorientationtracker.h, and, obviously, those used by the real theme server 
171fae344dd4 201026_3
hgs
parents:
diff changeset
    32
const TUid  KThemeOrientationCategory   = {0x20022E82}; // == KHbPsHardwareCoarseOrientationCategoryUid 
171fae344dd4 201026_3
hgs
parents:
diff changeset
    33
const TUint KThemeOrientationKey        = 0x4F726965; // == KHbPsHardwareCoarseOrientationKey 
171fae344dd4 201026_3
hgs
parents:
diff changeset
    34
171fae344dd4 201026_3
hgs
parents:
diff changeset
    35
void CWindowStuff::ConstructL()
171fae344dd4 201026_3
hgs
parents:
diff changeset
    36
    {
171fae344dd4 201026_3
hgs
parents:
diff changeset
    37
    User::LeaveIfError(iWs.Connect());
171fae344dd4 201026_3
hgs
parents:
diff changeset
    38
    iWs.SetAutoFlush(ETrue);
171fae344dd4 201026_3
hgs
parents:
diff changeset
    39
    
171fae344dd4 201026_3
hgs
parents:
diff changeset
    40
    iWindowGroup = RWindowGroup(iWs);
171fae344dd4 201026_3
hgs
parents:
diff changeset
    41
    User::LeaveIfError(iWindowGroup.Construct(reinterpret_cast<TUint32>(&iWindowGroup)));
171fae344dd4 201026_3
hgs
parents:
diff changeset
    42
    
171fae344dd4 201026_3
hgs
parents:
diff changeset
    43
    iChildWindow = RWindow(iWs);
171fae344dd4 201026_3
hgs
parents:
diff changeset
    44
    User::LeaveIfError(iChildWindow.Construct(iWindowGroup, reinterpret_cast<TUint32>(&iChildWindow)));
171fae344dd4 201026_3
hgs
parents:
diff changeset
    45
    }
171fae344dd4 201026_3
hgs
parents:
diff changeset
    46
171fae344dd4 201026_3
hgs
parents:
diff changeset
    47
CWindowStuff::~CWindowStuff()
171fae344dd4 201026_3
hgs
parents:
diff changeset
    48
    {
171fae344dd4 201026_3
hgs
parents:
diff changeset
    49
    Destroy();
171fae344dd4 201026_3
hgs
parents:
diff changeset
    50
    }
171fae344dd4 201026_3
hgs
parents:
diff changeset
    51
171fae344dd4 201026_3
hgs
parents:
diff changeset
    52
void CWindowStuff::Destroy()
171fae344dd4 201026_3
hgs
parents:
diff changeset
    53
    {
171fae344dd4 201026_3
hgs
parents:
diff changeset
    54
    iChildWindow.Close();
171fae344dd4 201026_3
hgs
parents:
diff changeset
    55
    iWindowGroup.Close();
171fae344dd4 201026_3
hgs
parents:
diff changeset
    56
    iWs.Close();    
171fae344dd4 201026_3
hgs
parents:
diff changeset
    57
    }
171fae344dd4 201026_3
hgs
parents:
diff changeset
    58
171fae344dd4 201026_3
hgs
parents:
diff changeset
    59
CTRenderOrientation::CTRenderOrientation()
171fae344dd4 201026_3
hgs
parents:
diff changeset
    60
    {
171fae344dd4 201026_3
hgs
parents:
diff changeset
    61
    // check that these two enums are aligned
171fae344dd4 201026_3
hgs
parents:
diff changeset
    62
    __ASSERT_COMPILE(EDisplayOrientationAuto == ENumWindowThings);
171fae344dd4 201026_3
hgs
parents:
diff changeset
    63
    
171fae344dd4 201026_3
hgs
parents:
diff changeset
    64
    SetTestStepName(KTRenderOrientation);
171fae344dd4 201026_3
hgs
parents:
diff changeset
    65
    }
171fae344dd4 201026_3
hgs
parents:
diff changeset
    66
171fae344dd4 201026_3
hgs
parents:
diff changeset
    67
CTRenderOrientation::~CTRenderOrientation()
171fae344dd4 201026_3
hgs
parents:
diff changeset
    68
    {
171fae344dd4 201026_3
hgs
parents:
diff changeset
    69
    }
171fae344dd4 201026_3
hgs
parents:
diff changeset
    70
171fae344dd4 201026_3
hgs
parents:
diff changeset
    71
TRenderOrientation CTRenderOrientation::GetRenderOrientationL()
171fae344dd4 201026_3
hgs
parents:
diff changeset
    72
    {    
171fae344dd4 201026_3
hgs
parents:
diff changeset
    73
    return GetOrientationL(iWsRenderOrientationProperty);    
171fae344dd4 201026_3
hgs
parents:
diff changeset
    74
    }
171fae344dd4 201026_3
hgs
parents:
diff changeset
    75
171fae344dd4 201026_3
hgs
parents:
diff changeset
    76
TRenderOrientation CTRenderOrientation::GetThemeOrientationL()
171fae344dd4 201026_3
hgs
parents:
diff changeset
    77
    {    
171fae344dd4 201026_3
hgs
parents:
diff changeset
    78
    return GetOrientationL(iThemeOrientationProperty);    
171fae344dd4 201026_3
hgs
parents:
diff changeset
    79
    }
171fae344dd4 201026_3
hgs
parents:
diff changeset
    80
171fae344dd4 201026_3
hgs
parents:
diff changeset
    81
TRenderOrientation CTRenderOrientation::GetOrientationL(RProperty& aProperty)
171fae344dd4 201026_3
hgs
parents:
diff changeset
    82
    {
171fae344dd4 201026_3
hgs
parents:
diff changeset
    83
    TInt orientation=EDisplayOrientationNormal;
171fae344dd4 201026_3
hgs
parents:
diff changeset
    84
    User::LeaveIfError(aProperty.Get(orientation));
171fae344dd4 201026_3
hgs
parents:
diff changeset
    85
    
171fae344dd4 201026_3
hgs
parents:
diff changeset
    86
    TESTL(orientation >= EDisplayOrientationNormal);
171fae344dd4 201026_3
hgs
parents:
diff changeset
    87
    TESTL(orientation < EDisplayOrientationAuto);    
171fae344dd4 201026_3
hgs
parents:
diff changeset
    88
    
171fae344dd4 201026_3
hgs
parents:
diff changeset
    89
    return static_cast<TRenderOrientation>(orientation);    
171fae344dd4 201026_3
hgs
parents:
diff changeset
    90
    }
171fae344dd4 201026_3
hgs
parents:
diff changeset
    91
171fae344dd4 201026_3
hgs
parents:
diff changeset
    92
void CTRenderOrientation::TestOrientationChangeL(const TDesC& aStepName, TTestPhase aTestPhase)
171fae344dd4 201026_3
hgs
parents:
diff changeset
    93
    {
171fae344dd4 201026_3
hgs
parents:
diff changeset
    94
    SetTestStepID(aStepName);
171fae344dd4 201026_3
hgs
parents:
diff changeset
    95
    
171fae344dd4 201026_3
hgs
parents:
diff changeset
    96
    if(EThemeOrientationChange == aTestPhase)
171fae344dd4 201026_3
hgs
parents:
diff changeset
    97
        {               
171fae344dd4 201026_3
hgs
parents:
diff changeset
    98
        TESTL(EDisplayOrientationNormal == GetThemeOrientationL());
171fae344dd4 201026_3
hgs
parents:
diff changeset
    99
        iWindowStuff[EFirstWindowThing].Session().IndicateAppOrientation(EDisplayOrientationAuto);        
171fae344dd4 201026_3
hgs
parents:
diff changeset
   100
        }
171fae344dd4 201026_3
hgs
parents:
diff changeset
   101
    
171fae344dd4 201026_3
hgs
parents:
diff changeset
   102
    TInt renderOrientation = GetRenderOrientationL();
171fae344dd4 201026_3
hgs
parents:
diff changeset
   103
    
171fae344dd4 201026_3
hgs
parents:
diff changeset
   104
    // For consistancy, check that we are starting from the same orientation
171fae344dd4 201026_3
hgs
parents:
diff changeset
   105
    TESTL(EDisplayOrientationNormal == renderOrientation);    
171fae344dd4 201026_3
hgs
parents:
diff changeset
   106
    
171fae344dd4 201026_3
hgs
parents:
diff changeset
   107
    // Set-up the timer
171fae344dd4 201026_3
hgs
parents:
diff changeset
   108
    iProfiler->InitResults();
171fae344dd4 201026_3
hgs
parents:
diff changeset
   109
    iTimingsTaken = 0;    
171fae344dd4 201026_3
hgs
parents:
diff changeset
   110
    
171fae344dd4 201026_3
hgs
parents:
diff changeset
   111
    // repeat numerous times to get a decent average
171fae344dd4 201026_3
hgs
parents:
diff changeset
   112
    for(TInt iterations=0; iterations < KNumIterations; ++iterations)
171fae344dd4 201026_3
hgs
parents:
diff changeset
   113
        {
171fae344dd4 201026_3
hgs
parents:
diff changeset
   114
        renderOrientation = GetRenderOrientationL();
171fae344dd4 201026_3
hgs
parents:
diff changeset
   115
        // For consistancy, check that we are starting from the same orientation
171fae344dd4 201026_3
hgs
parents:
diff changeset
   116
        TESTL(EDisplayOrientationNormal == renderOrientation);           
171fae344dd4 201026_3
hgs
parents:
diff changeset
   117
        
171fae344dd4 201026_3
hgs
parents:
diff changeset
   118
        // loop through the orientations, ending up changing back to normal
171fae344dd4 201026_3
hgs
parents:
diff changeset
   119
        for(++renderOrientation; renderOrientation <= EDisplayOrientationAuto; ++renderOrientation)
171fae344dd4 201026_3
hgs
parents:
diff changeset
   120
            {
171fae344dd4 201026_3
hgs
parents:
diff changeset
   121
            // % can be slow, do it outside of the timing
171fae344dd4 201026_3
hgs
parents:
diff changeset
   122
            TRenderOrientation testOrientation = static_cast<TRenderOrientation>(renderOrientation%EDisplayOrientationAuto);
171fae344dd4 201026_3
hgs
parents:
diff changeset
   123
            
171fae344dd4 201026_3
hgs
parents:
diff changeset
   124
            iWsRenderOrientationProperty.Subscribe(iRenderOrientationStatus);            
171fae344dd4 201026_3
hgs
parents:
diff changeset
   125
            // start the timeout timer
171fae344dd4 201026_3
hgs
parents:
diff changeset
   126
            iTimeoutTimer.After(iTimeoutStatus, KPublishTimeout);
171fae344dd4 201026_3
hgs
parents:
diff changeset
   127
            // start the results timer
171fae344dd4 201026_3
hgs
parents:
diff changeset
   128
            iProfiler->StartTimer();
171fae344dd4 201026_3
hgs
parents:
diff changeset
   129
            
171fae344dd4 201026_3
hgs
parents:
diff changeset
   130
            switch(aTestPhase)
171fae344dd4 201026_3
hgs
parents:
diff changeset
   131
                {
171fae344dd4 201026_3
hgs
parents:
diff changeset
   132
                case EIndicatedOrientationChange:
171fae344dd4 201026_3
hgs
parents:
diff changeset
   133
                    // Do the indicated orientation Change
171fae344dd4 201026_3
hgs
parents:
diff changeset
   134
                    iWindowStuff[EFirstWindowThing].Session().IndicateAppOrientation(testOrientation);
171fae344dd4 201026_3
hgs
parents:
diff changeset
   135
                    break;
171fae344dd4 201026_3
hgs
parents:
diff changeset
   136
                    
171fae344dd4 201026_3
hgs
parents:
diff changeset
   137
                case EWindowOrdinalChange:
171fae344dd4 201026_3
hgs
parents:
diff changeset
   138
                    // move the relevant window group to the front
171fae344dd4 201026_3
hgs
parents:
diff changeset
   139
                    // N.B. this will go wrong if the number of orientations and windows are not equal
171fae344dd4 201026_3
hgs
parents:
diff changeset
   140
                    iWindowStuff[testOrientation].WindowGroup().SetOrdinalPosition(0);
171fae344dd4 201026_3
hgs
parents:
diff changeset
   141
                    break;
171fae344dd4 201026_3
hgs
parents:
diff changeset
   142
                    
171fae344dd4 201026_3
hgs
parents:
diff changeset
   143
                case EThemeOrientationChange:
171fae344dd4 201026_3
hgs
parents:
diff changeset
   144
                    // Needs the focus window to be in auto mode
171fae344dd4 201026_3
hgs
parents:
diff changeset
   145
                    iThemeOrientationProperty.Set(testOrientation);
171fae344dd4 201026_3
hgs
parents:
diff changeset
   146
                    break;
171fae344dd4 201026_3
hgs
parents:
diff changeset
   147
                    
171fae344dd4 201026_3
hgs
parents:
diff changeset
   148
                default:
171fae344dd4 201026_3
hgs
parents:
diff changeset
   149
                    TESTL(EFalse);
171fae344dd4 201026_3
hgs
parents:
diff changeset
   150
                }
171fae344dd4 201026_3
hgs
parents:
diff changeset
   151
        
171fae344dd4 201026_3
hgs
parents:
diff changeset
   152
            // Wait for the update to have been published ( or time out while waiting )
171fae344dd4 201026_3
hgs
parents:
diff changeset
   153
            User::WaitForRequest(iRenderOrientationStatus, iTimeoutStatus);
171fae344dd4 201026_3
hgs
parents:
diff changeset
   154
            
171fae344dd4 201026_3
hgs
parents:
diff changeset
   155
            iProfiler->MarkResultSetL();
171fae344dd4 201026_3
hgs
parents:
diff changeset
   156
            ++iTimingsTaken;
171fae344dd4 201026_3
hgs
parents:
diff changeset
   157
            
171fae344dd4 201026_3
hgs
parents:
diff changeset
   158
            if(KErrNone != iRenderOrientationStatus.Int())
171fae344dd4 201026_3
hgs
parents:
diff changeset
   159
                {
171fae344dd4 201026_3
hgs
parents:
diff changeset
   160
                // timed out
171fae344dd4 201026_3
hgs
parents:
diff changeset
   161
                iWsRenderOrientationProperty.Cancel();                
171fae344dd4 201026_3
hgs
parents:
diff changeset
   162
                TESTL(EFalse);
171fae344dd4 201026_3
hgs
parents:
diff changeset
   163
                }
171fae344dd4 201026_3
hgs
parents:
diff changeset
   164
            else
171fae344dd4 201026_3
hgs
parents:
diff changeset
   165
                {
171fae344dd4 201026_3
hgs
parents:
diff changeset
   166
                // Check that it is actually the expected orientation
171fae344dd4 201026_3
hgs
parents:
diff changeset
   167
                TESTL(GetRenderOrientationL() == testOrientation);
171fae344dd4 201026_3
hgs
parents:
diff changeset
   168
                }
171fae344dd4 201026_3
hgs
parents:
diff changeset
   169
171fae344dd4 201026_3
hgs
parents:
diff changeset
   170
            if(KRequestPending == iTimeoutStatus.Int())
171fae344dd4 201026_3
hgs
parents:
diff changeset
   171
                {
171fae344dd4 201026_3
hgs
parents:
diff changeset
   172
                // as expected, so cancel the timeout timer
171fae344dd4 201026_3
hgs
parents:
diff changeset
   173
                iTimeoutTimer.Cancel();
171fae344dd4 201026_3
hgs
parents:
diff changeset
   174
                }
171fae344dd4 201026_3
hgs
parents:
diff changeset
   175
            else
171fae344dd4 201026_3
hgs
parents:
diff changeset
   176
                {
171fae344dd4 201026_3
hgs
parents:
diff changeset
   177
                // timed out
171fae344dd4 201026_3
hgs
parents:
diff changeset
   178
                TESTL(EFalse);
171fae344dd4 201026_3
hgs
parents:
diff changeset
   179
                }
171fae344dd4 201026_3
hgs
parents:
diff changeset
   180
            }
171fae344dd4 201026_3
hgs
parents:
diff changeset
   181
        }    
171fae344dd4 201026_3
hgs
parents:
diff changeset
   182
    
171fae344dd4 201026_3
hgs
parents:
diff changeset
   183
    // wrap it up    
171fae344dd4 201026_3
hgs
parents:
diff changeset
   184
    iProfiler->ResultsAnalysis(KTRenderOrientation,KErrNotFound,ENone,ENone,iTimingsTaken);
171fae344dd4 201026_3
hgs
parents:
diff changeset
   185
    }
171fae344dd4 201026_3
hgs
parents:
diff changeset
   186
171fae344dd4 201026_3
hgs
parents:
diff changeset
   187
TVerdict CTRenderOrientation::doTestStepL()
171fae344dd4 201026_3
hgs
parents:
diff changeset
   188
    {     
171fae344dd4 201026_3
hgs
parents:
diff changeset
   189
    INFO_PRINTF1(_L("Testing: Indicated Orientation Change"));
171fae344dd4 201026_3
hgs
parents:
diff changeset
   190
    TestOrientationChangeL(_L("GRAPHICS-UI-BENCH-0xxx1"), EIndicatedOrientationChange);
171fae344dd4 201026_3
hgs
parents:
diff changeset
   191
    
171fae344dd4 201026_3
hgs
parents:
diff changeset
   192
    INFO_PRINTF1(_L("Testing: Window Ordinal Position Change"));
171fae344dd4 201026_3
hgs
parents:
diff changeset
   193
    TestOrientationChangeL(_L("GRAPHICS-UI-BENCH-0xxx2"), EWindowOrdinalChange);
171fae344dd4 201026_3
hgs
parents:
diff changeset
   194
    
171fae344dd4 201026_3
hgs
parents:
diff changeset
   195
    INFO_PRINTF1(_L("Testing: Theme Orientation Change"));
171fae344dd4 201026_3
hgs
parents:
diff changeset
   196
    TestOrientationChangeL(_L("GRAPHICS-UI-BENCH-0xxx3"), EThemeOrientationChange);
171fae344dd4 201026_3
hgs
parents:
diff changeset
   197
    
171fae344dd4 201026_3
hgs
parents:
diff changeset
   198
    return TestStepResult();    
171fae344dd4 201026_3
hgs
parents:
diff changeset
   199
    }
171fae344dd4 201026_3
hgs
parents:
diff changeset
   200
171fae344dd4 201026_3
hgs
parents:
diff changeset
   201
_LIT(KThemeServerPropertyDefine, "twsthemeserverpropertydefine.exe");
171fae344dd4 201026_3
hgs
parents:
diff changeset
   202
_LIT(KThemeServerPropertyDefineCmdDefine, "define");
171fae344dd4 201026_3
hgs
parents:
diff changeset
   203
_LIT(KThemeServerPropertyDefineCmdDelete, "delete");   
171fae344dd4 201026_3
hgs
parents:
diff changeset
   204
   
171fae344dd4 201026_3
hgs
parents:
diff changeset
   205
void CTRenderOrientation::ThemeServerProperty(const TDesC& aCmd)
171fae344dd4 201026_3
hgs
parents:
diff changeset
   206
    {
171fae344dd4 201026_3
hgs
parents:
diff changeset
   207
    /* This Process called with the argument KThemeServerPropertyDefineCmdDelete, deletes 
171fae344dd4 201026_3
hgs
parents:
diff changeset
   208
       the theme server RProperty. This is because an RProperty can only be defined and 
171fae344dd4 201026_3
hgs
parents:
diff changeset
   209
       deleted from within a process with the same UID3 as the RProperty catogory you are 
171fae344dd4 201026_3
hgs
parents:
diff changeset
   210
       trying to define/delete.*/
171fae344dd4 201026_3
hgs
parents:
diff changeset
   211
    RProcess themeServerPropertyDefine;
171fae344dd4 201026_3
hgs
parents:
diff changeset
   212
    TInt err = themeServerPropertyDefine.Create(KThemeServerPropertyDefine, aCmd);
171fae344dd4 201026_3
hgs
parents:
diff changeset
   213
    if (KErrNone != err)
171fae344dd4 201026_3
hgs
parents:
diff changeset
   214
        {
171fae344dd4 201026_3
hgs
parents:
diff changeset
   215
        _LIT(KLog, "themeServerPropertyDefine.Create() failed with error: %d");
171fae344dd4 201026_3
hgs
parents:
diff changeset
   216
        INFO_PRINTF2(KLog, err);
171fae344dd4 201026_3
hgs
parents:
diff changeset
   217
        TEST(EFalse);        
171fae344dd4 201026_3
hgs
parents:
diff changeset
   218
        }
171fae344dd4 201026_3
hgs
parents:
diff changeset
   219
    
171fae344dd4 201026_3
hgs
parents:
diff changeset
   220
    //wait for themeServerPropertyDefine process to terminate
171fae344dd4 201026_3
hgs
parents:
diff changeset
   221
    TRequestStatus themeServerPropertyDefineLogonStatus;
171fae344dd4 201026_3
hgs
parents:
diff changeset
   222
    themeServerPropertyDefine.Logon(themeServerPropertyDefineLogonStatus);
171fae344dd4 201026_3
hgs
parents:
diff changeset
   223
    themeServerPropertyDefine.Resume();
171fae344dd4 201026_3
hgs
parents:
diff changeset
   224
    User::WaitForRequest(themeServerPropertyDefineLogonStatus);
171fae344dd4 201026_3
hgs
parents:
diff changeset
   225
    if (themeServerPropertyDefineLogonStatus != KErrNone)
171fae344dd4 201026_3
hgs
parents:
diff changeset
   226
        {
171fae344dd4 201026_3
hgs
parents:
diff changeset
   227
        _LIT(KLog, "themeServerPropertyDefine.Logon() failed with error: %d");
171fae344dd4 201026_3
hgs
parents:
diff changeset
   228
        INFO_PRINTF2(KLog, themeServerPropertyDefineLogonStatus);
171fae344dd4 201026_3
hgs
parents:
diff changeset
   229
        TEST(EFalse);        
171fae344dd4 201026_3
hgs
parents:
diff changeset
   230
        }
171fae344dd4 201026_3
hgs
parents:
diff changeset
   231
    themeServerPropertyDefine.Close();    
171fae344dd4 201026_3
hgs
parents:
diff changeset
   232
    }
171fae344dd4 201026_3
hgs
parents:
diff changeset
   233
171fae344dd4 201026_3
hgs
parents:
diff changeset
   234
TVerdict CTRenderOrientation::doTestStepPreambleL()
171fae344dd4 201026_3
hgs
parents:
diff changeset
   235
    {
171fae344dd4 201026_3
hgs
parents:
diff changeset
   236
    // Create in reverse order so that windowThing 0 is at the front
171fae344dd4 201026_3
hgs
parents:
diff changeset
   237
    for(TInt windowThing = ENumWindowThings - 1; windowThing >= 0 ; --windowThing)
171fae344dd4 201026_3
hgs
parents:
diff changeset
   238
        {
171fae344dd4 201026_3
hgs
parents:
diff changeset
   239
        iWindowStuff[windowThing].ConstructL();
171fae344dd4 201026_3
hgs
parents:
diff changeset
   240
        TRenderOrientation orientation = static_cast<TRenderOrientation>(windowThing%EDisplayOrientationAuto);
171fae344dd4 201026_3
hgs
parents:
diff changeset
   241
        iWindowStuff[windowThing].Session().IndicateAppOrientation(orientation);
171fae344dd4 201026_3
hgs
parents:
diff changeset
   242
        iWindowStuff[windowThing].WindowGroup().SetOrdinalPosition(0);
171fae344dd4 201026_3
hgs
parents:
diff changeset
   243
        }
171fae344dd4 201026_3
hgs
parents:
diff changeset
   244
    
171fae344dd4 201026_3
hgs
parents:
diff changeset
   245
    User::LeaveIfError(iWsRenderOrientationProperty.Attach(KRenderOrientationCategory, KRenderOrientationKey));
171fae344dd4 201026_3
hgs
parents:
diff changeset
   246
    
171fae344dd4 201026_3
hgs
parents:
diff changeset
   247
    ThemeServerProperty(KThemeServerPropertyDefineCmdDefine);
171fae344dd4 201026_3
hgs
parents:
diff changeset
   248
    User::LeaveIfError(iThemeOrientationProperty.Attach(KThemeOrientationCategory, KThemeOrientationKey));
171fae344dd4 201026_3
hgs
parents:
diff changeset
   249
    
171fae344dd4 201026_3
hgs
parents:
diff changeset
   250
    User::LeaveIfError(iTimeoutTimer.CreateLocal());
171fae344dd4 201026_3
hgs
parents:
diff changeset
   251
    
171fae344dd4 201026_3
hgs
parents:
diff changeset
   252
    return CTe_graphicsperformanceSuiteStepBase::doTestStepPreambleL();
171fae344dd4 201026_3
hgs
parents:
diff changeset
   253
    }
171fae344dd4 201026_3
hgs
parents:
diff changeset
   254
171fae344dd4 201026_3
hgs
parents:
diff changeset
   255
TVerdict CTRenderOrientation::doTestStepPostambleL()
171fae344dd4 201026_3
hgs
parents:
diff changeset
   256
    {
171fae344dd4 201026_3
hgs
parents:
diff changeset
   257
    iTimeoutTimer.Close();
171fae344dd4 201026_3
hgs
parents:
diff changeset
   258
    
171fae344dd4 201026_3
hgs
parents:
diff changeset
   259
    iThemeOrientationProperty.Close();
171fae344dd4 201026_3
hgs
parents:
diff changeset
   260
    ThemeServerProperty(KThemeServerPropertyDefineCmdDelete);    
171fae344dd4 201026_3
hgs
parents:
diff changeset
   261
    iWsRenderOrientationProperty.Close();
171fae344dd4 201026_3
hgs
parents:
diff changeset
   262
    
171fae344dd4 201026_3
hgs
parents:
diff changeset
   263
    for(TInt windowThing = 0; windowThing < ENumWindowThings; ++windowThing)
171fae344dd4 201026_3
hgs
parents:
diff changeset
   264
        {
171fae344dd4 201026_3
hgs
parents:
diff changeset
   265
        iWindowStuff[windowThing].Destroy();
171fae344dd4 201026_3
hgs
parents:
diff changeset
   266
        }
171fae344dd4 201026_3
hgs
parents:
diff changeset
   267
    
171fae344dd4 201026_3
hgs
parents:
diff changeset
   268
    return CTe_graphicsperformanceSuiteStepBase::doTestStepPostambleL();
171fae344dd4 201026_3
hgs
parents:
diff changeset
   269
    }