telephonyserverplugins/common_tsy/test/integration/src/cctsyintegrationtestairtimeduration.cpp
branchRCL_3
changeset 65 630d2f34d719
parent 0 3553901f7fa8
child 66 07a122eea281
--- a/telephonyserverplugins/common_tsy/test/integration/src/cctsyintegrationtestairtimeduration.cpp	Thu Aug 19 11:03:36 2010 +0300
+++ b/telephonyserverplugins/common_tsy/test/integration/src/cctsyintegrationtestairtimeduration.cpp	Tue Aug 31 16:23:08 2010 +0300
@@ -103,12 +103,6 @@
 	//
 	// TEST START
 	//
-		
-	// Check RMobilePhone::GetAirTimeDuration returns duration == 0.
-	TTimeIntervalSeconds timeBeforeDial;
-	TTimeIntervalSeconds timeAfterDial;
-	ASSERT_EQUALS(customApi.GetAirTimeDuration(timeBeforeDial), KErrNone, _L("RMmCustomAPI::GetAirTimeDuration returned with an error"))
-	ASSERT_EQUALS(timeBeforeDial.Int(),0,_L("RMmCustomAPI::GetAirTimeDuration did not return zero time duration as expected"))
 
 	// Dial a number that answers. 
 	TPtrC number; 
@@ -120,14 +114,19 @@
 	ASSERT_EQUALS(WaitForRequestWithTimeOut(dialStatus, ETimeMedium), KErrNone, _L("RCall::Dial timed-out"))
 	ASSERT_EQUALS(dialStatus.Int(), KErrNone, _L("RCall::Dial returned with an error"))
 
+	// Note that the air time reported before dialing a call is the last call airtime
+	TTimeIntervalSeconds timeOne;
+	TTimeIntervalSeconds timeTwo;
+	ASSERT_EQUALS(customApi.GetAirTimeDuration(timeOne), KErrNone, _L("RMmCustomAPI::GetAirTimeDuration returned with an error"))
+
 	// Wait for two second and check RMobilePhone::GetAirTimeDuration returns duration > previous duration. Repeat for 20 seconds. 
 	TInt count=1;
 	do
 		{
 		User::After(KOneSecond*2);
-		ASSERT_EQUALS(customApi.GetAirTimeDuration(timeAfterDial), KErrNone, _L("RMmCustomAPI::GetAirTimeDuration returned with an error"))
-		ASSERT_TRUE(timeAfterDial.Int()>timeBeforeDial.Int(),_L("RMmCustomAPI::GetAirTimeDuration did not return bigger time duration then the previous one"))
-		timeBeforeDial=timeAfterDial;
+		ASSERT_EQUALS(customApi.GetAirTimeDuration(timeTwo), KErrNone, _L("RMmCustomAPI::GetAirTimeDuration returned with an error"))
+		ASSERT_TRUE(timeTwo.Int()>timeOne.Int(),_L("RMmCustomAPI::GetAirTimeDuration did not return bigger time duration then the previous one"))
+		timeOne=timeTwo;
 		count++;
 		}while(count!=10);