usbmgmt/usbmgrtest/t_charging_arm/src/activetest.cpp
changeset 0 c9bc50fca66e
equal deleted inserted replaced
-1:000000000000 0:c9bc50fca66e
       
     1 /*
       
     2 * Copyright (c) 2006-2009 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:
       
    15 *
       
    16 */
       
    17 
       
    18 #include <e32base.h>
       
    19 #include <e32cons.h>
       
    20 #include <e32test.h>
       
    21 #include <e32twin.h>
       
    22 #include "activeconsole.h"
       
    23 
       
    24 LOCAL_C void ActiveTestL()
       
    25     {
       
    26 	CConsoleBase* console = Console::NewL(_L("ACTIVETEST"), TSize(KConsFullScreen, KConsFullScreen));
       
    27 	CleanupStack::PushL(console);
       
    28 
       
    29 	CActiveScheduler* scheduler = new(ELeave) CActiveScheduler;
       
    30 	CleanupStack::PushL(scheduler);
       
    31 	CActiveScheduler::Install(scheduler);
       
    32 
       
    33 	CActiveConsole* activeConsole = CActiveConsole::NewLC(*console);
       
    34 	activeConsole->RequestCharacter();
       
    35 	CActiveScheduler::Start();
       
    36 	// NB CActiveScheduler::Start only returns when someone somewhere has 
       
    37 	// called CActiveScheduler::Stop.
       
    38 
       
    39 	CleanupStack::PopAndDestroy(2); // activeConsole, scheduler
       
    40 
       
    41 	console->Printf(_L("\nPress any key"));
       
    42 	console->Getch(); // get and ignore character
       
    43 	CleanupStack::PopAndDestroy(); // console
       
    44 	}
       
    45 
       
    46 GLDEF_C TInt E32Main()
       
    47     {
       
    48 	__UHEAP_MARK;
       
    49 	CTrapCleanup* cleanup = CTrapCleanup::New();
       
    50 	TRAPD(error, ActiveTestL());
       
    51 	__ASSERT_ALWAYS(!error, User::Panic(_L("E32Main"), error));
       
    52 	delete cleanup;
       
    53 	__UHEAP_MARKEND;
       
    54 	return KErrNone;
       
    55     }