resourcemgmt/hwresourcesmgr/test/te_hwrm/hwrmtest.cpp
changeset 70 653a8b91b95e
parent 52 d6b9e89d80a3
child 78 3f0699f2e14c
equal deleted inserted replaced
64:61992147389a 70:653a8b91b95e
   143 	ADD_TEST_STEP_ISO_CPP(CHWRMTest, TestLightBlinkDurationRGB_ExtendedL);
   143 	ADD_TEST_STEP_ISO_CPP(CHWRMTest, TestLightBlinkDurationRGB_ExtendedL);
   144     ADD_TEST_STEP_ISO_CPP(CHWRMTest, TestLightEnhancedLightLeaveL);
   144     ADD_TEST_STEP_ISO_CPP(CHWRMTest, TestLightEnhancedLightLeaveL);
   145     ADD_TEST_STEP_ISO_CPP(CHWRMTest, TestLightSetColorReserveL);
   145     ADD_TEST_STEP_ISO_CPP(CHWRMTest, TestLightSetColorReserveL);
   146     
   146     
   147     // Power State tests
   147     // Power State tests
   148     ADD_TEST_STEP_ISO_CPP(CHWRMTest, TestPowerStatesL);
   148     ADD_TEST_STEP_ISO_CPP(CHWRMTest, TestPowerStatesL);	
   149 	
   149     ADD_TEST_STEP_ISO_CPP(CHWRMTest, TestPowerExtendedBatteryStatusL);
       
   150     ADD_TEST_STEP_ISO_CPP(CHWRMTest, TestPowerBatteryStatusL);
       
   151     ADD_TEST_STEP_ISO_CPP(CHWRMTest, TestPowerChargingStatusL);
       
   152     
   150 	// Extended Lights
   153 	// Extended Lights
   151 	ADD_TEST_STEP_ISO_CPP(CHWRMTest, TestExtendedLightSessionsL);
   154 	ADD_TEST_STEP_ISO_CPP(CHWRMTest, TestExtendedLightSessionsL);
   152 
   155 
   153 	ADD_TEST_STEP_ISO_CPP(CHWRMTest, TestInvalidSessionsL);
   156 	ADD_TEST_STEP_ISO_CPP(CHWRMTest, TestInvalidSessionsL);
   154 
   157 
  1347 	AddTestStateL(this, &CHWRMTest::DisplayLightOnColor_Client2L, 3*KTwoTimeUnits);
  1350 	AddTestStateL(this, &CHWRMTest::DisplayLightOnColor_Client2L, 3*KTwoTimeUnits);
  1348 	
  1351 	
  1349 	ExecuteTestL();	
  1352 	ExecuteTestL();	
  1350 	}
  1353 	}
  1351 
  1354 
  1352 
       
  1353 void CHWRMTest::TestPowerStatesL()
  1355 void CHWRMTest::TestPowerStatesL()
  1354 	{
  1356     {
  1355 	INFO_PRINTF1(_L("Start test step: TestPowerStatesL"));
  1357     INFO_PRINTF1(_L("Start test step: TestPowerStatesL"));
  1356 	AddTestStateL(this, &CHWRMTest::PowerStateOpenL, KTwoTimeUnits);
  1358     AddTestStateL(this, &CHWRMTest::PowerStateOpenL, KTwoTimeUnits);
  1357 	AddTestStateL(this, &CHWRMTest::BatteryLevelL, KTwoTimeUnits);
  1359     AddTestStateL(this, &CHWRMTest::ExpectLegacyBatteryStatusL, KTwoTimeUnits);
  1358 	AddTestStateL(this, &CHWRMTest::BatteryStateL, KTwoTimeUnits);
  1360     AddTestStateL(this, &CHWRMTest::ExpectLegacyChargingStatusL, KTwoTimeUnits);    
  1359 	AddTestStateL(this, &CHWRMTest::ChargingStatusL, KTwoTimeUnits);	
  1361     AddTestStateL(this, &CHWRMTest::BatteryLevelL, KTwoTimeUnits);
  1360 	
  1362     AddTestStateL(this, &CHWRMTest::BatteryStateL, KTwoTimeUnits);
  1361 	ExecuteTestL();	
  1363     AddTestStateL(this, &CHWRMTest::ChargingStatusL, KTwoTimeUnits);    
  1362 	}
  1364     
       
  1365     ExecuteTestL(); 
       
  1366     }
       
  1367 
       
  1368 void CHWRMTest::TestPowerExtendedBatteryStatusL()
       
  1369     {
       
  1370     INFO_PRINTF1(_L("Start test step: TestPowerExtendedBatteryStatusL"));
       
  1371     AddTestStateL(this, &CHWRMTest::PowerStateOpenL, KTwoTimeUnits);
       
  1372     AddTestStateL(this, &CHWRMTest::ExpectNewBatteryStatusL, KTwoTimeUnits);
       
  1373     AddTestStateL(this, &CHWRMTest::ExpectNewChargingStatusL, KTwoTimeUnits);
       
  1374     AddTestStateL(this, &CHWRMTest::ExtendedBatteryStateStatusOkL, KTwoTimeUnits);
       
  1375     AddTestStateL(this, &CHWRMTest::ExtendedBatteryStateUnknownErrorL, KTwoTimeUnits);
       
  1376 	AddTestStateL(this, &CHWRMTest::ExtendedBatteryStateUnsupportedL, KTwoTimeUnits);
       
  1377     AddTestStateL(this, &CHWRMTest::ExtendedBatteryStateAuthErrorL, KTwoTimeUnits);
       
  1378     AddTestStateL(this, &CHWRMTest::ExtendedBatteryStateStatusLowL, KTwoTimeUnits);
       
  1379     AddTestStateL(this, &CHWRMTest::ExtendedBatteryStateStatusEmptyL, KTwoTimeUnits);    
       
  1380     // Reset battery status to "Ok"
       
  1381     AddTestStateL(this, &CHWRMTest::ExtendedBatteryStateStatusOkL, KTwoTimeUnits);
       
  1382     
       
  1383     ExecuteTestL();
       
  1384     }
       
  1385 	
       
  1386 void CHWRMTest::TestPowerBatteryStatusL()
       
  1387     {
       
  1388     INFO_PRINTF1(_L("Start test step: TestPowerBatteryStatusL"));
       
  1389     AddTestStateL(this, &CHWRMTest::PowerStateOpenL, KTwoTimeUnits);
       
  1390     AddTestStateL(this, &CHWRMTest::ExpectLegacyBatteryStatusL, KTwoTimeUnits);
       
  1391     AddTestStateL(this, &CHWRMTest::ExpectLegacyChargingStatusL, KTwoTimeUnits);
       
  1392     AddTestStateL(this, &CHWRMTest::BatteryStateStatusOkL, KTwoTimeUnits);
       
  1393     AddTestStateL(this, &CHWRMTest::BatteryStateUnknownErrorL, KTwoTimeUnits);
       
  1394 		AddTestStateL(this, &CHWRMTest::BatteryStateUnsupportedL, KTwoTimeUnits);
       
  1395     AddTestStateL(this, &CHWRMTest::BatteryStateAuthErrorL, KTwoTimeUnits);
       
  1396     AddTestStateL(this, &CHWRMTest::BatteryStateStatusLowL, KTwoTimeUnits);
       
  1397     AddTestStateL(this, &CHWRMTest::BatteryStateStatusEmptyL, KTwoTimeUnits);    
       
  1398     // Reset battery status to "Ok"
       
  1399     AddTestStateL(this, &CHWRMTest::BatteryStateStatusOkL, KTwoTimeUnits);
       
  1400     
       
  1401     ExecuteTestL();
       
  1402     }	
       
  1403 
       
  1404 void CHWRMTest::TestPowerChargingStatusL()
       
  1405     {
       
  1406     INFO_PRINTF1(_L("Start test step: TestPowerChargingStatusL"));
       
  1407     AddTestStateL(this, &CHWRMTest::PowerStateOpenL, KTwoTimeUnits);
       
  1408     AddTestStateL(this, &CHWRMTest::ExpectLegacyBatteryStatusL, KTwoTimeUnits);
       
  1409     AddTestStateL(this, &CHWRMTest::ExpectLegacyChargingStatusL, KTwoTimeUnits);
       
  1410     AddTestStateL(this, &CHWRMTest::ChargingStatusNotConnectedL, KTwoTimeUnits);
       
  1411     AddTestStateL(this, &CHWRMTest::ChargingStatusChargingOkL, KTwoTimeUnits);
       
  1412     AddTestStateL(this, &CHWRMTest::ChargingStatusNotChargingL, KTwoTimeUnits);
       
  1413     AddTestStateL(this, &CHWRMTest::ChargingStatusAlmostCompleteL, KTwoTimeUnits);
       
  1414     AddTestStateL(this, &CHWRMTest::ChargingStatusCompletedChargingL, KTwoTimeUnits);
       
  1415     AddTestStateL(this, &CHWRMTest::ChargingStatusChargingContinuesL, KTwoTimeUnits);
       
  1416     AddTestStateL(this, &CHWRMTest::ChargingStatusErrorL, KTwoTimeUnits);
       
  1417     AddTestStateL(this, &CHWRMTest::ChargingStatusIllegalErrorL, KTwoTimeUnits);
       
  1418     AddTestStateL(this, &CHWRMTest::ChargingStatusUnderVoltageErrorL, KTwoTimeUnits);
       
  1419     AddTestStateL(this, &CHWRMTest::ChargingStatusOverVoltageErrorL, KTwoTimeUnits);
       
  1420     AddTestStateL(this, &CHWRMTest::ChargingStatusTooHotErrorL, KTwoTimeUnits);
       
  1421     AddTestStateL(this, &CHWRMTest::ChargingStatusTooColdErrorL, KTwoTimeUnits);
       
  1422     //Reset Charging Status to "completed"
       
  1423     AddTestStateL(this, &CHWRMTest::ChargingStatusCompletedChargingL, KTwoTimeUnits);
       
  1424     
       
  1425     ExecuteTestL();
       
  1426     }
  1363 
  1427 
  1364 void CHWRMTest::TestExtendedLightSessionsL()
  1428 void CHWRMTest::TestExtendedLightSessionsL()
  1365 	{
  1429 	{
  1366 	INFO_PRINTF1(_L("Start test step: TestExtendedLightSessionsL"));
  1430 	INFO_PRINTF1(_L("Start test step: TestExtendedLightSessionsL"));
  1367 	AddTestStateL(this, &CHWRMTest::DisableNotificationCheckingL, KOneTimeUnit);
  1431 	AddTestStateL(this, &CHWRMTest::DisableNotificationCheckingL, KOneTimeUnit);
  1476 	}
  1540 	}
  1477 
  1541 
  1478 #ifdef SYMBIAN_HWRM_EXTPOWERINFO
  1542 #ifdef SYMBIAN_HWRM_EXTPOWERINFO
  1479 #define SET_CHARGINGSTATUS(s) \
  1543 #define SET_CHARGINGSTATUS(s) \
  1480 	{ \
  1544 	{ \
  1481 	iMockPowerState.CompleteL(KHWRMChargingStatus, s, 5); \
  1545 	iMockPowerState.CompleteL(KHWRMExtendedChargingStatus, s, 5); \
  1482 	User::After(KOneSecond); \
  1546 	User::After(KOneSecond); \
  1483 	iChargingStatus = s; \
  1547 	iChargingStatus = s; \
  1484 	if(iChargingStatusCBregistered) ExpectedChargingStatusNotificationsL(s); \
  1548 	if(iChargingStatusCBregistered) ExpectedExtendedChargingStatusNotificationsL(s); \
  1485 	}
  1549 	}
  1486 
  1550 
  1487 void CHWRMTest::PowerAndPowerStateOpenL()
  1551 void CHWRMTest::PowerAndPowerStateOpenL()
  1488 	{
  1552 	{
  1489 	INFO_PRINTF1(_L("Step state: PowerAndPowerStateOpenL"));
  1553 	INFO_PRINTF1(_L("Step state: PowerAndPowerStateOpenL"));
  1508 	{
  1572 	{
  1509 	INFO_PRINTF1(_L("Step state: PowerChargingStatusErrorL"));
  1573 	INFO_PRINTF1(_L("Step state: PowerChargingStatusErrorL"));
  1510 	SET_CHARGINGSTATUS(EChargingStatusError);
  1574 	SET_CHARGINGSTATUS(EChargingStatusError);
  1511 	}
  1575 	}
  1512 
  1576 
       
  1577 void CHWRMTest::PowerChargingStatusIllegalErrorL()
       
  1578     {
       
  1579     INFO_PRINTF1(_L("Step state: PowerChargingStatusIllegalErrorL"));
       
  1580     SET_CHARGINGSTATUS(EChargingStatusIllegalChargerError);
       
  1581     }
       
  1582 
       
  1583 void CHWRMTest::PowerChargingStatusUnderVoltageErrorL()
       
  1584     {
       
  1585     INFO_PRINTF1(_L("Step state: PowerChargingStatusUnderVoltageErrorL"));
       
  1586     SET_CHARGINGSTATUS(EChargingStatusChargerUnderVoltageError);
       
  1587     }
       
  1588 
       
  1589 void CHWRMTest::PowerChargingStatusOverVoltageErrorL()
       
  1590     {
       
  1591     INFO_PRINTF1(_L("Step state: PowerChargingStatusOverVoltageErrorL"));
       
  1592     SET_CHARGINGSTATUS(EChargingStatusChargerOverVoltageError);
       
  1593     }
       
  1594 
       
  1595 void CHWRMTest::PowerChargingStatusTooHotErrorL()
       
  1596     {
       
  1597     INFO_PRINTF1(_L("Step state: PowerChargingStatusTooHotErrorL"));
       
  1598     SET_CHARGINGSTATUS(EChargingStatusTempTooHotError);
       
  1599     }
       
  1600 
       
  1601 void CHWRMTest::PowerChargingStatusTooColdErrorL()
       
  1602     {
       
  1603     INFO_PRINTF1(_L("Step state: PowerChargingStatusTooColdErrorL"));
       
  1604     SET_CHARGINGSTATUS(EChargingStatusTempTooColdError);
       
  1605     }
       
  1606 
  1513 void CHWRMTest::PowerChargingStatusNotConnectedL()
  1607 void CHWRMTest::PowerChargingStatusNotConnectedL()
  1514 	{
  1608 	{
  1515 	INFO_PRINTF1(_L("Step state: PowerChargingStatusNotConnectedL"));
  1609 	INFO_PRINTF1(_L("Step state: PowerChargingStatusNotConnectedL"));
  1516 	SET_CHARGINGSTATUS(EChargingStatusNotConnected);
  1610 	SET_CHARGINGSTATUS(EChargingStatusNotConnected);
  1517 	}
  1611 	}
  1549 void CHWRMTest::PowerChargingStatusError3L()
  1643 void CHWRMTest::PowerChargingStatusError3L()
  1550 	{
  1644 	{
  1551 	INFO_PRINTF1(_L("Step state: PowerChargingStatusError3L"));
  1645 	INFO_PRINTF1(_L("Step state: PowerChargingStatusError3L"));
  1552 	if(iChargingStatusCBregistered)
  1646 	if(iChargingStatusCBregistered)
  1553 		{
  1647 		{
  1554 		ExpectedChargingStatusNotificationsL(EChargingStatusError);
  1648 		ExpectedExtendedChargingStatusNotificationsL(EChargingStatusError);
  1555 		ExpectedChargingStatusNotificationsL(EChargingStatusError);
  1649 		ExpectedExtendedChargingStatusNotificationsL(EChargingStatusError);
  1556 		}
  1650 		}
  1557 	SET_CHARGINGSTATUS(EChargingStatusError);
  1651 	SET_CHARGINGSTATUS(EChargingStatusError);
  1558 	}
  1652 	}
       
  1653 
       
  1654 void CHWRMTest::PowerChargingStatusIllegalError3L()
       
  1655     {
       
  1656     INFO_PRINTF1(_L("Step state: PowerChargingStatusIllegalError3L"));
       
  1657     if(iChargingStatusCBregistered)
       
  1658         {
       
  1659         ExpectedExtendedChargingStatusNotificationsL(EChargingStatusIllegalChargerError);
       
  1660         ExpectedExtendedChargingStatusNotificationsL(EChargingStatusIllegalChargerError);
       
  1661         }
       
  1662     SET_CHARGINGSTATUS(EChargingStatusIllegalChargerError);
       
  1663     }
       
  1664 
       
  1665 void CHWRMTest::PowerChargingStatusUnderVoltageError3L()
       
  1666     {
       
  1667     INFO_PRINTF1(_L("Step state: PowerChargingStatusUnderVoltageError3L"));
       
  1668     if(iChargingStatusCBregistered)
       
  1669         {
       
  1670         ExpectedExtendedChargingStatusNotificationsL(EChargingStatusChargerUnderVoltageError);
       
  1671         ExpectedExtendedChargingStatusNotificationsL(EChargingStatusChargerUnderVoltageError);
       
  1672         }
       
  1673     SET_CHARGINGSTATUS(EChargingStatusChargerUnderVoltageError);
       
  1674     }
       
  1675 
       
  1676 void CHWRMTest::PowerChargingStatusOverVoltageError3L()
       
  1677     {
       
  1678     INFO_PRINTF1(_L("Step state: PowerChargingStatusOverVoltageError3L"));
       
  1679     if(iChargingStatusCBregistered)
       
  1680         {
       
  1681         ExpectedExtendedChargingStatusNotificationsL(EChargingStatusChargerOverVoltageError);
       
  1682         ExpectedExtendedChargingStatusNotificationsL(EChargingStatusChargerOverVoltageError);
       
  1683         }    
       
  1684     SET_CHARGINGSTATUS(EChargingStatusChargerOverVoltageError);
       
  1685     }
       
  1686 
       
  1687 void CHWRMTest::PowerChargingStatusTooHotError3L()
       
  1688     {
       
  1689     INFO_PRINTF1(_L("Step state: PowerChargingStatusTooHotError3L"));
       
  1690     if(iChargingStatusCBregistered)
       
  1691         {
       
  1692         ExpectedExtendedChargingStatusNotificationsL(EChargingStatusTempTooHotError);
       
  1693         ExpectedExtendedChargingStatusNotificationsL(EChargingStatusTempTooHotError);
       
  1694         }   
       
  1695     SET_CHARGINGSTATUS(EChargingStatusTempTooHotError);
       
  1696     }
       
  1697 
       
  1698 void CHWRMTest::PowerChargingStatusTooColdError3L()
       
  1699     {
       
  1700     INFO_PRINTF1(_L("Step state: PowerChargingStatusTooColdError3L"));
       
  1701     if(iChargingStatusCBregistered)
       
  1702         {
       
  1703         ExpectedExtendedChargingStatusNotificationsL(EChargingStatusTempTooColdError);
       
  1704         ExpectedExtendedChargingStatusNotificationsL(EChargingStatusTempTooColdError);
       
  1705         }
       
  1706     SET_CHARGINGSTATUS(EChargingStatusTempTooColdError);
       
  1707     }
  1559 
  1708 
  1560 void CHWRMTest::PowerChargingStatusNotConnected3L()
  1709 void CHWRMTest::PowerChargingStatusNotConnected3L()
  1561 	{
  1710 	{
  1562 	INFO_PRINTF1(_L("Step state: PowerChargingStatusNotConnected3L"));
  1711 	INFO_PRINTF1(_L("Step state: PowerChargingStatusNotConnected3L"));
  1563 	if(iChargingStatusCBregistered)
  1712 	if(iChargingStatusCBregistered)
  1564 		{
  1713 		{
  1565 		ExpectedChargingStatusNotificationsL(EChargingStatusNotConnected);
  1714 		ExpectedExtendedChargingStatusNotificationsL(EChargingStatusNotConnected);
  1566 		ExpectedChargingStatusNotificationsL(EChargingStatusNotConnected);
  1715 		ExpectedExtendedChargingStatusNotificationsL(EChargingStatusNotConnected);
  1567 		}
  1716 		}
  1568 	SET_CHARGINGSTATUS(EChargingStatusNotConnected);
  1717 	SET_CHARGINGSTATUS(EChargingStatusNotConnected);
  1569 	}
  1718 	}
  1570 
  1719 
  1571 void CHWRMTest::PowerChargingStatusCharging3L()
  1720 void CHWRMTest::PowerChargingStatusCharging3L()
  1572 	{
  1721 	{
  1573 	INFO_PRINTF1(_L("Step state: PowerChargingStatusCharging3L"));
  1722 	INFO_PRINTF1(_L("Step state: PowerChargingStatusCharging3L"));
  1574 	if(iChargingStatusCBregistered)
  1723 	if(iChargingStatusCBregistered)
  1575 		{
  1724 		{
  1576 		ExpectedChargingStatusNotificationsL(EChargingStatusCharging);
  1725 		ExpectedExtendedChargingStatusNotificationsL(EChargingStatusCharging);
  1577 		ExpectedChargingStatusNotificationsL(EChargingStatusCharging);
  1726 		ExpectedExtendedChargingStatusNotificationsL(EChargingStatusCharging);
  1578 		}
  1727 		}
  1579 	SET_CHARGINGSTATUS(EChargingStatusCharging);
  1728 	SET_CHARGINGSTATUS(EChargingStatusCharging);
  1580 	}
  1729 	}
  1581 
  1730 
  1582 void CHWRMTest::PowerChargingStatusNotCharging3L()
  1731 void CHWRMTest::PowerChargingStatusNotCharging3L()
  1583 	{
  1732 	{
  1584 	INFO_PRINTF1(_L("Step state: PowerChargingStatusNotCharging3L"));
  1733 	INFO_PRINTF1(_L("Step state: PowerChargingStatusNotCharging3L"));
  1585 	if(iChargingStatusCBregistered)
  1734 	if(iChargingStatusCBregistered)
  1586 		{
  1735 		{
  1587 		ExpectedChargingStatusNotificationsL(EChargingStatusNotCharging);
  1736 		ExpectedExtendedChargingStatusNotificationsL(EChargingStatusNotCharging);
  1588 		ExpectedChargingStatusNotificationsL(EChargingStatusNotCharging);
  1737 		ExpectedExtendedChargingStatusNotificationsL(EChargingStatusNotCharging);
  1589 		}
  1738 		}
  1590 	SET_CHARGINGSTATUS(EChargingStatusNotCharging);
  1739 	SET_CHARGINGSTATUS(EChargingStatusNotCharging);
  1591 	}
  1740 	}
  1592 
  1741 
  1593 void CHWRMTest::PowerChargingStatusAlmostComplete3L()
  1742 void CHWRMTest::PowerChargingStatusAlmostComplete3L()
  1594 	{
  1743 	{
  1595 	INFO_PRINTF1(_L("Step state: PowerChargingStatusAlmostComplete3L"));
  1744 	INFO_PRINTF1(_L("Step state: PowerChargingStatusAlmostComplete3L"));
  1596 	if(iChargingStatusCBregistered)
  1745 	if(iChargingStatusCBregistered)
  1597 		{
  1746 		{
  1598 		ExpectedChargingStatusNotificationsL(EChargingStatusAlmostComplete);
  1747 		ExpectedExtendedChargingStatusNotificationsL(EChargingStatusAlmostComplete);
  1599 		ExpectedChargingStatusNotificationsL(EChargingStatusAlmostComplete);
  1748 		ExpectedExtendedChargingStatusNotificationsL(EChargingStatusAlmostComplete);
  1600 		}
  1749 		}
  1601 	SET_CHARGINGSTATUS(EChargingStatusAlmostComplete);
  1750 	SET_CHARGINGSTATUS(EChargingStatusAlmostComplete);
  1602 	}
  1751 	}
  1603 
  1752 
  1604 void CHWRMTest::PowerChargingStatusComplete3L()
  1753 void CHWRMTest::PowerChargingStatusComplete3L()
  1605 	{
  1754 	{
  1606 	INFO_PRINTF1(_L("Step state: PowerChargingStatusComplete3L"));
  1755 	INFO_PRINTF1(_L("Step state: PowerChargingStatusComplete3L"));
  1607 	if(iChargingStatusCBregistered)
  1756 	if(iChargingStatusCBregistered)
  1608 		{
  1757 		{
  1609 		ExpectedChargingStatusNotificationsL(EChargingStatusChargingComplete);
  1758 		ExpectedExtendedChargingStatusNotificationsL(EChargingStatusChargingComplete);
  1610 		ExpectedChargingStatusNotificationsL(EChargingStatusChargingComplete);
  1759 		ExpectedExtendedChargingStatusNotificationsL(EChargingStatusChargingComplete);
  1611 		}
  1760 		}
  1612 	SET_CHARGINGSTATUS(EChargingStatusChargingComplete);
  1761 	SET_CHARGINGSTATUS(EChargingStatusChargingComplete);
  1613 	}
  1762 	}
  1614 
  1763 
  1615 void CHWRMTest::PowerChargingStatusContinued3L()
  1764 void CHWRMTest::PowerChargingStatusContinued3L()
  1616 	{
  1765 	{
  1617 	INFO_PRINTF1(_L("Step state: PowerChargingStatusContinued3L"));
  1766 	INFO_PRINTF1(_L("Step state: PowerChargingStatusContinued3L"));
  1618 	if(iChargingStatusCBregistered)
  1767 	if(iChargingStatusCBregistered)
  1619 		{
  1768 		{
  1620 		ExpectedChargingStatusNotificationsL(EChargingStatusChargingContinued);
  1769 		ExpectedExtendedChargingStatusNotificationsL(EChargingStatusChargingContinued);
  1621 		ExpectedChargingStatusNotificationsL(EChargingStatusChargingContinued);
  1770 		ExpectedExtendedChargingStatusNotificationsL(EChargingStatusChargingContinued);
  1622 		}
  1771 		}
  1623 	SET_CHARGINGSTATUS(EChargingStatusChargingContinued);
  1772 	SET_CHARGINGSTATUS(EChargingStatusChargingContinued);
  1624 	}
  1773 	}
  1625 
  1774 
  1626 
  1775 
  2346 	{
  2495 	{
  2347 	INFO_PRINTF1(_L("Step state: GetBatteryChargerTypeUSBMulticlientL"));
  2496 	INFO_PRINTF1(_L("Step state: GetBatteryChargerTypeUSBMulticlientL"));
  2348 	TestBatteryChargerTypeMultiClientL((TInt)CHWRMPower::EBatteryChargerUsbDedicated);
  2497 	TestBatteryChargerTypeMultiClientL((TInt)CHWRMPower::EBatteryChargerUsbDedicated);
  2349 	}
  2498 	}
  2350 
  2499 
       
  2500 void CHWRMTest::GetBatteryChargerTypeUSBHispeedHost()
       
  2501     {
       
  2502     INFO_PRINTF1(_L("Step state: GetBatteryChargerTypeUSBHispeedHost"));
       
  2503     
       
  2504     CHWRMPower& power = GetPowerSessionWithCallbackRegisteredL();
       
  2505     
       
  2506     RMockPower& mockPower = GetMockPower();
       
  2507 
       
  2508     TBuf8<1> emptyDes;
       
  2509     mockPower.ExpectProcessCmdL(HWRMPowerCommand::EGetBatteryChargerTypeCmdId, emptyDes);
       
  2510 
       
  2511     HWRMPowerCommand::TBatteryChargerTypeData responsedata;
       
  2512     responsedata.iErrorCode = KErrNone;
       
  2513     responsedata.iChargerType = HWRMPowerCommand::EBatteryChargerUsbHispeedHost;
       
  2514 
       
  2515     HWRMPowerCommand::TBatteryChargerTypeResponsePackage response(responsedata);
       
  2516     mockPower.CompleteL(HWRMPowerCommand::EGetBatteryChargerTypeCmdId, 2, response);
       
  2517     
       
  2518     CHWRMPower::TBatteryChargerType data;
       
  2519     User::LeaveIfError(power.GetBatteryChargerType(data));
       
  2520 
       
  2521     if( data != CHWRMPower::EBatteryChargerUsbHispeedHost )
       
  2522         {
       
  2523         User::Leave(KErrGeneral);
       
  2524         }
       
  2525     }
       
  2526 
       
  2527 void CHWRMTest::GetBatteryChargerTypeUSBHispeedHostMulticlientL()
       
  2528     {
       
  2529     INFO_PRINTF1(_L("Step state: GetBatteryChargerTypeUSBHispeedHostMulticlientL"));
       
  2530     TestBatteryChargerTypeMultiClientL((TInt)CHWRMPower::EBatteryChargerUsbHispeedHost);
       
  2531     }
       
  2532 
       
  2533 void CHWRMTest::GetBatteryChargerTypeUSBAca()
       
  2534     {
       
  2535     INFO_PRINTF1(_L("Step state: GetBatteryChargerTypeUSBAca"));
       
  2536     
       
  2537     CHWRMPower& power = GetPowerSessionWithCallbackRegisteredL();
       
  2538     
       
  2539     RMockPower& mockPower = GetMockPower();
       
  2540 
       
  2541     TBuf8<1> emptyDes;
       
  2542     mockPower.ExpectProcessCmdL(HWRMPowerCommand::EGetBatteryChargerTypeCmdId, emptyDes);
       
  2543 
       
  2544     HWRMPowerCommand::TBatteryChargerTypeData responsedata;
       
  2545     responsedata.iErrorCode = KErrNone;
       
  2546     responsedata.iChargerType = HWRMPowerCommand::EBatteryChargerUsbAca;
       
  2547 
       
  2548     HWRMPowerCommand::TBatteryChargerTypeResponsePackage response(responsedata);
       
  2549     mockPower.CompleteL(HWRMPowerCommand::EGetBatteryChargerTypeCmdId, 2, response);
       
  2550     
       
  2551     CHWRMPower::TBatteryChargerType data;
       
  2552     User::LeaveIfError(power.GetBatteryChargerType(data));
       
  2553 
       
  2554     if( data != CHWRMPower::EBatteryChargerUsbAca )
       
  2555         {
       
  2556         User::Leave(KErrGeneral);
       
  2557         }
       
  2558     }
       
  2559 
       
  2560 void CHWRMTest::GetBatteryChargerTypeUSBAcaMulticlientL()
       
  2561     {
       
  2562     INFO_PRINTF1(_L("Step state: GetBatteryChargerTypeUSBAcaMulticlientL"));
       
  2563     TestBatteryChargerTypeMultiClientL((TInt)CHWRMPower::EBatteryChargerUsbAca);
       
  2564     }
       
  2565 
  2351 void CHWRMTest::GetBatteryChargerTypeWithPluginErrorL()
  2566 void CHWRMTest::GetBatteryChargerTypeWithPluginErrorL()
  2352 	{
  2567 	{
  2353 	INFO_PRINTF1(_L("Step state: GetBatteryChargerTypeWithPluginErrorL"));
  2568 	INFO_PRINTF1(_L("Step state: GetBatteryChargerTypeWithPluginErrorL"));
  2354 	
  2569 	
  2355 	CHWRMPower& power0 = GetPowerSessionWithCallbackRegisteredL();
  2570 	CHWRMPower& power0 = GetPowerSessionWithCallbackRegisteredL();
  2507 
  2722 
  2508 	AddTestStateL(this, &CHWRMTest::PowerAndPowerStateOpenL, KTwoTimeUnits);
  2723 	AddTestStateL(this, &CHWRMTest::PowerAndPowerStateOpenL, KTwoTimeUnits);
  2509 	AddTestStateL(this, &CHWRMTest::RegisterChargingStatusCallbackL, KOneTimeUnit);
  2724 	AddTestStateL(this, &CHWRMTest::RegisterChargingStatusCallbackL, KOneTimeUnit);
  2510 	
  2725 	
  2511 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusErrorL, KTwoTimeUnits);
  2726 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusErrorL, KTwoTimeUnits);
       
  2727 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusIllegalErrorL, KTwoTimeUnits);
       
  2728 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusUnderVoltageErrorL, KTwoTimeUnits);
       
  2729 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusOverVoltageErrorL, KTwoTimeUnits);
       
  2730 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusTooHotErrorL, KTwoTimeUnits);
       
  2731 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusTooColdErrorL, KTwoTimeUnits);	
  2512 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusNotConnectedL, KTwoTimeUnits);
  2732 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusNotConnectedL, KTwoTimeUnits);
  2513 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusChargingL, KTwoTimeUnits);
  2733 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusChargingL, KTwoTimeUnits);
  2514 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusNotChargingL, KTwoTimeUnits);
  2734 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusNotChargingL, KTwoTimeUnits);
  2515 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusAlmostCompleteL, KTwoTimeUnits);
  2735 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusAlmostCompleteL, KTwoTimeUnits);
  2516 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusCompleteL, KTwoTimeUnits);
  2736 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusCompleteL, KTwoTimeUnits);
  2530 
  2750 
  2531 	AddTestStateL(this, &CHWRMTest::PowerAndPowerState3SessionsOpenL, KTwoTimeUnits);
  2751 	AddTestStateL(this, &CHWRMTest::PowerAndPowerState3SessionsOpenL, KTwoTimeUnits);
  2532 	AddTestStateL(this, &CHWRMTest::RegisterChargingStatusCallbackMultiClient3L, KOneTimeUnit);
  2752 	AddTestStateL(this, &CHWRMTest::RegisterChargingStatusCallbackMultiClient3L, KOneTimeUnit);
  2533 	
  2753 	
  2534 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusError3L, KTwoTimeUnits);
  2754 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusError3L, KTwoTimeUnits);
       
  2755 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusIllegalError3L, KTwoTimeUnits);
       
  2756     AddTestStateL(this, &CHWRMTest::PowerChargingStatusUnderVoltageError3L, KTwoTimeUnits);
       
  2757     AddTestStateL(this, &CHWRMTest::PowerChargingStatusOverVoltageError3L, KTwoTimeUnits);
       
  2758     AddTestStateL(this, &CHWRMTest::PowerChargingStatusTooHotError3L, KTwoTimeUnits);
       
  2759     AddTestStateL(this, &CHWRMTest::PowerChargingStatusTooColdError3L, KTwoTimeUnits);
  2535 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusNotConnected3L, KTwoTimeUnits);
  2760 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusNotConnected3L, KTwoTimeUnits);
  2536 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusCharging3L, KTwoTimeUnits);
  2761 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusCharging3L, KTwoTimeUnits);
  2537 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusNotCharging3L, KTwoTimeUnits);
  2762 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusNotCharging3L, KTwoTimeUnits);
  2538 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusAlmostComplete3L, KTwoTimeUnits);
  2763 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusAlmostComplete3L, KTwoTimeUnits);
  2539 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusComplete3L, KTwoTimeUnits);
  2764 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusComplete3L, KTwoTimeUnits);
  2615 	AddTestStateL(this, &CHWRMTest::StartRemainingChargingTimeErrorL, KTwoTimeUnits);
  2840 	AddTestStateL(this, &CHWRMTest::StartRemainingChargingTimeErrorL, KTwoTimeUnits);
  2616 	
  2841 	
  2617 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusErrorL, KTwoTimeUnits);
  2842 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusErrorL, KTwoTimeUnits);
  2618 	AddTestStateL(this, &CHWRMTest::StartRemainingChargingTimeErrorL, KTwoTimeUnits);
  2843 	AddTestStateL(this, &CHWRMTest::StartRemainingChargingTimeErrorL, KTwoTimeUnits);
  2619 	
  2844 	
       
  2845 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusIllegalErrorL, KTwoTimeUnits);
       
  2846     AddTestStateL(this, &CHWRMTest::StartRemainingChargingTimeErrorL, KTwoTimeUnits);
       
  2847         
       
  2848     AddTestStateL(this, &CHWRMTest::PowerChargingStatusOverVoltageErrorL, KTwoTimeUnits);
       
  2849     AddTestStateL(this, &CHWRMTest::StartRemainingChargingTimeErrorL, KTwoTimeUnits);
       
  2850     
       
  2851     AddTestStateL(this, &CHWRMTest::PowerChargingStatusUnderVoltageErrorL, KTwoTimeUnits);
       
  2852     AddTestStateL(this, &CHWRMTest::StartRemainingChargingTimeErrorL, KTwoTimeUnits);
       
  2853     
       
  2854     AddTestStateL(this, &CHWRMTest::PowerChargingStatusTooHotErrorL, KTwoTimeUnits);
       
  2855     AddTestStateL(this, &CHWRMTest::StartRemainingChargingTimeErrorL, KTwoTimeUnits);
       
  2856         
       
  2857     AddTestStateL(this, &CHWRMTest::PowerChargingStatusTooColdErrorL, KTwoTimeUnits);
       
  2858     AddTestStateL(this, &CHWRMTest::StartRemainingChargingTimeErrorL, KTwoTimeUnits);
       
  2859 	
  2620 	ExecuteTestL();
  2860 	ExecuteTestL();
  2621 	}
  2861 	}
  2622 
  2862 
  2623 void CHWRMTest::TestPowerRemainingChargingTimeWhenStartedL()
  2863 void CHWRMTest::TestPowerRemainingChargingTimeWhenStartedL()
  2624 	{
  2864 	{
  2795 	AddTestStateL(this, &CHWRMTest::StartChargingCurrentErrorL, KTwoTimeUnits);
  3035 	AddTestStateL(this, &CHWRMTest::StartChargingCurrentErrorL, KTwoTimeUnits);
  2796 	
  3036 	
  2797 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusErrorL, KTwoTimeUnits);
  3037 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusErrorL, KTwoTimeUnits);
  2798 	AddTestStateL(this, &CHWRMTest::StartChargingCurrentErrorL, KTwoTimeUnits);
  3038 	AddTestStateL(this, &CHWRMTest::StartChargingCurrentErrorL, KTwoTimeUnits);
  2799 	
  3039 	
       
  3040 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusIllegalErrorL, KTwoTimeUnits);
       
  3041 	AddTestStateL(this, &CHWRMTest::StartChargingCurrentErrorL, KTwoTimeUnits);
       
  3042 	    
       
  3043 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusOverVoltageErrorL, KTwoTimeUnits);
       
  3044 	AddTestStateL(this, &CHWRMTest::StartChargingCurrentErrorL, KTwoTimeUnits);
       
  3045 	
       
  3046 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusUnderVoltageErrorL, KTwoTimeUnits);
       
  3047 	AddTestStateL(this, &CHWRMTest::StartChargingCurrentErrorL, KTwoTimeUnits);
       
  3048 	
       
  3049 	AddTestStateL(this, &CHWRMTest::PowerChargingStatusTooHotErrorL, KTwoTimeUnits);
       
  3050     AddTestStateL(this, &CHWRMTest::StartChargingCurrentErrorL, KTwoTimeUnits);
       
  3051 	    
       
  3052     AddTestStateL(this, &CHWRMTest::PowerChargingStatusTooColdErrorL, KTwoTimeUnits);
       
  3053     AddTestStateL(this, &CHWRMTest::StartChargingCurrentErrorL, KTwoTimeUnits);
       
  3054 	        
  2800 	ExecuteTestL();
  3055 	ExecuteTestL();
  2801 	}
  3056 	}
  2802 
  3057 
  2803 void CHWRMTest::TestPowerChargingCurrentWhenStartedL()
  3058 void CHWRMTest::TestPowerChargingCurrentWhenStartedL()
  2804 	{
  3059 	{
  2969 	AddTestStateL(this, &CHWRMTest::PowerAndPowerStateOpenL, KTwoTimeUnits);
  3224 	AddTestStateL(this, &CHWRMTest::PowerAndPowerStateOpenL, KTwoTimeUnits);
  2970 	
  3225 	
  2971 	AddTestStateL(this, &CHWRMTest::GetBatteryChargerTypeNoCharger, KTwoTimeUnits);
  3226 	AddTestStateL(this, &CHWRMTest::GetBatteryChargerTypeNoCharger, KTwoTimeUnits);
  2972 	AddTestStateL(this, &CHWRMTest::GetBatteryChargerTypeACMain, KTwoTimeUnits);
  3227 	AddTestStateL(this, &CHWRMTest::GetBatteryChargerTypeACMain, KTwoTimeUnits);
  2973 	AddTestStateL(this, &CHWRMTest::GetBatteryChargerTypeUSB, KTwoTimeUnits);
  3228 	AddTestStateL(this, &CHWRMTest::GetBatteryChargerTypeUSB, KTwoTimeUnits);
  2974 
  3229 	AddTestStateL(this, &CHWRMTest::GetBatteryChargerTypeUSBHispeedHost, KTwoTimeUnits);
       
  3230 	AddTestStateL(this, &CHWRMTest::GetBatteryChargerTypeUSBAca, KTwoTimeUnits);
       
  3231 	
  2975 	ExecuteTestL();
  3232 	ExecuteTestL();
  2976 	}
  3233 	}
  2977 
  3234 
  2978 void CHWRMTest::TestPowerGetBatteryChargerTypeMulticlientL()
  3235 void CHWRMTest::TestPowerGetBatteryChargerTypeMulticlientL()
  2979 	{
  3236 	{
  2982 	AddTestStateL(this, &CHWRMTest::PowerAndPowerState3SessionsOpenL, KTwoTimeUnits);
  3239 	AddTestStateL(this, &CHWRMTest::PowerAndPowerState3SessionsOpenL, KTwoTimeUnits);
  2983 	
  3240 	
  2984 	AddTestStateL(this, &CHWRMTest::GetBatteryChargerTypeNoChargerMulticlientL, 2*KTwoTimeUnits);
  3241 	AddTestStateL(this, &CHWRMTest::GetBatteryChargerTypeNoChargerMulticlientL, 2*KTwoTimeUnits);
  2985 	AddTestStateL(this, &CHWRMTest::GetBatteryChargerTypeACMainMulticlientL, 2*KTwoTimeUnits);
  3242 	AddTestStateL(this, &CHWRMTest::GetBatteryChargerTypeACMainMulticlientL, 2*KTwoTimeUnits);
  2986 	AddTestStateL(this, &CHWRMTest::GetBatteryChargerTypeUSBMulticlientL, 2*KTwoTimeUnits);
  3243 	AddTestStateL(this, &CHWRMTest::GetBatteryChargerTypeUSBMulticlientL, 2*KTwoTimeUnits);
  2987 
  3244 	AddTestStateL(this, &CHWRMTest::GetBatteryChargerTypeUSBHispeedHostMulticlientL, 2*KTwoTimeUnits);
       
  3245 	AddTestStateL(this, &CHWRMTest::GetBatteryChargerTypeUSBAcaMulticlientL, 2*KTwoTimeUnits);
       
  3246 	
  2988 	ExecuteTestL();
  3247 	ExecuteTestL();
  2989 	}
  3248 	}
  2990 
  3249 
  2991 void CHWRMTest::TestPowerGetBatteryChargerTypeWithPluginErrorL()
  3250 void CHWRMTest::TestPowerGetBatteryChargerTypeWithPluginErrorL()
  2992 	{
  3251 	{
  4411 		
  4670 		
  4412 	// connect to mock power state plugin
  4671 	// connect to mock power state plugin
  4413 	OpenPowerStateSessionL();		
  4672 	OpenPowerStateSessionL();		
  4414 	}
  4673 	}
  4415 
  4674 
       
  4675 void CHWRMTest::ExpectLegacyBatteryStatusL()
       
  4676     {
       
  4677     delete iExtendedBatteryStatusObserver;
       
  4678     iExtendedBatteryStatusObserver = NULL;
       
  4679     iExpectedExtendedBatteryStatusNotifications.Reset();
       
  4680     }
       
  4681 
       
  4682 void CHWRMTest::ExpectLegacyChargingStatusL()
       
  4683     {
       
  4684     delete iExtendedChargingStatusObserver;
       
  4685     iExtendedChargingStatusObserver = NULL;
       
  4686     iExpectedExtendedChargingStatusNotifications.Reset();
       
  4687     }
       
  4688 
       
  4689 void CHWRMTest::ExpectNewBatteryStatusL()
       
  4690     {
       
  4691     delete iBatteryStatusObserver;
       
  4692     iBatteryStatusObserver = NULL;
       
  4693     iExpectedBatteryStatusNotifications.Reset();
       
  4694     }
       
  4695 
       
  4696 void CHWRMTest::ExpectNewChargingStatusL()
       
  4697     {
       
  4698     delete iChargingStatusObserver;
       
  4699     iChargingStatusObserver = NULL;
       
  4700     iExpectedChargingStatusNotifications.Reset();
       
  4701     }
       
  4702 
  4416 void CHWRMTest::BatteryLevelL()
  4703 void CHWRMTest::BatteryLevelL()
  4417 	{
  4704 	{
  4418 	INFO_PRINTF1(_L("Step state: BatteryLevelL"));
  4705 	INFO_PRINTF1(_L("Step state: BatteryLevelL"));
  4419 		
  4706 		
  4420 	ExpectBatteryLevelNotificationL(EBatteryLevelLevel7);
  4707 	ExpectBatteryLevelNotificationL(EBatteryLevelLevel7);
  4431 	TInt delay(5);
  4718 	TInt delay(5);
  4432 	iMockPowerState.CompleteL(KHWRMBatteryStatus,EBatteryStatusOk,delay);
  4719 	iMockPowerState.CompleteL(KHWRMBatteryStatus,EBatteryStatusOk,delay);
  4433 	User::After(KOneSecond);
  4720 	User::After(KOneSecond);
  4434 	
  4721 	
  4435 	}
  4722 	}
       
  4723 	
       
  4724 // Pump New Values from MockServer and test the legacy keys
       
  4725 void CHWRMTest::BatteryStateUnknownErrorL()
       
  4726     {
       
  4727     INFO_PRINTF1(_L("Step state: BatteryStateUnknownErrorL"));
       
  4728      
       
  4729     ExpectBatteryStatusNotificationL(EBatteryStatusUnknown);
       
  4730     TInt delay(5);
       
  4731     iMockPowerState.CompleteL(KHWRMBatteryStatus,EBatteryStatusUnknown,delay);
       
  4732     User::After(KOneSecond);    
       
  4733     }
       
  4734 	
       
  4735 void CHWRMTest::BatteryStateUnsupportedL()
       
  4736     {
       
  4737     INFO_PRINTF1(_L("Step state: BatteryStateUnsupportedL"));
       
  4738      
       
  4739     ExpectBatteryStatusNotificationL(EBatteryStatusUnknown);
       
  4740     TInt delay(5);
       
  4741     iMockPowerState.CompleteL(KHWRMBatteryStatus,EBatteryStatusNotSupported,delay);
       
  4742     User::After(KOneSecond);    
       
  4743     }	
       
  4744 
       
  4745 void CHWRMTest::BatteryStateAuthErrorL()
       
  4746     {
       
  4747     INFO_PRINTF1(_L("Step state: BatteryStateAuthErrorL"));
       
  4748     
       
  4749     ExpectBatteryStatusNotificationL(EBatteryStatusUnknown);
       
  4750     TInt delay(5);
       
  4751     iMockPowerState.CompleteL(KHWRMBatteryStatus,EBatteryStatusDbiAuthFailed,delay);
       
  4752     User::After(KOneSecond);
       
  4753     }
       
  4754 
       
  4755 void CHWRMTest::BatteryStateStatusOkL()
       
  4756     {
       
  4757     INFO_PRINTF1(_L("Step state: BatteryStateStatusOkL"));
       
  4758         
       
  4759     ExpectBatteryStatusNotificationL(EBatteryStatusOk);
       
  4760     TInt delay(5);
       
  4761     iMockPowerState.CompleteL(KHWRMBatteryStatus,EBatteryStatusOk,delay);
       
  4762     User::After(KOneSecond);    
       
  4763     }
       
  4764 
       
  4765 void CHWRMTest::BatteryStateStatusLowL()
       
  4766     {
       
  4767     INFO_PRINTF1(_L("Step state: BatteryStateStatusLowL"));
       
  4768     
       
  4769     ExpectBatteryStatusNotificationL(EBatteryStatusLow);
       
  4770     TInt delay(5);
       
  4771     iMockPowerState.CompleteL(KHWRMBatteryStatus,EBatteryStatusLow,delay);
       
  4772     User::After(KOneSecond);
       
  4773     }
       
  4774 
       
  4775 void CHWRMTest::BatteryStateStatusEmptyL()
       
  4776     {
       
  4777     INFO_PRINTF1(_L("Step state: BatteryStateStatusEmptyL"));
       
  4778     
       
  4779     ExpectBatteryStatusNotificationL(EBatteryStatusEmpty);
       
  4780     TInt delay(5);
       
  4781     iMockPowerState.CompleteL(KHWRMBatteryStatus,EBatteryStatusEmpty,delay);
       
  4782     User::After(KOneSecond);
       
  4783     }	
       
  4784 			
       
  4785 // Pump New Values from MockServer and test the extended keys
       
  4786 void CHWRMTest::ExtendedBatteryStateUnknownErrorL()
       
  4787     {
       
  4788     INFO_PRINTF1(_L("Step state: ExtendedBatteryStateUnknownErrorL"));
       
  4789      
       
  4790     ExpectExtendedBatteryStatusNotificationL(EBatteryStatusUnknown);
       
  4791     TInt delay(5);
       
  4792     iMockPowerState.CompleteL(KHWRMExtendedBatteryStatus,EBatteryStatusUnknown,delay);
       
  4793     User::After(KOneSecond);    
       
  4794     }
       
  4795 
       
  4796 void CHWRMTest::ExtendedBatteryStateUnsupportedL()
       
  4797     {
       
  4798     INFO_PRINTF1(_L("Step state: ExtendedBatteryStateUnsupportedL"));
       
  4799      
       
  4800     ExpectExtendedBatteryStatusNotificationL(EBatteryStatusNotSupported);
       
  4801     TInt delay(5);
       
  4802     iMockPowerState.CompleteL(KHWRMExtendedBatteryStatus,EBatteryStatusNotSupported,delay);
       
  4803     User::After(KOneSecond);    
       
  4804     }
       
  4805 	
       
  4806 void CHWRMTest::ExtendedBatteryStateAuthErrorL()
       
  4807     {
       
  4808     INFO_PRINTF1(_L("Step state: ExtendedBatteryStateAuthErrorL"));
       
  4809     
       
  4810     ExpectExtendedBatteryStatusNotificationL(EBatteryStatusDbiAuthFailed);
       
  4811     TInt delay(5);
       
  4812     iMockPowerState.CompleteL(KHWRMExtendedBatteryStatus,EBatteryStatusDbiAuthFailed,delay);
       
  4813     User::After(KOneSecond);
       
  4814     }
       
  4815 
       
  4816 void CHWRMTest::ExtendedBatteryStateStatusOkL()
       
  4817     {
       
  4818     INFO_PRINTF1(_L("Step state: ExtendedBatteryStateStatusOkL"));
       
  4819         
       
  4820     ExpectExtendedBatteryStatusNotificationL(EBatteryStatusOk);
       
  4821     TInt delay(5);
       
  4822     iMockPowerState.CompleteL(KHWRMExtendedBatteryStatus,EBatteryStatusOk,delay);
       
  4823     User::After(KOneSecond);    
       
  4824     }
       
  4825 
       
  4826 void CHWRMTest::ExtendedBatteryStateStatusLowL()
       
  4827     {
       
  4828     INFO_PRINTF1(_L("Step state: ExtendedBatteryStateStatusLowL"));
       
  4829     
       
  4830     ExpectExtendedBatteryStatusNotificationL(EBatteryStatusLow);
       
  4831     TInt delay(5);
       
  4832     iMockPowerState.CompleteL(KHWRMExtendedBatteryStatus,EBatteryStatusLow,delay);
       
  4833     User::After(KOneSecond);
       
  4834     }
       
  4835 
       
  4836 void CHWRMTest::ExtendedBatteryStateStatusEmptyL()
       
  4837     {
       
  4838     INFO_PRINTF1(_L("Step state: ExtendedBatteryStateStatusEmptyL"));
       
  4839     
       
  4840     ExpectExtendedBatteryStatusNotificationL(EBatteryStatusEmpty);
       
  4841     TInt delay(5);
       
  4842     iMockPowerState.CompleteL(KHWRMExtendedBatteryStatus,EBatteryStatusEmpty,delay);
       
  4843     User::After(KOneSecond);
       
  4844     }
  4436 
  4845 
  4437 void CHWRMTest::ChargingStatusL()
  4846 void CHWRMTest::ChargingStatusL()
  4438 	{
  4847 	{
  4439 	INFO_PRINTF1(_L("Step state: ChargingStatusL"));
  4848 	INFO_PRINTF1(_L("Step state: ChargingStatusL"));
  4440 	
  4849 	
  4442 	TInt delay(5);
  4851 	TInt delay(5);
  4443 	iMockPowerState.CompleteL(KHWRMChargingStatus,EChargingStatusChargingComplete,delay);
  4852 	iMockPowerState.CompleteL(KHWRMChargingStatus,EChargingStatusChargingComplete,delay);
  4444 	User::After(KOneSecond);
  4853 	User::After(KOneSecond);
  4445 	
  4854 	
  4446 	}
  4855 	}
       
  4856 
       
  4857 void CHWRMTest::ChargingStatusNotConnectedL()
       
  4858     {
       
  4859     INFO_PRINTF1(_L("Step state: ChargingStatusNotConnectedL"));
       
  4860     
       
  4861     ExpectedChargingStatusNotificationsL(EChargingStatusNotConnected);
       
  4862     TInt delay(5);
       
  4863     iMockPowerState.CompleteL(KHWRMChargingStatus,EChargingStatusNotConnected,delay);
       
  4864     User::After(KOneSecond);
       
  4865     }
       
  4866 
       
  4867 void CHWRMTest::ChargingStatusChargingOkL()
       
  4868     {
       
  4869     INFO_PRINTF1(_L("Step state: ChargingStatusChargingOkL"));
       
  4870     
       
  4871     ExpectedChargingStatusNotificationsL(EChargingStatusCharging);
       
  4872     TInt delay(5);
       
  4873     iMockPowerState.CompleteL(KHWRMChargingStatus,EChargingStatusCharging,delay);
       
  4874     User::After(KOneSecond);
       
  4875     }
       
  4876 
       
  4877 void CHWRMTest::ChargingStatusNotChargingL()
       
  4878     {
       
  4879     INFO_PRINTF1(_L("Step state: ChargingStatusNotChargingL"));
       
  4880     
       
  4881     ExpectedChargingStatusNotificationsL(EChargingStatusNotCharging);
       
  4882     TInt delay(5);
       
  4883     iMockPowerState.CompleteL(KHWRMChargingStatus,EChargingStatusNotCharging,delay);
       
  4884     User::After(KOneSecond);
       
  4885     }
       
  4886 
       
  4887 void CHWRMTest::ChargingStatusAlmostCompleteL()
       
  4888     {
       
  4889     INFO_PRINTF1(_L("Step state: ChargingStatusAlmostCompleteL"));
       
  4890     
       
  4891     ExpectedChargingStatusNotificationsL(EChargingStatusAlmostComplete);
       
  4892     TInt delay(5);
       
  4893     iMockPowerState.CompleteL(KHWRMChargingStatus,EChargingStatusAlmostComplete,delay);
       
  4894     User::After(KOneSecond);
       
  4895     }
       
  4896 
       
  4897 void CHWRMTest::ChargingStatusCompletedChargingL()
       
  4898     {
       
  4899     INFO_PRINTF1(_L("Step state: ChargingStatusCompletedChargingL"));
       
  4900     
       
  4901     ExpectedChargingStatusNotificationsL(EChargingStatusChargingComplete);
       
  4902     TInt delay(5);
       
  4903     iMockPowerState.CompleteL(KHWRMChargingStatus,EChargingStatusChargingComplete,delay);
       
  4904     User::After(KOneSecond);
       
  4905     }
       
  4906 
       
  4907 void CHWRMTest::ChargingStatusChargingContinuesL()
       
  4908     {
       
  4909     INFO_PRINTF1(_L("Step state: ChargingStatusChargingContinuesL"));
       
  4910     
       
  4911     ExpectedChargingStatusNotificationsL(EChargingStatusChargingContinued);
       
  4912     TInt delay(5);
       
  4913     iMockPowerState.CompleteL(KHWRMChargingStatus,EChargingStatusChargingContinued,delay);
       
  4914     User::After(KOneSecond);
       
  4915     }
       
  4916 
       
  4917 void CHWRMTest::ChargingStatusErrorL()
       
  4918     {
       
  4919     INFO_PRINTF1(_L("Step state: ChargingStatusErrorL"));
       
  4920     
       
  4921     ExpectedChargingStatusNotificationsL(EChargingStatusError);
       
  4922     TInt delay(5);
       
  4923     iMockPowerState.CompleteL(KHWRMChargingStatus,EChargingStatusError,delay);
       
  4924     User::After(KOneSecond);
       
  4925     }
       
  4926 
       
  4927 // Below API's publishes new Charging States and expects mapped states using the legacy P&S key
       
  4928 void CHWRMTest::ChargingStatusIllegalErrorL()
       
  4929     {
       
  4930     INFO_PRINTF1(_L("Step state: ChargingStatusIllegalErrorL"));
       
  4931     
       
  4932     ExpectedChargingStatusNotificationsL(EChargingStatusError);
       
  4933     TInt delay(5);
       
  4934     iMockPowerState.CompleteL(KHWRMChargingStatus,EChargingStatusIllegalChargerError,delay);
       
  4935     User::After(KOneSecond);
       
  4936     }
       
  4937 
       
  4938 void CHWRMTest::ChargingStatusUnderVoltageErrorL()
       
  4939     {
       
  4940     INFO_PRINTF1(_L("Step state: ChargingStatusUnderVoltageL"));
       
  4941     
       
  4942     ExpectedChargingStatusNotificationsL(EChargingStatusError);
       
  4943     TInt delay(5);
       
  4944     iMockPowerState.CompleteL(KHWRMChargingStatus,EChargingStatusChargerUnderVoltageError,delay);
       
  4945     User::After(KOneSecond);
       
  4946     }
       
  4947 
       
  4948 void CHWRMTest::ChargingStatusOverVoltageErrorL()
       
  4949     {
       
  4950     INFO_PRINTF1(_L("Step state: ChargingStatusOverVoltageL"));
       
  4951     
       
  4952     ExpectedChargingStatusNotificationsL(EChargingStatusError);
       
  4953     TInt delay(5);
       
  4954     iMockPowerState.CompleteL(KHWRMChargingStatus,EChargingStatusChargerOverVoltageError,delay);
       
  4955     User::After(KOneSecond);
       
  4956     }
       
  4957 
       
  4958 void CHWRMTest::ChargingStatusTooHotErrorL()
       
  4959     {
       
  4960     INFO_PRINTF1(_L("Step state: ChargingStatusTooHotErrorL"));
       
  4961     
       
  4962     ExpectedChargingStatusNotificationsL(EChargingStatusError);
       
  4963     TInt delay(5);
       
  4964     iMockPowerState.CompleteL(KHWRMChargingStatus,EChargingStatusTempTooHotError,delay);
       
  4965     User::After(KOneSecond);
       
  4966     }
       
  4967 
       
  4968 void CHWRMTest::ChargingStatusTooColdErrorL()
       
  4969     {
       
  4970     INFO_PRINTF1(_L("Step state: ChargingStatusTooColdErrorL"));
       
  4971     
       
  4972     ExpectedChargingStatusNotificationsL(EChargingStatusError);
       
  4973     TInt delay(5);
       
  4974     iMockPowerState.CompleteL(KHWRMChargingStatus,EChargingStatusTempTooColdError,delay);
       
  4975     User::After(KOneSecond);
       
  4976     }
  4447 	
  4977 	
  4448 void CHWRMTest::VibraOpenL()
  4978 void CHWRMTest::VibraOpenL()
  4449 	{
  4979 	{
  4450 	INFO_PRINTF1(_L("Step state: VibraOpenL"));
  4980 	INFO_PRINTF1(_L("Step state: VibraOpenL"));
  4451 	
  4981