Lines Matching refs:self
72 def setup_class(self): argument
73 devices = self.register_controller(android_device, min_number=1)
74 self.dut = devices[0]
75 self.camera = str(self.user_params['camera'])
76 logging.debug('Camera_id: %s', self.camera)
77 if self.user_params.get('chart_distance'):
78 self.chart_distance = float(self.user_params['chart_distance'])
79 logging.debug('Chart distance: %s cm', self.chart_distance)
80 if self.user_params.get('chart_loc_arg'):
81 self.chart_loc_arg = self.user_params['chart_loc_arg']
83 self.chart_loc_arg = ''
84 if self.user_params.get('debug_mode'):
85 self.debug_mode = True if self.user_params[
87 if self.user_params.get('scene'):
88 self.scene = self.user_params['scene']
89 camera_id_combo = self.parse_hidden_camera_id()
90 self.camera_id = camera_id_combo[0]
92 self.hidden_physical_id = camera_id_combo[1]
94 self.hidden_physical_id = None
99 self.tablet = devices[1]
100 self.tablet_screen_brightness = self.user_params['brightness']
105 self.fps = int(self.user_params['fps'])
106 img_size = self.user_params['img_size'].split(',')
107 self.img_w = int(img_size[0])
108 self.img_h = int(img_size[1])
109 self.test_length = float(self.user_params['test_length'])
110 self.rotator_cntl = self.user_params['rotator_cntl']
111 self.rotator_ch = str(self.user_params['rotator_ch'])
113 self.tablet = None
116 self._setup_devices(num_devices)
118 def _setup_devices(self, num): argument
124 self.setup_dut(self.dut)
126 logic = lambda d: self.setup_dut(d) if d else self.setup_tablet()
128 logic, [(self.dut,), (None,)],
132 def setup_dut(self, device): argument
133 self.dut.adb.shell(
138 def setup_tablet(self): argument
140 self.tablet.adb.shell(['input', 'keyevent', 'KEYCODE_POWER'])
142 self.tablet.adb.shell(['input', 'keyevent', 'KEYCODE_WAKEUP'])
145 self.tablet.adb.shell(['wm', 'dismiss-keyguard'])
148 self.tablet.adb.shell(
152 self.tablet.adb.shell(
154 str(self.tablet_screen_brightness)])
156 format(self.tablet_screen_brightness))
157 self.tablet.adb.shell('settings put system screen_off_timeout {}'.format(
159 self.set_tablet_landscape_orientation()
160 self.tablet.adb.shell('am force-stop com.google.android.apps.docs')
161 self.tablet.adb.shell('am force-stop com.google.android.apps.photos')
162 self.tablet.adb.shell('am force-stop com.android.gallery3d')
163 self.tablet.adb.shell('am force-stop com.sec.android.gallery3d')
165 def set_tablet_landscape_orientation(self): argument
170 output = self.tablet.adb.shell('dumpsys window | grep mLandscapeRotation')
180 self.tablet.adb.shell(['settings', 'put', 'system', 'user_rotation',
184 int(self.tablet.adb.shell('settings get system user_rotation')))
186 def parse_hidden_camera_id(self): argument
192 camera_id_combo = self.camera.split(its_session_utils.SUB_CAMERA_SEPARATOR)
195 def determine_not_yet_mandated_tests(self, device_id, scene): argument
221 def on_pass(self, record): argument
224 def on_fail(self, record): argument
226 if self.user_params.get('scene'):
227 not_yet_mandated_tests = self.determine_not_yet_mandated_tests(
228 self.dut.serial, self.scene)
229 if self.current_test_info.name in not_yet_mandated_tests[self.scene]:
230 logging.debug('%s is not yet mandated.', self.current_test_info.name)