aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-09-19 14:34:11 +0000
committerCI bot <ps-jenkins@lists.canonical.com>2014-09-19 14:34:11 +0000
commita72a776c15a48341b9b06bbdd113d4112acd3e20 (patch)
tree86ecb9508b3e3f32b5e5c727b2bcbf8a3840d243 /tests
parent790f43bcea23f926f6617e0fe41026a3adaee8cc (diff)
parent8da361db324d454ee9910ea3e169f428d32a925a (diff)
downloadayatana-indicator-datetime-a72a776c15a48341b9b06bbdd113d4112acd3e20.tar.gz
ayatana-indicator-datetime-a72a776c15a48341b9b06bbdd113d4112acd3e20.tar.bz2
ayatana-indicator-datetime-a72a776c15a48341b9b06bbdd113d4112acd3e20.zip
Adjust our floating alarms when the local timezone changes.
Fixes: 1332095 Approved by: Ted Gould, PS Jenkins bot
Diffstat (limited to 'tests')
-rw-r--r--tests/manual9
-rw-r--r--tests/test-clock.cpp31
2 files changed, 25 insertions, 15 deletions
diff --git a/tests/manual b/tests/manual
index 2b16841..87ad674 100644
--- a/tests/manual
+++ b/tests/manual
@@ -40,6 +40,15 @@ Test-case indicator-datetime/new-alarm-wakeup
<dd>If the device supports haptic feedback, confirm the alarm vibrates.</dd>
</dl>
+Test-case indicator-datetime/alarm-timezone
+<dl>
+ <dt>In ubuntu-system-settings, change your timezone to a zone you're not in</dt>
+ <dt>In ubuntu-clock-app, create and save an upcoming alarm</dt>
+ <dd>The indicator's menu should show the alarm to click at the specified time</dd>
+ <dt>In ubuntu-system-settings, change back to your correct timezone</dt>
+ <dd>The indicator's menu should still show the alarm to click at the specified time</dd>
+</dl>
+
Test-case indicator-datetime/snooze
<dl>
<dt>Create and save an upcoming alarm in ubuntu-clock-app</dt>
diff --git a/tests/test-clock.cpp b/tests/test-clock.cpp
index 62281fb..5601d35 100644
--- a/tests/test-clock.cpp
+++ b/tests/test-clock.cpp
@@ -19,11 +19,12 @@
#include <datetime/clock.h>
#include <datetime/clock-mock.h>
-#include <datetime/timezones.h>
+#include <datetime/timezone.h>
#include <notifications/dbus-shared.h>
#include "test-dbus-fixture.h"
+#include "timezone-mock.h"
/***
****
@@ -40,9 +41,9 @@ class ClockFixture: public TestDBusFixture
TEST_F(ClockFixture, MinuteChangedSignalShouldTriggerOncePerMinute)
{
// start up a live clock
- std::shared_ptr<Timezones> zones(new Timezones);
- zones->timezone.set("America/New_York");
- LiveClock clock(zones);
+ auto timezone_ = std::make_shared<MockTimezone>();
+ timezone_->timezone.set("America/New_York");
+ LiveClock clock(timezone_);
wait_msec(500); // wait for the bus to set up
// count how many times clock.minute_changed() is emitted over the next minute
@@ -65,17 +66,17 @@ TEST_F(ClockFixture, MinuteChangedSignalShouldTriggerOncePerMinute)
TEST_F(ClockFixture, HelloFixture)
{
- std::shared_ptr<Timezones> zones(new Timezones);
- zones->timezone.set("America/New_York");
- LiveClock clock(zones);
+ auto timezone_ = std::make_shared<MockTimezone>();
+ timezone_->timezone.set("America/New_York");
+ LiveClock clock(timezone_);
}
TEST_F(ClockFixture, TimezoneChangeTriggersSkew)
{
- std::shared_ptr<Timezones> zones(new Timezones);
- zones->timezone.set("America/New_York");
- LiveClock clock(zones);
+ auto timezone_ = std::make_shared<MockTimezone>();
+ timezone_->timezone.set("America/New_York");
+ LiveClock clock(timezone_);
auto tz_nyc = g_time_zone_new("America/New_York");
auto now_nyc = g_date_time_new_now(tz_nyc);
@@ -90,9 +91,9 @@ TEST_F(ClockFixture, TimezoneChangeTriggersSkew)
g_main_loop_quit(loop);
});
g_idle_add([](gpointer gs){
- static_cast<Timezones*>(gs)->timezone.set("America/Los_Angeles");
+ static_cast<Timezone*>(gs)->timezone.set("America/Los_Angeles");
return G_SOURCE_REMOVE;
- }, zones.get());
+ }, timezone_.get());
g_main_loop_run(loop);
auto tz_la = g_time_zone_new("America/Los_Angeles");
@@ -130,9 +131,9 @@ namespace
*/
TEST_F(ClockFixture, SleepTriggersSkew)
{
- std::shared_ptr<Timezones> zones(new Timezones);
- zones->timezone.set("America/New_York");
- LiveClock clock(zones);
+ auto timezone_ = std::make_shared<MockTimezone>();
+ timezone_->timezone.set("America/New_York");
+ LiveClock clock(timezone_);
wait_msec(250); // wait for the bus to set up
bool skewed = false;