1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-11-14 04:15:37 +00:00
Commit graph

142 commits

Author SHA1 Message Date
Evangelos Ribeiro Tzaras
d3e42c93cd refactor: Switch to CallsPluginManager 2023-05-20 04:04:50 +02:00
Evangelos Ribeiro Tzaras
37b208f040 test-plugins: Switch to CallsPluginManager 2023-05-20 04:04:50 +02:00
Evangelos Ribeiro Tzaras
4598eaa020 test-manager: Codestyle 2023-05-15 09:56:28 +02:00
Evangelos Ribeiro Tzaras
e26e6640d8 test-application: Use dummy plugin
The test should not try communicating with any modem through ModemManager.

Fixes: #576
2023-05-12 16:46:30 +00:00
Evangelos Ribeiro Tzaras
e80abf713a tests: Use g_test_init instead of gtk_test_init
gtk_test_init() ends up calling gtk_init() which tries opening
the default display. CI jobs sometimes seem to trip over this
even when run through xvfb-run. Therefore we use g_test_init()
instead.
2023-05-09 07:44:09 +00:00
Evangelos Ribeiro Tzaras
12161080bc test-manager: Remove unused include 2023-04-18 08:34:39 +00:00
Evangelos Ribeiro Tzaras
62f6f75667 test-manager: Remove unused variable 2023-04-18 08:34:39 +00:00
Evangelos Ribeiro Tzaras
cf52fbba67 test-contacts: Add more test cases
Testing lookup of both empty string and NULL ensures we won't regress.
2023-04-13 06:01:05 +00:00
Evangelos Ribeiro Tzaras
830906f57a contacts-provider: Handle NULL and empty strings graceful in lookup
Fixes a crash where we asserted on best match when the id was NULL or
empty.

Closes: #567
2023-04-13 06:01:05 +00:00
Evangelos Ribeiro Tzaras
13d57f19bf tests: Add CALLS_SIP_ACCOUNT_FILE to environment
Otherwise the application test will try using the users
configured SIP accounts.
2023-04-10 08:03:21 +02:00
Guido Günther
b087bea16b Resolve emergency number types
We add a small hardcoded table for now. Future versions
will improve this to parse this out of ASOPs eccdata.

If we can't determine the type of a number we add it verbatim.
2023-04-06 16:37:59 +00:00
Guido Günther
9f68e242fd build: Run tests under C locale
This allows us to check for strings that contain translations.
We could also force a locale (see phosh's screenshot tests) at
a later point.
2023-04-06 16:37:59 +00:00
Evangelos Ribeiro Tzaras
d6619d68c9 tests: Don't override XDG_CONFIG_HOME
It was introduced in 4b51f340c8
to prevent accessing user home during tests:

The only place where this the home is currently accessed is when loading
SIP accounts and these can already be overriden with
CALLS_SIP_ACCOUNT_FILE.

It seems that XDG_CONFIG_HOME is propagated to the flatpak runner,
even though it was only overriden for the test suite.

  ========================================================================
  Building module calls in /builds/devrtz/calls/.flatpak-builder/build/calls-1
  ========================================================================
  Error: module calls: Error opening directory '/builds/devrtz/calls/_build/calls': Permission denied

Reported at https://gitlab.gnome.org/Infrastructure/GitLab/-/issues/596#note_1654082
2023-02-12 10:26:48 +01:00
Guido Günther
372aa452c3 tests: Add emergency call DBus test
Make sure the API gets exported and we can query numbers
2023-02-12 08:00:56 +00:00
Guido Günther
ca4e77a8b0 tests/dbus: Check for error early
This gives a detailed error messages whereas checking if `proxy`
is `NULL` tells us only that on error.
2023-02-12 08:00:56 +00:00
Guido Günther
4fb2115b9b tests/dbus: Switch to g_test_init
gtk_test_init() runs gtk_init() which then breaks isolation.
2023-02-12 08:00:56 +00:00
Evangelos Ribeiro Tzaras
e4bd4580e7 tests: Add application shutdown tests 2023-02-09 19:07:32 +00:00
Evangelos Ribeiro Tzaras
4b51f340c8 tests: Prevent tests from accessing user home
User files such as call records and VoIP account configs should be left
alone during tests.
2023-02-09 19:07:32 +00:00
Evangelos Ribeiro Tzaras
bb6b76107c build: Rename util.{c,h} to calls-util.{c,h}
"util" is a very generic name. This guards against accidentally
including similarly named headers from elsewhere.
2023-01-22 07:33:02 +00:00
Evangelos Ribeiro Tzaras
6137a93ce2 test-dbus: Test basic call interaction
Test that call gets exported on the bus and that basic interactions
such as accepting and hanging up works.
2023-01-20 17:12:02 +01:00
Evangelos Ribeiro Tzaras
4aa6884e43 tests: Add skeleton DBus API client test suite 2023-01-20 17:12:02 +01:00
Evangelos Ribeiro Tzaras
ae6e232f98 tests: Add DBus server binary
This should facilitate DBus API testing.
2023-01-20 17:12:02 +01:00
Evangelos Ribeiro Tzaras
e5a6ace32d tests: Don't mock calls_contacts_provider_new()
Having set which folks backends to use the real function can be used
without causing any warnings leading to the build to fail.
2023-01-20 17:12:01 +01:00
Evangelos Ribeiro Tzaras
b6bdfaca99 tests: Use key-file folks backend
If folks is built with the 'eds' backend it will get used by default.
During testing the system address book should not be queried.
It might even be impossible if the environment is not set up to
connect to the session bus raising the following warning:

(process:701522): folks-WARNING **: 09:13:54.291: Failed to find primary PersonaStore with type ID 'eds' and ID 'system-address-book'.
Individuals will not be linked properly and creating new links between Personas will not work.
The configured primary PersonaStore's backend may not be installed. If you are unsure, check with your distribution.

Fixes: #427
2023-01-20 17:12:01 +01:00
Evangelos Ribeiro Tzaras
82c3cea464 tests: Remove unused mock-libfeedback.h 2023-01-20 17:12:01 +01:00
Evangelos Ribeiro Tzaras
35953ff4d1 tests: ui-call: Prefer type specific assertions
This will make it easier to see what's going wrong when an assertion fails.
2023-01-20 17:12:01 +01:00
Evangelos Ribeiro Tzaras
f997048a38 build: Rename config.h to calls-config.h
This guards against accidentally including configuration from elsewhere.
2022-12-22 15:08:18 +00:00
Julian Sparber
b3040e38a4 tests: Ensure that plugins are build for tests that need them 2022-12-03 12:39:27 +01:00
Julian Sparber
db6d69e026 tests: Make ringer test depend on mocked libfeedback
This makes sure that the mocked libfeedback library is build before
running tests and drops the need of LD_PRELOAD.
2022-12-03 12:39:27 +01:00
Julian Sparber
486846b069 manager: Only set search path from CALLS_PLUGIN_DIR when path exists
Libpeas has issues searching in a path that doesn't exsist.
2022-12-03 12:32:29 +01:00
Julian Sparber
270d145b65 tests: Use CALLS_PLUGIN_DIR to search for plugins in the build dir
There is no need to add a second variable to search for plugins, we can
use CALLS_PLUGIN_DIR directly.
2022-12-03 12:32:29 +01:00
Julian Sparber
d804b996f4 plugins: Rescan for plugins after adding search paths
Using rescan allows use to give a priority to search paths. So this way
plugins in `CALLS_PLUGIN_DIR` take precedence over plugins we ship.

This also makes sure that the plugin test searches in the same location
as CallsManager.
2022-12-03 12:32:29 +01:00
Julian Sparber
baeae94c2e meson: Don't set G_TEST_*
Those env variables aren't needed.
2022-12-03 12:32:29 +01:00
Evangelos Ribeiro Tzaras
1056cba62a ringer: Never cancel async DBus calls and refactor
Previously our code assumed that g_cancellable_cancel() the async DBus
calls to libfeedback would guarantee that the underlying operation would
not be performed (i.e. triggering or ending a feedback).

However the endless ringing exhibited in #470 shows this assumption not
to hold. Therefore we avoid using g_cancellable_cancel () completely and
default to waiting for the async operation to finish.

update_ring () now sets the target state by inspecting managed calls and
the main logic will now step towards the target state:
Changing from regular/loud to soft/quiet ringing (or vice versa)
requires we first end feedback before (re)triggering it.

Additionally the "is-quiet" and "is-ringing" properties are replaced by
a new "state" property to allow changing the combination atomically.

Closes: #470
2022-11-15 09:52:17 +00:00
Evangelos Ribeiro Tzaras
43353d48a3 mock-lfb-event: Emit "feedback-ended" signal
This emulates lfb behaviour and the ringer will rely on this behaviour
when ending feedbacks.
2022-11-15 09:52:17 +00:00
Evangelos Ribeiro Tzaras
c0183d740e mock-lfb-event: Uncrustify 2022-11-15 09:52:17 +00:00
Evangelos Ribeiro Tzaras
baee7dbc89 test-ringer: Assert object finalization
This helps catching any dangling references.
2022-11-15 09:52:17 +00:00
Evangelos Ribeiro Tzaras
1deee0b71b util: Add API to check address family of IP address 2022-11-01 11:04:35 +00:00
Evangelos Ribeiro Tzaras
1489cfa796 test-util: Remove unused include 2022-11-01 11:04:35 +00:00
Evangelos Ribeiro Tzaras
c5759df955 build: drop libmocka dependency
It is now unused
2022-10-11 07:41:07 +00:00
Evangelos Ribeiro Tzaras
4262ec8231 test-ringer: Use glib testing functions instead of mocka 2022-10-11 07:41:07 +00:00
Evangelos Ribeiro Tzaras
31a11b0abc tests: Rename functions
This is done as a follow up commit after the cancellation test was
removed in order to (slightly) ease review.
2022-10-11 07:41:07 +00:00
Evangelos Ribeiro Tzaras
280527d7a7 tests: Mock libfeedback
Copied from libfeedback as of 2e081602f627505e566cc0bdb6cd96c7642d8b65
and adjusted for our mocking needs.

The mocked library will be LD_PRELOADED for the moment,
but further changes to the build should allow us to simply link
to it in the future.
2022-10-11 07:41:07 +00:00
Evangelos Ribeiro Tzaras
b4887fa68a test-ringer: Remove cancellable test
This will get removed soon while refactoring the ringer as cancelling
the async methods would not guarantee that the requested operation would
not be performed.

It could actually already be started (e.g. starting or stopping the
feedback), but we have not yet received the reply, so it was always a
bit flaky.
2022-10-11 07:41:07 +00:00
Evangelos Ribeiro Tzaras
a35cd09cdb tests: Remove unused code 2022-09-19 19:14:17 +02:00
Evangelos Ribeiro Tzaras
8a928f2008 call: Remove waiting state
The waiting state is not used any more and made wrong assumptions to
begin with, so let's get rid of it.
2022-09-01 17:48:02 +02:00
Evangelos Ribeiro Tzaras
11ba83c16e Move plugin specific tests into dedicated directory
This will prove beneficial when we also add tests for the policy engine
plugins. The increased locality is also nice to have.
2022-08-19 08:43:57 +00:00
Evangelos Ribeiro Tzaras
86a8f3ae22 Move provider plugins into a dedicated directory
Since we will introduce another type of plugin for the policy engine
we want to have each plugin type in separate directories.

We also have to adjust:

- plugin search directories
- po file location
- update paths for calls-doc target
2022-08-19 08:43:57 +00:00
Evangelos Ribeiro Tzaras
857c375ab9 Disable g722 to avoid test failure with ffmpeg 5.0/gst-libav
Bail out! CallsSipMediaPipeline-FATAL-WARNING: Error trying to setup codecs for pipeline: Could not create 'decoder' element of type avdec_g722
stderr:

(gst-plugin-scanner:196349): GLib-GObject-WARNING **: 07:29:24.149: type name '-a-png-encoder-pred' contains invalid characters

See
https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/1055
2022-08-05 17:21:05 +00:00
Chris Talbot
e91d6258ad calls-ui-call-data: change DELAY_UI_MS to 100 ms
15 ms does not seem to be enough time for phosh-antispam to be able
to hang up before the incoming call screen shows up. In my experiement,
90 looks to be the minimum time needed for the incoming call to not show up.

I put it to 100 ms just to be safe.
2022-06-11 18:56:46 -04:00