Example #1
0
class Location_OnOff(UIATestBase):
    def setUp(self):
        super(Location_OnOff, self).setUp()
        self._test_name = __name__
        print "[Setup]: %s" % self._test_name
        self.d = g_common_obj.get_device()
        self.l = Logger.getlogger(__name__)
        self.gc = GPS_Common()
        self.gc.check_if_wifi_connected()
        self.gc.init_apk()
        self.gc.Turn_On_Location()
        self.gc.init_location()
        (self._lattd, self._longtd) = self.gc.fetch_latitude_longitude()

    def test_turnOnOffLocation10Times(self):
        #         self.gc.kill_uiautomator()
        #         _cmd = "shell am instrument \
        #         -e class com.intel.uitests.tests.comms.location.CoordinatesIterative#testTurnOnOffLocationIterative \
        #         -e latitude %s -e longitude %s -e iterations 10 \
        #         -w  com.intel.uitests.test/com.intel.uitests.runner.UiTestRunner " % (self._lattd, self._longtd)
        #         _test_result = g_common_obj.adb_cmd_common(_cmd, 600)
        #         assert "OK" in _test_result, "%s failed" % self.__str__()
        for i in range(10):
            self.gc.Turn_Off_Location()
            self.gc.location_not_get()
            self.gc.Turn_On_Location()
            self.gc.get_location_and_check_accuracy(self._lattd, self._longtd)
            self.l.info("GPS On/Off cycle %s Pass." % (i + 1))
Example #2
0
class AGPS(UIATestBase):
    def setUp(self):
        super(AGPS, self).setUp()
        self._test_name = __name__
        self.d = g_common_obj.get_device()
        print "[Setup]: %s" % self._test_name
        self.gc = GPS_Common()
        self.gc.Turn_On_Location()
        self.gc.check_if_wifi_connected()

    def test_files_downloaded(self):
        assert g_common_obj.adb_cmd_capture_msg(
            "getprop | grep BRCM"
        ), "DUT doesn't seem to have a broadcom gps chip, quit test"
        assert g_common_obj.adb_cmd_capture_msg('[ -e "/data/gps/lto2.dat" ] && echo "Pass" || echo "Fail"') == "Pass", \
        "The file lto2.dat not found!"
        assert g_common_obj.adb_cmd_capture_msg('[ -e "/data/gps/ltoStatus.txt" ] && echo "Pass" || echo "Fail"') == "Pass", \
        "The file ltoStatus.txt not found!"

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name
        super(AGPS, self).tearDown()
        g_common_obj.stop_app_am("com.android.settings")