[epiphany] tests: remove deprecated libsoup API usage



commit b40b416143c78f099f9bb490aa6526c027772928
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Tue Aug 26 18:15:34 2014 +0300

    tests: remove deprecated libsoup API usage

 tests/ephy-download-test.c         |   13 ++++++++-----
 tests/ephy-snapshot-service-test.c |    8 ++++----
 tests/ephy-web-view-test.c         |    5 +++--
 3 files changed, 15 insertions(+), 11 deletions(-)
---
diff --git a/tests/ephy-download-test.c b/tests/ephy-download-test.c
index 6fff06e..e0e499b 100644
--- a/tests/ephy-download-test.c
+++ b/tests/ephy-download-test.c
@@ -162,6 +162,7 @@ int
 main (int argc, char *argv[])
 {
   int ret;
+  GSList* uris;
   SoupServer *server;
 
   gtk_test_init (&argc, &argv);
@@ -177,11 +178,13 @@ main (int argc, char *argv[])
 
   _ephy_shell_create_instance (EPHY_EMBED_SHELL_MODE_TEST);
 
-  server = soup_server_new (SOUP_SERVER_PORT, 0, NULL);
-  soup_server_run_async (server);
-
-  base_uri = soup_uri_new ("http://127.0.0.1/";);
-  soup_uri_set_port (base_uri, soup_server_get_port (server));
+  server = soup_server_new (NULL, NULL);
+  soup_server_listen_local (server, 0,
+                            SOUP_SERVER_LISTEN_IPV4_ONLY,
+                            NULL);
+  uris = soup_server_get_uris (server);
+  base_uri = (SoupURI*)uris->data;
+  g_slist_free (uris);
 
   soup_server_add_handler (server, NULL, server_callback, NULL, NULL);
 
diff --git a/tests/ephy-snapshot-service-test.c b/tests/ephy-snapshot-service-test.c
index 609f487..dc81195 100644
--- a/tests/ephy-snapshot-service-test.c
+++ b/tests/ephy-snapshot-service-test.c
@@ -230,13 +230,13 @@ main (int argc, char *argv[])
   gtk_test_init (&argc, &argv);
   ephy_debug_init ();
 
-  server = soup_server_new (SOUP_SERVER_PORT, 45716,
-                            SOUP_SERVER_SERVER_HEADER, "snapshot-service-test-server",
+  server = soup_server_new (SOUP_SERVER_SERVER_HEADER, "snapshot-service-test-server",
                             NULL);
        soup_server_add_handler (server, NULL,
                            server_callback, NULL, NULL);
-       soup_server_run_async (server);
-
+  soup_server_listen_local (server, 45716,
+                            SOUP_SERVER_LISTEN_IPV4_ONLY,
+                            NULL);
   mtime = time(NULL);
 
   g_test_add_func ("/lib/ephy-snapshot-service/test_snapshot",
diff --git a/tests/ephy-web-view-test.c b/tests/ephy-web-view-test.c
index 3156125..7a4820d 100644
--- a/tests/ephy-web-view-test.c
+++ b/tests/ephy-web-view-test.c
@@ -464,9 +464,10 @@ main (int argc, char *argv[])
 
   _ephy_shell_create_instance (EPHY_EMBED_SHELL_MODE_TEST);
 
-  server = soup_server_new (SOUP_SERVER_PORT, SERVER_PORT, NULL);
+  server = soup_server_new (NULL, NULL);
   soup_server_add_handler (server, NULL, server_callback, NULL, NULL);
-  soup_server_run_async (server);
+  soup_server_listen_local (server, SERVER_PORT,
+                           SOUP_SERVER_LISTEN_IPV4_ONLY, NULL);
 
   g_test_add_func ("/embed/ephy-web-view/non_search_regex",
                    test_ephy_web_view_non_search_regex);


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