Merge lp:~mterry/unity8/fix-emulator-tutorial into lp:unity8

Proposed by Michael Terry on 2015-08-20
Status: Merged
Approved by: Albert Astals Cid on 2015-08-21
Approved revision: 1929
Merged at revision: 1928
Proposed branch: lp:~mterry/unity8/fix-emulator-tutorial
Merge into: lp:unity8
Diff against target: 112 lines (+16/-29)
4 files modified
qml/Shell.qml (+7/-8)
qml/Tutorial/Tutorial.qml (+0/-7)
qml/Tutorial/TutorialContent.qml (+2/-9)
tests/qmltests/Tutorial/tst_Tutorial.qml (+7/-5)
To merge this branch: bzr merge lp:~mterry/unity8/fix-emulator-tutorial
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) 2015-08-20 Approve on 2015-08-21
PS Jenkins bot continuous-integration Needs Fixing on 2015-08-20
Review via email: mp+268607@code.launchpad.net

Commit Message

Skip the tutorial entirely when in desktop mode. This fixes the emulator not being able to pass the tutorial.

Previously, only part of the tutorial was reliant on DDAs, but now even the launcher needs it. Since the emulator has a separate bug preventing drags from working and comes up as desktop mode, this will skip the tutorial on the emulator.

When the emulator fixes its drags and can be shown in phone mode again, presumably the tutorial will work correctly again in that case.

Description of the Change

Skip the tutorial entirely when in desktop mode. This fixes the emulator not being able to pass the tutorial.

Previously, only part of the tutorial was reliant on DDAs, but now even the launcher needs it. Since the emulator has a separate bug preventing drags from working and comes up as desktop mode, this will skip the tutorial on the emulator.

When the emulator fixes its drags and can be shown in phone mode again, presumably the tutorial will work correctly again in that case.

To post a comment you must log in.
1929. By Michael Terry on 2015-08-20

Fix test

Albert Astals Cid (aacid) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Yes

 * Did CI run pass?
it's on holiday

 * Did you make sure that the branch does not contain spurious tags?
Yes

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Shell.qml'
2--- qml/Shell.qml 2015-08-03 13:47:44 +0000
3+++ qml/Shell.qml 2015-08-20 15:38:59 +0000
4@@ -367,20 +367,19 @@
5 id: tutorial
6 objectName: "tutorial"
7 anchors.fill: parent
8- active: AccountsService.demoEdges
9- paused: LightDM.Greeter.active
10- launcher: launcher
11- panel: panel
12- edgeSize: shell.edgeSize
13
14 // EdgeDragAreas don't work with mice. So to avoid trapping the user,
15- // we'll tell the tutorial to avoid using them on the Desktop. The
16+ // we skip the tutorial on the Desktop to avoid using them. The
17 // Desktop doesn't use the same spread design anyway. The tutorial is
18 // all a bit of a placeholder on non-phone form factors right now.
19 // When the design team gives us more guidance, we can do something
20 // more clever here.
21- // TODO: use DeviceConfiguration instead of checking source
22- useEdgeDragArea: applicationsDisplayLoader.source != Qt.resolvedUrl("Stages/DesktopStage.qml")
23+ active: usageScenario != "desktop" && AccountsService.demoEdges
24+
25+ paused: LightDM.Greeter.active
26+ launcher: launcher
27+ panel: panel
28+ edgeSize: shell.edgeSize
29
30 onFinished: {
31 AccountsService.demoEdges = false;
32
33=== modified file 'qml/Tutorial/Tutorial.qml'
34--- qml/Tutorial/Tutorial.qml 2015-04-03 14:23:02 +0000
35+++ qml/Tutorial/Tutorial.qml 2015-08-20 15:38:59 +0000
36@@ -23,7 +23,6 @@
37 property alias active: loader.active
38 property bool paused
39 property real edgeSize
40- property bool useEdgeDragArea
41
42 property Item launcher
43 property Item panel
44@@ -61,12 +60,6 @@
45
46 Binding {
47 target: loader.item
48- property: "useEdgeDragArea"
49- value: root.useEdgeDragArea
50- }
51-
52- Binding {
53- target: loader.item
54 property: "launcher"
55 value: root.launcher
56 }
57
58=== modified file 'qml/Tutorial/TutorialContent.qml'
59--- qml/Tutorial/TutorialContent.qml 2015-04-03 14:23:02 +0000
60+++ qml/Tutorial/TutorialContent.qml 2015-08-20 15:38:59 +0000
61@@ -32,7 +32,6 @@
62
63 property bool paused: false
64 property real edgeSize
65- property bool useEdgeDragArea
66
67 signal finished()
68
69@@ -78,17 +77,11 @@
70 anchors.fill: parent
71 textXOffset: root.launcher.panelWidth
72 paused: !shown || root.paused
73- text: root.useEdgeDragArea ? i18n.tr("Tap here to continue.") : i18n.tr("Click here to finish.")
74+ text: i18n.tr("Tap here to continue.")
75
76 onFinished: {
77 root.launcher.hide();
78- if (root.useEdgeDragArea) {
79- tutorialRight.show();
80- } else {
81- // Last two screens use EdgeDragArea (right edge spread and
82- // bottom edge). So just end tutorial here.
83- root.finish();
84- }
85+ tutorialRight.show();
86 }
87 }
88
89
90=== modified file 'tests/qmltests/Tutorial/tst_Tutorial.qml'
91--- tests/qmltests/Tutorial/tst_Tutorial.qml 2015-08-03 13:47:44 +0000
92+++ tests/qmltests/Tutorial/tst_Tutorial.qml 2015-08-20 15:38:59 +0000
93@@ -263,12 +263,14 @@
94 goToPage(null);
95 }
96
97- function test_walkthroughOnDesktop() {
98+ function test_skipOnDesktop() {
99+ var tutorial = findChild(shell, "tutorial");
100+ tryCompare(tutorial, "active", true);
101+ tryCompare(tutorial, "running", true);
102+
103 shell.usageScenario = "desktop";
104- var page = goToPage("tutorialLeftFinish");
105- var tick = findChild(page, "tick");
106- tap(tick);
107- checkFinished();
108+ tryCompare(tutorial, "active", false);
109+ tryCompare(tutorial, "running", false);
110 }
111
112 function test_launcherShortDrag() {

Subscribers

People subscribed via source and target branches