aboutsummaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2016-04-22 09:43:44 -0500
committerCharles Kerr <charles.kerr@canonical.com>2016-04-22 09:43:44 -0500
commitce5234162fa0c534ff9abf3fce3d03f4b01e893e (patch)
treefa1de28390d3fad05b9a9405190f82cde3fa70e5 /tests/unit
parentb37db33c628675971f118fb3e241dc32a9f0a5d0 (diff)
downloadayatana-indicator-display-ce5234162fa0c534ff9abf3fce3d03f4b01e893e.tar.gz
ayatana-indicator-display-ce5234162fa0c534ff9abf3fce3d03f4b01e893e.tar.bz2
ayatana-indicator-display-ce5234162fa0c534ff9abf3fce3d03f4b01e893e.zip
don't prompt when the greeter's not running yet: change greeter's payload from an 'is_active' bool to a three-value state of active, inactive, and unavailable
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/greeter-test.cpp29
1 files changed, 17 insertions, 12 deletions
diff --git a/tests/unit/greeter-test.cpp b/tests/unit/greeter-test.cpp
index 72df3bc..bfa88e8 100644
--- a/tests/unit/greeter-test.cpp
+++ b/tests/unit/greeter-test.cpp
@@ -18,6 +18,7 @@
*/
#include <tests/utils/qt-fixture.h>
+#include <tests/utils/gtest-print-helpers.h>
#include <src/dbus-names.h>
#include <src/greeter.h>
@@ -110,45 +111,49 @@ protected:
TEST_F(GreeterFixture, ActiveServiceStartsBeforeWatcher)
{
- constexpr bool expected {true};
+ constexpr bool is_active {true};
+ constexpr Greeter::State expected {Greeter::State::ACTIVE};
- start_greeter_service(expected);
+ start_greeter_service(is_active);
UnityGreeter greeter;
- ASSERT_PROPERTY_EQ_EVENTUALLY(expected, greeter.is_active());
+ ASSERT_PROPERTY_EQ_EVENTUALLY(expected, greeter.state());
}
TEST_F(GreeterFixture, WatcherStartsBeforeActiveService)
{
- constexpr bool expected {true};
+ constexpr bool is_active {true};
+ constexpr Greeter::State expected {Greeter::State::ACTIVE};
UnityGreeter greeter;
- start_greeter_service(expected);
+ start_greeter_service(is_active);
- ASSERT_PROPERTY_EQ_EVENTUALLY(expected, greeter.is_active());
+ ASSERT_PROPERTY_EQ_EVENTUALLY(expected, greeter.state());
}
TEST_F(GreeterFixture, InactiveServiceStartsBeforeWatcher)
{
- constexpr bool expected {false};
+ constexpr bool is_active {false};
+ constexpr Greeter::State expected {Greeter::State::INACTIVE};
- start_greeter_service(expected);
+ start_greeter_service(is_active);
UnityGreeter greeter;
- ASSERT_PROPERTY_EQ_EVENTUALLY(expected, greeter.is_active());
+ ASSERT_PROPERTY_EQ_EVENTUALLY(expected, greeter.state());
}
TEST_F(GreeterFixture, WatcherStartsBeforeInactiveService)
{
- constexpr bool expected {false};
+ constexpr bool is_active {false};
+ constexpr Greeter::State expected {Greeter::State::INACTIVE};
UnityGreeter greeter;
- start_greeter_service(expected);
+ start_greeter_service(is_active);
- ASSERT_PROPERTY_EQ_EVENTUALLY(expected, greeter.is_active());
+ ASSERT_PROPERTY_EQ_EVENTUALLY(expected, greeter.state());
}