def _simulate_user_activity(self): """Inject user activity via D-bus to restart idle timer. Note that if the screen has gone black, these use activities will wake up the display again. However, they will not wake up a screen that has merely been dimmed. """ graphics_utils.click_mouse() # Note: Duration is 0.4 seconds. graphics_utils.press_keys(['KEY_LEFTCTRL'])
def gmaps_test(self): """ Google Maps test. Load maps and zoom in and out. """ with self.new_chrome() as cr: tabs = self.open_urls(cr, [GMAPS_MTV_URL]) # Click into the map area to achieve focus. time.sleep(5) graphics_utils.click_mouse() # Do the stress test. cycle = 0 while time.time() - self._start_time < self._test_duration_secs: logging.info('Maps zoom cycle %d', cycle) cycle += 1 self.maps_zoom_cycle() for tab in tabs: tab.Close()