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