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
1=== modified file 'memevent/ubuntu_test_cases/memory_usage_measurement/apps/browser.py'
2--- memevent/ubuntu_test_cases/memory_usage_measurement/apps/browser.py 2013-08-05 23:23:31 +0000
3+++ memevent/ubuntu_test_cases/memory_usage_measurement/apps/browser.py 2013-09-03 17:34:26 +0000
4@@ -2,7 +2,8 @@
5
6 from testtools.matchers import Contains, Equals
7
8-from webbrowser_app.emulators.main_window import MainWindow as BrowserWindow
9+from ubuntuuitoolkit.emulators import UbuntuUIToolkitEmulatorBase
10+from webbrowser_app.emulators.browser import Browser
11
12 from ubuntu_test_cases.memory_usage_measurement.apps import App
13 from ubuntu_test_cases.memory_usage_measurement.matchers import (
14@@ -19,10 +20,10 @@
15
16 def assert_chrome_eventually_hidden(self):
17 """Make sure chrome is eventually hidden."""
18- view = self.window.get_qml_view()
19- chrome = self.window.get_chrome()
20- self.tc.assertThat(lambda: chrome.globalRect[1],
21- Eventually(Equals(view.y + view.height)))
22+
23+ toolbar = self.window.get_toolbar()
24+ self.tc.assertThat(toolbar.opened, Eventually(Equals(False)))
25+ self.tc.assertThat(toolbar.animating, Eventually(Equals(False)))
26
27 def assert_page_eventually_loaded(self, url):
28 """Make sure page is eventually loaded."""
29@@ -67,7 +68,7 @@
30
31 """
32 self.ensure_chrome_is_hidden()
33- self.reveal_chrome()
34+ self.window.open_toolbar()
35 self.clear_address_bar()
36 self.type_in_address_bar(url)
37 self.keyboard.press_and_release("Enter")
38@@ -80,21 +81,13 @@
39 ('--desktop_file_hint='
40 '/usr/share/applications/webbrowser-app.desktop'),
41 ]
42- self.app = self.tc.launch_test_application(*args, app_type='qt')
43- self.window = BrowserWindow(self.app)
44- self.tc.assertThat(self.window.get_qml_view().visible,
45- Eventually(Equals(True)))
46-
47- def reveal_chrome(self):
48- """Reveal chrome."""
49- panel = self.window.get_panel()
50- distance = self.window.get_chrome().height
51- view = self.window.get_qml_view()
52- x_line = int(view.x + view.width * 0.5)
53- start_y = int(view.y + view.height - 1)
54- stop_y = int(start_y - distance)
55- self.pointer.drag(x_line, start_y, x_line, stop_y)
56- self.tc.assertThat(panel.state, Eventually(Equals('spread')))
57+ self.app = self.tc.launch_test_application(
58+ *args,
59+ app_type='qt',
60+ emulator_base=UbuntuUIToolkitEmulatorBase
61+ )
62+ self.window = self.app.select_single(Browser)
63+ self.window.visible.wait_for(True)
64
65 def type_in_address_bar(self, text):
66 """Type text in address bar.

Subscribers

People subscribed via source and target branches