contentstorage/caclient/tsrc/t_caclient/src/t_caclient_backupnotifier.cpp
author Jaakko Haukipuro (Nokia-MS/Oulu) <Jaakko.Haukipuro@nokia.com>
Thu, 16 Sep 2010 12:11:40 +0100
changeset 117 c63ee96dbe5f
permissions -rw-r--r--
Missing activityfw and taskswitcher components - fix for Bug 3670

/*
* Copyright (c) 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:  Main test class for hspluginmodel library.
*
*/
#include "t_caclient.h"
#include "caservice.h"
#include "caquery.h"
#include <sacls.h>
#include <connect/sbdefs.h>

#ifdef Q_OS_SYMBIAN
//s60
#include <e32base.h>
//#include <>
#include <W32STD.H>
#include <APGTASK.H>

#include "t_caclient.h"
#include "cabackupnotifier.h"
#include "castorageproxy.h"

// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
//
void TestCaClient::TestCreateBackupNotifier()
{
    QScopedPointer<CCaStorageProxy> proxy( CCaStorageProxy::NewL() ) ;
    QScopedPointer<CCaBackupNotifier> notifier( CCaBackupNotifier::NewL( proxy.data() ) );
    
    QVERIFY( notifier );
    
}

// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
//
void TestCaClient::TestBackupNotifierRunL()
{
	QScopedPointer<CCaStorageProxy> proxy( CCaStorageProxy::NewL() );
	QScopedPointer<CCaBackupNotifier> notifier( CCaBackupNotifier::NewL( proxy.data() ) );

    TUid KUidMyCat={0x101aaaa6};
    RProperty::Define(KUidMyCat, 0, RProperty::EInt, 0);

    notifier->Cancel();
    notifier->iProperty.Attach(KUidMyCat,0);
    notifier->iStatus = KRequestPending;
    notifier->iProperty.Subscribe(notifier->iStatus);
    notifier->SetActive();
    
    RProperty::Set(KUidMyCat, 0, conn::EBURRestorePartial);
    QTest::qWait(5000);
    
    QVERIFY( notifier->iLastState == CCaBackupNotifier::ECaRestore );
    
}


#endif //Q_OS_SYMBIAN