~ubuntu-branches/ubuntu/wily/webbrowser-app/wily-proposed

« back to all changes in this revision

Viewing changes to tests/autopilot/webbrowser_app/tests/test_new_tab_view.py

  • Committer: Package Import Robot
  • Author(s): Olivier Tilloy, CI Train Bot, Michael Sheldon, Olivier Tilloy, Ugo Riboni
  • Date: 2015-09-28 08:15:15 UTC
  • mfrom: (1.2.115)
  • Revision ID: package-import@ubuntu.com-20150928081515-t7zk2r671umog1d0
Tags: 0.23+15.10.20150928-0ubuntu1
[ CI Train Bot ]
* New rebuild forced.
* Resync trunk.

[ Michael Sheldon ]
* Add support for alternative mimetype header for vcards (LP:
  #1498992)

[ Olivier Tilloy ]
* Add a context menu to each tab in the tab bar, allowing to insert a
  new tab just after, close or reload the current tab.
* Fix a couple of autopilot test failures on desktop. (LP: #1495297,
  #1499411)
* Update translation template.

[ Ugo Riboni ]
* Add a context menu to each tab in the tab bar, allowing to insert a
  new tab just after, close or reload the current tab.

Show diffs side-by-side

added added

removed removed

Lines of Context:
458
458
        bookmark = bookmarks[1]
459
459
        title = bookmark.title
460
460
        grip = bookmark.get_grip()
461
 
        original_x = grip.globalRect.x
462
 
        original_y = grip.globalRect.y
 
461
        rect = grip.globalRect
463
462
 
464
463
        # Test that when hovering normal bookmarks item the grip appears
465
464
        self.assertThat(grip.opacity, Equals(0))
467
466
        self.assertThat(grip.opacity, Eventually(Equals(1.0)))
468
467
 
469
468
        # Test that an item bounces back when dragged within the list itself
470
 
        self.pointing_device.drag(original_x, original_y,
471
 
                                  original_x, original_y + 200)
 
469
        self.pointing_device.drag(rect.x, rect.y,
 
470
                                  rect.x, rect.y + 200)
 
471
        self.assertThat(grip.globalRect, Eventually(Equals(rect)))
472
472
 
473
473
        # Test that an item bounces back when dragged to the same folder
474
474
        folder = folders[0]
475
475
        folder_cx = folder.globalRect.x + folder.width / 2
476
476
        folder_cy = folder.globalRect.y + folder.height / 2
477
 
        self.pointing_device.drag(original_x, original_y,
478
 
                                  folder_cx, folder_cy)
479
 
 
480
 
        self.assertThat(lambda: (grip.globalRect.x, grip.globalRect.y),
481
 
                        Eventually(Equals((original_x, original_y))))
 
477
        # Work around https://launchpad.net/bugs/1499437 by dragging downwards
 
478
        # a little bit first, then to the target folder.
 
479
        self.pointing_device.move_to_object(grip)
 
480
        pos = self.pointing_device.position()
 
481
        self.pointing_device.press()
 
482
        self.pointing_device.move(pos[0], pos[1] + 20)
 
483
        self.pointing_device.move(folder_cx, folder_cy)
 
484
        self.pointing_device.release()
 
485
        self.assertThat(grip.globalRect, Eventually(Equals(rect)))
482
486
 
483
487
        # Test that dragging an item to another folder removes it from this one
484
488
        # and adds it to the target folder
485
489
        folder = folders[2]
486
490
        folder_cx = folder.globalRect.x + folder.width / 2
487
491
        folder_cy = folder.globalRect.y + folder.height / 2
488
 
        self.pointing_device.drag(original_x, original_y,
489
 
                                  folder_cx, folder_cy)
490
 
 
 
492
        # Work around https://launchpad.net/bugs/1499437 by dragging downwards
 
493
        # a little bit first, then to the target folder.
 
494
        self.pointing_device.move_to_object(grip)
 
495
        pos = self.pointing_device.position()
 
496
        self.pointing_device.press()
 
497
        self.pointing_device.move(pos[0], pos[1] + 20)
 
498
        # Move the cursor to a few pixels below the vertical center of the
 
499
        # folder to ensure that the folder above doesn’t get targetted instead.
 
500
        self.pointing_device.move(folder_cx, folder_cy + 5)
 
501
        self.pointing_device.release()
491
502
        self.assertThat(lambda: len(view.get_bookmarks_list()),
492
503
                        Eventually(NotEquals(previous_count)))
493
504