telephonyserverplugins/common_tsy/test/integration/src/tcallcontroltsytesthelper.cpp
author Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
Wed, 02 Jun 2010 16:33:50 +0100
branchopencode
changeset 32 58332560b319
parent 24 6638e7f4bd8f
permissions -rw-r--r--
Bring opencode branch up-to-date with latest cellularsrv changes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
24
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
     1
// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
     2
// All rights reserved.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
     3
// This component and the accompanying materials are made available
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
     5
// which accompanies this distribution, and is available
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
     7
//
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
     8
// Initial Contributors:
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
     9
// Nokia Corporation - initial contribution.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    10
//
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    11
// Contributors:
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    12
//
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    13
// Description:
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    14
//
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    15
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    16
#include "tcallcontroltsytesthelper.h" 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    17
#include "cctsytestlogging.h"
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    18
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    19
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    20
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    21
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    22
* Constructor
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    23
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    24
TCallControlTsyTestHelper::TCallControlTsyTestHelper(CCTSYIntegrationTestSuiteStepBase& aTestStep)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    25
			: TTsyTestHelperBase( aTestStep )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    26
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    27
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    28
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    29
* Notify reset for RCall::NotifyCapsChange
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    30
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    31
void TCallControlTsyTestHelper::WaitForCallNotifyCapsChange( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    32
				RCall& aCall,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    33
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    34
				RCall::TCaps& aCaps, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    35
				RCall::TCaps aWantedCaps,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    36
				RCall::TCaps aUnwantedCaps,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    37
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    38
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    39
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    40
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    41
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    42
	ASSERT_EQUALS(err, KErrNone, _L("RCall::NotifyCapsChange did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    43
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    44
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    45
							&& ( ((aCaps.iFlags & aWantedCaps.iFlags) != aWantedCaps.iFlags)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    46
								 || ((aCaps.iFlags & aUnwantedCaps.iFlags) != 0) ) )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    47
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    48
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    49
		// Repost notification until timeout or we get the right result.	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    50
		aCall.NotifyCapsChange(aRequestStatus, aCaps);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    51
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    52
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    53
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    54
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    55
				_L("RCall::NotifyCapsChange Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    56
	ASSERT_BITS_SET(aCaps.iFlags, aWantedCaps.iFlags, aUnwantedCaps.iFlags, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    57
				_L("RCall::NotifyCapsChange Wrong caps"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    58
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    59
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    60
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    61
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    62
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    63
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    64
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    65
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    66
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    67
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    68
* Notify reset for RCall::NotifyCallDurationChange
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    69
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    70
void TCallControlTsyTestHelper::WaitForCallNotifyCallDurationChange( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    71
				RCall& aCall,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    72
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    73
				TTimeIntervalSeconds& aTime, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    74
				TTimeIntervalSeconds aExpectedTime,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    75
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    76
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    77
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    78
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    79
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    80
	ASSERT_EQUALS(err, KErrNone, _L("RCall::NotifyCallDurationChange did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    81
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    82
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    83
							&& aTime != aExpectedTime )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    84
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    85
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    86
		// Repost notification until timeout or we get the right result.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    87
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    88
		aCall.NotifyCallDurationChange(aRequestStatus, aTime);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    89
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    90
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    91
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    92
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RCall::NotifyCallDurationChange Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    93
	ASSERT_EQUALS(aTime.Int(), aExpectedTime.Int(), 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    94
				_L("RCall::NotifyCallDurationChange Wrong result"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    95
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    96
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    97
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    98
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
    99
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   100
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   101
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   102
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   103
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   104
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   105
* Notify reset for RCall::NotifyHookChange
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   106
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   107
void TCallControlTsyTestHelper::WaitForCallNotifyHookChange( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   108
				RCall& aCall,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   109
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   110
				RCall::THookStatus& aHookStatus, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   111
				RCall::THookStatus aExpectedHookStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   112
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   113
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   114
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   115
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   116
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   117
	ASSERT_EQUALS(err, KErrNone, _L("RCall::NotifyHookChange did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   118
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   119
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   120
							&& aHookStatus != aExpectedHookStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   121
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   122
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   123
		// Repost notification until timeout or we get the right result.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   124
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   125
		aCall.NotifyHookChange(aRequestStatus, aHookStatus);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   126
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   127
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   128
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   129
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RCall::NotifyHookChange Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   130
	ASSERT_EQUALS(aHookStatus, aExpectedHookStatus, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   131
				_L("RCall::NotifyHookChange Wrong result"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   132
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   133
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   134
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   135
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   136
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   137
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   138
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   139
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   140
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   141
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   142
* Notify reset for RCall::NotifyStatusChange
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   143
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   144
void TCallControlTsyTestHelper::WaitForCallNotifyStatusChange( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   145
				RCall& aCall,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   146
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   147
				RCall::TStatus& aCallStatus, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   148
				RCall::TStatus& aExpectedCallStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   149
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   150
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   151
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   152
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   153
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeMedium);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   154
	ASSERT_EQUALS(err, KErrNone, _L("RCall::NotifyStatusChange did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   155
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   156
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   157
							&& aCallStatus != aExpectedCallStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   158
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   159
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   160
		// Repost notification until timeout or we get the right result.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   161
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   162
		aCall.NotifyStatusChange(aRequestStatus, aCallStatus);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   163
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeMedium);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   164
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   165
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   166
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RCall::NotifyStatusChange Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   167
	ASSERT_EQUALS(aCallStatus, aExpectedCallStatus, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   168
				_L("RCall::NotifyStatusChange Wrong result"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   169
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   170
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   171
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   172
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   173
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   174
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   175
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   176
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   177
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   178
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   179
* Notify reset for RLine::NotifyCapsChange
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   180
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   181
void TCallControlTsyTestHelper::WaitForLineNotifyCapsChange( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   182
				RLine& aLine,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   183
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   184
				RLine::TCaps& aCaps, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   185
				RLine::TCaps aWantedCaps,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   186
				RLine::TCaps aUnwantedCaps,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   187
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   188
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   189
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   190
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   191
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   192
	ASSERT_EQUALS(err, KErrNone, _L("RLine::NotifyCapsChange did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   193
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   194
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   195
							&& ( ((aCaps.iFlags & aWantedCaps.iFlags) != aWantedCaps.iFlags)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   196
								 || ((aCaps.iFlags & aUnwantedCaps.iFlags) != 0) ) )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   197
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   198
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   199
		// Repost notification until timeout or we get the right result.	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   200
		aLine.NotifyCapsChange(aRequestStatus, aCaps);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   201
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   202
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   203
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   204
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   205
				_L("RLine::NotifyCapsChange Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   206
	ASSERT_BITS_SET(aCaps.iFlags, aWantedCaps.iFlags, aUnwantedCaps.iFlags, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   207
				_L("RLine::NotifyCapsChange Wrong caps"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   208
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   209
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   210
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   211
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   212
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   213
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   214
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   215
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   216
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   217
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   218
* Notify reset for RLine::NotifyCallAdded
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   219
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   220
void TCallControlTsyTestHelper::WaitForLineNotifyCallAdded( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   221
				RLine& aLine,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   222
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   223
				TName& aName, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   224
				TName aExpectedName,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   225
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   226
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   227
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   228
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   229
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   230
	ASSERT_EQUALS(err, KErrNone, _L("RLine::NotifyCallAdded did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   231
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   232
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   233
							&& aName != aExpectedName )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   234
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   235
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   236
		// Repost notification until timeout or we get the right result.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   237
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   238
		aLine.NotifyCallAdded(aRequestStatus, aName);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   239
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   240
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   241
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   242
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RLine::NotifyCallAdded Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   243
	ASSERT_EQUALS_DES16(aName, aExpectedName, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   244
				_L("RLine::NotifyCallAdded Wrong result"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   245
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   246
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   247
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   248
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   249
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   250
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   251
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   252
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   253
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   254
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   255
* Notify reset for RLine::NotifyHookChange
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   256
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   257
void TCallControlTsyTestHelper::WaitForLineNotifyHookChange( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   258
				RLine& aLine,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   259
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   260
				RCall::THookStatus& aHookStatus, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   261
				RCall::THookStatus aExpectedHookStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   262
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   263
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   264
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   265
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   266
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   267
	ASSERT_EQUALS(err, KErrNone, _L("RLine::NotifyHookChange did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   268
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   269
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   270
							&& aHookStatus != aExpectedHookStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   271
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   272
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   273
		// Repost notification until timeout or we get the right result.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   274
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   275
		aLine.NotifyHookChange(aRequestStatus, aHookStatus);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   276
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   277
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   278
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   279
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RLine::NotifyHookChange Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   280
	ASSERT_EQUALS(aHookStatus, aExpectedHookStatus, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   281
				_L("RLine::NotifyHookChange Wrong result"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   282
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   283
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   284
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   285
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   286
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   287
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   288
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   289
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   290
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   291
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   292
* Notify reset for RLine::NotifyStatusChange
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   293
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   294
void TCallControlTsyTestHelper::WaitForLineNotifyStatusChange( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   295
				RLine& aLine,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   296
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   297
				RCall::TStatus& aLineStatus, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   298
				RCall::TStatus& aExpectedLineStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   299
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   300
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   301
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   302
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   303
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeVeryLong);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   304
	ASSERT_EQUALS(err, KErrNone, _L("RLine::NotifyStatusChange did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   305
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   306
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   307
							&& aLineStatus != aExpectedLineStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   308
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   309
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   310
		// Repost notification until timeout or we get the right result.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   311
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   312
		aLine.NotifyStatusChange(aRequestStatus, aLineStatus);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   313
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeVeryLong);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   314
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   315
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   316
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RLine::NotifyStatusChange Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   317
	ASSERT_EQUALS(aLineStatus, aExpectedLineStatus, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   318
				_L("RLine::NotifyStatusChange Wrong result"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   319
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   320
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   321
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   322
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   323
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   324
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   325
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   326
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   327
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   328
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   329
* Notify reset for RLine::NotifyIncomingCall
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   330
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   331
void TCallControlTsyTestHelper::WaitForLineNotifyIncomingCall( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   332
				RLine& aLine,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   333
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   334
				TName& aName, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   335
				TName aExpectedName,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   336
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   337
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   338
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   339
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   340
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeMedium);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   341
	ASSERT_EQUALS(err, KErrNone, _L("RLine::NotifyIncomingCall did not complete"));
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   342
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   343
	DEBUG_PRINTF2(_L("Name returned is: %S"), &aName);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   344
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   345
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   346
							&& aName != aExpectedName )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   347
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   348
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   349
		// Repost notification until timeout or we get the right result.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   350
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   351
		aLine.NotifyIncomingCall(aRequestStatus, aName);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   352
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeMedium);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   353
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   354
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   355
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RLine::NotifyIncomingCall Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   356
	ASSERT_EQUALS_DES16(aName, aExpectedName, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   357
				_L("RLine::NotifyIncomingCall Wrong result"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   358
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   359
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   360
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   361
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   362
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   363
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   364
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   365
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   366
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   367
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   368
* Notify reset for RPhone::NotifyCapsChange
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   369
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   370
void TCallControlTsyTestHelper::WaitForPhoneNotifyCapsChange( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   371
				RPhone& aPhone,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   372
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   373
				RPhone::TCaps& aCaps, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   374
				RPhone::TCaps aWantedCaps,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   375
				RPhone::TCaps aUnwantedCaps,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   376
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   377
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   378
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   379
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   380
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   381
	ASSERT_EQUALS(err, KErrNone, _L("RPhone::NotifyCapsChange did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   382
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   383
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   384
							&& ( ((aCaps.iFlags & aWantedCaps.iFlags) != aWantedCaps.iFlags)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   385
								 || ((aCaps.iFlags & aUnwantedCaps.iFlags) != 0) ) )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   386
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   387
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   388
		// Repost notification until timeout or we get the right result.	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   389
		aPhone.NotifyCapsChange(aRequestStatus, aCaps);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   390
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   391
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   392
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   393
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   394
				_L("RPhone::NotifyCapsChange Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   395
	ASSERT_BITS_SET(aCaps.iFlags, aWantedCaps.iFlags, aUnwantedCaps.iFlags, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   396
				_L("RPhone::NotifyCapsChange Wrong caps"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   397
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   398
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   399
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   400
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   401
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   402
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   403
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   404
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   405
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   406
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   407
* Notify reset for RPhone::NotifyModemDetected
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   408
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   409
void TCallControlTsyTestHelper::WaitForPhoneNotifyModemDetected( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   410
				RPhone& aPhone,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   411
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   412
				RPhone::TModemDetection& aDetection, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   413
				RPhone::TModemDetection aExpectedDetection,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   414
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   415
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   416
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   417
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   418
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   419
	ASSERT_EQUALS(err, KErrNone, _L("RPhone::NotifyModemDetected did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   420
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   421
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   422
							&& aDetection != aExpectedDetection )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   423
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   424
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   425
		// Repost notification until timeout or we get the right result.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   426
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   427
		aPhone.NotifyModemDetected(aRequestStatus, aDetection);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   428
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   429
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   430
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   431
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RPhone::NotifyModemDetected Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   432
	ASSERT_EQUALS(aDetection, aExpectedDetection, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   433
				_L("RPhone::NotifyModemDetected Wrong result"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   434
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   435
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   436
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   437
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   438
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   439
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   440
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   441
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   442
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   443
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   444
* Notify reset for RMobileCall::NotifyAlternatingCallSwitch
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   445
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   446
void TCallControlTsyTestHelper::WaitForMobileCallNotifyAlternatingCallSwitch( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   447
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   448
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   449
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   450
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   451
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   452
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   453
	ASSERT_EQUALS(err, KErrNone, _L("RMobileCall::NotifyAlternatingCallSwitch did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   454
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobileCall::NotifyAlternatingCallSwitch Wrong completion status"))		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   455
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   456
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   457
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   458
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   459
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   460
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   461
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   462
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   463
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   464
* Notify reset for RMobileCall::NotifyAudioToneEvent
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   465
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   466
void TCallControlTsyTestHelper::WaitForMobileCallNotifyAudioToneEvent( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   467
				RMobileCall& aMobileCall,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   468
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   469
				TCmpBase<RMobileCall::TAudioToneV3> &aAudioToneV3,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   470
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   471
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   472
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   473
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   474
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   475
	ASSERT_EQUALS(err, KErrNone, _L("RMobileCall::NotifyAudioToneEvent did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   476
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   477
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   478
							&& !aAudioToneV3.IsEqual(ENoLogError) )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   479
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   480
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   481
		// Repost notification until timeout or we get the right result.		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   482
		RMobileCall::TAudioToneV3Pckg pkgParam( aAudioToneV3.GetValue() );
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   483
		aMobileCall.NotifyAudioToneEvent(aRequestStatus, pkgParam);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   484
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   485
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   486
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   487
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobileCall::NotifyAudioToneEvent Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   488
	ASSERT_TRUE(aAudioToneV3.IsEqual(ELogError), 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   489
				_L("RMobileCall::NotifyAudioToneEvent Wrong result"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   490
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   491
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   492
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   493
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   494
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   495
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   496
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   497
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   498
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   499
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   500
* Notify reset for RMobileCall::NotifyCallEvent
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   501
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   502
void TCallControlTsyTestHelper::WaitForMobileCallNotifyCallEvent( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   503
				RMobileCall& aMobileCall,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   504
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   505
				RMobileCall::TMobileCallEvent& aEvent, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   506
				RMobileCall::TMobileCallEvent aExpectedEvent,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   507
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   508
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   509
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   510
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   511
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeMedium);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   512
	ASSERT_EQUALS(err, KErrNone, _L("RMobileCall::NotifyCallEvent did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   513
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   514
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   515
							&& aEvent != aExpectedEvent )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   516
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   517
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   518
		// Repost notification until timeout or we get the right result.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   519
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   520
		aMobileCall.NotifyCallEvent(aRequestStatus, aEvent);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   521
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   522
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   523
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   524
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobileCall::NotifyCallEvent Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   525
	ASSERT_EQUALS(aEvent, aExpectedEvent, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   526
				_L("RMobileCall::NotifyCallEvent Wrong result"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   527
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   528
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   529
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   530
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   531
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   532
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   533
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   534
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   535
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   536
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   537
* Notify reset for RMobileCall::NotifyHscsdInfoChange
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   538
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   539
void TCallControlTsyTestHelper::WaitForMobileCallNotifyHscsdInfoChange( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   540
				RMobileCall& aMobileCall,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   541
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   542
				TCmpBase<RMobileCall::TMobileCallHscsdInfoV1> &aMobileCallHscsdInfoV1,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   543
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   544
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   545
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   546
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   547
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   548
	ASSERT_EQUALS(err, KErrNone, _L("RMobileCall::NotifyHscsdInfoChange did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   549
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   550
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   551
							&& !aMobileCallHscsdInfoV1.IsEqual(ENoLogError) )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   552
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   553
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   554
		// Repost notification until timeout or we get the right result.		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   555
		RMobileCall::TMobileCallHscsdInfoV1Pckg pkgParam( aMobileCallHscsdInfoV1.GetValue() );
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   556
		aMobileCall.NotifyHscsdInfoChange(aRequestStatus, pkgParam);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   557
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   558
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   559
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   560
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobileCall::NotifyHscsdInfoChange Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   561
	ASSERT_TRUE(aMobileCallHscsdInfoV1.IsEqual(ELogError), 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   562
				_L("RMobileCall::NotifyHscsdInfoChange Wrong result"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   563
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   564
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   565
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   566
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   567
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   568
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   569
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   570
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   571
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   572
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   573
* Notify reset for RMobileCall::NotifyMobileCallCapsChange
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   574
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   575
void TCallControlTsyTestHelper::WaitForMobileCallNotifyMobileCallCapsChange( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   576
				RMobileCall& aMobileCall,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   577
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   578
				TCmpRMobileCallTMobileCallCaps &aMobileCallCapsV1,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   579
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   580
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   581
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   582
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   583
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeLong);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   584
	ASSERT_EQUALS(err, KErrNone, _L("RMobileCall::NotifyMobileCallCapsChange did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   585
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   586
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   587
							&& !aMobileCallCapsV1.IsEqual(ENoLogError) )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   588
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   589
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   590
		// Repost notification until timeout or we get the right result.		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   591
		RMobileCall::TMobileCallCapsV1Pckg pkgParam( aMobileCallCapsV1.GetValue() );
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   592
		aMobileCall.NotifyMobileCallCapsChange(aRequestStatus, pkgParam);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   593
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeVeryLong);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   594
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   595
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   596
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobileCall::NotifyMobileCallCapsChange Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   597
	ASSERT_TRUE(aMobileCallCapsV1.IsEqual(ELogError), 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   598
				_L("RMobileCall::NotifyMobileCallCapsChange Wrong result"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   599
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   600
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   601
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   602
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   603
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   604
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   605
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   606
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   607
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   608
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   609
* Notify reset for RMobileCall::NotifyMobileCallStatusChange
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   610
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   611
void TCallControlTsyTestHelper::WaitForMobileCallNotifyMobileCallStatusChange( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   612
				RMobileCall& aMobileCall,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   613
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   614
				RMobileCall::TMobileCallStatus& aStatus, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   615
				RMobileCall::TMobileCallStatus aExpectedStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   616
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   617
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   618
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   619
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   620
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeLong);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   621
	ASSERT_EQUALS(err, KErrNone, _L("RMobileCall::NotifyMobileCallStatusChange did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   622
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   623
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   624
							&& aStatus != aExpectedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   625
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   626
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   627
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   628
		// Repost notification until timeout or we get the right result.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   629
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   630
		aMobileCall.NotifyMobileCallStatusChange(aRequestStatus, aStatus);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   631
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeLong);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   632
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   633
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   634
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobileCall::NotifyMobileCallStatusChange Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   635
	ASSERT_EQUALS(aStatus, aExpectedStatus, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   636
				_L("RMobileCall::NotifyMobileCallStatusChange Wrong result"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   637
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   638
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   639
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   640
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   641
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   642
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   643
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   644
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   645
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   646
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   647
* Notify reset for RMobileCall::NotifyMobileDataCallCapsChange
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   648
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   649
void TCallControlTsyTestHelper::WaitForMobileCallNotifyMobileDataCallCapsChange( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   650
				RMobileCall& aMobileCall,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   651
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   652
				TCmpBase<RMobileCall::TMobileCallDataCapsV1> &aMobileCallDataCapsV1,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   653
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   654
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   655
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   656
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   657
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   658
	ASSERT_EQUALS(err, KErrNone, _L("RMobileCall::NotifyMobileDataCallCapsChange did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   659
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   660
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   661
							&& !aMobileCallDataCapsV1.IsEqual(ENoLogError) )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   662
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   663
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   664
		// Repost notification until timeout or we get the right result.		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   665
		RMobileCall::TMobileCallDataCapsV1Pckg pkgParam( aMobileCallDataCapsV1.GetValue() );
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   666
		aMobileCall.NotifyMobileDataCallCapsChange(aRequestStatus, pkgParam);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   667
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   668
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   669
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   670
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobileCall::NotifyMobileDataCallCapsChange Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   671
	ASSERT_TRUE(aMobileCallDataCapsV1.IsEqual(ELogError), 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   672
				_L("RMobileCall::NotifyMobileDataCallCapsChange Wrong result"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   673
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   674
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   675
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   676
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   677
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   678
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   679
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   680
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   681
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   682
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   683
* Notify reset for RMobileCall::NotifyUUSCapsChange
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   684
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   685
void TCallControlTsyTestHelper::WaitForMobileCallNotifyUUSCapsChange( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   686
				RMobileCall& aMobileCall,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   687
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   688
				TUint32& aCaps, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   689
				TUint32 aWantedCaps,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   690
				TUint32 aUnwantedCaps,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   691
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   692
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   693
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   694
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   695
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   696
	ASSERT_EQUALS(err, KErrNone, _L("RMobileCall::NotifyUUSCapsChange did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   697
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   698
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   699
							&& ( ((aCaps & aWantedCaps) != aWantedCaps)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   700
								 || ((aCaps & aUnwantedCaps) != 0) ) )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   701
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   702
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   703
		// Repost notification until timeout or we get the right result.	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   704
		aMobileCall.NotifyUUSCapsChange(aRequestStatus, aCaps);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   705
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   706
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   707
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   708
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   709
				_L("RMobileCall::NotifyUUSCapsChange Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   710
	ASSERT_BITS_SET(aCaps, aWantedCaps, aUnwantedCaps, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   711
				_L("RMobileCall::NotifyUUSCapsChange Wrong caps"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   712
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   713
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   714
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   715
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   716
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   717
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   718
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   719
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   720
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   721
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   722
* Notify reset for RMobileCall::NotifyVoiceFallback
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   723
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   724
void TCallControlTsyTestHelper::WaitForMobileCallNotifyVoiceFallback( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   725
				RMobileCall& aMobileCall,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   726
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   727
				TName& aCallName, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   728
				TName aExpectedCallName,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   729
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   730
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   731
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   732
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   733
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   734
	ASSERT_EQUALS(err, KErrNone, _L("RMobileCall::NotifyVoiceFallback did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   735
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   736
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   737
							&& aCallName != aExpectedCallName )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   738
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   739
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   740
		// Repost notification until timeout or we get the right result.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   741
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   742
		aMobileCall.NotifyVoiceFallback(aRequestStatus, aCallName);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   743
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   744
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   745
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   746
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobileCall::NotifyVoiceFallback Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   747
	ASSERT_EQUALS_DES16(aCallName, aExpectedCallName, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   748
				_L("RMobileCall::NotifyVoiceFallback Wrong result"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   749
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   750
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   751
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   752
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   753
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   754
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   755
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   756
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   757
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   758
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   759
* Notify reset for RMobileCall::NotifyPrivacyConfirmation
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   760
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   761
void TCallControlTsyTestHelper::WaitForMobileCallNotifyPrivacyConfirmation( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   762
				RMobileCall& aMobileCall,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   763
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   764
				RMobilePhone::TMobilePhonePrivacy& aPrivacySetting, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   765
				RMobilePhone::TMobilePhonePrivacy aExpectedPrivacySetting,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   766
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   767
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   768
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   769
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   770
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   771
	ASSERT_EQUALS(err, KErrNone, _L("RMobileCall::NotifyPrivacyConfirmation did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   772
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   773
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   774
							&& aPrivacySetting != aExpectedPrivacySetting )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   775
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   776
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   777
		// Repost notification until timeout or we get the right result.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   778
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   779
		aMobileCall.NotifyPrivacyConfirmation(aRequestStatus, aPrivacySetting);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   780
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   781
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   782
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   783
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobileCall::NotifyPrivacyConfirmation Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   784
	ASSERT_EQUALS(aPrivacySetting, aExpectedPrivacySetting, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   785
				_L("RMobileCall::NotifyPrivacyConfirmation Wrong result"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   786
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   787
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   788
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   789
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   790
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   791
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   792
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   793
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   794
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   795
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   796
* Notify reset for RMobileCall::NotifyTrafficChannelConfirmation
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   797
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   798
void TCallControlTsyTestHelper::WaitForMobileCallNotifyTrafficChannelConfirmation( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   799
				RMobileCall& aMobileCall,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   800
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   801
				RMobileCall::TMobileCallTch& aTchType, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   802
				RMobileCall::TMobileCallTch aExpectedTchType,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   803
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   804
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   805
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   806
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   807
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   808
	ASSERT_EQUALS(err, KErrNone, _L("RMobileCall::NotifyTrafficChannelConfirmation did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   809
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   810
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   811
							&& aTchType != aExpectedTchType )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   812
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   813
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   814
		// Repost notification until timeout or we get the right result.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   815
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   816
		aMobileCall.NotifyTrafficChannelConfirmation(aRequestStatus, aTchType);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   817
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   818
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   819
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   820
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobileCall::NotifyTrafficChannelConfirmation Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   821
	ASSERT_EQUALS(aTchType, aExpectedTchType, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   822
				_L("RMobileCall::NotifyTrafficChannelConfirmation Wrong result"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   823
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   824
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   825
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   826
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   827
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   828
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   829
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   830
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   831
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   832
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   833
* Notify reset for RMobileCall::NotifyRemotePartyInfoChange
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   834
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   835
void TCallControlTsyTestHelper::WaitForMobileCallNotifyRemotePartyInfoChange( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   836
				RMobileCall& aMobileCall,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   837
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   838
				TCmpBase<RMobileCall::TMobileCallRemotePartyInfoV1> &aMobileCallRemotePartyInfoV1,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   839
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   840
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   841
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   842
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   843
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   844
	ASSERT_EQUALS(err, KErrNone, _L("RMobileCall::NotifyRemotePartyInfoChange did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   845
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   846
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   847
							&& !aMobileCallRemotePartyInfoV1.IsEqual(ENoLogError) )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   848
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   849
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   850
		// Repost notification until timeout or we get the right result.		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   851
		RMobileCall::TMobileCallRemotePartyInfoV1Pckg pkgParam( aMobileCallRemotePartyInfoV1.GetValue() );
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   852
		aMobileCall.NotifyRemotePartyInfoChange(aRequestStatus, pkgParam);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   853
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   854
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   855
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   856
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobileCall::NotifyRemotePartyInfoChange Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   857
	ASSERT_TRUE(aMobileCallRemotePartyInfoV1.IsEqual(ELogError), 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   858
				_L("RMobileCall::NotifyRemotePartyInfoChange Wrong result"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   859
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   860
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   861
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   862
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   863
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   864
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   865
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   866
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   867
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   868
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   869
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   870
* Notify reset for RMobileConferenceCall::NotifyCapsChange
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   871
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   872
void TCallControlTsyTestHelper::WaitForMobileConferenceCallNotifyCapsChange( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   873
				RMobileConferenceCall& aMobileConferenceCall,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   874
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   875
				TUint32& aCaps, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   876
				TUint32 aWantedCaps,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   877
				TUint32 aUnwantedCaps,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   878
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   879
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   880
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   881
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   882
	TEST_FRAMEWORK_LOG2(_L("RMobileConferenceCall::NotifyCapsChange looking for caps %08X"),
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   883
			aWantedCaps	);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   884
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   885
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   886
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeMedium);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   887
	ASSERT_EQUALS(err, KErrNone, _L("RMobileConferenceCall::NotifyCapsChange did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   888
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   889
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   890
							&& ( ((aCaps & aWantedCaps) != aWantedCaps)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   891
								 || ((aCaps & aUnwantedCaps) != 0) ) )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   892
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   893
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   894
		// Repost notification until timeout or we get the right result.	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   895
		TEST_FRAMEWORK_LOG2(_L("TCallControlTsyTestHelper::WaitForMobileConferenceCallNotifyCapsChange got caps %08X"),
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   896
				aCaps );
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   897
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   898
		aMobileConferenceCall.NotifyCapsChange(aRequestStatus, aCaps);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   899
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   900
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   901
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   902
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   903
				_L("RMobileConferenceCall::NotifyCapsChange Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   904
	ASSERT_BITS_SET(aCaps, aWantedCaps, aUnwantedCaps, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   905
				_L("RMobileConferenceCall::NotifyCapsChange Wrong caps"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   906
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   907
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   908
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   909
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   910
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   911
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   912
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   913
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   914
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   915
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   916
* Notify reset for RMobileConferenceCall::NotifyConferenceEvent
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   917
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   918
void TCallControlTsyTestHelper::WaitForMobileConferenceCallNotifyConferenceEvent( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   919
				RMobileConferenceCall& aMobileConferenceCall,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   920
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   921
				RMobileConferenceCall::TMobileConferenceEvent& aEvent, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   922
				RMobileConferenceCall::TMobileConferenceEvent aExpectedEvent,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   923
				TName &aCallName,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   924
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   925
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   926
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   927
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   928
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeMedium);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   929
	ASSERT_EQUALS(err, KErrNone, _L("RMobileConferenceCall::NotifyConferenceEvent did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   930
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   931
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   932
							&& aEvent != aExpectedEvent )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   933
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   934
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   935
		// Repost notification until timeout or we get the right result.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   936
		TEST_FRAMEWORK_LOG4(_L("TCallControlTsyTestHelper::WaitForMobileConferenceCallNotifyConferenceEvent looking for %d got %d name %S"),
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   937
									aExpectedEvent, aEvent, &aCallName );
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   938
				
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   939
		aMobileConferenceCall.NotifyConferenceEvent(aRequestStatus, aEvent, aCallName);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   940
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   941
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   942
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   943
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobileConferenceCall::NotifyConferenceEvent Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   944
	ASSERT_EQUALS(aEvent, aExpectedEvent, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   945
				_L("RMobileConferenceCall::NotifyConferenceEvent Wrong result"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   946
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   947
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   948
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   949
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   950
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   951
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   952
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   953
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   954
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   955
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   956
* Notify reset for RMobileConferenceCall::NotifyConferenceStatusChange
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   957
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   958
void TCallControlTsyTestHelper::WaitForMobileConferenceCallNotifyConferenceStatusChange( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   959
				RMobileConferenceCall& aMobileConferenceCall,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   960
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   961
				RMobileConferenceCall::TMobileConferenceStatus& aStatus, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   962
				RMobileConferenceCall::TMobileConferenceStatus aExpectedStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   963
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   964
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   965
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   966
	TEST_FRAMEWORK_LOG2(_L("RMobileConferenceCall::NotifyConferenceStatusChange looking for %d"),
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   967
			aExpectedStatus	);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   968
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   969
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   970
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeMedium);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   971
	ASSERT_EQUALS(err, KErrNone, _L("RMobileConferenceCall::NotifyConferenceStatusChange did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   972
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   973
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   974
							&& aStatus != aExpectedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   975
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   976
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   977
		// Repost notification until timeout or we get the right result.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   978
		TEST_FRAMEWORK_LOG2(_L("RMobileConferenceCall::NotifyConferenceStatusChange intermediate %d"),
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   979
								aStatus	);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   980
		aMobileConferenceCall.NotifyConferenceStatusChange(aRequestStatus, aStatus);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   981
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   982
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   983
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   984
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobileConferenceCall::NotifyConferenceStatusChange Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   985
	ASSERT_EQUALS(aStatus, aExpectedStatus, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   986
				_L("RMobileConferenceCall::NotifyConferenceStatusChange Wrong result"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   987
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   988
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   989
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   990
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   991
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   992
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   993
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   994
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   995
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   996
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   997
* Notify reset for RMobileLine::NotifyMobileLineStatusChange
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   998
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
   999
void TCallControlTsyTestHelper::WaitForMobileLineNotifyMobileLineStatusChange( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1000
				RMobileLine& aMobileLine,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1001
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1002
				RMobileCall::TMobileCallStatus& aStatus, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1003
				RMobileCall::TMobileCallStatus aExpectedStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1004
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1005
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1006
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1007
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1008
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeMedium);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1009
	ASSERT_EQUALS(err, KErrNone, _L("RMobileLine::NotifyMobileLineStatusChange did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1010
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1011
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1012
							&& aStatus != aExpectedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1013
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1014
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1015
		// Repost notification until timeout or we get the right result.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1016
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1017
		aMobileLine.NotifyMobileLineStatusChange(aRequestStatus, aStatus);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1018
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1019
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1020
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1021
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobileLine::NotifyMobileLineStatusChange Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1022
	ASSERT_EQUALS(aStatus, aExpectedStatus, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1023
				_L("RMobileLine::NotifyMobileLineStatusChange Wrong result"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1024
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1025
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1026
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1027
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1028
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1029
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1030
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1031
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1032
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1033
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1034
* Notify reset for RMobilePhone::NotifyALSLineChange
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1035
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1036
void TCallControlTsyTestHelper::WaitForMobilePhoneNotifyALSLineChange( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1037
				RMobilePhone& aMobilePhone,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1038
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1039
				RMobilePhone::TMobilePhoneALSLine& aALSLine, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1040
				RMobilePhone::TMobilePhoneALSLine aExpectedALSLine,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1041
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1042
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1043
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1044
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1045
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1046
	ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::NotifyALSLineChange did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1047
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1048
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1049
							&& aALSLine != aExpectedALSLine )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1050
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1051
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1052
		// Repost notification until timeout or we get the right result.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1053
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1054
		aMobilePhone.NotifyALSLineChange(aRequestStatus, aALSLine);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1055
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1056
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1057
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1058
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobilePhone::NotifyALSLineChange Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1059
	ASSERT_EQUALS(aALSLine, aExpectedALSLine, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1060
				_L("RMobilePhone::NotifyALSLineChange Wrong result"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1061
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1062
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1063
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1064
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1065
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1066
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1067
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1068
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1069
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1070
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1071
* Notify reset for RMobilePhone::NotifyAlternatingCallCapsChange
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1072
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1073
void TCallControlTsyTestHelper::WaitForMobilePhoneNotifyAlternatingCallCapsChange( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1074
				RMobilePhone& aMobilePhone,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1075
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1076
				TUint32& aCaps, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1077
				TUint32 aWantedCaps,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1078
				TUint32 aUnwantedCaps,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1079
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1080
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1081
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1082
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1083
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1084
	ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::NotifyAlternatingCallCapsChange did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1085
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1086
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1087
							&& ( ((aCaps & aWantedCaps) != aWantedCaps)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1088
								 || ((aCaps & aUnwantedCaps) != 0) ) )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1089
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1090
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1091
		// Repost notification until timeout or we get the right result.	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1092
		aMobilePhone.NotifyAlternatingCallCapsChange(aRequestStatus, aCaps);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1093
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1094
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1095
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1096
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1097
				_L("RMobilePhone::NotifyAlternatingCallCapsChange Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1098
	ASSERT_BITS_SET(aCaps, aWantedCaps, aUnwantedCaps, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1099
				_L("RMobilePhone::NotifyAlternatingCallCapsChange Wrong caps"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1100
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1101
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1102
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1103
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1104
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1105
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1106
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1107
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1108
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1109
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1110
* Notify reset for RMobilePhone::NotifyAlternatingCallModeChange
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1111
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1112
void TCallControlTsyTestHelper::WaitForMobilePhoneNotifyAlternatingCallModeChange( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1113
				RMobilePhone& aMobilePhone,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1114
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1115
				RMobilePhone::TMobilePhoneAlternatingCallMode& aMode, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1116
				RMobilePhone::TMobilePhoneAlternatingCallMode aExpectedMode,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1117
				RMobilePhone::TMobileService &aFirstService,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1118
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1119
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1120
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1121
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1122
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1123
	ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::NotifyAlternatingCallModeChange did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1124
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1125
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1126
							&& aMode != aExpectedMode )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1127
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1128
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1129
		// Repost notification until timeout or we get the right result.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1130
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1131
		aMobilePhone.NotifyAlternatingCallModeChange(aRequestStatus, aMode, aFirstService);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1132
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1133
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1134
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1135
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobilePhone::NotifyAlternatingCallModeChange Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1136
	ASSERT_EQUALS(aMode, aExpectedMode, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1137
				_L("RMobilePhone::NotifyAlternatingCallModeChange Wrong result"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1138
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1139
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1140
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1141
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1142
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1143
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1144
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1145
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1146
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1147
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1148
* Notify reset for RMobilePhone::NotifyDTMFCapsChange
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1149
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1150
void TCallControlTsyTestHelper::WaitForMobilePhoneNotifyDTMFCapsChange( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1151
				RMobilePhone& aMobilePhone,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1152
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1153
				TUint32& aCaps, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1154
				TUint32 aWantedCaps,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1155
				TUint32 aUnwantedCaps,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1156
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1157
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1158
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1159
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1160
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeMedium);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1161
	ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::NotifyDTMFCapsChange did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1162
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1163
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1164
							&& ( ((aCaps & aWantedCaps) != aWantedCaps)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1165
								 || ((aCaps & aUnwantedCaps) != 0) ) )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1166
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1167
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1168
		// Repost notification until timeout or we get the right result.	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1169
		aMobilePhone.NotifyDTMFCapsChange(aRequestStatus, aCaps);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1170
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1171
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1172
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1173
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1174
				_L("RMobilePhone::NotifyDTMFCapsChange Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1175
	ASSERT_BITS_SET(aCaps, aWantedCaps, aUnwantedCaps, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1176
				_L("RMobilePhone::NotifyDTMFCapsChange Wrong caps"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1177
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1178
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1179
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1180
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1181
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1182
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1183
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1184
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1185
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1186
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1187
* Notify reset for RMobilePhone::NotifyDTMFEvent
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1188
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1189
void TCallControlTsyTestHelper::WaitForMobilePhoneNotifyDTMFEvent( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1190
				RMobilePhone& aMobilePhone,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1191
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1192
				RMobilePhone::TMobilePhoneDTMFEvent& aEvent, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1193
				RMobilePhone::TMobilePhoneDTMFEvent& aExpectedEvent,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1194
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1195
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1196
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1197
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1198
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1199
	ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::NotifyDTMFEvent did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1200
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1201
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1202
							&& aEvent != aExpectedEvent )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1203
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1204
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1205
		// Repost notification until timeout or we get the right result.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1206
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1207
		aMobilePhone.NotifyDTMFEvent(aRequestStatus, aEvent);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1208
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1209
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1210
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1211
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobilePhone::NotifyDTMFEvent Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1212
	ASSERT_EQUALS(aEvent, aExpectedEvent, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1213
				_L("RMobilePhone::NotifyDTMFEvent Wrong result"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1214
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1215
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1216
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1217
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1218
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1219
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1220
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1221
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1222
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1223
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1224
* Notify reset for RMobilePhone::NotifyFdnStatusChange
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1225
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1226
void TCallControlTsyTestHelper::WaitForMobilePhoneNotifyFdnStatusChange( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1227
				RMobilePhone& aMobilePhone,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1228
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1229
				RMobilePhone::TMobilePhoneFdnStatus& aFdnStatus, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1230
				RMobilePhone::TMobilePhoneFdnStatus aExpectedFdnStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1231
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1232
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1233
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1234
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1235
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1236
	ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::NotifyFdnStatusChange did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1237
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1238
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1239
							&& aFdnStatus != aExpectedFdnStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1240
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1241
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1242
		// Repost notification until timeout or we get the right result.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1243
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1244
		aMobilePhone.NotifyFdnStatusChange(aRequestStatus, aFdnStatus);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1245
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1246
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1247
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1248
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobilePhone::NotifyFdnStatusChange Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1249
	ASSERT_EQUALS(aFdnStatus, aExpectedFdnStatus, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1250
				_L("RMobilePhone::NotifyFdnStatusChange Wrong result"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1251
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1252
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1253
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1254
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1255
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1256
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1257
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1258
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1259
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1260
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1261
* Notify reset for RMobilePhone::NotifyIncomingCallTypeChange
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1262
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1263
void TCallControlTsyTestHelper::WaitForMobilePhoneNotifyIncomingCallTypeChange( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1264
				RMobilePhone& aMobilePhone,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1265
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1266
				RMobilePhone::TMobilePhoneIncomingCallType &aCallType,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1267
				TCmpBase<RMobileCall::TMobileDataCallParamsV1> &aMobileDataCallParamsV1,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1268
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1269
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1270
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1271
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1272
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1273
	ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::NotifyIncomingCallTypeChange did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1274
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1275
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1276
							&& !aMobileDataCallParamsV1.IsEqual(ENoLogError) )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1277
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1278
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1279
		// Repost notification until timeout or we get the right result.		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1280
		RMobileCall::TMobileDataCallParamsV1Pckg pkgParam( aMobileDataCallParamsV1.GetValue() );
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1281
		aMobilePhone.NotifyIncomingCallTypeChange(aRequestStatus, aCallType, pkgParam);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1282
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1283
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1284
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1285
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobilePhone::NotifyIncomingCallTypeChange Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1286
	ASSERT_TRUE(aMobileDataCallParamsV1.IsEqual(ELogError), 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1287
				_L("RMobilePhone::NotifyIncomingCallTypeChange Wrong result"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1288
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1289
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1290
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1291
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1292
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1293
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1294
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1295
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1296
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1297
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1298
* Notify reset for RMobilePhone::NotifyIndicatorChange
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1299
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1300
void TCallControlTsyTestHelper::WaitForMobilePhoneNotifyIndicatorChange( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1301
				RMobilePhone& aMobilePhone,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1302
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1303
				TUint32& aIndicator, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1304
				TUint32 aExpectedIndicator,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1305
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1306
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1307
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1308
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1309
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1310
	ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::NotifyIndicatorChange did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1311
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1312
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1313
							&& aIndicator != aExpectedIndicator )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1314
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1315
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1316
		// Repost notification until timeout or we get the right result.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1317
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1318
		aMobilePhone.NotifyIndicatorChange(aRequestStatus, aIndicator);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1319
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1320
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1321
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1322
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobilePhone::NotifyIndicatorChange Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1323
	ASSERT_EQUALS(aIndicator, aExpectedIndicator, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1324
				_L("RMobilePhone::NotifyIndicatorChange Wrong result"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1325
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1326
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1327
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1328
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1329
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1330
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1331
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1332
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1333
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1334
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1335
* Notify reset for RMobilePhone::NotifyMessageWaiting
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1336
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1337
void TCallControlTsyTestHelper::WaitForMobilePhoneNotifyMessageWaiting( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1338
				RMobilePhone& aMobilePhone,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1339
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1340
				TInt& aCount, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1341
				TInt aExpectedCount,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1342
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1343
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1344
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1345
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1346
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1347
	ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::NotifyMessageWaiting did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1348
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1349
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1350
							&& aCount != aExpectedCount )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1351
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1352
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1353
		// Repost notification until timeout or we get the right result.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1354
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1355
		aMobilePhone.NotifyMessageWaiting(aRequestStatus, aCount);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1356
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1357
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1358
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1359
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobilePhone::NotifyMessageWaiting Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1360
	ASSERT_EQUALS(aCount, aExpectedCount, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1361
				_L("RMobilePhone::NotifyMessageWaiting Wrong result"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1362
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1363
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1364
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1365
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1366
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1367
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1368
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1369
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1370
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1371
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1372
* Notify reset for RMobilePhone::NotifyMulticallIndicatorChange
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1373
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1374
void TCallControlTsyTestHelper::WaitForMobilePhoneNotifyMulticallIndicatorChange( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1375
				RMobilePhone& aMobilePhone,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1376
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1377
				RMobilePhone::TMobilePhoneMulticallIndicator& aMulticallIndicator, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1378
				RMobilePhone::TMobilePhoneMulticallIndicator aExpectedMulticallIndicator,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1379
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1380
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1381
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1382
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1383
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1384
	ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::NotifyMulticallIndicatorChange did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1385
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1386
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1387
							&& aMulticallIndicator != aExpectedMulticallIndicator )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1388
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1389
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1390
		// Repost notification until timeout or we get the right result.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1391
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1392
		aMobilePhone.NotifyMulticallIndicatorChange(aRequestStatus, aMulticallIndicator);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1393
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1394
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1395
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1396
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobilePhone::NotifyMulticallIndicatorChange Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1397
	ASSERT_EQUALS(aMulticallIndicator, aExpectedMulticallIndicator, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1398
				_L("RMobilePhone::NotifyMulticallIndicatorChange Wrong result"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1399
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1400
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1401
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1402
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1403
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1404
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1405
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1406
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1407
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1408
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1409
* Notify reset for RMobilePhone::NotifyMulticallParamsChange
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1410
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1411
void TCallControlTsyTestHelper::WaitForMobilePhoneNotifyMulticallParamsChange( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1412
				RMobilePhone& aMobilePhone,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1413
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1414
				TCmpBase<RMobilePhone::TMobilePhoneMulticallSettingsV1> &aMobilePhoneMulticallSettingsV1,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1415
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1416
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1417
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1418
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1419
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1420
	ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::NotifyMulticallParamsChange did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1421
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1422
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1423
							&& !aMobilePhoneMulticallSettingsV1.IsEqual(ENoLogError) )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1424
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1425
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1426
		// Repost notification until timeout or we get the right result.		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1427
		RMobilePhone::TMobilePhoneMulticallSettingsV1Pckg pkgParam( aMobilePhoneMulticallSettingsV1.GetValue() );
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1428
		aMobilePhone.NotifyMulticallParamsChange(aRequestStatus, pkgParam);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1429
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1430
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1431
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1432
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobilePhone::NotifyMulticallParamsChange Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1433
	ASSERT_TRUE(aMobilePhoneMulticallSettingsV1.IsEqual(ELogError), 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1434
				_L("RMobilePhone::NotifyMulticallParamsChange Wrong result"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1435
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1436
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1437
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1438
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1439
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1440
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1441
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1442
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1443
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1444
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1445
* Notify reset for RMobilePhone::NotifyMultimediaCallPreferenceChange
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1446
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1447
void TCallControlTsyTestHelper::WaitForMobilePhoneNotifyMultimediaCallPreferenceChange( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1448
				RMobilePhone& aMobilePhone,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1449
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1450
				RMobilePhone::TMobilePhoneMultimediaSettings& aMmSettings, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1451
				RMobilePhone::TMobilePhoneMultimediaSettings aExpectedMmSettings,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1452
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1453
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1454
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1455
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1456
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1457
	ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::NotifyMultimediaCallPreferenceChange did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1458
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1459
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1460
							&& aMmSettings != aExpectedMmSettings )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1461
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1462
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1463
		// Repost notification until timeout or we get the right result.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1464
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1465
		aMobilePhone.NotifyMultimediaCallPreferenceChange(aRequestStatus, aMmSettings);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1466
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1467
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1468
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1469
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobilePhone::NotifyMultimediaCallPreferenceChange Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1470
	ASSERT_EQUALS(aMmSettings, aExpectedMmSettings, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1471
				_L("RMobilePhone::NotifyMultimediaCallPreferenceChange Wrong result"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1472
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1473
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1474
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1475
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1476
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1477
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1478
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1479
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1480
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1481
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1482
* Notify reset for RMobilePhone::NotifyStopInDTMFString
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1483
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1484
void TCallControlTsyTestHelper::WaitForMobilePhoneNotifyStopInDTMFString( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1485
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1486
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1487
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1488
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1489
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1490
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1491
	ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::NotifyStopInDTMFString did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1492
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobilePhone::NotifyStopInDTMFString Wrong completion status"))		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1493
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1494
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1495
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1496
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1497
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1498
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1499
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1500
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1501
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1502
* Notify reset for RMobilePhone::NotifyAirTimeDurationChange
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1503
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1504
void TCallControlTsyTestHelper::WaitForMobilePhoneNotifyAirTimeDurationChange( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1505
				RMobilePhone& aMobilePhone,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1506
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1507
				TTimeIntervalSeconds& aTime, 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1508
				TTimeIntervalSeconds aExpectedTime,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1509
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1510
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1511
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1512
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1513
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1514
	ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::NotifyAirTimeDurationChange did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1515
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1516
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1517
							&& aTime != aExpectedTime )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1518
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1519
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1520
		// Repost notification until timeout or we get the right result.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1521
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1522
		aMobilePhone.NotifyAirTimeDurationChange(aRequestStatus, aTime);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1523
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1524
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1525
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1526
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobilePhone::NotifyAirTimeDurationChange Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1527
	ASSERT_EQUALS(aTime.Int(), aExpectedTime.Int(), 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1528
				_L("RMobilePhone::NotifyAirTimeDurationChange Wrong result"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1529
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1530
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1531
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1532
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1533
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1534
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1535
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1536
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1537
		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1538
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1539
* Notify reset for RMobilePhone::NotifyCostInfoChange
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1540
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1541
void TCallControlTsyTestHelper::WaitForMobilePhoneNotifyCostInfoChange( 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1542
				RMobilePhone& aMobilePhone,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1543
				TEtelRequestBase& aRequestStatus,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1544
				TCmpBase<RMobilePhone::TMobilePhoneCostInfoV1> &aMobilePhoneCostInfoV1,
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1545
				TInt aWantedStatus )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1546
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1547
	{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1548
	// Wait for the request to complete	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1549
	TInt err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1550
	ASSERT_EQUALS(err, KErrNone, _L("RMobilePhone::NotifyCostInfoChange did not complete"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1551
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1552
	while (	err == KErrNone && aRequestStatus.Int() == KErrNone  	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1553
							&& !aMobilePhoneCostInfoV1.IsEqual(ENoLogError) )
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1554
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1555
		// Request has completed with incorrect result. Consume any outstanding
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1556
		// Repost notification until timeout or we get the right result.		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1557
		RMobilePhone::TMobilePhoneCostInfoV1Pckg pkgParam( aMobilePhoneCostInfoV1.GetValue() );
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1558
		aMobilePhone.NotifyCostInfoChange(aRequestStatus, pkgParam);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1559
		err = iTestStep.WaitForRequestWithTimeOut(aRequestStatus, ETimeShort);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1560
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1561
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1562
	ASSERT_EQUALS(aRequestStatus.Int(), aWantedStatus, _L("RMobilePhone::NotifyCostInfoChange Wrong completion status"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1563
	ASSERT_TRUE(aMobilePhoneCostInfoV1.IsEqual(ELogError), 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1564
				_L("RMobilePhone::NotifyCostInfoChange Wrong result"))	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1565
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1566
	// Cancel request if it is still pending	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1567
	if (aRequestStatus.Int() == KRequestPending)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1568
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1569
		aRequestStatus.Cancel();
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1570
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1571
	}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1572
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1573
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1574
* Check the valid variables returned by RMobileCall::GetMobileCallInfo including the phone number
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1575
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1576
void TCallControlTsyTestHelper::CheckForValidCallInfo(RMobileCall::TMobileCallInfoV1& aCallInfo, TPtrC aNumber)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1577
{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1578
	CheckForValidCallInfo(aCallInfo);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1579
	if(aCallInfo.iValid & RMobileCall::KCallDialledParty)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1580
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1581
		ASSERT_TRUE( aCallInfo.iDialledParty.iTelNumber == aNumber, _L("RMobileCall::GetMobileCallInfo set bitmask for KCallId to true, but set iCallId to an invalid number"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1582
		}	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1583
}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1584
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1585
/**
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1586
* Check the valid variables returned by RMobileCall::GetMobileCallInfo, when phone number is unknown
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1587
*/	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1588
void TCallControlTsyTestHelper::CheckForValidCallInfo(RMobileCall::TMobileCallInfoV1& aCallInfo, TInt aRequiredExitCode, TBool aIsCallConnected)	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1589
{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1590
	if(aCallInfo.iValid & RMobileCall::KCallStartTime)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1591
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1592
		TTime invalidTime = 0;
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1593
		TTime startTime(aCallInfo.iStartTime);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1594
		if(aIsCallConnected)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1595
		    {
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1596
            ASSERT_TRUE( startTime > invalidTime, _L("RMobileCall::GetMobileCallInfo set bitmask for KCallStartTime to true, but set iStartTime to an invalid number"));
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1597
		    }
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1598
		else
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1599
		    {
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1600
		    ASSERT_EQUALS( startTime.Int64(), invalidTime.Int64(), _L("RMobileCall::GetMobileCallInfo set bitmask for KCallStartTime to true, but set iStartTime to an invalid invalid time"));
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1601
		    }
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1602
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1603
	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1604
	if(aCallInfo.iValid & RMobileCall::KCallDuration)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1605
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1606
		TTimeIntervalSeconds invalidTime = 0;
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1607
		TTimeIntervalSeconds callDuration(aCallInfo.iDuration);
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1608
		if(aIsCallConnected)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1609
		    {
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1610
		    ASSERT_TRUE( callDuration > invalidTime, _L("RMobileCall::GetMobileCallInfo set bitmask for KCallDuration to true, but set iDuration to an invalid number"));
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1611
		    }
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1612
		else
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1613
		    {
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1614
		    // Note: This value contains previous call duration since it is not connected, can be 0 or bigger than 0. 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1615
            ASSERT_TRUE( callDuration >= invalidTime, _L("RMobileCall::GetMobileCallInfo set bitmask for KCallDuration to true, but set iDuration to an invalid number"));
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1616
		    }
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1617
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1618
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1619
	if(aCallInfo.iValid & RMobileCall::KCallId)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1620
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1621
		if(aIsCallConnected)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1622
		    {
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1623
            ASSERT_TRUE( aCallInfo.iCallId > -1, _L("RMobileCall::GetMobileCallInfo set bitmask for KCallId to true, but set iCallId to an invalid number"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1624
		    }
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1625
		else
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1626
		    {
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1627
            ASSERT_EQUALS( aCallInfo.iCallId, -1, _L("RMobileCall::GetMobileCallInfo set bitmask for KCallId to true, but set iCallId to an invalid number"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1628
		    }
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1629
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1630
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1631
	if(aCallInfo.iValid & RMobileCall::KCallRemoteParty)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1632
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1633
		ASSERT_TRUE( aCallInfo.iRemoteParty.iRemoteNumber.iTelNumber.Length() > 0, _L("RMobileCall::GetMobileCallInfo set bitmask for KCallRemoteParty to true, but set iRemoteParty.iRemoteNumber.iTelNumber.Length() to an invalid length"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1634
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1635
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1636
	if(aCallInfo.iValid & RMobileCall::KCallExitCode)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1637
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1638
        // Note: iExitCode contains previous call result if it is not connected. 
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1639
		ASSERT_EQUALS( aCallInfo.iExitCode, aRequiredExitCode, _L("RMobileCall::GetMobileCallInfo set bitmask for KCallExitCode to true, but did not set iExitCode to that expected."))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1640
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1641
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1642
	if(aCallInfo.iValid & RMobileCall::KCallEmergency)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1643
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1644
		ASSERT_EQUALS( aCallInfo.iEmergency, (TBool)EFalse, _L("RMobileCall::GetMobileCallInfo set bitmask for KCallEmergency to true, but did not set iEmergency to EFalse, even though this is not an emergency number"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1645
		}				
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1646
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1647
	if(aCallInfo.iValid & RMobileCall::KCallForwarded)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1648
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1649
		ASSERT_EQUALS( aCallInfo.iForwarded, (TBool)EFalse, _L("RMobileCall::GetMobileCallInfo set bitmask for KCallForwarded to true, but did not set iForwarded to EFalse, even though this is not an Forwarded call"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1650
		}		
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1651
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1652
	if(aCallInfo.iValid & RMobileCall::KCallPrivacy)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1653
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1654
		ASSERT_TRUE( aCallInfo.iPrivacy != RMobilePhone::EPrivacyUnspecified, _L("RMobileCall::GetMobileCallInfo set bitmask for KCallPrivacy to true, but did not set to an expected number"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1655
		}	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1656
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1657
	if(aCallInfo.iValid & RMobileCall::KCallTch)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1658
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1659
		ASSERT_TRUE( (aCallInfo.iTch != RMobileCall::ETchUnknown) , _L("RMobileCall::GetMobileCallInfo set bitmask for KCallTch to true, but iTch is still unknown"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1660
		}	
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1661
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1662
    // CTSY initialises iAlternatingCall to EAlternatingModeUnspecified, which should be updated from LTSY.
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1663
    // ( IPC is EMobileCallGetMobileCallInfo and method is CompleteNotifyMobileCallInfoChange().
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1664
	if(aCallInfo.iValid & RMobileCall::KCallAlternating)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1665
		{
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1666
		if(aIsCallConnected)
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1667
		    {
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1668
		    // Because LTSY is not updating this correctly, check is changed from !=EAlternatingModeUnspecified to ==EAlternatingModeUnspecified
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1669
		    ASSERT_EQUALS(aCallInfo.iAlternatingCall, RMobilePhone::EAlternatingModeUnspecified, _L("RMobileCall::GetMobileCallInfo set bitmask for KCallAlternating to true, but iAlternatingCall is not EAlternatingModeUnspecified"))
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1670
		    }
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1671
		else
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1672
		    {
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1673
		    ASSERT_EQUALS(aCallInfo.iAlternatingCall, RMobilePhone::EAlternatingModeUnspecified , _L("RMobileCall::GetMobileCallInfo set bitmask for KCallAlternating to true, but iAlternatingCall is not initialized EAlternatingModeUnspecified"));
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1674
		    }
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1675
		}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1676
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1677
}
6638e7f4bd8f opencode
Oscar Gonzalez <oscar.1.gonzalez@nokia.com>
parents: 23
diff changeset
  1678