aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ephy-download-test.c2
-rw-r--r--tests/ephy-embed-single-test.c2
-rw-r--r--tests/ephy-encodings-test.c4
-rw-r--r--tests/ephy-session-test.c26
-rw-r--r--tests/ephy-shell-test.c17
-rw-r--r--tests/ephy-web-view-test.c2
6 files changed, 33 insertions, 20 deletions
diff --git a/tests/ephy-download-test.c b/tests/ephy-download-test.c
index f92c7d091..475aa0327 100644
--- a/tests/ephy-download-test.c
+++ b/tests/ephy-download-test.c
@@ -194,7 +194,7 @@ main (int argc, char *argv[])
ret = g_test_run ();
- g_object_unref (ephy_shell);
+ g_object_unref (ephy_shell_get_default ());
ephy_file_helpers_shutdown ();
return ret;
diff --git a/tests/ephy-embed-single-test.c b/tests/ephy-embed-single-test.c
index a7f1583d9..80a54bcfa 100644
--- a/tests/ephy-embed-single-test.c
+++ b/tests/ephy-embed-single-test.c
@@ -104,7 +104,7 @@ main (int argc, char *argv[])
ret = g_test_run ();
- g_object_unref (ephy_shell);
+ g_object_unref (ephy_shell_get_default ());
ephy_file_helpers_shutdown ();
return ret;
diff --git a/tests/ephy-encodings-test.c b/tests/ephy-encodings-test.c
index ec085bbe7..ffa88e5ab 100644
--- a/tests/ephy-encodings-test.c
+++ b/tests/ephy-encodings-test.c
@@ -90,7 +90,7 @@ main (int argc, char *argv[])
}
_ephy_shell_create_instance (EPHY_EMBED_SHELL_MODE_TEST);
- g_assert (ephy_shell);
+ g_assert (ephy_shell_get_default ());
g_test_add_func ("/src/ephy-encodings/create",
test_ephy_encodings_create);
@@ -101,7 +101,7 @@ main (int argc, char *argv[])
ret = g_test_run ();
ephy_file_helpers_shutdown ();
- g_object_unref (ephy_shell);
+ g_object_unref (ephy_shell_get_default ());
return ret;
}
diff --git a/tests/ephy-session-test.c b/tests/ephy-session-test.c
index 6295be475..4923f2779 100644
--- a/tests/ephy-session-test.c
+++ b/tests/ephy-session-test.c
@@ -51,13 +51,13 @@ test_ephy_session_load (void)
EphyEmbed *embed;
EphyWebView *view;
- session = EPHY_SESSION (ephy_shell_get_session (ephy_shell));
+ session = EPHY_SESSION (ephy_shell_get_session (ephy_shell_get_default ()));
g_assert (session);
ret = ephy_session_load_from_string (session, session_data, -1, 0);
g_assert (ret);
- l = ephy_shell_get_windows (ephy_shell);
+ l = ephy_shell_get_windows (ephy_shell_get_default ());
g_assert (l);
g_assert_cmpint (g_list_length (l), ==, 1);
@@ -86,7 +86,7 @@ test_ephy_session_load_empty_session (void)
EphyEmbed *embed;
EphyWebView *view;
- session = EPHY_SESSION (ephy_shell_get_session (ephy_shell));
+ session = EPHY_SESSION (ephy_shell_get_session (ephy_shell_get_default ()));
g_assert (session);
ret = ephy_session_load_from_string (session, session_data_empty, -1, 0);
@@ -99,7 +99,7 @@ test_ephy_session_load_empty_session (void)
while (g_main_context_pending (NULL))
g_main_context_iteration (NULL, FALSE);
- l = ephy_shell_get_windows (ephy_shell);
+ l = ephy_shell_get_windows (ephy_shell_get_default ());
g_assert (l);
g_assert_cmpint (g_list_length (l), ==, 1);
@@ -136,13 +136,13 @@ test_ephy_session_load_many_windows (void)
EphyEmbed *embed;
EphyWebView *view;
- session = EPHY_SESSION (ephy_shell_get_session (ephy_shell));
+ session = EPHY_SESSION (ephy_shell_get_session (ephy_shell_get_default ()));
g_assert (session);
ret = ephy_session_load_from_string (session, session_data_many_windows, -1, 0);
g_assert (ret);
- l = ephy_shell_get_windows (ephy_shell);
+ l = ephy_shell_get_windows (ephy_shell_get_default ());
g_assert (l);
g_assert_cmpint (g_list_length (l), ==, 2);
@@ -170,7 +170,7 @@ test_ephy_session_open_uri_after_loading_session (void)
guint32 user_time;
const char* uris[] = { "ephy-about:epiphany", NULL };
- session = EPHY_SESSION (ephy_shell_get_session (ephy_shell));
+ session = EPHY_SESSION (ephy_shell_get_session (ephy_shell_get_default ()));
g_assert (session);
user_time = gdk_x11_display_get_user_time (gdk_display_get_default ());
@@ -178,7 +178,7 @@ test_ephy_session_open_uri_after_loading_session (void)
ret = ephy_session_load_from_string (session, session_data_many_windows, -1, 0);
g_assert (ret);
- l = ephy_shell_get_windows (ephy_shell);
+ l = ephy_shell_get_windows (ephy_shell_get_default ());
g_assert (l);
g_assert_cmpint (g_list_length (l), ==, 2);
@@ -206,7 +206,7 @@ test_ephy_session_open_uri_after_loading_session (void)
while (gtk_events_pending ())
gtk_main_iteration_do (FALSE);
- l = ephy_shell_get_windows (ephy_shell);
+ l = ephy_shell_get_windows (ephy_shell_get_default ());
g_assert (l);
g_assert_cmpint (g_list_length (l), ==, 2);
@@ -227,7 +227,7 @@ test_ephy_session_open_uri_after_loading_session (void)
/* We should still have 2 windows here, since the new URI should be
* in a new tab of an existing window.
*/
- l = ephy_shell_get_windows (ephy_shell);
+ l = ephy_shell_get_windows (ephy_shell_get_default ());
g_assert (l);
g_assert_cmpint (g_list_length (l), ==, 2);
}
@@ -250,9 +250,9 @@ main (int argc, char *argv[])
}
_ephy_shell_create_instance (EPHY_EMBED_SHELL_MODE_TEST);
- g_assert (ephy_shell);
+ g_assert (ephy_shell_get_default ());
- g_application_register (G_APPLICATION (ephy_shell), NULL, NULL);
+ g_application_register (G_APPLICATION (ephy_shell_get_default ()), NULL, NULL);
g_test_add_func ("/src/ephy-session/load",
test_ephy_session_load);
@@ -268,7 +268,7 @@ main (int argc, char *argv[])
ret = g_test_run ();
- g_object_unref (ephy_shell);
+ g_object_unref (ephy_shell_get_default ());
ephy_file_helpers_shutdown ();
return ret;
diff --git a/tests/ephy-shell-test.c b/tests/ephy-shell-test.c
index 1f4a65a22..a0b0c4115 100644
--- a/tests/ephy-shell-test.c
+++ b/tests/ephy-shell-test.c
@@ -40,6 +40,7 @@
static void
test_ephy_shell_basic_embeds (void)
{
+ EphyShell *ephy_shell;
GtkWidget *window;
EphyEmbed *embed1;
@@ -47,6 +48,8 @@ test_ephy_shell_basic_embeds (void)
GList *children;
+ ephy_shell = ephy_shell_get_default ();
+
/* Both embed and window should be created. */
embed1 = ephy_shell_new_tab_full
(ephy_shell,
@@ -89,10 +92,12 @@ test_ephy_shell_basic_embeds (void)
static void
test_ephy_shell_parent_windows (void)
{
+ EphyShell *ephy_shell;
GtkWidget *window;
GtkWidget *window2;
EphyEmbed *embed;
+ ephy_shell = ephy_shell_get_default ();
window = GTK_WIDGET (ephy_window_new ());
/* parent-window provided */
@@ -134,10 +139,12 @@ test_ephy_shell_parent_windows (void)
static void
test_ephy_shell_tab_load (void)
{
+ EphyShell *ephy_shell;
GtkWidget *window;
EphyEmbed *embed;
EphyWebView *view;
+ ephy_shell = ephy_shell_get_default ();
window = GTK_WIDGET (ephy_window_new ());
/* homepage is "about:blank" for now, see embed/ephy-web-view.c */
@@ -174,6 +181,7 @@ get_notebook_page_num (GtkWidget *notebook, EphyEmbed *embed)
static void
test_ephy_shell_tab_append (void)
{
+ EphyShell *ephy_shell;
GtkWidget *window;
GtkWidget *notebook;
@@ -183,6 +191,7 @@ test_ephy_shell_tab_append (void)
EphyEmbed *embed4;
EphyEmbed *embed5;
+ ephy_shell = ephy_shell_get_default ();
window = GTK_WIDGET (ephy_window_new ());
notebook = ephy_window_get_notebook (EPHY_WINDOW (window));
@@ -222,6 +231,7 @@ test_ephy_shell_tab_append (void)
static void
test_ephy_shell_tab_from_external (void)
{
+ EphyShell *ephy_shell;
GtkWidget *window;
GtkWidget *notebook;
@@ -231,6 +241,7 @@ test_ephy_shell_tab_from_external (void)
EphyEmbed *embed4;
EphyEmbed *embed5;
+ ephy_shell = ephy_shell_get_default ();
embed = ephy_shell_new_tab (ephy_shell, NULL, NULL, "about:epiphany",
EPHY_NEW_TAB_DONT_SHOW_WINDOW | EPHY_NEW_TAB_OPEN_PAGE);
window = gtk_widget_get_toplevel (GTK_WIDGET (embed));
@@ -285,6 +296,7 @@ test_ephy_shell_tab_from_external (void)
static void
test_ephy_shell_tab_no_history (void)
{
+ EphyShell *ephy_shell;
GtkWidget *window;
EphyEmbed *embed;
@@ -297,6 +309,7 @@ test_ephy_shell_tab_no_history (void)
WebKitWebBackForwardList *bflist;
WebKitWebHistoryItem *item;
+ ephy_shell = ephy_shell_get_default ();
embed = ephy_shell_new_tab (ephy_shell, NULL, NULL, NULL,
EPHY_NEW_TAB_DONT_SHOW_WINDOW);
window = gtk_widget_get_toplevel (GTK_WIDGET (embed));
@@ -345,7 +358,7 @@ main (int argc, char *argv[])
}
_ephy_shell_create_instance (EPHY_EMBED_SHELL_MODE_TEST);
- g_application_register (G_APPLICATION (ephy_shell), NULL, NULL);
+ g_application_register (G_APPLICATION (ephy_shell_get_default ()), NULL, NULL);
g_test_add_func ("/src/ephy-shell/basic_embeds",
test_ephy_shell_basic_embeds);
@@ -367,7 +380,7 @@ main (int argc, char *argv[])
ret = g_test_run ();
- g_object_unref (ephy_shell);
+ g_object_unref (ephy_shell_get_default ());
ephy_file_helpers_shutdown ();
return ret;
diff --git a/tests/ephy-web-view-test.c b/tests/ephy-web-view-test.c
index c26fa407d..b95aac0c8 100644
--- a/tests/ephy-web-view-test.c
+++ b/tests/ephy-web-view-test.c
@@ -475,7 +475,7 @@ main (int argc, char *argv[])
ret = g_test_run ();
g_object_unref (server);
- g_object_unref (ephy_shell);
+ g_object_unref (ephy_shell_get_default ());
ephy_file_helpers_shutdown ();
return ret;