@@ -74,210 +74,210 @@ Item {
74 swipeUntilScopeViewIsReached(dashHome);
74 swipeUntilScopeViewIsReached(dashHome);
78−// Test the effect of a right-edge drag on the dash in 3 situations:
78+ Test the effect of a right-edge drag on the dash in 3 situations:
79−// 1 - when no application has been launched yet
79+ 1 - when no application has been launched yet
80−// 2 - when there's a minimized application
80+ 2 - when there's a minimized application
81−// 3 - after the last running application has been closed/stopped
81+ 3 - after the last running application has been closed/stopped
83−// The behavior of Dash on 3 should be the same as on 1.
83+ The behavior of Dash on 3 should be the same as on 1.
85−// function test_rightEdgeDrag() {
85+ function test_rightEdgeDrag() {
86−// checkRightEdgeDragWithNoRunningApps();
86+ checkRightEdgeDragWithNoRunningApps();
88−// dragLauncherIntoView();
88+ dragLauncherIntoView();
90−// // Launch an app from the launcher
91−// tapOnAppIconInLauncher();
92−// waitUntilApplicationWindowIsFullyVisible();
90+ // Launch an app from the launcher
91+ tapOnAppIconInLauncher();
92+ waitUntilApplicationWindowIsFullyVisible();
94−// // Minimize the application we just launched
94+ // Minimize the application we just launched
95−// swipeFromLeftEdge();
95+ swipeFromLeftEdge();
97−// waitForUIToSettle();
97+ waitForUIToSettle();
99−// checkRightEdgeDragWithMinimizedApp();
99+ checkRightEdgeDragWithMinimizedApp();
101−// // Minimize that application once again
101+ // Minimize that application once again
102−// swipeFromLeftEdge();
102+ swipeFromLeftEdge();
104−// // kill it
104+ // kill it
105−// ApplicationManager.mainStageApplications.clear();
105+ ApplicationManager.mainStageApplications.clear();
107−// waitForUIToSettle();
107+ waitForUIToSettle();
109−// // Right edge behavior should now be the same as before that app was launched
109+ // Right edge behavior should now be the same as before that app was launched
110−// checkRightEdgeDragWithNoRunningApps();
110+ checkRightEdgeDragWithNoRunningApps();
114−// Perform a right-edge drag when the Dash is being show and there are
114+ Perform a right-edge drag when the Dash is being show and there are
115−// no running/minimized apps to be restored.
115+ no running/minimized apps to be restored.
117−// The expected behavior is that an animation should be played to hint the
117+ The expected behavior is that an animation should be played to hint the
118−// user that his right-edge drag gesture has been successfully recognized
118+ user that his right-edge drag gesture has been successfully recognized
119−// but there is no application to be brought to foreground.
119+ but there is no application to be brought to foreground.
121−// function checkRightEdgeDragWithNoRunningApps() {
121+ function checkRightEdgeDragWithNoRunningApps() {
122−// var touchX = shell.width - (shell.edgeSize / 2);
122+ var touchX = shell.width - (shell.edgeSize / 2);
123−// var touchY = shell.height / 2;
123+ var touchY = shell.height / 2;
125−// var dash = findChild(shell, "dash");
125+ var dash = findChild(shell, "dash");
126−// // check that dash has normal scale and opacity
126+ // check that dash has normal scale and opacity
127−// compare(dash.contentScale, 1.0);
127+ compare(dash.contentScale, 1.0);
128−// compare(dash.opacity, 1.0);
128+ compare(dash.opacity, 1.0);
130−// touchFlick(shell, touchX, touchY, shell.width * 0.1, touchY,
130+ touchFlick(shell, touchX, touchY, shell.width * 0.1, touchY,
131−// true /* beginTouch */, false /* endTouch */);
131+ true /* beginTouch */, false /* endTouch */);
133−// // check that Dash has been scaled down and had its opacity reduced
133+ // check that Dash has been scaled down and had its opacity reduced
134−// tryCompareFunction(function() { return dash.contentScale <= 0.9; }, true);
134+ tryCompareFunction(function() { return dash.contentScale <= 0.9; }, true);
135−// tryCompareFunction(function() { return dash.opacity <= 0.5; }, true);
135+ tryCompareFunction(function() { return dash.opacity <= 0.5; }, true);
137−// touchRelease(shell, shell.width * 0.1, touchY);
137+ touchRelease(shell, shell.width * 0.1, touchY);
139−// // and now everything should have gone back to normal
139+ // and now everything should have gone back to normal
140−// tryCompare(dash, "contentScale", 1.0);
140+ tryCompare(dash, "contentScale", 1.0);
141−// tryCompare(dash, "opacity", 1.0);
141+ tryCompare(dash, "opacity", 1.0);
145−// Perform a right-edge drag when the Dash is being show and there is
145+ Perform a right-edge drag when the Dash is being show and there is
146−// a running/minimized app to be restored.
146+ a running/minimized app to be restored.
148−// The expected behavior is that the dash should fade away and ultimately be
148+ The expected behavior is that the dash should fade away and ultimately be
149−// made invisible once the gesture is finished as the restored app will now
149+ made invisible once the gesture is finished as the restored app will now
150−// be on foreground.
150+ be on foreground.
152−// function checkRightEdgeDragWithMinimizedApp() {
152+ function checkRightEdgeDragWithMinimizedApp() {
153−// var touchX = shell.width - (shell.edgeSize / 2);
153+ var touchX = shell.width - (shell.edgeSize / 2);
154−// var touchY = shell.height / 2;
154+ var touchY = shell.height / 2;
156−// var dash = findChild(shell, "dash");
156+ var dash = findChild(shell, "dash");
157−// // check that dash has normal scale and opacity
157+ // check that dash has normal scale and opacity
158−// tryCompare(dash, "contentScale", 1.0);
158+ tryCompare(dash, "contentScale", 1.0);
159−// tryCompare(dash, "opacity", 1.0);
159+ tryCompare(dash, "opacity", 1.0);
161−// touchFlick(shell, touchX, touchY, shell.width * 0.1, touchY,
161+ touchFlick(shell, touchX, touchY, shell.width * 0.1, touchY,
162−// true /* beginTouch */, false /* endTouch */);
162+ true /* beginTouch */, false /* endTouch */);
164−// // check that Dash has been scaled down and had its opacity reduced
164+ // check that Dash has been scaled down and had its opacity reduced
165−// tryCompareFunction(function() { return dash.contentScale <= 0.9; }, true);
165+ tryCompareFunction(function() { return dash.contentScale <= 0.9; }, true);
166−// tryCompareFunction(function() { return dash.opacity <= 0.5; }, true);
166+ tryCompareFunction(function() { return dash.opacity <= 0.5; }, true);
168−// touchRelease(shell, shell.width * 0.1, touchY);
168+ touchRelease(shell, shell.width * 0.1, touchY);
170−// // dash should have gone away, now that the app is on foreground
170+ // dash should have gone away, now that the app is on foreground
171−// tryCompare(dash, "visible", false);
171+ tryCompare(dash, "visible", false);
174−// // Wait for the whole UI to settle down
174+ // Wait for the whole UI to settle down
175−// function waitForUIToSettle() {
175+ function waitForUIToSettle() {
176−// waitUntilApplicationWindowIsFullyHidden();
176+ waitUntilApplicationWindowIsFullyHidden();
177−// var dashContentList = findChild(shell, "dashContentList");
177+ var dashContentList = findChild(shell, "dashContentList");
178−// tryCompare(dashContentList, "moving", false);
178+ tryCompare(dashContentList, "moving", false);
181−// function dragLauncherIntoView() {
181+ function dragLauncherIntoView() {
182−// var launcherPanel = findChild(shell, "launcherPanel");
182+ var launcherPanel = findChild(shell, "launcherPanel");
183−// verify(launcherPanel.x = - launcherPanel.width);
183+ verify(launcherPanel.x = - launcherPanel.width);
184−// swipeFromLeftEdge();
184+ swipeFromLeftEdge();
185−// tryCompare(launcherPanel, "x", 0);
185+ tryCompare(launcherPanel, "x", 0);
188−// function tapOnAppIconInLauncher() {
188+ function tapOnAppIconInLauncher() {
189−// var launcherPanel = findChild(shell, "launcherPanel");
189+ var launcherPanel = findChild(shell, "launcherPanel");
191−// // pick the first icon, the one at the bottom.
191+ // pick the first icon, the one at the bottom.
192−// var appIcon = findChild(launcherPanel, "launcherDelegate0")
192+ var appIcon = findChild(launcherPanel, "launcherDelegate0")
194−// // Swipe upwards over the launcher to ensure that this icon
194+ // Swipe upwards over the launcher to ensure that this icon
195−// // at the bottom is not folded and faded away.
195+ // at the bottom is not folded and faded away.
196−// var touchStartX = launcherPanel.width / 2;
196+ var touchStartX = launcherPanel.width / 2;
197−// var touchStartY = launcherPanel.height / 2;
197+ var touchStartY = launcherPanel.height / 2;
198−// touchFlick(launcherPanel, touchStartX, touchStartY, touchStartX, 0);
198+ touchFlick(launcherPanel, touchStartX, touchStartY, touchStartX, 0);
199−// tryCompare(launcherPanel, "moving", false);
199+ tryCompare(launcherPanel, "moving", false);
201−// // NB tapping (i.e., using touch events) doesn't activate the icon... go figure...
201+ // NB tapping (i.e., using touch events) doesn't activate the icon... go figure...
202−// mouseClick(appIcon, appIcon.width / 2, appIcon.height / 2);
202+ mouseClick(appIcon, appIcon.width / 2, appIcon.height / 2);
205−// function waitUntilApplicationWindowIsFullyVisible() {
205+ function waitUntilApplicationWindowIsFullyVisible() {
206−// var underlay = findChild(shell, "underlay");
206+ var underlay = findChild(shell, "underlay");
207−// tryCompare(underlay, "visible", false);
207+ tryCompare(underlay, "visible", false);
210−// function waitUntilApplicationWindowIsFullyHidden() {
210+ function waitUntilApplicationWindowIsFullyHidden() {
211−// var stages = findChild(shell, "stages");
211+ var stages = findChild(shell, "stages");
212−// tryCompare(stages, "fullyHidden", true);
212+ tryCompare(stages, "fullyHidden", true);
215−// function swipeUntilScopeViewIsReached(scopeView) {
215+ function swipeUntilScopeViewIsReached(scopeView) {
216−// while (!itemIsOnScreen(scopeView)) {
216+ while (!itemIsOnScreen(scopeView)) {
217−// if (itemIsToLeftOfScreen(scopeView)) {
217+ if (itemIsToLeftOfScreen(scopeView)) {
218−// swipeRightFromCenter();
218+ swipeRightFromCenter();
219−// } else {
219+ } else {
220−// swipeLeftFromCenter();
220+ swipeLeftFromCenter();
222−// waitUntilItemStopsMoving(scopeView);
222+ waitUntilItemStopsMoving(scopeView);
226−// function swipeFromLeftEdge() {
226+ function swipeFromLeftEdge() {
227−// var touchStartX = 2;
227+ var touchStartX = 2;
228−// var touchStartY = shell.height / 2;
228+ var touchStartY = shell.height / 2;
229−// touchFlick(shell, touchStartX, touchStartY, shell.width * 0.75, touchStartY);
229+ touchFlick(shell, touchStartX, touchStartY, shell.width * 0.75, touchStartY);
232−// function swipeLeftFromCenter() {
232+ function swipeLeftFromCenter() {
233−// var touchStartX = shell.width / 2;
233+ var touchStartX = shell.width / 2;
234−// var touchStartY = shell.height / 2;
234+ var touchStartY = shell.height / 2;
235−// touchFlick(shell, touchStartX, touchStartY, 0, touchStartY);
235+ touchFlick(shell, touchStartX, touchStartY, 0, touchStartY);
238−// function swipeRightFromCenter() {
238+ function swipeRightFromCenter() {
239−// var touchStartX = shell.width / 2;
239+ var touchStartX = shell.width / 2;
240−// var touchStartY = shell.height / 2;
240+ var touchStartY = shell.height / 2;
241−// touchFlick(shell, touchStartX, touchStartY, shell.width, touchStartY);
241+ touchFlick(shell, touchStartX, touchStartY, shell.width, touchStartY);
244−// function swipeUpFromCenter() {
244+ function swipeUpFromCenter() {
245−// var touchStartX = shell.width / 2;
245+ var touchStartX = shell.width / 2;
246−// var touchStartY = shell.height / 2;
246+ var touchStartY = shell.height / 2;
247−// touchFlick(shell, touchStartX, touchStartY, touchStartX, 0);
247+ touchFlick(shell, touchStartX, touchStartY, touchStartX, 0);
250−// function itemIsOnScreen(item) {
250+ function itemIsOnScreen(item) {
251−// var itemRectInShell = item.mapToItem(shell, 0, 0, item.width, item.height);
251+ var itemRectInShell = item.mapToItem(shell, 0, 0, item.width, item.height);
253−// return itemRectInShell.x >= 0
253+ return itemRectInShell.x >= 0
254−// && itemRectInShell.y >= 0
254+ && itemRectInShell.y >= 0
255−// && itemRectInShell.x + itemRectInShell.width <= shell.width
255+ && itemRectInShell.x + itemRectInShell.width <= shell.width
256−// && itemRectInShell.y + itemRectInShell.height <= shell.height;
256+ && itemRectInShell.y + itemRectInShell.height <= shell.height;
259−// function itemIsToLeftOfScreen(item) {
259+ function itemIsToLeftOfScreen(item) {
260−// var itemRectInShell = item.mapToItem(shell, 0, 0, item.width, item.height);
260+ var itemRectInShell = item.mapToItem(shell, 0, 0, item.width, item.height);
261−// return itemRectInShell.x < 0;
261+ return itemRectInShell.x < 0;
264−// function waitUntilItemStopsMoving(item) {
264+ function waitUntilItemStopsMoving(item) {
265−// var itemRectInShell = item.mapToItem(shell, 0, 0, item.width, item.height);
265+ var itemRectInShell = item.mapToItem(shell, 0, 0, item.width, item.height);
266−// var previousX = itemRectInShell.x;
266+ var previousX = itemRectInShell.x;
267−// var previousY = itemRectInShell.y;
267+ var previousY = itemRectInShell.y;
268−// var isStill = false;
268+ var isStill = false;
271−// wait(100);
271+ wait(100);
272−// itemRectInShell = item.mapToItem(shell, 0, 0, item.width, item.height);
272+ itemRectInShell = item.mapToItem(shell, 0, 0, item.width, item.height);
273−// if (itemRectInShell.x == previousX && itemRectInShell.y == previousY) {
273+ if (itemRectInShell.x == previousX && itemRectInShell.y == previousY) {
274−// isStill = true;
274+ isStill = true;
275−// } else {
275+ } else {
276−// previousX = itemRectInShell.x;
276+ previousX = itemRectInShell.x;
277−// previousY = itemRectInShell.y;
277+ previousY = itemRectInShell.y;
279−// } while (!isStill);
279+ } while (!isStill);
282 function test_wallpaper_data() {
282 function test_wallpaper_data() {
@@ -289,7 +289,6 @@ Item {
289 function test_wallpaper(data) {
289 function test_wallpaper(data) {
290 var backgroundImage = findChild(shell, "backgroundImage")
290 var backgroundImage = findChild(shell, "backgroundImage")
291 GSettingsController.setPictureUri(data.url)
291 GSettingsController.setPictureUri(data.url)
293 tryCompareFunction(function() { return backgroundImage.source.toString().indexOf(data.url) !== -1; }, true)
292 tryCompareFunction(function() { return backgroundImage.source.toString().indexOf(data.url) !== -1; }, true)
294 tryCompare(backgroundImage, "status", Image.Ready)
293 tryCompare(backgroundImage, "status", Image.Ready)
@@ -297,9 +296,9 @@ Item {
297 function test_wallpaper_wrong() {
296 function test_wallpaper_wrong() {
298 var backgroundImage = findChild(shell, "backgroundImage")
297 var backgroundImage = findChild(shell, "backgroundImage")
299 GSettingsController.setPictureUri("wrong")
298 GSettingsController.setPictureUri("wrong")
300− wait(2000)
299+ tryCompare(backgroundImage, "status", Image.Error)
301− //tryCompareFunction(function() { return oldGSettingsBackground == backgroundSettings.pictureUri; }, true)
302−// tryCompareFunction(function() { return backgroundImage.source.toString().indexOf(data.url) !== -1; }, true)
300+ tryCompareFunction(function() { return backgroundImage.source.toString().indexOf(shell.defaultBackground) !== -1; }, true)
301+ tryCompare(backgroundImage, "status", Image.Ready)