summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Catanzaro <mcatanzaro@gnome.org>2020-09-03 18:05:00 -0500
committerMichael Catanzaro <mcatanzaro@gnome.org>2020-09-11 23:29:08 +0000
commitdeef36f58b8ecffcf36a20e8111ab2e89ddfa9f0 (patch)
tree902bc09ea2d953a806c42fc26ad0359592d4ff10 /tests
parente08364e56870905af6647886e28ec3eb8623dfcb (diff)
downloadepiphany-deef36f58b8ecffcf36a20e8111ab2e89ddfa9f0.tar.gz
Remove ad-hoc query parameter strippingmcatanzaro/send-request
This old, manual, and very non-comprehensive method of tracking prevention doesn't make much sense to do now that we have far more sophisticated anti-tracking measures in WebKit and enabled by default that don't require listing ad-hoc query parameters to remove from URLs.
Diffstat (limited to 'tests')
-rw-r--r--tests/ephy-uri-helpers-test.c88
-rw-r--r--tests/meson.build10
2 files changed, 0 insertions, 98 deletions
diff --git a/tests/ephy-uri-helpers-test.c b/tests/ephy-uri-helpers-test.c
deleted file mode 100644
index 8cdd23913..000000000
--- a/tests/ephy-uri-helpers-test.c
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/*
- * Copyright © 2013 Bastien Nocera <hadess@hadess.net>
- *
- * This file is part of Epiphany.
- *
- * Epiphany is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * Epiphany is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Epiphany. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "config.h"
-#include "ephy-debug.h"
-#include "ephy-uri-helpers.h"
-#include "ephy-settings.h"
-
-#include <glib.h>
-#include <gtk/gtk.h>
-
-static void
-test_ephy_uri_helpers_remove_tracking (void)
-{
- struct {
- const char *input;
- const char *output;
- } const items[] = {
- { "http://www.test.com/", "http://www.test.com/" },
- { "http://www.test.com/?key=foo", "http://www.test.com/?key=foo" },
- /* From the description in https://addons.mozilla.org/fr/firefox/addon/pure-url/ */
- { "http://bigpicture.ru/?p=431513&utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%%3A+bigpictures+%%28%%D0%%9D%%D0%%9E%%D0%%92%%D0%%9E%%D0%%A1%%D0%%A2%%D0%%98+%%D0%%92+%%D0%%A4%%D0%%9E%%D0%%A2%%D0%%9E%%D0%%93%%D0%%A0%%D0%%90%%D0%%A4%%D0%%98%%D0%%AF%%D0%%A5%%29", "http://bigpicture.ru/?p=431513" },
- { "http://www.test.com/?utm_source=feedburner", "http://www.test.com/" },
- { "http://www.test.com/?feature=foo", "http://www.test.com/?feature=foo" },
- { "http://foo.youtube.com/?feature=foo", "http://foo.youtube.com/" },
- /* https://bugzilla.gnome.org/show_bug.cgi?id=724724 */
- { "http://git.savannah.gnu.org/gitweb/?p=grep.git;a=commit;h=97318f5e59a1ef6feb8a378434a00932a3fc1e0b",
- "http://git.savannah.gnu.org/gitweb/?p=grep.git;a=commit;h=97318f5e59a1ef6feb8a378434a00932a3fc1e0b" },
- /* https://bugzilla.gnome.org/show_bug.cgi?id=730464 */
- { "https://mail.google.com/mail/u/0/?ui=2&ik=37373eb942&rid=7cea..&auto=1&view=lno&_reqid=1168127&pcd=1&mb=0&rt=j",
- "https://mail.google.com/mail/u/0/?ui=2&ik=37373eb942&rid=7cea..&auto=1&view=lno&_reqid=1168127&pcd=1&mb=0&rt=j" },
- { "http://www.test.com/?utm_source=feedburner&view=lno&_reqid=1234", "http://www.test.com/?view=lno&_reqid=1234" },
- { "http://www.test.com/?some&valid&query", "http://www.test.com/?some&valid&query" },
- { "http://www.test.com/?utm_source=feedburner&some&valid&query", "http://www.test.com/?some&valid&query" },
- };
- guint i;
-
- for (i = 0; i < G_N_ELEMENTS (items); i++) {
- char *result;
-
- g_test_message ("TRACKING: uri: %s; expected: %s;",
- items[i].input, items[i].output);
- result = ephy_remove_tracking_from_uri (items[i].input);
- if (result == NULL)
- result = g_strdup (items[i].input);
- g_assert_cmpstr (items[i].output, ==, result);
- g_free (result);
- }
-}
-
-int
-main (int argc,
- char *argv[])
-{
- int ret;
-
- /* This should affect only this test, we use it so we can test for
- * default directory changes. */
- g_setenv ("GSETTINGS_BACKEND", "memory", TRUE);
-
- gtk_test_init (&argc, &argv);
-
- ephy_debug_init ();
-
- g_test_add_func ("/lib/ephy-uri-helpers/remove_tracking",
- test_ephy_uri_helpers_remove_tracking);
-
- ret = g_test_run ();
-
- return ret;
-}
diff --git a/tests/meson.build b/tests/meson.build
index f2a0ac6a9..8ddcb250b 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -156,16 +156,6 @@ if get_option('unit_tests').enabled()
env: envs
)
- uri_helpers_test = executable('test-ephy-uri-helpers',
- 'ephy-uri-helpers-test.c',
- dependencies: ephymain_dep,
- c_args: test_cargs,
- )
- test('URI helpers test',
- uri_helpers_test,
- env: envs,
- )
-
web_app_utils_test = executable('test-ephy-web-app-utils',
'ephy-web-app-utils-test.c',
dependencies: ephymain_dep,