diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-10-04 02:56:58 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-10-04 02:56:58 +0000 |
commit | e3703a1b9f34923b12add2129b5cc90c34763023 (patch) | |
tree | e0a4b36c9dd433070a8e7d060aeb8553f46331e9 | |
parent | 7ebde67b817defa328ce3d5331c2f3ea2bfe684c (diff) | |
parent | 9dfa9b7e83ec7b6651602632fd9998b5b32a05f7 (diff) | |
download | platform_tools_test_connectivity-e3703a1b9f34923b12add2129b5cc90c34763023.tar.gz platform_tools_test_connectivity-e3703a1b9f34923b12add2129b5cc90c34763023.tar.bz2 platform_tools_test_connectivity-e3703a1b9f34923b12add2129b5cc90c34763023.zip |
Merge "Adding cellular voice call power tests"
-rw-r--r-- | acts/tests/google/power/tel/lab/PowerTelVoiceCallTest.py | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/acts/tests/google/power/tel/lab/PowerTelVoiceCallTest.py b/acts/tests/google/power/tel/lab/PowerTelVoiceCallTest.py new file mode 100644 index 0000000000..f5b2539839 --- /dev/null +++ b/acts/tests/google/power/tel/lab/PowerTelVoiceCallTest.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python3.4 +# +# Copyright 2018 - The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the 'License'); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an 'AS IS' BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import time + +from acts.controllers.anritsu_lib.md8475a import VirtualPhoneAutoAnswer + +from acts.test_utils.power import PowerCellularLabBaseTest as PWCEL +from acts.test_utils.tel.tel_test_utils import initiate_call, hangup_call, set_phone_silent_mode + + +class PowerVoiceCallTest(PWCEL.PowerCellularLabBaseTest): + """ Voice call power test. + + Inherits from PowerCellularLabBaseTest. Contains methods to initiate + a voice call from the DUT and pick up from the callbox. + + """ + + # Time for the callbox to pick up the call + CALL_SETTLING_TIME = 10 + + def setup_class(self): + """ Executed only once when initializing the class. + + Configs the callbox to pick up the call automatically and + sets the phone to silent mode. + """ + + super().setup_class() + + # Make the callbox pick up the call automatically + self.virtualPhoneHandle = self.anritsu.get_VirtualPhone() + self.virtualPhoneHandle.auto_answer = (VirtualPhoneAutoAnswer.ON, 0) + + # Set voice call volume to minimum + set_phone_silent_mode(self.log, self.dut) + + def power_voice_call_test(self): + """ Measures power during a voice call. + + Measurement step in this test. Starts the voice call and + initiates power measurement. Pass or fail is decided with a + threshold value. + """ + + # Initiate the voice call + initiate_call(self.log, self.dut, "+11112223333") + + # Wait for the callbox to pick up + time.sleep(self.CALL_SETTLING_TIME) + + # Mute the call + self.dut.droid.telecomCallMute() + + # Turn of screen + self.dut.droid.goToSleepNow() + + # Measure power + self.collect_power_data() + + # End the call + hangup_call(self.log, self.dut) + + # Check if power measurement is within the required values + self.pass_fail_check() |