[epiphany] ephy-embed-utils: overview and incognito URLs should also be considered as empty



commit e15b85f26c3fa01625864054c27b56ff2d917e04
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Sat Dec 3 13:15:47 2016 +0100

    ephy-embed-utils: overview and incognito URLs should also be considered as empty

 embed/ephy-embed-utils.c      |   13 +++++--------
 tests/ephy-embed-utils-test.c |    4 +++-
 2 files changed, 8 insertions(+), 9 deletions(-)
---
diff --git a/embed/ephy-embed-utils.c b/embed/ephy-embed-utils.c
index 055fb89..90dcd95 100644
--- a/embed/ephy-embed-utils.c
+++ b/embed/ephy-embed-utils.c
@@ -265,14 +265,11 @@ ephy_embed_utils_normalize_or_autosearch_address (const char *address)
 gboolean
 ephy_embed_utils_url_is_empty (const char *location)
 {
-  gboolean is_empty = FALSE;
-
-  if (location == NULL ||
-      location[0] == '\0' ||
-      strcmp (location, "about:blank") == 0)
-    is_empty = TRUE;
-
-  return is_empty;
+  return (location == NULL ||
+          location[0] == '\0' ||
+          strcmp (location, "about:blank") == 0 ||
+          strcmp (location, "ephy-about:overview") == 0 ||
+          strcmp (location, "ephy-about:incognito") == 0);
 }
 
 /* This is the list of addresses that should never be shown in the
diff --git a/tests/ephy-embed-utils-test.c b/tests/ephy-embed-utils-test.c
index 934d4a5..d52da80 100644
--- a/tests/ephy-embed-utils-test.c
+++ b/tests/ephy-embed-utils-test.c
@@ -89,7 +89,9 @@ static const IsEmptyTest tests_is_empty[] = {
   { "about:blank", "about:blank", TRUE },
   { "about:blanco", "about:blanco", FALSE },
   { "non-blank-URI", "http://www.gnome.org";, FALSE },
-  { "random", "what is this, I don't even", FALSE }
+  { "random", "what is this, I don't even", FALSE },
+  { "overview", "ephy-about:overview", TRUE },
+  { "incognito", "ephy-about:incognito", TRUE }
 };
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]