~3v1n0/unity/alt+tab-scroll-wheel

« back to all changes in this revision

Viewing changes to tests/autopilot/autopilot/tests/test_invisible_windows.py

  • Committer: Marco Trevisan (Treviño)
  • Date: 2012-03-06 17:09:00 UTC
  • mfrom: (2021.2.33 unity)
  • Revision ID: mail@3v1n0.net-20120306170900-f6xp3f63bo9rjiys
Merging with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
from time import sleep
16
16
 
17
17
from autopilot.utilities import make_window_skip_taskbar
18
 
from autopilot.emulators.unity.launcher import Launcher
19
18
from autopilot.emulators.unity.switcher import Switcher
20
19
from autopilot.emulators.bamf import Bamf
21
20
 
28
27
        in the launcher or the switcher.
29
28
 
30
29
        """
 
30
        self.skipTest("This test needs to be rewritten. We don't support changing window states after they've been mapped.")
 
31
 
31
32
        b = Bamf()
32
33
        self.assertFalse(b.application_is_running('Calculator'))
33
34
        b.launch_application("gcalctool.desktop")
35
36
        sleep(1)
36
37
 
37
38
        switcher = Switcher()
38
 
        launcher = Launcher()
39
39
        # calculator should be in both launcher AND switcher:
40
 
        icon_names = [i.tooltip_text for i in launcher.get_launcher_icons()]
 
40
        icon_names = [i.tooltip_text for i in self.launcher.model.get_launcher_icons()]
41
41
        self.assertIn('Calculator', icon_names)
42
42
 
43
43
        switcher.initiate()
54
54
        sleep(2)
55
55
 
56
56
        # calculator should now NOT be in both launcher AND switcher:
57
 
        icon_names = [i.tooltip_text for i in launcher.get_launcher_icons()]
 
57
        icon_names = [i.tooltip_text for i in self.launcher.model.get_launcher_icons()]
58
58
        self.assertNotIn('Calculator', icon_names)
59
59
 
60
60
        switcher.initiate()
64
64
 
65
65
    def test_pinned_invisible_window(self):
66
66
        """Test behavior of an app with an invisible window that's pinned to the launher."""
 
67
 
 
68
        self.skipTest("This test needs to be rewritten. We don't support changing window states after they've been mapped.")
 
69
 
67
70
        b = Bamf()
68
71
        self.assertFalse(b.application_is_running('Calculator'))
69
72
        b.launch_application("gcalctool.desktop")
70
73
        self.addCleanup(call, ["killall", "gcalctool"])
71
74
        # need to pin the app to the launcher - this could be tricky.
72
 
        launcher = Launcher()
73
 
        launcher.reveal_launcher(0)
74
 
        icons = launcher.get_launcher_icons()
 
75
        self.launcher.get_launcher_for_monitor(0).reveal_launcher()
 
76
        icons = self.launcher.model.get_launcher_icons()
75
77
        # launcher.grab_switcher()
76
78
        calc_icon = None
77
79
        for icon in icons:
80
82
                break
81
83
 
82
84
        self.assertIsNotNone(calc_icon, "Could not find calculator in launcher.")
83
 
        launcher.lock_to_launcher(calc_icon)
84
 
        self.addCleanup(launcher.unlock_from_launcher, calc_icon)
 
85
        self.launcher.get_launcher_for_monitor(0).lock_to_launcher(calc_icon)
 
86
        self.addCleanup(self.launcher.get_launcher_for_monitor(0).unlock_from_launcher, calc_icon)
85
87
 
86
88
        # make calc window skip the taskbar:
87
89
        apps = b.get_running_applications_by_title('Calculator')
91
93
        make_window_skip_taskbar(windows[0].x_win)
92
94
 
93
95
        # clicking on launcher icon should start a new instance:
94
 
        launcher.click_launcher_icon(calc_icon)
 
96
        self.launcher.get_launcher_for_monitor(0).click_launcher_icon(calc_icon)
95
97
        sleep(1)
96
98
 
97
99
        # should now be one app with two windows: