~brandontschaefer/unity/allow-outof-bounds-dragging-overlay-scrollbar

« back to all changes in this revision

Viewing changes to tests/autopilot/unity/tests/launcher/test_icon_behavior.py

  • Committer: Tarmac
  • Author(s): Andrea Azzarone
  • Date: 2013-01-14 12:06:45 UTC
  • mfrom: (3030.1.3 fix-1087422)
  • Revision ID: tarmac-20130114120645-x92bb9l8mypuij4v
Fix a race condition with windows that start minimized. Fixes: https://bugs.launchpad.net/bugs/1087422, https://bugs.launchpad.net/bugs/1089981.

Approved by Łukasz Zemczak, Marco Trevisan (Treviño).

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
from unity.emulators.launcher import IconDragType
20
20
from unity.tests.launcher import LauncherTestCase, _make_scenarios
21
21
 
 
22
from Xlib import Xutil
 
23
 
22
24
logger = logging.getLogger(__name__)
23
25
 
24
26
 
219
221
 
220
222
        self.assertThat(self.window_manager.expo_active, Eventually(Equals(False)))
221
223
 
 
224
    def test_unminimize_initially_minimized_windows(self):
 
225
        """Make sure initially minimized windows can be unminimized."""
 
226
        window_spec = {
 
227
            "Title": "Hello",
 
228
            "Minimized": True
 
229
        }
 
230
 
 
231
        window = self.launch_test_window(window_spec)
 
232
        icon = self.launcher.model.get_icon(desktop_id=window.application.desktop_file)
 
233
 
 
234
        self.launcher_instance.click_launcher_icon(icon)
 
235
        self.assertThat(lambda: window.x_win.get_wm_state()['state'], Eventually(Equals(Xutil.NormalState)))
 
236
 
 
237
    def test_unminimize_minimized_immediately_after_show_windows(self):
 
238
        """Make sure minimized-immediately-after-show windows can be unminimized."""
 
239
        window_spec = {
 
240
            "Title": "Hello",
 
241
            "MinimizeImmediatelyAfterShow": True
 
242
        }
 
243
 
 
244
        window = self.launch_test_window(window_spec)
 
245
        icon = self.launcher.model.get_icon(desktop_id=window.application.desktop_file)
 
246
 
 
247
        self.launcher_instance.click_launcher_icon(icon)
 
248
        self.assertThat(lambda: window.x_win.get_wm_state()['state'], Eventually(Equals(Xutil.NormalState)))
222
249
 
223
250
class LauncherDragIconsBehavior(LauncherTestCase):
224
251
    """Tests dragging icons around the Launcher."""