on xenial help sign in
Merge pull request #295 from ubports/xenial_-_demo-drawer

Show the Drawer tutorial for upgrading users

commita45f16d2725458d692fc829c86f6977609df7b74 authorMarius Gripsgard <marius@ubports.com> dateMon 13 Apr 2020, 21:08 (7 years ago) parent2a12bafad9f0bd
7 files changed+24−18
plugins/AccountsService/AccountsService.cpp+1−1 plugins/AccountsService/com.canonical.unity.AccountsService.xml+6 qml/Tutorial/TutorialContent.qml+2−2 tests/autopilot/unity8/shell/fixture_setup.py+1−1 tests/plugins/AccountsService/PropertiesServer.cpp+1−1 tests/plugins/AccountsService/client.cpp+6−6 tests/qmltests/Tutorial/tst_Tutorial.qml+7−7
plugins/AccountsService/AccountsService.cpp+1−1
@@ -32,7 +32,7 @@
3232#define IFACE_UNITY_PRIVATE QStringLiteral("com.canonical.unity.AccountsService.Private")
3333
3434#define PROP_BACKGROUND_FILE QStringLiteral("BackgroundFile")
35−#define PROP_DEMO_EDGES QStringLiteral("demo-edges")
35+#define PROP_DEMO_EDGES QStringLiteral("DemoEdges2")
3636#define PROP_DEMO_EDGES_COMPLETED QStringLiteral("DemoEdgesCompleted")
3737#define PROP_EMAIL QStringLiteral("Email")
3838#define PROP_ENABLE_FINGERPRINT_IDENTIFICATION QStringLiteral("EnableFingerprintIdentification")
plugins/AccountsService/com.canonical.unity.AccountsService.xml+6
@@ -9,11 +9,17 @@
99 <annotation name="org.freedesktop.Accounts.Authentication.ChangeAny"
1010 value="com.ubuntu.AccountsService.GreeterChangeAny"/>
1111
12+ <!-- Marks that V1 (pre-8.21) edge demos have been run. Legacy value. -->
1213 <!-- Should have been named DemoEdges, sorry folks. -mterry -->
1314 <property name="demo-edges" type="b" access="readwrite">
1415 <annotation name="org.freedesktop.Accounts.DefaultValue" value="true"/>
1516 </property>
1617
18+ <!-- Marks that V2 (post-8.21) edge demos have been run -->
19+ <property name="DemoEdges2" type="b" access="readwrite">
20+ <annotation name="org.freedesktop.Accounts.DefaultValue" value="true"/>
21+ </property>
22+
1723 <!-- List of tutorial pages that have been completed by the user -->
1824 <property name="DemoEdgesCompleted" type="as" access="readwrite">
1925 <annotation name="org.freedesktop.Accounts.DefaultValue" value="[]"/>
qml/Tutorial/TutorialContent.qml+2−2
@@ -149,7 +149,7 @@ Item {
149149 objectName: "tutorialLeftLongLoader"
150150 anchors.fill: parent
151151
152− readonly property bool skipped: !d.mobileScenario || d.haveShown("left-long")
152+ readonly property bool skipped: !d.mobileScenario || d.haveShown("left-drawer")
153153 readonly property bool shown: item && item.shown
154154 active: !skipped || (item && item.visible)
155155 onSkippedChanged: if (skipped && shown) item.hide()
@@ -178,7 +178,7 @@ Item {
178178 }
179179
180180 onIsReadyChanged: if (isReady && !shown) tutorialLeftLongTimer.start()
181− onFinished: AccountsService.markDemoEdgeCompleted("left-long")
181+ onFinished: AccountsService.markDemoEdgeCompleted("left-drawer")
182182 }
183183 }
184184
tests/autopilot/unity8/shell/fixture_setup.py+1−1
@@ -48,7 +48,7 @@ class Tutorial(fixtures.Fixture):
4848 '/org/freedesktop/Accounts/User32011',
4949 'org.freedesktop.DBus.Properties.Get',
5050 'string:com.canonical.unity.AccountsService',
51− 'string:demo-edges'
51+ 'string:DemoEdges2'
5252 ]
5353 output = subprocess.check_output(command, universal_newlines=True)
5454 return True if output.count('true') else False
tests/plugins/AccountsService/PropertiesServer.cpp+1−1
@@ -124,7 +124,7 @@ void PropertiesServer::internalSet(const QString &interface, const QString &prop
124124
125125void PropertiesServer::Reset()
126126{
127− m_properties["com.canonical.unity.AccountsService"]["demo-edges"] = false;
127+ m_properties["com.canonical.unity.AccountsService"]["DemoEdges2"] = false;
128128 m_properties["com.canonical.unity.AccountsService"]["DemoEdgesCompleted"] = QStringList();
129129 m_properties["com.canonical.unity.AccountsService"]["LauncherItems"] = QVariant::fromValue(QList<QVariantMap>());
130130 m_properties["com.canonical.unity.AccountsService.Private"]["FailedLogins"] = 0;
tests/plugins/AccountsService/client.cpp+6−6
@@ -92,17 +92,17 @@ private Q_SLOTS:
9292 {
9393 // Test various invalid calls
9494 AccountsServiceDBusAdaptor session;
95− QCOMPARE(session.getUserPropertyAsync("NOPE", "com.canonical.unity.AccountsService", "demo-edges").value(), QVariant());
95+ QCOMPARE(session.getUserPropertyAsync("NOPE", "com.canonical.unity.AccountsService", "DemoEdges2").value(), QVariant());
9696 QCOMPARE(session.getUserPropertyAsync(QTest::currentTestFunction(), "com.canonical.unity.AccountsService", "NOPE").value(), QVariant());
9797 }
9898
9999 void testGetSetServiceDBusAdaptor()
100100 {
101101 AccountsServiceDBusAdaptor session;
102− session.setUserPropertyAsync(QTest::currentTestFunction(), "com.canonical.unity.AccountsService", "demo-edges", QVariant(true)).waitForFinished();
103− QCOMPARE(session.getUserPropertyAsync(QTest::currentTestFunction(), "com.canonical.unity.AccountsService", "demo-edges").value(), QVariant(true));
104− session.setUserPropertyAsync(QTest::currentTestFunction(), "com.canonical.unity.AccountsService", "demo-edges", QVariant(false)).waitForFinished();
105− QCOMPARE(session.getUserPropertyAsync(QTest::currentTestFunction(), "com.canonical.unity.AccountsService", "demo-edges").value(), QVariant(false));
102+ session.setUserPropertyAsync(QTest::currentTestFunction(), "com.canonical.unity.AccountsService", "DemoEdges2", QVariant(true)).waitForFinished();
103+ QCOMPARE(session.getUserPropertyAsync(QTest::currentTestFunction(), "com.canonical.unity.AccountsService", "DemoEdges2").value(), QVariant(true));
104+ session.setUserPropertyAsync(QTest::currentTestFunction(), "com.canonical.unity.AccountsService", "DemoEdges2", QVariant(false)).waitForFinished();
105+ QCOMPARE(session.getUserPropertyAsync(QTest::currentTestFunction(), "com.canonical.unity.AccountsService", "DemoEdges2").value(), QVariant(false));
106106 }
107107
108108 void testGetSetService()
@@ -162,7 +162,7 @@ private Q_SLOTS:
162162 QCOMPARE(session.demoEdges(), false);
163163 ASSERT_DBUS_CALL(m_userInterface->call("Set",
164164 "com.canonical.unity.AccountsService",
165− "demo-edges",
165+ "DemoEdges2",
166166 dbusVariant(true)));
167167 QTRY_COMPARE(session.demoEdges(), true);
168168 }
tests/qmltests/Tutorial/tst_Tutorial.qml+7−7
@@ -361,7 +361,7 @@ Rectangle {
361361 var tutorialRight = findChild(shell, "tutorialRight");
362362 var tutorialRightTimer = findChild(tutorialRight, "tutorialRightTimer");
363363
364− AccountsService.demoEdgesCompleted = ["top", "left", "left-long"];
364+ AccountsService.demoEdgesCompleted = ["top", "left", "left-drawer"];
365365 ApplicationManager.startApplication("facebook-webapp");
366366
367367 tryCompare(tutorialLeftLongLoader, "active", false);
@@ -457,7 +457,7 @@ Rectangle {
457457 touchFlick(shell, 0, halfHeight, shell.width, halfHeight);
458458
459459 tryCompare(tutorialLeftLongLoader, "shown", false);
460− tryCompare(AccountsService, "demoEdgesCompleted", ["top", "left", "left-long"]);
460+ tryCompare(AccountsService, "demoEdgesCompleted", ["top", "left", "left-drawer"]);
461461 }
462462
463463 function test_tutorialLeftAutoSkipped() {
@@ -573,7 +573,7 @@ Rectangle {
573573 openTutorialRight();
574574 touchFlick(shell, shell.width, halfHeight, 0, halfHeight);
575575
576− tryCompare(AccountsService, "demoEdgesCompleted", ["top", "left", "left-long", "right"]);
576+ tryCompare(AccountsService, "demoEdgesCompleted", ["top", "left", "left-drawer", "right"]);
577577 tryCompare(AccountsService, "demoEdges", false);
578578 }
579579
@@ -603,7 +603,7 @@ Rectangle {
603603 ApplicationManager.startApplication("gallery-app");
604604 tryCompare(ApplicationManager, "count", 1);
605605
606− AccountsService.demoEdgesCompleted = ["top", "left", "left-long"];
606+ AccountsService.demoEdgesCompleted = ["top", "left", "left-drawer"];
607607 verify(tutorialRightTimer.running);
608608 verify(!tutorialRightLoader.shown);
609609 tutorialRightTimer.interval = 1;
@@ -622,7 +622,7 @@ Rectangle {
622622 ApplicationManager.startApplication("facebook-webapp");
623623 tryCompare(ApplicationManager, "count", 1);
624624
625− AccountsService.demoEdgesCompleted = ["top", "left", "left-long"];
625+ AccountsService.demoEdgesCompleted = ["top", "left", "left-drawer"];
626626 tryCompare(tutorialLeftLongLoader, "skipped", true);
627627 verify(tutorialRightTimer.running);
628628 tryCompare(tutorialRight, "isReady", true);
@@ -631,7 +631,7 @@ Rectangle {
631631 wait(1000);
632632
633633 touchFlick(shell, shell.width, halfHeight, 0, halfHeight);
634− tryCompare(AccountsService, "demoEdgesCompleted", ["top", "left", "left-long", "right"]);
634+ tryCompare(AccountsService, "demoEdgesCompleted", ["top", "left", "left-drawer", "right"]);
635635 }
636636
637637 function test_activeCallInterruptsTutorial() {
@@ -683,7 +683,7 @@ Rectangle {
683683 verify(!tutorialRight.isReady);
684684 verify(!tutorialRight.shown);
685685 verify(!tutorialRight.paused);
686− compare(AccountsService.demoEdgesCompleted, ["top", "left", "left-long"]);
686+ compare(AccountsService.demoEdgesCompleted, ["top", "left", "left-drawer"]);
687687 }
688688
689689 function test_desktopOnlyShowsTutorialRight() {