1 #!/usr/bin/env python3.4 2 # 3 # Copyright 2016 - Google 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 """ 17 Test Script for VT Data test 18 """ 19 from acts.test_utils.tel.TelephonyBaseTest import TelephonyBaseTest 20 from acts.test_utils.tel.tel_defines import VT_STATE_BIDIRECTIONAL 21 from acts.test_utils.tel.tel_test_utils import hangup_call 22 from acts.test_utils.tel.tel_test_utils import multithread_func 23 from acts.test_utils.tel.tel_test_utils import verify_http_connection 24 from acts.test_utils.tel.tel_video_utils import \ 25 is_phone_in_call_video_bidirectional 26 from acts.test_utils.tel.tel_video_utils import phone_setup_video 27 from acts.test_utils.tel.tel_video_utils import video_call_setup_teardown 28 29 30 class TelLiveVideoDataTest(TelephonyBaseTest): 31 def __init__(self, controllers): 32 TelephonyBaseTest.__init__(self, controllers) 33 34 self.stress_test_number = self.get_stress_test_number() 35 self.wifi_network_ssid = self.user_params["wifi_network_ssid"] 36 self.number_of_devices = 2 37 38 try: 39 self.wifi_network_pass = self.user_params["wifi_network_pass"] 40 except KeyError: 41 self.wifi_network_pass = None 42 43 """ Tests Begin """ 44 45 @TelephonyBaseTest.tel_test_wrap 46 def test_internet_access_during_video_call(self): 47 """ Test Internet access during VT<->VT call. 48 49 Make Sure PhoneA is in LTE mode (with Video Calling). 50 Make Sure PhoneB is in LTE mode (with Video Calling). 51 Call from PhoneA to PhoneB as Bi-Directional Video, 52 Accept on PhoneB as video call. 53 Verify PhoneA have Internet access. 54 Hang up on PhoneA. 55 56 Returns: 57 True if pass; False if fail. 58 """ 59 ads = self.android_devices 60 tasks = [(phone_setup_video, (self.log, ads[0])), (phone_setup_video, 61 (self.log, ads[1]))] 62 if not multithread_func(self.log, tasks): 63 self.log.error("Phone Failed to Set Up Properly.") 64 return False 65 66 self.log.info("Step1: Make MO VT call.") 67 if not video_call_setup_teardown( 68 self.log, 69 ads[0], 70 ads[1], 71 None, 72 video_state=VT_STATE_BIDIRECTIONAL, 73 verify_caller_func=is_phone_in_call_video_bidirectional, 74 verify_callee_func=is_phone_in_call_video_bidirectional): 75 self.log.error("Failed to setup+teardown a call") 76 return False 77 78 self.log.info("Step2: Verify Internet on PhoneA.") 79 if not verify_http_connection(self.log, ads[0]): 80 self.log.error("Verify Internet on PhoneA failed.") 81 return False 82 83 return hangup_call(self.log, ads[0]) 84 85 86 """ Tests End """ 87