blob: 4e64be23e9ff2209940af4fc55c096de57994f37 [file] [log] [blame]
Scott Honga2e430b2020-08-27 15:14:57 +08001#!/usr/bin/env python3
2#
3# Copyright 2020 - The Android Open Source Project
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17from acts import utils
Xianyuan Jiaa4913cd2020-11-16 11:58:29 -080018from acts.test_utils.power.PowerGTWGnssBaseTest import PowerGTWGnssBaseTest
19from acts.test_utils.gnss import gnss_test_utils as gutils
20from acts.test_utils.wifi import wifi_test_utils as wutils
Scott Honga2e430b2020-08-27 15:14:57 +080021
22
23class GnssPowerLowPowerTest(PowerGTWGnssBaseTest):
24 """Gnss Power Low Power Mode Test"""
25
26 def setup_class(self):
27 super().setup_class()
28 self.unpack_userparams(req_param_names=['interval'])
29
30 # Test cases
31 def test_low_power_mode_DPO_on(self):
32 self.set_attenuation(self.atten_level['strong_signal'])
33 self.enable_DPO(True)
34 self.start_gnss_tracking_with_power_data(
35 mode='standalone', lowpower=True)
36
37 def test_low_power_mode_DPO_on_long_interval(self):
38 self.set_attenuation(self.atten_level['strong_signal'])
39 self.enable_DPO(True)
40 self.start_gnss_tracking_with_power_data(
41 mode='standalone', freq=self.interval, lowpower=True)
42
43 def test_low_power_mode_DPO_off(self):
44 self.set_attenuation(self.atten_level['strong_signal'])
45 self.enable_DPO(False)
46 self.start_gnss_tracking_with_power_data(
47 mode='standalone', lowpower=True)
48
49 def test_low_power_mode_DPO_off_long_interval(self):
50 self.set_attenuation(self.atten_level['strong_signal'])
51 self.enable_DPO(False)
52 self.start_gnss_tracking_with_power_data(
53 mode='standalone', freq=self.interval, lowpower=True)