104
105
self.keybinding_tap("expo/start")
105
106
self.addCleanup(self.keybinding, "expo/cancel")
108
def test_shortcut_hint_hide_pressing_modifiers(self):
109
"""Pressing a modifer key must hide the shortcut hint."""
110
self.shortcut_hint.ensure_visible()
111
self.addCleanup(self.shortcut_hint.ensure_hidden)
113
self.keyboard.press('Control')
107
115
self.assertThat(self.shortcut_hint.visible, Eventually(Equals(False)))
109
117
def test_launcher_switcher_next_doesnt_show_shortcut_hint(self):
134
142
self.assertThat(self.shortcut_hint.visible, Equals(False))
136
def test_launcher_switcher_next_keeps_shortcut_hint(self):
137
"""Super+Tab switcher cycling forwards must not dispel an already-showing
141
show_timeout = self.shortcut_hint.get_show_timeout()
142
self.shortcut_hint.ensure_visible()
143
self.addCleanup(self.shortcut_hint.ensure_hidden)
145
self.keybinding("launcher/switcher/next")
146
self.addCleanup(self.keyboard.press_and_release, "Escape")
148
self.assertThat(self.launcher.key_nav_is_active, Equals(True))
150
self.keybinding("launcher/switcher/next")
151
sleep(show_timeout * 2)
152
self.assertThat(self.shortcut_hint.visible, Equals(True))
154
def test_launcher_switcher_prev_keeps_shortcut_hint(self):
155
"""Super+Tab switcher cycling backwards must not dispel an already-showing
159
show_timeout = self.shortcut_hint.get_show_timeout()
160
self.shortcut_hint.ensure_visible()
161
self.addCleanup(self.shortcut_hint.ensure_visible)
163
self.keybinding("launcher/switcher/next")
164
self.addCleanup(self.keyboard.press_and_release, "Escape")
165
self.assertThat(self.launcher.key_nav_is_active, Equals(True))
167
self.keybinding("launcher/switcher/prev")
168
self.keybinding("launcher/switcher/prev")
169
sleep(show_timeout * 2)
170
self.assertThat(self.shortcut_hint.visible, Equals(True))
172
def test_launcher_switcher_cancel_doesnt_hide_shortcut_hint(self):
173
"""Cancelling the launcher switcher (by Escape) must not hide the
177
self.shortcut_hint.ensure_visible()
178
self.addCleanup(self.shortcut_hint.ensure_hidden)
180
self.keybinding("launcher/switcher/next")
181
# NOTE: This will generate an extra Escape keypress if the test passes,
182
# but that's better than the alternative...
183
self.addCleanup(self.keybinding, "launcher/switcher/exit")
185
self.assertThat(self.launcher.key_nav_is_active, Eventually(Equals(True)))
186
self.assertThat(self.shortcut_hint.visible, Equals(True))
188
self.keyboard.press_and_release("Escape")
190
self.assertThat(self.launcher.key_nav_is_active, Eventually(Equals(False)))
191
self.assertThat(self.shortcut_hint.visible, Equals(True))
193
def test_launcher_switcher_and_shortcut_hint_escaping(self):
194
"""Cancelling the launcher switcher (by Escape) should not hide the
195
shortcut hint view, an extra keypress is needed.
198
self.shortcut_hint.ensure_visible()
199
self.addCleanup(self.shortcut_hint.ensure_hidden)
201
self.keybinding("launcher/switcher/next")
203
self.assertThat(self.launcher.key_nav_is_active, Eventually(Equals(True)))
204
self.assertThat(self.shortcut_hint.visible, Equals(True))
206
self.keyboard.press_and_release("Escape")
208
self.assertThat(self.launcher.key_nav_is_active, Eventually(Equals(False)))
209
self.assertThat(self.shortcut_hint.visible, Equals(True))
211
self.keyboard.press_and_release("Escape")
212
self.assertThat(self.shortcut_hint.visible, Eventually(Equals(False)))
214
144
def test_launcher_icons_hints_show_with_shortcut_hint(self):
215
145
"""When the shortcut hint is shown also the launcer's icons hints should