| # Copyright (c) 2014 The Chromium OS Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| from autotest_lib.client.common_lib import utils |
| from autotest_lib.client.cros.ui import ui_test_base |
| |
| |
| class ui_SystemTray(ui_test_base.ui_TestBase): |
| """ |
| Collects system tray screenshots. |
| |
| See comments on parent class for overview of how things flow. |
| |
| """ |
| |
| shelf_height = None |
| x_offset_in_pixels = None |
| y_offset_in_pixels = None |
| |
| |
| @property |
| def test_area(self): |
| return 'system_tray' |
| |
| |
| def capture_screenshot(self, filepath): |
| utils.take_screen_shot_crop_by_height(filepath, |
| ui_SystemTray.shelf_height, |
| ui_SystemTray.x_offset_in_pixels, |
| ui_SystemTray.y_offset_in_pixels) |
| |
| |
| def run_once(self, shelf_height, x_offset_in_pixels, y_offset_in_pixels): |
| """ Called by autotest. Calls the parent template method that runs test. |
| |
| """ |
| |
| # store values passed in from control file. |
| # we will use them in capture_screenshot() which will get called as |
| # part of run_screenshot_comparison_test() - the parent's method. |
| |
| ui_SystemTray.shelf_height = shelf_height |
| ui_SystemTray.x_offset_in_pixels = x_offset_in_pixels |
| ui_SystemTray.y_offset_in_pixels = y_offset_in_pixels |
| |
| # see parent for implementation! |
| self.run_screenshot_comparison_test() |
| |
| |