[epiphany] Fix test-ephy-embed-shell
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] Fix test-ephy-embed-shell
- Date: Sat, 29 Dec 2018 15:40:13 +0000 (UTC)
commit 7c8f19af448d42cb498bd729f498f49ebcd554c6
Author: Jan-Michael Brummer <jan brummer tabos org>
Date: Fri Dec 21 10:31:02 2018 +0100
Fix test-ephy-embed-shell
Fixes: https://gitlab.gnome.org/GNOME/epiphany/issues/341
embed/ephy-embed-shell.c | 5 ++++-
tests/ephy-embed-shell-test.c | 8 +-------
tests/meson.build | 18 +++++++++---------
3 files changed, 14 insertions(+), 17 deletions(-)
---
diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c
index 2b1ce4fdd..75d565941 100644
--- a/embed/ephy-embed-shell.c
+++ b/embed/ephy-embed-shell.c
@@ -1688,7 +1688,10 @@ ephy_embed_shell_launch_handler (EphyEmbedShell *shell,
gboolean ret = FALSE;
g_assert (EPHY_IS_EMBED_SHELL (shell));
- g_assert (file || mime_type);
+ g_assert (file);
+
+ if (mime_type == NULL)
+ return ret;
if (ephy_is_running_inside_flatpak ()) {
return ephy_file_launch_file_via_uri_handler (file);
diff --git a/tests/ephy-embed-shell-test.c b/tests/ephy-embed-shell-test.c
index 6af89054e..e305434c2 100644
--- a/tests/ephy-embed-shell-test.c
+++ b/tests/ephy-embed-shell-test.c
@@ -22,10 +22,10 @@
#include "ephy-debug.h"
#include "ephy-embed.h"
#include "ephy-embed-prefs.h"
-#include "ephy-embed-private.h"
#include "ephy-embed-shell.h"
#include "ephy-embed-utils.h"
#include "ephy-file-helpers.h"
+#include "ephy-shell.h"
#include <glib.h>
#include <gtk/gtk.h>
@@ -39,18 +39,12 @@ test_ephy_embed_shell_launch_handler (void)
embed_shell = ephy_embed_shell_get_default ();
- ret = ephy_embed_shell_launch_handler (embed_shell, NULL, "text/html", 0);
- g_assert (ret == FALSE);
-
file = g_file_new_for_path (TEST_DIR "/data/test.html");
g_assert (file);
ret = ephy_embed_shell_launch_handler (embed_shell, file, NULL, 0);
g_assert (ret == FALSE);
- ret = ephy_embed_shell_launch_handler (embed_shell, file, "text/html", 0);
- g_assert (ret == FALSE);
-
g_object_unref (file);
}
diff --git a/tests/meson.build b/tests/meson.build
index 6f24acb3a..f9e425a6c 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -27,15 +27,15 @@ if get_option('unit_tests')
# env: envs
# )
- # FIXME: https://bugzilla.gnome.org/show_bug.cgi?id=773448
- # embed_shell_test = executable('test-ephy-embed-shell',
- # 'ephy-embed-shell-test.c',
- # dependencies: ephymain_dep
- # )
- # test('Embed shell test',
- # embed_shell_test,
- # env: envs
- # )
+ embed_shell_test = executable('test-ephy-embed-shell',
+ 'ephy-embed-shell-test.c',
+ dependencies: ephymain_dep,
+ c_args : '-DTEST_DIR="' + meson.current_source_dir() + '"'
+ )
+ test('Embed shell test',
+ embed_shell_test,
+ env: envs
+ )
embed_utils_test = executable('test-ephy-embed-utils',
'ephy-embed-utils-test.c',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]