diff options
author | Janusz Kozerski <j.kozerski@samsung.com> | 2015-09-25 14:47:34 +0200 |
---|---|---|
committer | Janusz Kozerski <j.kozerski@samsung.com> | 2015-11-10 11:43:34 +0100 |
commit | 473de0fb27052aff62e4b391feb1b6447f83ec41 (patch) | |
tree | d8e7ddf77eb3e3424394fd0529b004a77dfd6b77 /tests | |
parent | 7871c1f106e6c11503b4a2a6f7bbbd876d2ec1fc (diff) | |
download | cert-checker-473de0fb27052aff62e4b391feb1b6447f83ec41.tar.gz cert-checker-473de0fb27052aff62e4b391feb1b6447f83ec41.tar.bz2 cert-checker-473de0fb27052aff62e4b391feb1b6447f83ec41.zip |
Add popup
Since Notification framework doesn't support system daemons, the
cert-checker's internal popup should be provided.
Add implementation of popup binary - /usr/bin/cert-checker-popup
Cert-checker forks(), execs a popup binary, waits for popup
termination, and then reads user response from pipe.
Change-Id: Ie2e70f661feb1f262841d59a1b4c6a7ec49901f9
Diffstat (limited to 'tests')
-rw-r--r-- | tests/CMakeLists.txt | 6 | ||||
-rw-r--r-- | tests/popup_test.cpp | 14 | ||||
-rw-r--r-- | tests/stubs_.cpp | 3 |
3 files changed, 15 insertions, 8 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index ef836cd..511aeb9 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,13 +1,14 @@ PKG_CHECK_MODULES(CERT_CHECKER_TESTS_DEP REQUIRED + capi-appfw-application cert-svc-vcore + db-util dbus-1 dbus-glib-1 - db-util + elementary glib-2.0 gio-2.0 icu-i18n - notification key-manager libsystemd-journal libtzplatform-config @@ -76,6 +77,7 @@ SET(CERT_CHECKER_POPUP_TEST_SOURCES ${CERT_CHECKER_TESTS_SRC_PATH}/popup_test.cpp # cert-checker ${CERT_CHECKER_SRC_PATH}/app.cpp + ${CERT_CHECKER_SRC_PATH}/ui/popup-runner.cpp ${CERT_CHECKER_SRC_PATH}/ui/UIBackend.cpp # logs ${CERT_CHECKER_SRC_PATH}/log/log.cpp diff --git a/tests/popup_test.cpp b/tests/popup_test.cpp index e2e1e3d..d08747e 100644 --- a/tests/popup_test.cpp +++ b/tests/popup_test.cpp @@ -25,13 +25,19 @@ using namespace CCHECKER; -int main(void) +int main(int argc, char** argv) { - LogDebug("Cert-checker start!"); + LogDebug("Cert-checker popup-test start!"); + + int timeout = 60; + if (argc > 1) { + timeout = atoi(argv[1]); + } + LogDebug("popup-test timeout: " << timeout); setlocale(LC_ALL, ""); - UI::UIBackend ui(20); // timeout 20 seconds + UI::UIBackend ui(timeout); app_t app(std::string("test_APP_ID"), std::string("test PKG ID"), @@ -40,6 +46,6 @@ int main(void) ui.call_popup(app); - LogDebug("Cert-checker exit!"); + LogDebug("Cert-checker popup-test exit!"); return 0; } diff --git a/tests/stubs_.cpp b/tests/stubs_.cpp index b475690..9eb8cfa 100644 --- a/tests/stubs_.cpp +++ b/tests/stubs_.cpp @@ -112,8 +112,7 @@ void DB::SqlQuery::get_app_list(std::list<app_t> &apps_buffer) // UI UI::UIBackend::UIBackend(int timeout) : - m_notification(nullptr), - m_responseTimeout(timeout) + m_responseTimeout(timeout) {} UI::UIBackend::~UIBackend() |