[gnome-software] snap: Fix test checking icon at wrong time
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software] snap: Fix test checking icon at wrong time
- Date: Fri, 12 Jul 2019 10:29:38 +0000 (UTC)
commit 9c39cff6e8cfccb3cc618290e0ff85996142186e
Author: Robert Ancell <robert ancell canonical com>
Date: Fri Jul 12 11:45:49 2019 +1200
snap: Fix test checking icon at wrong time
plugins/snap/gs-self-test.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/plugins/snap/gs-self-test.c b/plugins/snap/gs-self-test.c
index aa6762de..cb8ce07d 100644
--- a/plugins/snap/gs-self-test.c
+++ b/plugins/snap/gs-self-test.c
@@ -102,7 +102,7 @@ make_snap (const gchar *name, SnapdSnapStatus status)
"common-ids", common_ids,
"description", "DESCRIPTION",
"download-size", status == SNAPD_SNAP_STATUS_AVAILABLE ? 500 : 0,
- "icon", "/icon",
+ "icon", status == SNAPD_SNAP_STATUS_AVAILABLE ? NULL : "/icon",
"id", name,
"install-date", status == SNAPD_SNAP_STATUS_INSTALLED ? install_date : NULL,
"installed-size", status == SNAPD_SNAP_STATUS_INSTALLED ? 1000 : 0,
@@ -300,8 +300,7 @@ gs_plugins_snap_test_func (GsPluginLoader *plugin_loader)
g_assert_cmpint (as_image_get_width (image), ==, 1024);
g_assert_cmpint (as_image_get_height (image), ==, 768);
pixbuf = gs_app_get_pixbuf (app);
- g_assert_cmpint (gdk_pixbuf_get_width (pixbuf), ==, 1);
- g_assert_cmpint (gdk_pixbuf_get_height (pixbuf), ==, 1);
+ g_assert_null (pixbuf);
g_assert_cmpint (gs_app_get_size_installed (app), ==, 0);
g_assert_cmpint (gs_app_get_size_download (app), ==, 500);
g_assert_cmpint (gs_app_get_install_date (app), ==, 0);
@@ -309,6 +308,7 @@ gs_plugins_snap_test_func (GsPluginLoader *plugin_loader)
g_object_unref (plugin_job);
plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_INSTALL,
"app", app,
+ "refine-flags", GS_PLUGIN_REFINE_FLAGS_REQUIRE_ICON,
NULL);
ret = gs_plugin_loader_job_action (plugin_loader, plugin_job, NULL, &error);
gs_test_flush_main_context ();
@@ -318,6 +318,10 @@ gs_plugins_snap_test_func (GsPluginLoader *plugin_loader)
g_assert_cmpint (gs_app_get_size_installed (app), ==, 1000);
g_assert_cmpint (gs_app_get_install_date (app), ==, g_date_time_to_unix (g_date_time_new_utc (2017,
1, 2, 11, 23, 58)));
+ pixbuf = gs_app_get_pixbuf (app);
+ g_assert_cmpint (gdk_pixbuf_get_width (pixbuf), ==, 64);
+ g_assert_cmpint (gdk_pixbuf_get_height (pixbuf), ==, 64);
+
g_object_unref (plugin_job);
plugin_job = gs_plugin_job_newv (GS_PLUGIN_ACTION_REMOVE,
"app", app,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]