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

127 commits

Author SHA1 Message Date
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
Evangelos Ribeiro Tzaras
50e7c87a4d sip: Store media encryption account preference to disk 2022-05-24 22:48:59 +02:00
Evangelos Ribeiro Tzaras
e75e04fb4e sip: Allow specifying if media encryption is desired
A property of type SipMediaEncryption is added to both the origin and
the call which allows to state if we want the media session to be
encrypted with SRTP.

Logic is added to interact with the CallsSdpCryptoContext if encryption
is desired.
2022-05-24 22:48:56 +02:00
Evangelos Ribeiro Tzaras
0e57d31c1e sip: media-manager: Include crypto attributes for capabilities
The API is changed to accept a list of calls_srtp_crypto_attributes
which get inserted into the SDP line.
2022-05-24 22:30:03 +02:00
Evangelos Ribeiro Tzaras
14350a38ed sip: Add SDP crypto context class
Objects of this type keep track of SDP of the local and remote peers,
allow generating offers and answers and codify default policy used for
cryptographic parameters.
2022-05-24 22:30:03 +02:00
Evangelos Ribeiro Tzaras
ea5b4f2895 sip: media-pipeline: Use cryptographic parameters
Allows setting up cryptographic parameters with
calls_sip_media_pipeline_set_crypto() and use them to set GstCaps for
GstSrtpDec and GObject properties for GstSrtpEnc
2022-05-24 22:30:03 +02:00
Evangelos Ribeiro Tzaras
4937723541 sip: Add srtp-utilities
These utilities aid in generating and parsing SDP crypto attributes to be used
during the offer/answer negotiation.
2022-05-24 22:30:03 +02:00
Evangelos Ribeiro Tzaras
e052201553 tests: Add testing for sideeffects of using CallsSettings
When setting up a binding between GSettings and GObject properties the
CallsSetting used to set the value from the GSetting to the property and
back to the GSetting.

While the value was still the default value it was marked as non default
because it had explicitly been set without any user interaction.
2022-05-13 19:58:07 +02:00
Evangelos Ribeiro Tzaras
94fa13af4c settings: Convert to the singleton pattern
We only have a single source of settings, so we should reflect that by
using a singleton. This also reduces our LoC.

This doesn't impair our ability to run tests because there we run with
GSETTINGS_BACKEND=memory
2022-05-13 19:58:07 +02:00
Evangelos Ribeiro Tzaras
85ee014cc9 tests: media: Rename tests 2022-04-12 08:03:49 +00:00
Evangelos Ribeiro Tzaras
acfd185e9e tests: media: Test pipeline
Run some basic tests on the pipeline
2022-03-05 23:02:15 +01:00
Evangelos Ribeiro Tzaras
849f298609 sip: media-pipeline: Remove lport-rtp and lport-rtcp property
We're not setting the desired ports from the outside anymore, but rather
querying the ports that have been allocated by the operating system.

Therefore the lport-rtp and lport-rtcp property have become superfluous and are
being removed. We also adapt to changes outside of the pipeline code.
2022-03-05 23:02:15 +01:00
Evangelos Ribeiro Tzaras
30c4e90499 ui-call-data: Store origin id and adapt to changes 2022-03-04 18:00:32 +01:00
Evangelos Ribeiro Tzaras
16b86c29b2 origin: Add id property and adapt to changes
The id property will be used to keep track of which origin was used for a call,
so that we can default to reusing the same origin when placing a call from the
history.
2022-03-04 18:00:32 +01:00
Evangelos Ribeiro Tzaras
c2d2c33eae tests: build: Avoid linking against sip module
Fixes the deprecation warning from meson:

DEPRECATION: target sip links against shared module sip, which is incorrect.
             This will be an error in the future, so please use shared_library() for sip instead.
             If shared_module() was used for sip because it has references to undefined symbols,
             use shared_libary() with `override_options: ['b_lundef=false']` instead.
2022-03-02 09:16:12 +01:00
Evangelos Ribeiro Tzaras
f017261c59 tests: Split media tests into separate file
This gives us a better separation of concerns and it will make it a bit easier
to move the sip independent media pieces out of the plugin in the mid to long
term.
2022-03-01 18:24:04 +01:00