Merge lp:~osomon/webbrowser-app/visual-tweaks into lp:webbrowser-app

Proposed by Olivier Tilloy
Status: Merged
Approved by: Olivier Tilloy
Approved revision: 1375
Merged at revision: 1371
Proposed branch: lp:~osomon/webbrowser-app/visual-tweaks
Merge into: lp:webbrowser-app
Diff against target: 598 lines (+129/-110)
11 files modified
debian/control (+2/-0)
src/Ubuntu/Web/ItemSelector02.qml (+7/-5)
src/app/webbrowser/Browser.qml (+3/-0)
src/app/webbrowser/HistoryViewWide.qml (+3/-13)
src/app/webbrowser/NavigationBar.qml (+1/-0)
src/app/webbrowser/NewTabViewWide.qml (+12/-1)
src/app/webbrowser/SettingsPage.qml (+64/-38)
src/app/webbrowser/TabsList.qml (+2/-2)
src/app/webbrowser/UrlDelegate.qml (+9/-16)
tests/autopilot/webbrowser_app/emulators/browser.py (+7/-12)
tests/autopilot/webbrowser_app/tests/test_settings.py (+19/-23)
To merge this branch: bzr merge lp:~osomon/webbrowser-app/visual-tweaks
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu Phablet Team Pending
Review via email: mp+287169@code.launchpad.net

Commit message

Visual tweaks per designers’ review.

To post a comment you must log in.
1364. By Olivier Tilloy

Update tabs list background color, per visual design request.

1365. By Olivier Tilloy

Make the drawer menu’s inverse mouse area the topmost item to ensure that the tabs list cannot be opened while the drawer menu is displayed.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1366. By Olivier Tilloy

Merge the latest changes from trunk and resolve a minor conflict.

1367. By Olivier Tilloy

Fix activating entries in the drawer menu.

1368. By Olivier Tilloy

Update autopilot tests.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1369. By Olivier Tilloy

Fix unit tests.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1370. By Olivier Tilloy

Fix one more flake8 error.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1371. By Olivier Tilloy

Remove UbuntuShape around favicons in history views, per visual design request.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1372. By Olivier Tilloy

Fix a crash that seems to result from the interaction of the custom DirectionalDragArea element and a topmost InverseMouseArea.

1373. By Olivier Tilloy

Simplify code.

1374. By Olivier Tilloy

Use a RowLayout to make code more readable.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1375. By Olivier Tilloy

Downgrade module import version to make it compatible with Qt 5.4.1 which is in vivid.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/control'
--- debian/control 2016-02-09 21:19:41 +0000
+++ debian/control 2016-03-01 11:22:46 +0000
@@ -21,6 +21,7 @@
21 qml-module-qt-labs-folderlistmodel,21 qml-module-qt-labs-folderlistmodel,
22 qml-module-qt-labs-settings,22 qml-module-qt-labs-settings,
23 qml-module-qtquick2 (>= 5.4),23 qml-module-qtquick2 (>= 5.4),
24 qml-module-qtquick-layouts,
24 qml-module-qttest,25 qml-module-qttest,
25 qt5-default,26 qt5-default,
26 qt5-qmake,27 qt5-qmake,
@@ -48,6 +49,7 @@
48 qml-module-qt-labs-folderlistmodel,49 qml-module-qt-labs-folderlistmodel,
49 qml-module-qt-labs-settings,50 qml-module-qt-labs-settings,
50 qml-module-qtquick2 (>= 5.4),51 qml-module-qtquick2 (>= 5.4),
52 qml-module-qtquick-layouts,
51 qml-module-qtquick-window2 (>= 5.3),53 qml-module-qtquick-window2 (>= 5.3),
52 qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.3) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.3),54 qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.3) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.3),
53 qtdeclarative5-ubuntu-web-plugin (= ${binary:Version}),55 qtdeclarative5-ubuntu-web-plugin (= ${binary:Version}),
5456
=== modified file 'src/Ubuntu/Web/ItemSelector02.qml'
--- src/Ubuntu/Web/ItemSelector02.qml 2015-08-10 15:22:00 +0000
+++ src/Ubuntu/Web/ItemSelector02.qml 2016-03-01 11:22:46 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright 2013-2015 Canonical Ltd.2 * Copyright 2013-2016 Canonical Ltd.
3 *3 *
4 * This file is part of webbrowser-app.4 * This file is part of webbrowser-app.
5 *5 *
@@ -18,7 +18,7 @@
1818
19import QtQuick 2.419import QtQuick 2.4
20import Ubuntu.Components 1.320import Ubuntu.Components 1.3
21import Ubuntu.Components.ListItems 1.3 as ListItem21import Ubuntu.Components.ListItems 1.3 as ListItems
22import Ubuntu.Components.Popups 1.322import Ubuntu.Components.Popups 1.3
2323
24Popover {24Popover {
@@ -38,8 +38,10 @@
3838
39 model: selectorModel.items39 model: selectorModel.items
4040
41 delegate: ListItem.Standard {41 delegate: ListItem {
42 text: model.text42 ListItemLayout {
43 title.text: model.text
44 }
43 enabled: model.enabled45 enabled: model.enabled
44 selected: model.selected46 selected: model.selected
45 onClicked: {47 onClicked: {
@@ -49,7 +51,7 @@
49 }51 }
5052
51 section.property: "group"53 section.property: "group"
52 section.delegate: ListItem.Header {54 section.delegate: ListItems.Header {
53 text: section55 text: section
54 }56 }
5557
5658
=== modified file 'src/app/webbrowser/Browser.qml'
--- src/app/webbrowser/Browser.qml 2016-02-23 11:24:33 +0000
+++ src/app/webbrowser/Browser.qml 2016-03-01 11:22:46 +0000
@@ -769,6 +769,9 @@
769 (osk.state == "hidden") && (recentView.state == "")769 (osk.state == "hidden") && (recentView.state == "")
770 visible: enabled770 visible: enabled
771 height: visible ? units.gu(4) : 0771 height: visible ? units.gu(4) : 0
772 // Ensure that this ends up below the chrome, so that the
773 // drawer menu’s inverse mouse area covers it.
774 z: -1
772775
773 onClicked: {776 onClicked: {
774 recentView.state = "shown"777 recentView.state = "shown"
775778
=== modified file 'src/app/webbrowser/HistoryViewWide.qml'
--- src/app/webbrowser/HistoryViewWide.qml 2016-01-28 18:35:14 +0000
+++ src/app/webbrowser/HistoryViewWide.qml 2016-03-01 11:22:46 +0000
@@ -306,19 +306,9 @@
306 title: Highlight.highlightTerms(model.title ? model.title : model.url, searchQuery.terms)306 title: Highlight.highlightTerms(model.title ? model.title : model.url, searchQuery.terms)
307 url: Highlight.highlightTerms(model.url, searchQuery.terms)307 url: Highlight.highlightTerms(model.url, searchQuery.terms)
308308
309 headerComponent: Component {309 headerComponent: Label {
310 Item {310 text: Qt.formatTime(model.lastVisit)
311 objectName: "historySectionDelegate"311 fontSize: "xx-small"
312 height: units.gu(3)
313 width: timeLabel.width
314
315 Label {
316 id: timeLabel
317 anchors.centerIn: parent
318 text: Qt.formatTime(model.lastVisit)
319 fontSize: "xx-small"
320 }
321 }
322 }312 }
323313
324 onClicked: {314 onClicked: {
325315
=== modified file 'src/app/webbrowser/NavigationBar.qml'
--- src/app/webbrowser/NavigationBar.qml 2016-02-18 09:29:20 +0000
+++ src/app/webbrowser/NavigationBar.qml 2016-03-01 11:22:46 +0000
@@ -256,6 +256,7 @@
256 clip: actionsListView.y != 0256 clip: actionsListView.y != 0
257257
258 InverseMouseArea {258 InverseMouseArea {
259 anchors.fill: parent
259 enabled: drawer.opened260 enabled: drawer.opened
260 onPressed: drawer.opened = false261 onPressed: drawer.opened = false
261 }262 }
262263
=== modified file 'src/app/webbrowser/NewTabViewWide.qml'
--- src/app/webbrowser/NewTabViewWide.qml 2016-02-02 11:09:49 +0000
+++ src/app/webbrowser/NewTabViewWide.qml 2016-03-01 11:22:46 +0000
@@ -112,7 +112,7 @@
112 left: parent.left112 left: parent.left
113 right: parent.right113 right: parent.right
114 }114 }
115 color: "#f8f8f8"115 color: "#ffffff"
116 height: sections.height116 height: sections.height
117117
118 Sections {118 Sections {
@@ -139,5 +139,16 @@
139 Action { text: i18n.tr("Bookmarks") }139 Action { text: i18n.tr("Bookmarks") }
140 ]140 ]
141 }141 }
142
143 Rectangle {
144 // Divider, see Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml
145 anchors {
146 left: parent.left
147 right: parent.right
148 top: parent.bottom
149 }
150 height: units.dp(1)
151 color: Qt.rgba(0, 0, 0, 0.1)
152 }
142 }153 }
143}154}
144155
=== modified file 'src/app/webbrowser/SettingsPage.qml'
--- src/app/webbrowser/SettingsPage.qml 2016-02-05 17:35:24 +0000
+++ src/app/webbrowser/SettingsPage.qml 2016-03-01 11:22:46 +0000
@@ -20,7 +20,6 @@
20import Qt.labs.settings 1.020import Qt.labs.settings 1.0
21import Ubuntu.Components 1.321import Ubuntu.Components 1.3
22import Ubuntu.Components.Popups 1.322import Ubuntu.Components.Popups 1.3
23import Ubuntu.Components.ListItems 1.3 as ListItems
24import Ubuntu.Web 0.223import Ubuntu.Web 0.2
25import webbrowserapp.private 0.124import webbrowserapp.private 0.1
2625
@@ -68,8 +67,10 @@
6867
69 width: parent.width68 width: parent.width
7069
71 ListItems.Subtitled {70 ListItem {
71 id: searchEngineListItem
72 objectName: "searchengine"72 objectName: "searchengine"
73 readonly property string currentSearchEngineDisplayName: currentSearchEngine.name
7374
74 SearchEngine {75 SearchEngine {
75 id: currentSearchEngine76 id: currentSearchEngine
@@ -77,32 +78,38 @@
77 filename: settingsObject.searchEngine78 filename: settingsObject.searchEngine
78 }79 }
7980
80 text: i18n.tr("Search engine")81 ListItemLayout {
81 subText: currentSearchEngine.name82 title.text: i18n.tr("Search engine")
83 subtitle.text: searchEngineListItem.currentSearchEngineDisplayName
84 }
8285
83 visible: searchEngines.engines.count > 186 visible: searchEngines.engines.count > 1
84
85 onClicked: searchEngineComponent.createObject(subpageContainer)87 onClicked: searchEngineComponent.createObject(subpageContainer)
86 }88 }
8789
88 ListItems.Subtitled {90 ListItem {
91 id: homepageListItem
89 objectName: "homepage"92 objectName: "homepage"
93 readonly property url currentHomepage: settingsObject.homepage
9094
91 text: i18n.tr("Homepage")95 ListItemLayout {
92 subText: settingsObject.homepage96 title.text: i18n.tr("Homepage")
97 subtitle.text: homepageListItem.currentHomepage
98 }
9399
94 onClicked: PopupUtils.open(homepageDialog)100 onClicked: PopupUtils.open(homepageDialog)
95 }101 }
96102
97 ListItems.Standard {103 ListItem {
98 objectName: "restoreSession"104 objectName: "restoreSession"
99105
100 text: i18n.tr("Restore previous session at startup")106 ListItemLayout {
101 highlightWhenPressed: false107 title.text: i18n.tr("Restore previous session at startup")
102108 CheckBox {
103 control: CheckBox {109 id: restoreSessionCheckbox
104 id: restoreSessionCheckbox110 SlotsLayout.position: SlotsLayout.Trailing
105 onTriggered: settingsObject.restoreSession = checked111 onTriggered: settingsObject.restoreSession = checked
112 }
106 }113 }
107114
108 Binding {115 Binding {
@@ -112,18 +119,22 @@
112 }119 }
113 }120 }
114121
115 ListItems.Standard {122 ListItem {
116 objectName: "privacy"123 objectName: "privacy"
117124
118 text: i18n.tr("Privacy & permissions")125 ListItemLayout {
126 title.text: i18n.tr("Privacy & permissions")
127 }
119128
120 onClicked: privacyComponent.createObject(subpageContainer)129 onClicked: privacyComponent.createObject(subpageContainer)
121 }130 }
122131
123 ListItems.Standard {132 ListItem {
124 objectName: "reset"133 objectName: "reset"
125134
126 text: i18n.tr("Reset browser settings")135 ListItemLayout {
136 title.text: i18n.tr("Reset browser settings")
137 }
127138
128 onClicked: settingsObject.restoreDefaults()139 onClicked: settingsObject.restoreDefaults()
129 }140 }
@@ -167,20 +178,25 @@
167178
168 model: searchEngines.engines179 model: searchEngines.engines
169180
170 delegate: ListItems.Standard {181 delegate: ListItem {
171 objectName: "searchEngineDelegate_" + index182 id: searchEngineDelegate
183 objectName: "searchEngineDelegate"
184 readonly property string displayName: delegateSearchEngine.name
172 SearchEngine {185 SearchEngine {
173 id: searchEngineDelegate186 id: delegateSearchEngine
174 searchPaths: searchEngines.searchPaths187 searchPaths: searchEngines.searchPaths
175 filename: model.filename188 filename: model.filename
176 }189 }
177 text: searchEngineDelegate.name
178190
179 control: CheckBox {191 ListItemLayout {
180 checked: settingsObject.searchEngine == searchEngineDelegate.filename192 title.text: searchEngineDelegate.displayName
181 onClicked: {193 CheckBox {
182 settingsObject.searchEngine = searchEngineDelegate.filename194 SlotsLayout.position: SlotsLayout.Trailing
183 searchEngineItem.destroy()195 checked: settingsObject.searchEngine == delegateSearchEngine.filename
196 onClicked: {
197 settingsObject.searchEngine = delegateSearchEngine.filename
198 searchEngineItem.destroy()
199 }
184 }200 }
185 }201 }
186 }202 }
@@ -224,15 +240,19 @@
224 id: privacyCol240 id: privacyCol
225 width: parent.width241 width: parent.width
226242
227 ListItems.Standard {243 ListItem {
228 objectName: "privacy.mediaAccess"244 objectName: "privacy.mediaAccess"
229 text: i18n.tr("Camera & microphone")245 ListItemLayout {
246 title.text: i18n.tr("Camera & microphone")
247 }
230 onClicked: mediaAccessComponent.createObject(subpageContainer)248 onClicked: mediaAccessComponent.createObject(subpageContainer)
231 }249 }
232250
233 ListItems.Standard {251 ListItem {
234 objectName: "privacy.clearHistory"252 objectName: "privacy.clearHistory"
235 text: i18n.tr("Clear Browsing History")253 ListItemLayout {
254 title.text: i18n.tr("Clear Browsing History")
255 }
236 enabled: HistoryModel.count > 0256 enabled: HistoryModel.count > 0
237 onClicked: {257 onClicked: {
238 var dialog = PopupUtils.open(privacyConfirmDialogComponent, privacyItem, {"title": i18n.tr("Clear Browsing History?")})258 var dialog = PopupUtils.open(privacyConfirmDialogComponent, privacyItem, {"title": i18n.tr("Clear Browsing History?")})
@@ -240,9 +260,11 @@
240 }260 }
241 }261 }
242262
243 ListItems.Standard {263 ListItem {
244 objectName: "privacy.clearCache"264 objectName: "privacy.clearCache"
245 text: i18n.tr("Clear Cache")265 ListItemLayout {
266 title.text: i18n.tr("Clear Cache")
267 }
246 onClicked: {268 onClicked: {
247 var dialog = PopupUtils.open(privacyConfirmDialogComponent, privacyItem, {"title": i18n.tr("Clear Cache?")})269 var dialog = PopupUtils.open(privacyConfirmDialogComponent, privacyItem, {"title": i18n.tr("Clear Cache?")})
248 dialog.confirmed.connect(function() {270 dialog.confirmed.connect(function() {
@@ -383,8 +405,10 @@
383 id: mediaAccessCol405 id: mediaAccessCol
384 width: parent.width406 width: parent.width
385407
386 ListItems.Standard {408 ListItem {
387 text: i18n.tr("Microphone")409 ListItemLayout {
410 title.text: i18n.tr("Microphone")
411 }
388 }412 }
389413
390 SettingsDeviceSelector {414 SettingsDeviceSelector {
@@ -402,8 +426,10 @@
402 }426 }
403 }427 }
404428
405 ListItems.Standard {429 ListItem {
406 text: i18n.tr("Camera")430 ListItemLayout {
431 title.text: i18n.tr("Camera")
432 }
407 }433 }
408434
409 SettingsDeviceSelector {435 SettingsDeviceSelector {
410436
=== modified file 'src/app/webbrowser/TabsList.qml'
--- src/app/webbrowser/TabsList.qml 2015-11-17 14:50:31 +0000
+++ src/app/webbrowser/TabsList.qml 2016-03-01 11:22:46 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright 2014-2015 Canonical Ltd.2 * Copyright 2014-2016 Canonical Ltd.
3 *3 *
4 * This file is part of webbrowser-app.4 * This file is part of webbrowser-app.
5 *5 *
@@ -50,7 +50,7 @@
50 right: parent.right50 right: parent.right
51 }51 }
52 height: invisibleTabChrome.height52 height: invisibleTabChrome.height
53 color: "#fbfbfb"53 color: "#111111"
54 }54 }
5555
56 Flickable {56 Flickable {
5757
=== modified file 'src/app/webbrowser/UrlDelegate.qml'
--- src/app/webbrowser/UrlDelegate.qml 2016-02-01 17:52:43 +0000
+++ src/app/webbrowser/UrlDelegate.qml 2016-03-01 11:22:46 +0000
@@ -17,6 +17,7 @@
17 */17 */
1818
19import QtQuick 2.419import QtQuick 2.4
20import QtQuick.Layouts 1.1
20import Ubuntu.Components 1.321import Ubuntu.Components 1.3
21import ".."22import ".."
2223
@@ -35,7 +36,7 @@
3536
36 signal removed()37 signal removed()
3738
38 Row {39 RowLayout {
39 anchors {40 anchors {
40 verticalCenter: parent.verticalCenter41 verticalCenter: parent.verticalCenter
41 left: parent.left42 left: parent.left
@@ -47,26 +48,18 @@
4748
48 Loader {49 Loader {
49 id: headerComponentLoader50 id: headerComponentLoader
50 sourceComponent: undefined51 anchors.verticalCenter: parent.verticalCenter
52 visible: status == Loader.Ready
51 }53 }
5254
53 UbuntuShape {55 Favicon {
54 id: iconContainer56 id: icon
55 width: units.gu(3)57 anchors.verticalCenter: parent.verticalCenter
56 height: width
57
58 Favicon {
59 id: icon
60 anchors.centerIn: parent
61 }
62 }58 }
6359
64 Column {60 Column {
65 width: parent.width - headerComponentLoader.width - iconContainer.width - parent.spacing - (headerComponentLoader.sourceComponent ? parent.spacing : 0)61 Layout.fillWidth: true
66 anchors {62 anchors.verticalCenter: parent.verticalCenter
67 top: parent.top
68 bottom: parent.bottom
69 }
7063
71 Label {64 Label {
72 id: title65 id: title
7366
=== modified file 'tests/autopilot/webbrowser_app/emulators/browser.py'
--- tests/autopilot/webbrowser_app/emulators/browser.py 2016-02-03 16:22:37 +0000
+++ tests/autopilot/webbrowser_app/emulators/browser.py 2016-03-01 11:22:46 +0000
@@ -508,30 +508,25 @@
508 return self.select_single(BrowserPageHeader)508 return self.select_single(BrowserPageHeader)
509509
510 def get_searchengine_entry(self):510 def get_searchengine_entry(self):
511 return self.select_single("Subtitled", objectName="searchengine")511 return self.select_single(objectName="searchengine")
512512
513 def get_searchengine_page(self):513 def get_searchengine_page(self):
514 return self.wait_select_single("QQuickItem",514 return self.wait_select_single(objectName="searchEnginePage")
515 objectName="searchEnginePage")
516515
517 def get_homepage_entry(self):516 def get_homepage_entry(self):
518 return self.select_single("Subtitled", objectName="homepage")517 return self.select_single(objectName="homepage")
519518
520 def get_restore_session_entry(self):519 def get_restore_session_entry(self):
521 return self.select_single("Standard", objectName="restoreSession")520 return self.select_single(objectName="restoreSession")
522
523 def get_background_tabs_entry(self):
524 return self.select_single("Standard", objectName="backgroundTabs")
525521
526 def get_privacy_entry(self):522 def get_privacy_entry(self):
527 return self.select_single("Standard", objectName="privacy")523 return self.select_single(objectName="privacy")
528524
529 def get_privacy_page(self):525 def get_privacy_page(self):
530 return self.wait_select_single("QQuickItem",526 return self.wait_select_single(objectName="privacySettings")
531 objectName="privacySettings")
532527
533 def get_reset_settings_entry(self):528 def get_reset_settings_entry(self):
534 return self.select_single("Standard", objectName="reset")529 return self.select_single(objectName="reset")
535530
536531
537class DownloadsPage(uitk.UbuntuUIToolkitCustomProxyObjectBase):532class DownloadsPage(uitk.UbuntuUIToolkitCustomProxyObjectBase):
538533
=== modified file 'tests/autopilot/webbrowser_app/tests/test_settings.py'
--- tests/autopilot/webbrowser_app/tests/test_settings.py 2015-09-03 12:58:26 +0000
+++ tests/autopilot/webbrowser_app/tests/test_settings.py 2016-03-01 11:22:46 +0000
@@ -1,6 +1,6 @@
1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-1# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
2#2#
3# Copyright 2015 Canonical3# Copyright 2015-2016 Canonical
4#4#
5# This program is free software: you can redistribute it and/or modify it5# This program is free software: you can redistribute it and/or modify it
6# under the terms of the GNU General Public License version 3, as published6# under the terms of the GNU General Public License version 3, as published
@@ -20,7 +20,6 @@
2020
21from testtools.matchers import Equals, GreaterThan, NotEquals21from testtools.matchers import Equals, GreaterThan, NotEquals
22from autopilot.matchers import Eventually22from autopilot.matchers import Eventually
23from autopilot.platform import model
2423
25import ubuntuuitoolkit as uitk24import ubuntuuitoolkit as uitk
2625
@@ -45,7 +44,7 @@
45 def test_open_close_searchengine_page(self):44 def test_open_close_searchengine_page(self):
46 settings = self.open_settings()45 settings = self.open_settings()
47 searchengine = settings.get_searchengine_entry()46 searchengine = settings.get_searchengine_entry()
48 old_engine = searchengine.subText47 old_engine = searchengine.currentSearchEngineDisplayName
49 self.assertThat(old_engine, NotEquals(""))48 self.assertThat(old_engine, NotEquals(""))
50 self.pointing_device.click_object(searchengine)49 self.pointing_device.click_object(searchengine)
51 searchengine_page = settings.get_searchengine_page()50 searchengine_page = settings.get_searchengine_page()
@@ -53,18 +52,21 @@
53 browser.BrowserPageHeader)52 browser.BrowserPageHeader)
54 searchengine_header.click_back_button()53 searchengine_header.click_back_button()
55 searchengine_page.wait_until_destroyed()54 searchengine_page.wait_until_destroyed()
56 self.assertThat(searchengine.subText, Equals(old_engine))55 self.assertThat(searchengine.currentSearchEngineDisplayName,
56 Equals(old_engine))
5757
58 def test_change_searchengine(self):58 def test_change_searchengine(self):
59 settings = self.open_settings()59 settings = self.open_settings()
60 searchengine = settings.get_searchengine_entry()60 searchengine = settings.get_searchengine_entry()
61 old_engine = searchengine.subText61 old_engine = searchengine.currentSearchEngineDisplayName
62 self.assertThat(old_engine, NotEquals(""))62 self.assertThat(old_engine, NotEquals(""))
63 self.pointing_device.click_object(searchengine)63 self.pointing_device.click_object(searchengine)
64 searchengine_page = settings.get_searchengine_page()64 searchengine_page = settings.get_searchengine_page()
65 self.assertThat(lambda: len(searchengine_page.select_many("Standard")),65 self.assertThat(lambda: len(searchengine_page.select_many(
66 Eventually(GreaterThan(1)))66 objectName="searchEngineDelegate")),
67 delegates = searchengine_page.select_many("Standard")67 Eventually(GreaterThan(1)))
68 delegates = searchengine_page.select_many(
69 objectName="searchEngineDelegate")
68 delegates.sort(key=lambda delegate: delegate.objectName)70 delegates.sort(key=lambda delegate: delegate.objectName)
69 new_index = -171 new_index = -1
70 for (i, delegate) in enumerate(delegates):72 for (i, delegate) in enumerate(delegates):
@@ -72,18 +74,19 @@
72 if (new_index == -1) and not checkbox.checked:74 if (new_index == -1) and not checkbox.checked:
73 new_index = i75 new_index = i
74 self.assertThat(checkbox.checked,76 self.assertThat(checkbox.checked,
75 Equals(delegate.text == old_engine))77 Equals(delegate.displayName == old_engine))
76 new_engine = delegates[new_index].text78 new_engine = delegates[new_index].displayName
77 self.assertThat(new_engine, NotEquals(old_engine))79 self.assertThat(new_engine, NotEquals(old_engine))
78 self.pointing_device.click_object(80 self.pointing_device.click_object(
79 delegates[new_index].select_single(uitk.CheckBox))81 delegates[new_index].select_single(uitk.CheckBox))
80 searchengine_page.wait_until_destroyed()82 searchengine_page.wait_until_destroyed()
81 self.assertThat(searchengine.subText, Eventually(Equals(new_engine)))83 self.assertThat(searchengine.currentSearchEngineDisplayName,
84 Eventually(Equals(new_engine)))
8285
83 def test_change_homepage(self):86 def test_change_homepage(self):
84 settings = self.open_settings()87 settings = self.open_settings()
85 homepage = settings.get_homepage_entry()88 homepage = settings.get_homepage_entry()
86 old = homepage.subText89 old = homepage.currentHomepage
87 self.assertThat(old, NotEquals(""))90 self.assertThat(old, NotEquals(""))
8891
89 # First test cancelling the edition92 # First test cancelling the edition
@@ -97,7 +100,7 @@
97 objectName="homepageDialog.cancelButton")100 objectName="homepageDialog.cancelButton")
98 self.pointing_device.click_object(cancel_button)101 self.pointing_device.click_object(cancel_button)
99 dialog.wait_until_destroyed()102 dialog.wait_until_destroyed()
100 self.assertThat(homepage.subText, Equals(old))103 self.assertThat(homepage.currentHomepage, Equals(old))
101104
102 # Then test actually changing the homepage105 # Then test actually changing the homepage
103 self.pointing_device.click_object(homepage)106 self.pointing_device.click_object(homepage)
@@ -113,7 +116,7 @@
113 objectName="homepageDialog.saveButton")116 objectName="homepageDialog.saveButton")
114 self.pointing_device.click_object(save_button)117 self.pointing_device.click_object(save_button)
115 dialog.wait_until_destroyed()118 dialog.wait_until_destroyed()
116 self.assertThat(homepage.subText, Eventually(Equals(new)))119 self.assertThat(homepage.currentHomepage, Eventually(Equals(new)))
117120
118 def test_open_close_privacy_settings(self):121 def test_open_close_privacy_settings(self):
119 settings = self.open_settings()122 settings = self.open_settings()
@@ -130,7 +133,6 @@
130 self.pointing_device.click_object(privacy)133 self.pointing_device.click_object(privacy)
131 privacy_page = settings.get_privacy_page()134 privacy_page = settings.get_privacy_page()
132 clear_history = privacy_page.select_single(135 clear_history = privacy_page.select_single(
133 "Standard",
134 objectName="privacy.clearHistory")136 objectName="privacy.clearHistory")
135 self.assertThat(clear_history.enabled, Equals(True))137 self.assertThat(clear_history.enabled, Equals(True))
136138
@@ -158,7 +160,6 @@
158 self.pointing_device.click_object(privacy)160 self.pointing_device.click_object(privacy)
159 privacy_page = settings.get_privacy_page()161 privacy_page = settings.get_privacy_page()
160 clear_cache = privacy_page.select_single(162 clear_cache = privacy_page.select_single(
161 "Standard",
162 objectName="privacy.clearCache")163 objectName="privacy.clearCache")
163 self.assertThat(clear_cache.enabled, Equals(True))164 self.assertThat(clear_cache.enabled, Equals(True))
164165
@@ -186,18 +187,13 @@
186 self.pointing_device.click_object(reset)187 self.pointing_device.click_object(reset)
187188
188 searchengine = settings.get_searchengine_entry()189 searchengine = settings.get_searchengine_entry()
189 self.assertThat(searchengine.subText,190 self.assertThat(searchengine.currentSearchEngineDisplayName,
190 Eventually(Equals("Google")))191 Eventually(Equals("Google")))
191192
192 homepage = settings.get_homepage_entry()193 homepage = settings.get_homepage_entry()
193 self.assertThat(homepage.subText,194 self.assertThat(homepage.currentHomepage,
194 Eventually(Equals("http://start.ubuntu.com")))195 Eventually(Equals("http://start.ubuntu.com")))
195196
196 restore_session = settings.get_restore_session_entry()197 restore_session = settings.get_restore_session_entry()
197 checkbox = restore_session.select_single(uitk.CheckBox)198 checkbox = restore_session.select_single(uitk.CheckBox)
198 self.assertThat(checkbox.checked, Eventually(Equals(True)))199 self.assertThat(checkbox.checked, Eventually(Equals(True)))
199
200 background_tabs = settings.get_background_tabs_entry()
201 checkbox = background_tabs.select_single(uitk.CheckBox)
202 self.assertThat(checkbox.checked,
203 Eventually(Equals(model() == 'Desktop')))

Subscribers

People subscribed via source and target branches

to status/vote changes: