/usr/lib/python2.7/dist-packages/unity/tests/launcher/test_visual.py is in unity-autopilot 7.5.0+18.04.20180413-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
# Copyright 2012 Canonical
# Authors: Thomi Richards,
# Marco Trevisan (TreviƱo)
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
from __future__ import absolute_import
from autopilot.matchers import Eventually
import logging
from testtools.matchers import Equals
from time import sleep
from unity.emulators.icons import BFBLauncherIcon
from unity.tests.launcher import LauncherTestCase
logger = logging.getLogger(__name__)
class LauncherVisualTests(LauncherTestCase):
"""Tests for visual aspects of the launcher (icon saturation etc.)."""
def test_keynav_from_dash_saturates_icons(self):
"""Starting super+tab switcher from the dash must resaturate launcher icons.
Tests fix for bug #913569.
"""
bfb = self.unity.launcher.model.get_bfb_icon()
self.mouse.move(bfb.center.x, bfb.center.y)
self.unity.dash.ensure_visible()
current_monitor = self.unity.dash.monitor
sleep(1)
# We can't use 'launcher_instance.switcher_start()' since it moves the mouse.
self.keybinding_hold_part_then_tap("launcher/switcher")
self.addCleanup(self.keybinding_release, "launcher/switcher")
self.addCleanup(self.keybinding, "launcher/switcher/exit")
self.keybinding_tap("launcher/switcher/next")
for icon in self.unity.launcher.model.get_launcher_icons():
self.assertFalse(icon.monitors_desaturated[current_monitor])
def test_opening_dash_desaturates_icons(self):
"""Opening the dash must desaturate all the launcher icons."""
self.unity.dash.ensure_visible()
current_monitor = self.unity.dash.monitor
self.addCleanup(self.unity.dash.ensure_hidden)
for icon in self.unity.launcher.model.get_launcher_icons():
if isinstance(icon, BFBLauncherIcon):
self.assertFalse(icon.monitors_desaturated[current_monitor])
else:
self.assertTrue(icon.monitors_desaturated[current_monitor])
def test_opening_dash_with_mouse_over_launcher_keeps_icon_saturation(self):
"""Opening dash with mouse over launcher must not desaturate icons."""
launcher_instance = self.get_launcher()
x,y,w,h = launcher_instance.geometry
self.mouse.move(x + w/2, y + h/2)
sleep(.5)
self.unity.dash.ensure_visible()
current_monitor = self.unity.dash.monitor
self.addCleanup(self.unity.dash.ensure_hidden)
for icon in self.unity.launcher.model.get_launcher_icons():
self.assertFalse(icon.monitors_desaturated[current_monitor])
def test_mouse_over_with_dash_open_desaturates_icons(self):
"""Moving mouse over launcher with dash open must saturate icons."""
self.unity.dash.ensure_visible()
current_monitor = self.unity.dash.monitor
self.addCleanup(self.unity.dash.ensure_hidden)
sleep(.5)
self.mouse.move_to_object(self.get_launcher())
sleep(.5)
for icon in self.unity.launcher.model.get_launcher_icons():
self.assertFalse(icon.monitors_desaturated[current_monitor])
|