• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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"""
19from acts.libs.utils.multithread import multithread_func
20from acts_contrib.test_utils.tel.TelephonyBaseTest import TelephonyBaseTest
21from acts_contrib.test_utils.tel.tel_defines import VT_STATE_BIDIRECTIONAL
22from acts_contrib.test_utils.tel.tel_test_utils import verify_http_connection
23from acts_contrib.test_utils.tel.tel_video_utils import is_phone_in_call_video_bidirectional
24from acts_contrib.test_utils.tel.tel_video_utils import phone_setup_video
25from acts_contrib.test_utils.tel.tel_video_utils import video_call_setup_teardown
26from acts_contrib.test_utils.tel.tel_voice_utils import hangup_call
27
28
29class TelLiveVideoDataTest(TelephonyBaseTest):
30    def setup_class(self):
31        super().setup_class()
32
33        self.stress_test_number = self.get_stress_test_number()
34        self.number_of_devices = 2
35
36    """ Tests Begin """
37
38    @TelephonyBaseTest.tel_test_wrap
39    def test_internet_access_during_video_call(self):
40        """ Test Internet access during VT<->VT call.
41
42        Make Sure PhoneA is in LTE mode (with Video Calling).
43        Make Sure PhoneB is in LTE mode (with Video Calling).
44        Call from PhoneA to PhoneB as Bi-Directional Video,
45        Accept on PhoneB as video call.
46        Verify PhoneA have Internet access.
47        Hang up on PhoneA.
48
49        Returns:
50            True if pass; False if fail.
51        """
52        ads = self.android_devices
53        tasks = [(phone_setup_video, (self.log, ads[0])), (phone_setup_video,
54                                                           (self.log, ads[1]))]
55        if not multithread_func(self.log, tasks):
56            self.log.error("Phone Failed to Set Up Properly.")
57            return False
58
59        self.log.info("Step1: Make MO VT call.")
60        if not video_call_setup_teardown(
61                self.log,
62                ads[0],
63                ads[1],
64                None,
65                video_state=VT_STATE_BIDIRECTIONAL,
66                verify_caller_func=is_phone_in_call_video_bidirectional,
67                verify_callee_func=is_phone_in_call_video_bidirectional):
68            self.log.error("Failed to setup+teardown a call")
69            return False
70
71        self.log.info("Step2: Verify Internet on PhoneA.")
72        if not verify_http_connection(self.log, ads[0]):
73            self.log.error("Verify Internet on PhoneA failed.")
74            return False
75
76        return hangup_call(self.log, ads[0])
77
78
79""" Tests End """
80