Merge lp:~zsombi/ubuntu-ui-toolkit/alarm-sound-fix into lp:ubuntu-ui-toolkit/staging

Proposed by Zsombor Egri on 2014-08-06
Status: Merged
Approved by: Zoltan Balogh on 2014-08-12
Approved revision: 1182
Merged at revision: 1185
Proposed branch: lp:~zsombi/ubuntu-ui-toolkit/alarm-sound-fix
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 116 lines (+38/-4)
5 files modified
modules/Ubuntu/Components/plugin/alarmmanager_p.h (+3/-2)
modules/Ubuntu/Components/plugin/ucalarm.cpp (+7/-0)
modules/Ubuntu/Components/plugin/ucalarm.h (+2/-0)
modules/Ubuntu/Components/plugin/ucalarm_p.h (+2/-2)
tests/unit/tst_alarms/tst_alarms.cpp (+24/-0)
To merge this branch: bzr merge lp:~zsombi/ubuntu-ui-toolkit/alarm-sound-fix
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve on 2014-08-12
Christian Dywan (community) 2014-08-06 Approve on 2014-08-06
Nekhelesh Ramananthan (community) testing Approve on 2014-08-06
Review via email: mp+229800@code.launchpad.net

Commit message

Alarm sounds lost during fetch fix.

To post a comment you must log in.
Nekhelesh Ramananthan (nik90) wrote :

On testing this MP against https://bugs.launchpad.net/+branch/~nik90/ubuntu-clock-app/alarmtest, it works as expected. The alarm sound url is now properly retrieved while editing an alarm.

SideNote: I can now make install this MP on my utopic VM which has EDS as the alarm backend. No more it getting stuck during the make install process :D

review: Approve (testing)
Christian Dywan (kalikiana) wrote :

Looks sensible.

review: Approve
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:1182
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/736/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/3117
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2446
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-ci/568
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/568
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/568/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-ci/568
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/3154
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4361
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4361/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/11103
    SUCCESS: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/2028
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2716
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2716/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/736/rebuild

review: Approve (continuous-integration)
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-autolanding/324/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/3147
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2475
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-autolanding/268
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-autolanding/268
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-autolanding/268/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-autolanding/268
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/3177
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4392
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4392/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/11131
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/2048
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2746
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2746/artifact/work/output/*zip*/output.zip

review: Needs Fixing (continuous-integration)
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-autolanding/327/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/3152
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2480
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-autolanding/271
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-autolanding/271
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-autolanding/271/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-autolanding/271
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/3182
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4397
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4397/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/11137
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/2053
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2751
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2751/artifact/work/output/*zip*/output.zip

review: Needs Fixing (continuous-integration)
Christian Dywan (kalikiana) wrote :

  File "/usr/lib/python3/dist-packages/ubuntuuitoolkit/tests/custom_proxy_objects/test_date_picker.py", line 218, in test_pick_time
    self.time_picker.pick_time(self.time_to_pick)
  File "/usr/lib/python3/dist-packages/ubuntuuitoolkit/_custom_proxy_objects/pickers.py", line 141, in pick_time
    self.hours.wait_for(time.hour)
AssertionError: After 10.0 seconds test on DatePicker.hours failed: 12 != dbus.Int32(13, variant_level=1)

Zsombor Egri (zsombi) wrote :

> File "/usr/lib/python3/dist-
> packages/ubuntuuitoolkit/tests/custom_proxy_objects/test_date_picker.py", line
> 218, in test_pick_time
> self.time_picker.pick_time(self.time_to_pick)
> File "/usr/lib/python3/dist-
> packages/ubuntuuitoolkit/_custom_proxy_objects/pickers.py", line 141, in
> pick_time
> self.hours.wait_for(time.hour)
> AssertionError: After 10.0 seconds test on DatePicker.hours failed: 12 !=
> dbus.Int32(13, variant_level=1)

Looks like the AP tests we have for the DatePicker are not the most stable ones :/

PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:1182
http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/785/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-utopic-touch/3380
    FAILURE: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-utopic/2651/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-amd64-ci/617
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/617
        deb: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-armhf-ci/617/artifact/work/output/*zip*/output.zip
    SUCCESS: http://jenkins.qa.ubuntu.com/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-utopic-i386-ci/617
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-mako/3307
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4627
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-armhf/4627/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/11307
    FAILURE: http://jenkins.qa.ubuntu.com/job/autopilot-testrunner-otto-utopic/2142/console
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2928
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-utopic-amd64/2928/artifact/work/output/*zip*/output.zip

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/ubuntu-sdk-team-ubuntu-ui-toolkit-staging-ci/785/rebuild

review: Needs Fixing (continuous-integration)
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'modules/Ubuntu/Components/plugin/alarmmanager_p.h'
--- modules/Ubuntu/Components/plugin/alarmmanager_p.h 2014-03-11 06:32:29 +0000
+++ modules/Ubuntu/Components/plugin/alarmmanager_p.h 2014-08-06 14:24:24 +0000
@@ -51,13 +51,14 @@
51 , originalDate(other.originalDate)51 , originalDate(other.originalDate)
52 , date(other.date)52 , date(other.date)
53 , message(other.message)53 , message(other.message)
54 , sound(other.sound)
54 , type(other.type)55 , type(other.type)
55 , days(other.days)56 , days(other.days)
56 , enabled(other.enabled)57 , enabled(other.enabled)
57 {58 {
58 }59 }
5960
60 bool compare(const AlarmData &other)61 bool compare(const AlarmData &other) const
61 {62 {
62 // cookie, sound, and enabled do not count on alarm equality63 // cookie, sound, and enabled do not count on alarm equality
63 return date == other.date64 return date == other.date
@@ -66,7 +67,7 @@
66 && days == other.days;67 && days == other.days;
67 }68 }
6869
69 bool operator==(const AlarmData &other)70 bool operator==(const AlarmData &other) const
70 {71 {
71 return compare(other);72 return compare(other);
72 }73 }
7374
=== modified file 'modules/Ubuntu/Components/plugin/ucalarm.cpp'
--- modules/Ubuntu/Components/plugin/ucalarm.cpp 2014-05-15 09:49:25 +0000
+++ modules/Ubuntu/Components/plugin/ucalarm.cpp 2014-08-06 14:24:24 +0000
@@ -343,6 +343,13 @@
343{343{
344}344}
345345
346bool UCAlarm::operator==(const UCAlarm &that) const
347{
348 Q_D(const UCAlarm);
349 AlarmData const dataThat = UCAlarmPrivate::get(&that)->rawData;
350 return d->rawData == dataThat;
351}
352
346/*!353/*!
347 * \qmlproperty bool Alarm::enabled354 * \qmlproperty bool Alarm::enabled
348 * The property specifies whether the alarm is enabled or not. Disable dalarms355 * The property specifies whether the alarm is enabled or not. Disable dalarms
349356
=== modified file 'modules/Ubuntu/Components/plugin/ucalarm.h'
--- modules/Ubuntu/Components/plugin/ucalarm.h 2013-09-18 10:13:04 +0000
+++ modules/Ubuntu/Components/plugin/ucalarm.h 2014-08-06 14:24:24 +0000
@@ -89,6 +89,8 @@
89 UCAlarm(const QDateTime &dt, DaysOfWeek days = AutoDetect, const QString &message = QString(), QObject *parent = 0);89 UCAlarm(const QDateTime &dt, DaysOfWeek days = AutoDetect, const QString &message = QString(), QObject *parent = 0);
90 ~UCAlarm();90 ~UCAlarm();
9191
92 bool operator==(const UCAlarm &that) const;
93
92public: // getter/setter94public: // getter/setter
93 bool enabled() const;95 bool enabled() const;
94 void setEnabled(bool enabled);96 void setEnabled(bool enabled);
9597
=== modified file 'modules/Ubuntu/Components/plugin/ucalarm_p.h'
--- modules/Ubuntu/Components/plugin/ucalarm_p.h 2014-04-10 09:48:30 +0000
+++ modules/Ubuntu/Components/plugin/ucalarm_p.h 2014-08-06 14:24:24 +0000
@@ -31,8 +31,8 @@
31 UCAlarmPrivate(UCAlarm *qq);31 UCAlarmPrivate(UCAlarm *qq);
32 ~UCAlarmPrivate();32 ~UCAlarmPrivate();
3333
34 static UCAlarmPrivate *get(UCAlarm *alarm) {34 static UCAlarmPrivate *get(const UCAlarm *alarm) {
35 return alarm->d_func();35 return const_cast<UCAlarm*>(alarm)->d_func();
36 }36 }
3737
38 void setDefaults();38 void setDefaults();
3939
=== modified file 'tests/unit/tst_alarms/tst_alarms.cpp'
--- tests/unit/tst_alarms/tst_alarms.cpp 2014-07-28 16:47:50 +0000
+++ tests/unit/tst_alarms/tst_alarms.cpp 2014-08-06 14:24:24 +0000
@@ -92,6 +92,18 @@
92 return pAlarm1->rawData.compare(pAlarm2->rawData);92 return pAlarm1->rawData.compare(pAlarm2->rawData);
93 }93 }
9494
95 bool findAlarm(const QString &message, UCAlarm &result)
96 {
97 QList<AlarmData> alarms = AlarmManager::instance().alarms();
98 Q_FOREACH(AlarmData i, alarms) {
99 if (i.message == message) {
100 UCAlarmPrivate::get(&result)->rawData = i;
101 return true;
102 }
103 }
104 return false;
105 }
106
95private Q_SLOTS:107private Q_SLOTS:
96108
97 void initTestCase()109 void initTestCase()
@@ -502,6 +514,18 @@
502 alarm.setDate(QDateTime::currentDateTime().addSecs(3600));514 alarm.setDate(QDateTime::currentDateTime().addSecs(3600));
503 QCOMPARE((int)alarm.daysOfWeek(), dow);515 QCOMPARE((int)alarm.daysOfWeek(), dow);
504 }516 }
517
518 void test_sound_saving() {
519 UCAlarm alarm(QDateTime::currentDateTime().addSecs(60), "test_onetime_sound");
520 alarm.setSound(QUrl("file:///usr/share/sounds/ubuntu/ringtones/Celestial.ogg"));
521 alarm.save();
522 waitForRequest(&alarm);
523
524 UCAlarm saved;
525 QVERIFY(findAlarm("test_onetime_sound", saved));
526 QCOMPARE(alarm, saved);
527 QCOMPARE(alarm.sound().toString(), saved.sound().toString());
528 }
505};529};
506530
507QTEST_MAIN(tst_UCAlarms)531QTEST_MAIN(tst_UCAlarms)

Subscribers

People subscribed via source and target branches