Merge lp:~joetalbott/ubuntu-test-cases/memevent_browser into lp:ubuntu-test-cases/smoke-touch-apps

Proposed by Joe Talbott
Status: Merged
Approved by: Joe Talbott
Approved revision: 87
Merged at revision: 87
Proposed branch: lp:~joetalbott/ubuntu-test-cases/memevent_browser
Merge into: lp:ubuntu-test-cases/smoke-touch-apps
Diff against target: 66 lines (+14/-21)
1 file modified
memevent/ubuntu_test_cases/memory_usage_measurement/apps/browser.py (+14/-21)
To merge this branch: bzr merge lp:~joetalbott/ubuntu-test-cases/memevent_browser
Reviewer Review Type Date Requested Status
Andy Doan (community) Approve
Review via email: mp+183720@code.launchpad.net

Commit message

Memevent Browser - Update to match UI Toolkit changes.

Description of the change

Memevent Browser - Update to match UI Toolkit changes.

To post a comment you must log in.
Revision history for this message
Andy Doan (doanac) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'memevent/ubuntu_test_cases/memory_usage_measurement/apps/browser.py'
--- memevent/ubuntu_test_cases/memory_usage_measurement/apps/browser.py 2013-08-05 23:23:31 +0000
+++ memevent/ubuntu_test_cases/memory_usage_measurement/apps/browser.py 2013-09-03 17:34:26 +0000
@@ -2,7 +2,8 @@
22
3from testtools.matchers import Contains, Equals3from testtools.matchers import Contains, Equals
44
5from webbrowser_app.emulators.main_window import MainWindow as BrowserWindow5from ubuntuuitoolkit.emulators import UbuntuUIToolkitEmulatorBase
6from webbrowser_app.emulators.browser import Browser
67
7from ubuntu_test_cases.memory_usage_measurement.apps import App8from ubuntu_test_cases.memory_usage_measurement.apps import App
8from ubuntu_test_cases.memory_usage_measurement.matchers import (9from ubuntu_test_cases.memory_usage_measurement.matchers import (
@@ -19,10 +20,10 @@
1920
20 def assert_chrome_eventually_hidden(self):21 def assert_chrome_eventually_hidden(self):
21 """Make sure chrome is eventually hidden."""22 """Make sure chrome is eventually hidden."""
22 view = self.window.get_qml_view()23
23 chrome = self.window.get_chrome()24 toolbar = self.window.get_toolbar()
24 self.tc.assertThat(lambda: chrome.globalRect[1],25 self.tc.assertThat(toolbar.opened, Eventually(Equals(False)))
25 Eventually(Equals(view.y + view.height)))26 self.tc.assertThat(toolbar.animating, Eventually(Equals(False)))
2627
27 def assert_page_eventually_loaded(self, url):28 def assert_page_eventually_loaded(self, url):
28 """Make sure page is eventually loaded."""29 """Make sure page is eventually loaded."""
@@ -67,7 +68,7 @@
6768
68 """69 """
69 self.ensure_chrome_is_hidden()70 self.ensure_chrome_is_hidden()
70 self.reveal_chrome()71 self.window.open_toolbar()
71 self.clear_address_bar()72 self.clear_address_bar()
72 self.type_in_address_bar(url)73 self.type_in_address_bar(url)
73 self.keyboard.press_and_release("Enter")74 self.keyboard.press_and_release("Enter")
@@ -80,21 +81,13 @@
80 ('--desktop_file_hint='81 ('--desktop_file_hint='
81 '/usr/share/applications/webbrowser-app.desktop'),82 '/usr/share/applications/webbrowser-app.desktop'),
82 ]83 ]
83 self.app = self.tc.launch_test_application(*args, app_type='qt')84 self.app = self.tc.launch_test_application(
84 self.window = BrowserWindow(self.app)85 *args,
85 self.tc.assertThat(self.window.get_qml_view().visible,86 app_type='qt',
86 Eventually(Equals(True)))87 emulator_base=UbuntuUIToolkitEmulatorBase
8788 )
88 def reveal_chrome(self):89 self.window = self.app.select_single(Browser)
89 """Reveal chrome."""90 self.window.visible.wait_for(True)
90 panel = self.window.get_panel()
91 distance = self.window.get_chrome().height
92 view = self.window.get_qml_view()
93 x_line = int(view.x + view.width * 0.5)
94 start_y = int(view.y + view.height - 1)
95 stop_y = int(start_y - distance)
96 self.pointer.drag(x_line, start_y, x_line, stop_y)
97 self.tc.assertThat(panel.state, Eventually(Equals('spread')))
9891
99 def type_in_address_bar(self, text):92 def type_in_address_bar(self, text):
100 """Type text in address bar.93 """Type text in address bar.

Subscribers

People subscribed via source and target branches