//
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
//
//! @file
//! @SYMTestSuiteName		GRAPHICS-WSERV-DsaSession-PublicApi
//! @SYMScriptTestEnvironment	This test script requires a basic ROM.

///////////////////////////////////////////////////////////////////////////////
// GRAPHICS-WSERV-DsaSession-PublicApi.script
//
// Tests all public elements of the RDirectScreenAccess class
// as a means of confidence that the API works as expected.
//
// The purpose is to provide a regression test suite of PublishedAll APIs for
// RDirectScreenAccess related classes.
// Negative testing is performed to confirm that correct errors are returned
// when incorrect parameters are given.
//
// The tests are fully automated.
///////////////////////////////////////////////////////////////////////////////

LOAD_SUITE T_GraphicsWservAPI

// ****************************************************************************
// RDirectScreenAccess
// ****************************************************************************

START_TESTCASE GRAPHICS-WSERV-DsaSession-PublicApi-0001
//! @SYMTestCaseID          GRAPHICS-WSERV-DsaSession-PublicApi-0001
//! @SYMAPI                 RDirectScreenAccess::RDirectScreenAccess()
//! @SYMAuthor              Jeffery Zhao
//! @SYMCreationDate        19/12/2007
//! @SYMTestCaseDesc        Create with default constructor but not initialise a RDirectScreenAccess object.
//! @SYMTestActions         1.Create RDirectScreenAccess.
//! @SYMTestStatus          Implemented
//! @SYMTestPriority        High
//! @SYMTestExpectedResults RDirectScreenAccess object was created without causing panic
//! @SYMTestType            CIT
    START_TEST_BLOCK    10        T_GraphicsWservAPI    \graphics\GRAPHICS-WSERV-DsaSession-PublicApi.ini
        CREATE_OBJECT   RDirectScreenAccess   rdsa
        COMMAND         rdsa    new
        COMMAND         rdsa    Close
    END_TEST_BLOCK
END_TESTCASE GRAPHICS-WSERV-DsaSession-PublicApi-0001


START_TESTCASE GRAPHICS-WSERV-DsaSession-PublicApi-0002
//! @SYMTestCaseID          GRAPHICS-WSERV-DsaSession-PublicApi-0002
//! @SYMAPI                 RDirectScreenAccess::RDirectScreenAccess(RWsSession{ref})
//! @SYMAuthor              Jeffery Zhao
//! @SYMCreationDate        19/12/2007
//! @SYMTestCaseDesc        Create but not initialise a RDirectScreenAccess object attached with RWsSession.
//! @SYMTestActions         1.  Create RWsSession.
//!                         2.  Create RDirectScreenAccess.
//!                         3.  Close RWsSession.
//! @SYMTestStatus          Implemented
//! @SYMTestPriority        High
//! @SYMTestExpectedResults RDirectScreenAccess object was created without causing panic
//! @SYMTestType            CIT
    START_TEST_BLOCK    10        T_GraphicsWservAPI    \graphics\GRAPHICS-WSERV-DsaSession-PublicApi.ini
        CREATE_OBJECT   RWsSession            ws
        CREATE_OBJECT   RDirectScreenAccess   rdsa
        COMMAND         ws     new
        COMMAND         ws     Connect
        COMMAND         rdsa   new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         rdsa   Close
        COMMAND         ws     Close
    END_TEST_BLOCK
END_TESTCASE GRAPHICS-WSERV-DsaSession-PublicApi-0002



START_TESTCASE GRAPHICS-WSERV-DsaSession-PublicApi-0003
//! @SYMTestCaseID          GRAPHICS-WSERV-DsaSession-PublicApi-0003
//! @SYMAPI                 RDirectScreenAccess::Construct()
//! @SYMAuthor              Jeffery Zhao
//! @SYMCreationDate        19/12/2007
//! @SYMTestCaseDesc        Create and initialise a RDirectScreenAccess object with construct.
//! @SYMTestActions         1. Create RWsSession.
//!                         2. Create RDirectScreenAccess.
//!                         3. Construct RDirectScreenAccess.
//!                         4. Close RWsSession & RDirectScreenAccess.
//! @SYMTestStatus          Implemented
//! @SYMTestPriority        High
//! @SYMTestExpectedResults RDirectScreenAccess object was created and constructed without causing panic
//! @SYMTestType            CIT
    START_TEST_BLOCK    10        T_GraphicsWservAPI    \graphics\GRAPHICS-WSERV-DsaSession-PublicApi.ini
        CREATE_OBJECT       RWsSession            ws
        CREATE_OBJECT       RDirectScreenAccess   rdsa
        COMMAND         ws     new
        COMMAND         ws     Connect
        COMMAND         rdsa   new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         rdsa   Construct
        COMMAND         rdsa   Close
        COMMAND         ws     Close
    END_TEST_BLOCK
END_TESTCASE GRAPHICS-WSERV-DsaSession-PublicApi-0003


START_TESTCASE GRAPHICS-WSERV-DsaSession-PublicApi-0004
//! @SYMTestCaseID          GRAPHICS-WSERV-DsaSession-PublicApi-0004
//! @SYMAPI                 RDirectScreenAccess::Request(RRegion{ptr}{ref}, TRequestStatus{ref}, const RWindowBase{ref})
//! @SYMAuthor              Jeffery Zhao
//! @SYMCreationDate        19/12/2007
//! @SYMTestCaseDesc        Create a RDirectScreenAccess object and issue a request.                        
//! @SYMTestActions         1. Create RWsSession,RWindow,CWindowGc,CWsScreenDevice.
//!                         2. Create RDirectScreenAccess.
//!                         3. Call CWsScreenDevice::CreateContext()
//!                         4. Construct RWindow and call RWindow::SetShape & Activate
//!                         5. Create RDirectScreenAccess and call RDirectScreenAccess::Construct().
//!                         6. Call RDirectScreenAccess::Request and outstanding.
//!                         7. Destruct and close all object created. 
//! @SYMTestStatus          Implemented
//! @SYMTestPriority        High
//! @SYMTestExpectedResults 1.RDirectScreenAccess object was created successfully 2. Issue a DSA request successfully.
//!                         3. Check all the return value as expected.
//! @SYMTestType            CIT
    START_TEST_BLOCK    10        T_GraphicsWservAPI    \graphics\GRAPHICS-WSERV-DsaSession-PublicApi.ini
        CREATE_OBJECT   RWsSession                ws
        CREATE_OBJECT   RWindowGroup              wingrp
        CREATE_OBJECT   RWindow                   win           
        CREATE_OBJECT   CWsScreenDevice           scrdev
        CREATE_OBJECT   CWindowGc                 wingc
        CREATE_OBJECT   RDirectScreenAccess       rdsa
        COMMAND         ws            new
        COMMAND         ws            Connect
        COMMAND         scrdev        new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         scrdev        Construct        
        COMMAND         scrdev        CreateContext  GRAPHICS-WSERV-DsaSession-Setup-0004-0001-CreateContext_command005
        COMMAND         wingrp        new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         wingrp        Construct      GRAPHICS-WSERV-DsaSession-Setup-0004-0001-Construct_command007
        COMMAND         win           new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         win           Construct      GRAPHICS-WSERV-DsaSession-Setup-0004-0001-Construct_command009
        COMMAND         win           SetShape       GRAPHICS-WSERV-DsaSession-Setup-0004-0001-SetShape_command010
        COMMAND         win           Activate
        COMMAND         rdsa          new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         rdsa          Construct
        COMMAND         !AsyncError=-3          rdsa          Request        GRAPHICS-WSERV-DsaSession-PublicApi-0004-0001-Request_command014
        COMMAND         rdsa          Completed
        COMMAND         rdsa          Close
        OUTSTANDING
        COMMAND         wingc        ~
        COMMAND         win           Close
        COMMAND         wingrp        Close
        COMMAND         scrdev        ~
        COMMAND         ws            Close
    END_TEST_BLOCK
END_TESTCASE GRAPHICS-WSERV-DsaSession-PublicApi-0004


START_TESTCASE GRAPHICS-WSERV-DsaSession-PublicApi-0005
//! @SYMTestCaseID          GRAPHICS-WSERV-DsaSession-PublicApi-0005
//! @SYMAPI                 RDirectScreenAccess::Completed()
//! @SYMAuthor              Jeffery Zhao
//! @SYMCreationDate        19/12/2007
//! @SYMTestCaseDesc        Create a RDirectScreenAccess object and request,and complete without panic.
//! @SYMTestActions         1. Create RWsSession,RWindow,CWindowGc,CWsScreenDevice.
//!                         2. Create RDirectScreenAccess.
//!                         3. Call CWsScreenDevice::CreateContext()
//!                         4. Construct RWindow and call RWindow::SetShape & Activate
//!                         5. Create RDirectScreenAccess and call RDirectScreenAccess::Construct().
//!                         6. Call RDirectScreenAccess::Request and outstanding.
//!                         7. Call CWindowGc::Activate,RWindow::BeginRedraw,CWindowGc::DrawLine,RWindow::EndRedraw,CWindowGc::Deactivate
//!                         8. Call RDirectScreenAccess::Completed().
//!                         9. Destruct and close all created object.
//! @SYMTestStatus          Implemented
//! @SYMTestPriority        High
//! @SYMTestExpectedResults 1.RDirectScreenAccess Completed successfully. 2. Request return value should be KErrCancel(-3).
//! @SYMTestType            CIT
    START_TEST_BLOCK    10        T_GraphicsWservAPI    \graphics\GRAPHICS-WSERV-DsaSession-PublicApi.ini
        CREATE_OBJECT   RWsSession                ws
        CREATE_OBJECT   RWindowGroup              wingrp
        CREATE_OBJECT   RWindow                   win           
        CREATE_OBJECT   CWsScreenDevice           scrdev      
        CREATE_OBJECT   CWindowGc                 wingc
        CREATE_OBJECT   RDirectScreenAccess       rdsa
        COMMAND         ws            new
        COMMAND         ws            Connect
        COMMAND         scrdev        new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         scrdev        Construct        
        COMMAND         scrdev        CreateContext  GRAPHICS-WSERV-DsaSession-Setup-0004-0001-CreateContext_command005
        COMMAND         wingrp        new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         wingrp        Construct      GRAPHICS-WSERV-DsaSession-Setup-0004-0001-Construct_command007
        COMMAND         win           new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         win           Construct      GRAPHICS-WSERV-DsaSession-Setup-0004-0001-Construct_command009
        COMMAND         win           SetShape       GRAPHICS-WSERV-DsaSession-Setup-0004-0001-SetShape_command010
        COMMAND         win           Activate
        COMMAND         rdsa          new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         rdsa          Construct
        COMMAND         !AsyncError=-3          rdsa          Request        GRAPHICS-WSERV-DsaSession-PublicApi-0004-0001-Request_command014
        COMMAND         wingc         Activate       GRAPHICS-WSERV-DsaSession-Setup-0004-0001-Activate_command015
        COMMAND         win           BeginRedraw
        COMMAND         wingc         DrawLine       GRAPHICS-WSERV-DsaSession-Setup-0004-0001-DrawLine_command017
        COMMAND         win           EndRedraw
        COMMAND         wingc         Deactivate
        COMMAND         wingc         ~
        COMMAND         rdsa          Completed
        COMMAND         rdsa          Close
        OUTSTANDING
        COMMAND         win           Close
        COMMAND         wingrp        Close
        COMMAND         scrdev        ~
        COMMAND         ws            Close
    END_TEST_BLOCK
END_TESTCASE GRAPHICS-WSERV-DsaSession-PublicApi-0005


START_TESTCASE GRAPHICS-WSERV-DsaSession-PublicApi-0006
//! @SYMTestCaseID          GRAPHICS-WSERV-DsaSession-PublicApi-0006
//! @SYMAPI                 RDirectScreenAccess::Cancel()
//! @SYMAuthor              Jeffery Zhao
//! @SYMCreationDate        19/12/2007
//! @SYMTestCaseDesc        Create a RDirectScreenAccess object and request,and then Cancel without panic.
//! @SYMTestActions         1.  Create RWsSession,RWindow,CWindowGc,CWsScreenDevice.
//!                         2.  Create RDirectScreenAccess.
//!                         3.  Call CWsScreenDevice::CreateContext()
//!                         4.  Construct RWindow and call RWindow::SetShape & Activate
//!                         5.  Create RDirectScreenAccess and call RDirectScreenAccess::Construct().
//!                         6.  Call RDirectScreenAccess::Request and outstanding.
//!                         7.  Call CWindowGc::Activate,RWindow::BeginRedraw,CWindowGc::DrawLine,RWindow::EndRedraw,CWindowGc::Deactivate
//!                         8.  Call RDirectScreenAccess::Cancel().
//!                         9.  Destruct and close all created object.
//! @SYMTestStatus            Implemented
//! @SYMTestPriority        High
//! @SYMTestExpectedResults  1. RDirectScreenAccess object was canceled successfully. 2. Request return value should be KErrCancel(-3) after cancled.
//! @SYMTestType            CIT
    START_TEST_BLOCK    10        T_GraphicsWservAPI    \graphics\GRAPHICS-WSERV-DsaSession-PublicApi.ini
        CREATE_OBJECT   RWsSession                ws
        CREATE_OBJECT   RWindowGroup              wingrp
        CREATE_OBJECT   RWindow                   win           
        CREATE_OBJECT   CWsScreenDevice           scrdev      
        CREATE_OBJECT   CWindowGc                 wingc
        CREATE_OBJECT   RDirectScreenAccess       rdsa
        COMMAND         ws            new
        COMMAND         ws            Connect
        COMMAND         scrdev        new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         scrdev        Construct        
        COMMAND         scrdev        CreateContext  GRAPHICS-WSERV-DsaSession-Setup-0004-0001-CreateContext_command005
        COMMAND         wingrp        new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         wingrp        Construct      GRAPHICS-WSERV-DsaSession-Setup-0004-0001-Construct_command007
        COMMAND         win           new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         win           Construct      GRAPHICS-WSERV-DsaSession-Setup-0004-0001-Construct_command009
        COMMAND         win           SetShape       GRAPHICS-WSERV-DsaSession-Setup-0004-0001-SetShape_command010
        COMMAND         win           Activate
        COMMAND         rdsa          new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         rdsa          Construct
        COMMAND         !AsyncError=-3          rdsa          Request        GRAPHICS-WSERV-DsaSession-PublicApi-0004-0001-Request_command014
        COMMAND         wingc         Activate       GRAPHICS-WSERV-DsaSession-Setup-0004-0001-Activate_command015
        COMMAND         win           BeginRedraw
        COMMAND         wingc         DrawLine       GRAPHICS-WSERV-DsaSession-Setup-0004-0001-DrawLine_command017
        COMMAND         win           EndRedraw
        COMMAND         wingc         Deactivate
        COMMAND         wingc         ~
        COMMAND         scrdev        ~
        COMMAND         rdsa          Cancel
        OUTSTANDING
        COMMAND         rdsa          Close
        COMMAND         win           Close
        COMMAND         wingrp        Close
        COMMAND         scrdev         ~
        COMMAND         ws            Close
    END_TEST_BLOCK
END_TESTCASE GRAPHICS-WSERV-DsaSession-PublicApi-0006


START_TESTCASE GRAPHICS-WSERV-DsaSession-PublicApi-0007
//! @SYMTestCaseID          GRAPHICS-WSERV-DsaSession-PublicApi-0007
//! @SYMAPI                 RDirectScreenAccess::Cancel()
//! @SYMAuthor              Jeffery Zhao
//! @SYMCreationDate        19/12/2007
//! @SYMTestCaseDesc        Create a RDirectScreenAccess object and request then cancel; after cancel, we request again, negative test.
//! @SYMTestActions         1. Create RWsSession,RWindow,CWindowGc,CWsScreenDevice.
//!                         2. Create RDirectScreenAccess.
//!                         3. Call CWsScreenDevice::CreateContext()
//!                         4. Construct RWindow and call RWindow::SetShape & Activate
//!                         5. Create RDirectScreenAccess and call RDirectScreenAccess::Construct().
//!                         6. Call RDirectScreenAccess::Request and outstanding.
//!                         7. Call CWindowGc::Activate,RWindow::BeginRedraw,CWindowGc::DrawLine,RWindow::EndRedraw,CWindowGc::Deactivate
//!                         8. Call RDirectScreenAccess::Cancel() and Request again,then outstanding.
//!                         9. Destruct and close all created object.
//! @SYMTestStatus          Implemented
//! @SYMTestPriority        High
//! @SYMTestExpectedResults RDirectScreenAccess object Request return value should be KErrCancel(-3) after it was canceled.
//! @SYMTestType            CIT
    START_TEST_BLOCK    10        T_GraphicsWservAPI    \graphics\GRAPHICS-WSERV-DsaSession-PublicApi.ini
        CREATE_OBJECT   RWsSession                ws
        CREATE_OBJECT   RWindowGroup              wingrp
        CREATE_OBJECT   RWindow                   win           
        CREATE_OBJECT   CWsScreenDevice           scrdev      
        CREATE_OBJECT   CWindowGc                 wingc
        CREATE_OBJECT   RDirectScreenAccess       rdsa
        COMMAND         ws            new
        COMMAND         ws            Connect
        COMMAND         scrdev        new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         scrdev        Construct        
        COMMAND         scrdev        CreateContext  GRAPHICS-WSERV-DsaSession-Setup-0004-0001-CreateContext_command005
        COMMAND         wingrp        new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         wingrp        Construct      GRAPHICS-WSERV-DsaSession-Setup-0004-0001-Construct_command007
        COMMAND         win           new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         win           Construct      GRAPHICS-WSERV-DsaSession-Setup-0004-0001-Construct_command009
        COMMAND         win           SetShape       GRAPHICS-WSERV-DsaSession-Setup-0004-0001-SetShape_command010
        COMMAND         win           Activate
        COMMAND         rdsa          new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         rdsa          Construct
        COMMAND         !AsyncError=-3          rdsa          Request        GRAPHICS-WSERV-DsaSession-PublicApi-0004-0001-Request_command014
        COMMAND         wingc         Activate       GRAPHICS-WSERV-DsaSession-Setup-0004-0001-Activate_command015
        COMMAND         win           BeginRedraw
        COMMAND         wingc         DrawLine       GRAPHICS-WSERV-DsaSession-Setup-0004-0001-DrawLine_command017
        COMMAND         win           EndRedraw
        COMMAND         wingc         Deactivate
        COMMAND         wingc         ~
        COMMAND         rdsa          Cancel
        OUTSTANDING
        COMMAND         rdsa          Request        GRAPHICS-WSERV-DsaSession-PublicApi-0004-0001-Request_command014
        COMMAND         rdsa          Completed
        COMMAND         rdsa          Close
        COMMAND         win           Close
        COMMAND         wingrp        Close
        COMMAND         scrdev        ~
        COMMAND         ws            Close
    END_TEST_BLOCK
END_TESTCASE GRAPHICS-WSERV-DsaSession-PublicApi-0007


START_TESTCASE GRAPHICS-WSERV-DsaSession-PublicApi-0008
//! @SYMTestCaseID          GRAPHICS-WSERV-DsaSession-PublicApi-0008
//! @SYMAPI                 RDirectScreenAccess::Request(RRegion{ptr}{ref}, TRequestStatus{ref}, const RWindowBase{ref})
//! @SYMAuthor              Jeffery Zhao
//! @SYMCreationDate        02/01/2008
//! @SYMTestCaseDesc        Negative test, creates a RDirectScreenAccess object and issues a request on an invisible window.
//! @SYMTestActions         1. Create and connect RWsSession;
//!                         2. Create and construct RWindowGroup;
//!                         3. Create and Construct RWindow
//!                         4. Active RWindow and call SetVisible to make the RWindow object invisible. 
//!                         5. Create RDirectScreenAccess.
//!                         6. Construct RDirectScreenAccess.
//!                         7. Issue DSA request.
//!                         8. Complete DSA.
//!                         9. Destruct and close all object created. 
//! @SYMTestStatus          Implemented
//! @SYMTestPriority        High
//! @SYMTestExpectedResults 1.RDirectScreenAccess object was created successfully 2. Issue a DSA request and return KErrNotReady(-18).
//! @SYMTestType            CIT
    START_TEST_BLOCK    10        T_GraphicsWservAPI    \graphics\GRAPHICS-WSERV-DsaSession-PublicApi.ini
        CREATE_OBJECT   RWsSession                ws
        CREATE_OBJECT   RWindowGroup              wingrp
        CREATE_OBJECT   RWindow                   win           
        CREATE_OBJECT   RDirectScreenAccess       rdsa
        COMMAND         ws            new
        COMMAND         ws            Connect
        COMMAND         wingrp        new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         wingrp        Construct      GRAPHICS-WSERV-DsaSession-Setup-0004-0001-Construct_command007
        COMMAND         win           new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         win           Construct      GRAPHICS-WSERV-DsaSession-Setup-0004-0001-Construct_command009
        COMMAND         win           Activate
        COMMAND         win           SetVisible     GRAPHICS-WSERV-DsaSession-PublicApi-0008-0001-SetVisible_command008
        COMMAND         rdsa          new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         rdsa          Construct
        COMMAND !Error=-18 rdsa       Request        GRAPHICS-WSERV-DsaSession-PublicApi-0008-0001-Request_command011
        COMMAND         rdsa          Completed
        COMMAND         rdsa          Close
        COMMAND         win           Close
        COMMAND         wingrp        Close
        COMMAND         ws            Close
    END_TEST_BLOCK
END_TESTCASE GRAPHICS-WSERV-DsaSession-PublicApi-0008

START_TESTCASE GRAPHICS-WSERV-DsaSession-PublicApi-0009
//! @SYMTestCaseID          GRAPHICS-WSERV-DsaSession-PublicApi-0009
//! @SYMAPI                 RDirectScreenAccess::Request(RRegion{ptr}{ref}, TRequestStatus{ref}, const RWindowBase{ref})
//! @SYMAuthor              Jeffery Zhao
//! @SYMCreationDate        02/01/2008
//! @SYMTestCaseDesc        Negative test,create a RDirectScreenAccess object and generate a memory allocate fail when issue request.
//! @SYMTestActions         1. Create RWsSession,RWindowGroup,RWindow.
//!                         2. Construct RWindowGroup & RWindow and call RWindow::SetShape & Activate;
//!                         3. Create RDirectScreenAccess.
//!                         4. Construct RDirectScreenAccess.
//!                         5. Eat system memory until lefted memory less thans 20 byte and issue DSA request,it will return KErrNoMemory(-4).
//!                         6. Free eaten memory.
//!                         7. Destruct and close all object created. 
//! @SYMTestStatus          Implemented
//! @SYMTestPriority        High
//! @SYMTestExpectedResults 1.RDirectScreenAccess object was created successfully 2. Issue a DSA request and return KErrNoMemory(-4).
//! @SYMTestType            CIT
    START_TEST_BLOCK    10        T_GraphicsWservAPI    \graphics\GRAPHICS-WSERV-DsaSession-PublicApi.ini
        CREATE_OBJECT   RWsSession                ws
        CREATE_OBJECT   RWindowGroup              wingrp
        CREATE_OBJECT   RWindow                   win           
        CREATE_OBJECT   RDirectScreenAccess       rdsa
        COMMAND         ws            new
        COMMAND         ws            Connect
        COMMAND         wingrp        new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         wingrp        Construct      GRAPHICS-WSERV-DsaSession-Setup-0004-0001-Construct_command007
        COMMAND         win           new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         win           Construct      GRAPHICS-WSERV-DsaSession-Setup-0004-0001-Construct_command009
        COMMAND         win           SetShape       GRAPHICS-WSERV-DsaSession-Setup-0004-0001-SetShape_command010
        COMMAND         win           Activate
        COMMAND         rdsa          new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         rdsa          Construct
        COMMAND         rdsa          Util_EatupMemory GRAPHICS-WSERV-DsaSession-PublicApi-0009-0001-Util_EatupMemory_command011
        COMMAND !Error=-4 rdsa        Request        GRAPHICS-WSERV-DsaSession-PublicApi-0009-0001-Request_command012
        COMMAND         rdsa          Util_FreeEatenMemory
        COMMAND         rdsa          Close
        COMMAND         win           Close
        COMMAND         wingrp        Close
        COMMAND         ws            Close
    END_TEST_BLOCK
END_TESTCASE GRAPHICS-WSERV-DsaSession-PublicApi-0009

START_TESTCASE GRAPHICS-WSERV-DsaSession-PublicApi-0010
//! @SYMTestCaseID          GRAPHICS-WSERV-DsaSession-PublicApi-0010
//! @SYMAPI                 RDirectScreenAccess::Request(RRegion{ptr}{ref}, TRequestStatus{ref}, const RWindowBase{ref})
//! @SYMAuthor              Jeffery Zhao
//! @SYMCreationDate        02/01/2008
//! @SYMTestCaseDesc        Negative test, creates a RDirectScreenAccess object and  issues a request with uninitialized RWindow argument.
//! @SYMTestActions         1. Create and connect RWsSession.
//!                         2. Create RWindow;
//!                         3. Create RDirectScreenAccess.
//!                         4. Construct RDirectScreenAccess.
//!                         5. Issue DSA request with uninitialized RWindow object
//!                         6. Complete DSA.
//!                         7. Destruct and close all object created. 
//! @SYMTestStatus          Implemented
//! @SYMTestPriority        High
//! @SYMTestExpectedResults 1.RDirectScreenAccess object was created successfully 
//!                         2.WSERV 6 panic received at Test Action 5.
//! @SYMTestType            CIT
    START_TEST_BLOCK    10        T_GraphicsWservAPI    \graphics\GRAPHICS-WSERV-DsaSession-PublicApi.ini
        CREATE_OBJECT   RWsSession                ws
        CREATE_OBJECT   RWindow                   win           
        CREATE_OBJECT   RDirectScreenAccess       rdsa
        COMMAND         ws            new
        COMMAND         ws            Connect
        COMMAND         win           new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         rdsa          new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         rdsa          Construct
        COMMAND         rdsa          Request        GRAPHICS-WSERV-DsaSession-PublicApi-0010-0001-Request_command006
        COMMAND         rdsa          Completed
        COMMAND         rdsa          Close
        COMMAND         win           Close
        COMMAND         ws            Close
    END_TEST_BLOCK !PanicString=WSERV !PanicCode=6
    RUN_TEST_STEP	100	T_GraphicsWservAPI	utilityClearPanicDlg
END_TESTCASE GRAPHICS-WSERV-DsaSession-PublicApi-0010


START_TESTCASE GRAPHICS-WSERV-DsaSession-PublicApi-0011
//! @SYMTestCaseID          GRAPHICS-WSERV-DsaSession-PublicApi-0011
//! @SYMAPI                 RDirectScreenAccess::Completed()
//! @SYMAuthor              Jeffery Zhao
//! @SYMCreationDate        07/01/2008
//! @SYMTestCaseDesc        Negative test, completes DSA without request.
//! @SYMTestActions         1. Create and connect RWsSession.
//!                         2. Create RDirectScreenAccess.
//!                         3. Construct RDirectScreenAccess.
//!                         4. Complete DSA without request.
//!                         5. Destruct and close all object created. 
//! @SYMTestStatus          Implemented
//! @SYMTestPriority        High
//! @SYMTestExpectedResults W32 8 panic received at Test Action 4.
//! @SYMTestType            CIT
    START_TEST_BLOCK    10        T_GraphicsWservAPI    \graphics\GRAPHICS-WSERV-DsaSession-PublicApi.ini
        CREATE_OBJECT   RWsSession                ws           
        CREATE_OBJECT   RDirectScreenAccess       rdsa
        COMMAND         ws            new
        COMMAND         ws            Connect
        COMMAND         rdsa          new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         rdsa          Construct
        COMMAND         rdsa          Completed
        COMMAND         rdsa          Close
        COMMAND         ws            Close
    END_TEST_BLOCK !PanicString=W32 !PanicCode=8
    RUN_TEST_STEP	100	T_GraphicsWservAPI	utilityClearPanicDlg
END_TESTCASE GRAPHICS-WSERV-DsaSession-PublicApi-0011

//!START_TESTCASE GRAPHICS-WSERV-DsaSession-PublicApi-0012
//! @SYMTestCaseID          GRAPHICS-WSERV-DsaSession-PublicApi-0012
//! @SYMAPI                 RDirectScreenAccess::Cancel()
//! @SYMAuthor              Jeffery Zhao
//! @SYMCreationDate        07/01/2008
//! @SYMTestCaseDesc        Negative test, calls other function after closing DSA.
//! @SYMTestActions         1. Create and connect RWsSession.
//!                         2. Create RDirectScreenAccess.
//!                         3. Construct RDirectScreenAccess.
//!                         4. Close DSA.
//!                         5. Call Cancel() to verify close DSA successfully.
//!                         6. Destruct and close all object created. 
//! @SYMTestStatus          Implemented
//! @SYMTestPriority        High
//! @SYMTestExpectedResults KERN-EXEC 3 panic received at Test Action 5.
//! @SYMTestType            CIT
//!    START_TEST_BLOCK    10        T_GraphicsWservAPI    \graphics\GRAPHICS-WSERV-DsaSession-PublicApi.ini
//!        CREATE_OBJECT   RWsSession                ws          
//!        CREATE_OBJECT   RDirectScreenAccess       rdsa
//!        COMMAND         ws            new
//!        COMMAND         ws            Connect
//!        COMMAND         rdsa          new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
//!        COMMAND         rdsa          Construct
//!        COMMAND         rdsa          Close
//!        COMMAND         rdsa          Cancel
//!        COMMAND         ws            Close
//!    END_TEST_BLOCK !PanicString=KERN-EXEC !PanicCode=3
//!    RUN_TEST_STEP	100	T_GraphicsWservAPI	utilityClearPanicDlg
//!END_TESTCASE GRAPHICS-WSERV-DsaSession-PublicApi-0012

START_TESTCASE GRAPHICS-WSERV-DsaSession-PublicApi-0013
//! @SYMTestCaseID          GRAPHICS-WSERV-DsaSession-PublicApi-0013
//! @SYMAPI                 RDirectScreenAccess::Request(RRegion{ptr}{ref}, TRequestStatus{ref}, const RWindowBase{ref})
//! @SYMAuthor              Jeffery Zhao
//! @SYMCreationDate        16/01/2008
//! @SYMTestCaseDesc        Negative test,create two RDirectScreenAccess object and issue request at same window.
//! @SYMTestActions         1. Create RWsSession and connect.
//!                         2. Create and construct RWindowGroup,RWindow. 
//!                         3. Set window shape and activate the window.
//!                         4. Create the first RDirectScreenAccess.
//!                         5. Construct the first RDirectScreenAccess.
//!                         6. Issue a request using first DSA object.
//!                         7. Create and construct the second DSA object. 
//!                         8. Issue a request using the second DSA object at the same window.
//!                         9. Destruct and close all object created.
//! @SYMTestStatus          Implemented
//! @SYMTestPriority        High
//! @SYMTestExpectedResults DSA request will take an AsyncError(-3).
//! @SYMTestType            CIT
    START_TEST_BLOCK    10        T_GraphicsWservAPI    \graphics\GRAPHICS-WSERV-DsaSession-PublicApi.ini
        CREATE_OBJECT   RWsSession                ws
        CREATE_OBJECT   RWindowGroup              wingrp
        CREATE_OBJECT   RWindow                   win           
        CREATE_OBJECT   RDirectScreenAccess       rdsa
        CREATE_OBJECT   RDirectScreenAccess       rdsa2
        COMMAND         ws            new
        COMMAND         ws            Connect
        COMMAND         wingrp        new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         wingrp        Construct      GRAPHICS-WSERV-DsaSession-Setup-0004-0001-Construct_command007
        COMMAND         win           new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         win           Construct      GRAPHICS-WSERV-DsaSession-Setup-0004-0001-Construct_command009
        COMMAND         win           SetShape       GRAPHICS-WSERV-DsaSession-Setup-0004-0001-SetShape_command010
        COMMAND         win           Activate
        COMMAND         rdsa          new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         rdsa          Construct
        COMMAND !AsyncError=-3 rdsa   Request        GRAPHICS-WSERV-DsaSession-PublicApi-0013-0001-Request_command011
        COMMAND         rdsa          Cancel
        COMMAND         rdsa2         new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         rdsa2         Construct
        COMMAND !AsyncError=-3 rdsa2  Request        GRAPHICS-WSERV-DsaSession-PublicApi-0013-0001-Request_command014
        COMMAND         rdsa2         Cancel
        OUTSTANDING
        COMMAND         rdsa2         Close
        COMMAND         rdsa          Close
        COMMAND         win           Close
        COMMAND         wingrp        Close
        COMMAND         ws            Close
    END_TEST_BLOCK
END_TESTCASE GRAPHICS-WSERV-DsaSession-PublicApi-0013

START_TESTCASE GRAPHICS-WSERV-DsaSession-PublicApi-0014
//! @SYMTestCaseID          GRAPHICS-WSERV-DsaSession-PublicApi-0014
//! @SYMAPI                 RDirectScreenAccess::Request(RRegion{ptr}{ref}, TRequestStatus{ref}, const RWindowBase{ref})
//! @SYMAuthor              Jeffery Zhao
//! @SYMCreationDate        16/01/2008
//! @SYMTestCaseDesc        Negative test,creates a RDirectScreenAccess object and issues DSA request, then creates another window and draws line on the window where there DSA is taking place.
//! @SYMTestActions         1. Create RWsSession and connect.
//!                         2. Create and construct CWsScreenDevice object. 
//!                         3. Create and construct RWindowGroup,RWindow. 
//!                         4. Set window shape and activate the window.
//!                         5. Create and construct RDirectScreenAccess object.
//!                         6. Issue DSA request.
//!                         7. Create and construct the second window.
//!                         7. Activate the second window. 
//!                         8. Activate the CWindowGc object which get from CWsScreenDevice::CreateContext.
//!                         9. BeginRedraw with the seconde window and draw a line on the window,then EndRedraw.
//!                         10. Destruct and close all object created.
//! @SYMTestStatus          Implemented
//! @SYMTestPriority        High
//! @SYMTestExpectedResults DSA request will be terminated(TerminationReasons:ETerminateRegion 1) when draw line on the second window.
//! @SYMTestType            CIT
     START_TEST_BLOCK    10        T_GraphicsWservAPI    \graphics\GRAPHICS-WSERV-DsaSession-PublicApi.ini
        CREATE_OBJECT   RWsSession                ws
        CREATE_OBJECT   RWindowGroup              wingrp
        CREATE_OBJECT   RWindow                   win           
        CREATE_OBJECT   RWindow                   win2
        CREATE_OBJECT   CWsScreenDevice           scrdev
        CREATE_OBJECT   CWindowGc                 wingc
        CREATE_OBJECT   RDirectScreenAccess       rdsa
        COMMAND         ws            new
        COMMAND         ws            Connect
        COMMAND         scrdev        new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         scrdev        Construct        
        COMMAND         scrdev        CreateContext  GRAPHICS-WSERV-DsaSession-Setup-0004-0001-CreateContext_command005
        COMMAND         wingrp        new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         wingrp        Construct      GRAPHICS-WSERV-DsaSession-Setup-0004-0001-Construct_command007
        COMMAND         win           new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         win           Construct      GRAPHICS-WSERV-DsaSession-Setup-0004-0001-Construct_command009
        COMMAND         win           SetShape       GRAPHICS-WSERV-DsaSession-Setup-0004-0001-SetShape_command010
        COMMAND         win           Activate
        COMMAND         rdsa          new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         rdsa          Construct
        COMMAND !AsyncError=1 rdsa    Request        GRAPHICS-WSERV-DsaSession-PublicApi-0014-0001-Request_command014
        COMMAND         win2          new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         win2          Construct      GRAPHICS-WSERV-DsaSession-Setup-0004-0001-Construct_command111
        COMMAND         win2          Activate
        COMMAND         wingc         Activate       GRAPHICS-WSERV-DsaSession-Setup-0004-0001-Activate_command111
        COMMAND         win2          BeginRedraw
        COMMAND         wingc         DrawLine       GRAPHICS-WSERV-DsaSession-Setup-0004-0001-DrawLine_command017
        COMMAND         win2          EndRedraw
        COMMAND         wingc         Deactivate
        COMMAND         wingc         ~
        OUTSTANDING
        COMMAND         rdsa          Close
        COMMAND         wingc         ~
        COMMAND         win           Close
        COMMAND         win2          Close
        COMMAND         wingrp        Close
        COMMAND         scrdev        ~
        COMMAND         ws            Close
    END_TEST_BLOCK
END_TESTCASE GRAPHICS-WSERV-DsaSession-PublicApi-0014

START_TESTCASE GRAPHICS-WSERV-DsaSession-PublicApi-0015
//! @SYMTestCaseID          GRAPHICS-WSERV-DsaSession-PublicApi-0015
//! @SYMAPI                 RDirectScreenAccess::Completed()
//! @SYMAuthor              Jeffery Zhao
//! @SYMCreationDate        16-05-2008
//! @SYMTestCaseDesc        Creates a RDirectScreenAccess object and  issues a request, then complete twice.
//! @SYMTestActions         1. Create and connect RWsSession.
//!                         2. Create RWindow;
//!                         3. Create RDirectScreenAccess.
//!                         4. Construct RDirectScreenAccess.
//!                         5. Issue DSA request.
//!                         6. Complete DSA twice.
//!                         7. Destruct and close all object created. 
//! @SYMTestStatus          Implemented
//! @SYMTestPriority        High
//! @SYMTestExpectedResults RDirectScreenAccess object was Completed successfully.
//! @SYMTestType            CIT
    START_TEST_BLOCK    10        T_GraphicsWservAPI    \graphics\GRAPHICS-WSERV-DsaSession-PublicApi.ini
        CREATE_OBJECT   RWsSession                ws
        CREATE_OBJECT   RWindowGroup              wingrp
        CREATE_OBJECT   RWindow                   win           
        CREATE_OBJECT   RDirectScreenAccess       rdsa
        COMMAND         ws            new
        COMMAND         ws            Connect
        COMMAND         wingrp        new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         wingrp        Construct      GRAPHICS-WSERV-DsaSession-Setup-0004-0001-Construct_command007
        COMMAND         win           new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         win           Construct      GRAPHICS-WSERV-DsaSession-Setup-0004-0001-Construct_command009
        COMMAND         rdsa          new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         rdsa          Construct
        COMMAND         rdsa          Request        GRAPHICS-WSERV-DsaSession-PublicApi-0015-0001-Request_command009
        COMMAND         rdsa          Completed
        COMMAND         rdsa          Completed
    END_TEST_BLOCK !PanicString=W32 !PanicCode=8
    RUN_TEST_STEP	100	T_GraphicsWservAPI	utilityClearPanicDlg
END_TESTCASE GRAPHICS-WSERV-DsaSession-PublicApi-0015

START_TESTCASE GRAPHICS-WSERV-DsaSession-PublicApi-0016
//! @SYMTestCaseID          GRAPHICS-WSERV-DsaSession-PublicApi-0016
//! @SYMAPI                 RDirectScreenAccess::Cancel()
//! @SYMAuthor              Jeffery Zhao
//! @SYMCreationDate        16-05-2008
//! @SYMTestCaseDesc        Negative test, cancel DSA without starting.
//! @SYMTestActions         1. Create and connect RWsSession.
//!                         2. Create RDirectScreenAccess.
//!                         3. Construct RDirectScreenAccess.
//!                         4. Cancel DSA.
//!                         5. Close all object created. 
//! @SYMTestStatus          Implemented
//! @SYMTestPriority        High
//! @SYMTestExpectedResults RDirectScreenAccess object was canceled successfully.
//! @SYMTestType            CIT
    START_TEST_BLOCK    10        T_GraphicsWservAPI    \graphics\GRAPHICS-WSERV-DsaSession-PublicApi.ini
        CREATE_OBJECT   RWsSession                ws          
        CREATE_OBJECT   RDirectScreenAccess       rdsa
        COMMAND         ws            new
        COMMAND         ws            Connect
        COMMAND         rdsa          new            GRAPHICS-WSERV-DsaSession-Setup-0002-0001-new_command003
        COMMAND         rdsa          Construct
        COMMAND         rdsa          Cancel
        COMMAND         rdsa          Close
        COMMAND         ws            Close
    END_TEST_BLOCK
END_TESTCASE GRAPHICS-WSERV-DsaSession-PublicApi-0016
