mmsharing/livecommsui/lcuiengine/tsrc/ut_lcuieng/src/ut_lcuiengine.cpp
changeset 26 5554410e16f5
parent 25 53c1c4459a94
child 29 36d7ded3ca23
equal deleted inserted replaced
25:53c1c4459a94 26:5554410e16f5
   592     bool ok( false );
   592     bool ok( false );
   593 
   593 
   594     //1. setting landscape
   594     //1. setting landscape
   595     QVERIFY( LC_SESSION( mEngine )->iLocalPlayer );
   595     QVERIFY( LC_SESSION( mEngine )->iLocalPlayer );
   596     QVERIFY( LC_SESSION( mEngine )->iRemotePlayer );
   596     QVERIFY( LC_SESSION( mEngine )->iRemotePlayer );
   597     QVERIFY( LC_SESSION( mEngine )->iLocalPlayer->iOrientation == MLcWindow::EPortrait );
       
   598     QVERIFY( LC_SESSION( mEngine )->iRemotePlayer->iOrientation == MLcWindow::EPortrait );
       
   599 
   597 
   600     ok = mEngine->d->setOrientation( Qt::Horizontal );
   598     ok = mEngine->d->setOrientation( Qt::Horizontal );
   601     QVERIFY( ok );
   599     QVERIFY( ok );
   602     QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_SetLcWindowOrientationL ) );
   600     QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_SetLcWindowOrientationL ) );
   603     QVERIFY( LC_SESSION( mEngine )->iLocalPlayer->iOrientation == MLcWindow::ELandscape );
   601     QVERIFY( LC_SESSION( mEngine )->iLocalPlayer->iOrientation == MLcWindow::ELandscape );
   604     QVERIFY( LC_SESSION( mEngine )->iRemotePlayer->iOrientation == MLcWindow::ELandscape );
   602     QVERIFY( LC_SESSION( mEngine )->iRemotePlayer->iOrientation == MLcWindow::ELandscape );
   605 
   603 
   606     
   604     //2. setting layout failed
   607     //2. setting portrait
       
   608     lcutStub_LcPlayer_reset();
       
   609     ok = mEngine->d->setOrientation( Qt::Vertical );
       
   610     QVERIFY( ok );
       
   611     QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_SetLcWindowOrientationL ) );
       
   612     QVERIFY( LC_SESSION( mEngine )->iLocalPlayer->iOrientation == MLcWindow::EPortrait );
       
   613     QVERIFY( LC_SESSION( mEngine )->iRemotePlayer->iOrientation == MLcWindow::EPortrait );
       
   614     
       
   615     //3. setting layout failed
       
   616     // Leave
   605     // Leave
   617     lcutStub_LcEngine_setFailure( -1 );
   606     lcutStub_LcEngine_setFailure( -1 );
   618     lcutStub_LcPlayer_reset();
   607     lcutStub_LcPlayer_reset();
   619     ok = mEngine->d->setOrientation( Qt::Horizontal );
   608     ok = mEngine->d->setOrientation( Qt::Horizontal );
   620     QVERIFY( !ok );
   609     QVERIFY( !ok );
   621     QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_NoCall ) );
   610     QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_NoCall ) );
   622     
   611     
   623     //4. setting layout with no players
   612     //3. setting layout with no players
   624     lcutStub_LcEngine_reset();
   613     lcutStub_LcEngine_reset();
   625     lcutStub_LcPlayer_reset();
   614     lcutStub_LcPlayer_reset();
   626     delete LC_SESSION( mEngine )->iLocalPlayer;
   615     delete LC_SESSION( mEngine )->iLocalPlayer;
   627     LC_SESSION( mEngine )->iLocalPlayer = 0;
   616     LC_SESSION( mEngine )->iLocalPlayer = 0;
   628     delete LC_SESSION( mEngine )->iRemotePlayer;
   617     delete LC_SESSION( mEngine )->iRemotePlayer;
   630     
   619     
   631     ok = mEngine->d->setOrientation( Qt::Horizontal );
   620     ok = mEngine->d->setOrientation( Qt::Horizontal );
   632     QVERIFY( ok );
   621     QVERIFY( ok );
   633     QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_NoCall ) );    
   622     QVERIFY( lcutStub_LcPlayer_expectCall( lcutStub_LcPlayer_NoCall ) );    
   634 }
   623 }
       
   624 
   635 
   625 
   636 void UT_LcUiEngine::testToggleMute()
   626 void UT_LcUiEngine::testToggleMute()
   637 {
   627 {
   638     QSignalSpy mutedSpy(mEngine, SIGNAL(muted()));
   628     QSignalSpy mutedSpy(mEngine, SIGNAL(muted()));
   639     QSignalSpy unmutedSpy(mEngine, SIGNAL(unmuted()));
   629     QSignalSpy unmutedSpy(mEngine, SIGNAL(unmuted()));