diff options
10 files changed, 0 insertions, 1044 deletions
diff --git a/gdata/tests/Makefile.am b/gdata/tests/Makefile.am index 94482c4a..3637e60f 100644 --- a/gdata/tests/Makefile.am +++ b/gdata/tests/Makefile.am @@ -55,7 +55,6 @@ test_programs = \ tasks \ perf \ authorization \ - client-login-authorizer \ oauth1-authorizer \ oauth2-authorizer \ streams \ @@ -115,15 +114,6 @@ dist_test_data = \ traces/calendar/teardown-temp-calendar \ traces/calendar/teardown-temp-calendar-acls \ \ - traces/client-login-authorizer/client-login-authorizer-authenticate-async \ - traces/client-login-authorizer/client-login-authorizer-authenticate-async-cancellation \ - traces/client-login-authorizer/client-login-authorizer-authenticate-async-multiple-domains \ - traces/client-login-authorizer/client-login-authorizer-authenticate-sync \ - traces/client-login-authorizer/client-login-authorizer-authenticate-sync-bad-password \ - traces/client-login-authorizer/client-login-authorizer-authenticate-sync-cancellation \ - traces/client-login-authorizer/client-login-authorizer-authenticate-sync-multiple-domains \ - traces/client-login-authorizer/setup-client-login-authorizer-data-authenticated \ - \ traces/contacts/authentication \ traces/contacts/authentication-async \ traces/contacts/authentication-async-cancellation \ diff --git a/gdata/tests/client-login-authorizer.c b/gdata/tests/client-login-authorizer.c deleted file mode 100644 index 1f40dfaa..00000000 --- a/gdata/tests/client-login-authorizer.c +++ /dev/null @@ -1,820 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* - * GData Client - * Copyright (C) Philip Withnall 2011 <philip@tecnocode.co.uk> - * - * GData Client is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * GData Client 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with GData Client. If not, see <http://www.gnu.org/licenses/>. - */ - -#include <glib.h> -#include <gdata/gdata.h> - -#include "common.h" - -static GThread *main_thread = NULL; -static UhmServer *mock_server = NULL; - -static void -test_client_login_authorizer_constructor (void) -{ - GDataClientLoginAuthorizer *authorizer; - - authorizer = gdata_client_login_authorizer_new ("client-id", GDATA_TYPE_YOUTUBE_SERVICE); - - g_assert (authorizer != NULL); - g_assert (GDATA_IS_CLIENT_LOGIN_AUTHORIZER (authorizer)); - g_assert (GDATA_IS_AUTHORIZER (authorizer)); - - g_object_unref (authorizer); -} - -static void -test_client_login_authorizer_constructor_for_domains (void) -{ - GDataClientLoginAuthorizer *authorizer; - GDataAuthorizationDomain *domain; - GList *domains; - - /* Try with standard domains first */ - domains = gdata_service_get_authorization_domains (GDATA_TYPE_YOUTUBE_SERVICE); - authorizer = gdata_client_login_authorizer_new_for_authorization_domains ("client-id", domains); - g_list_free (domains); - - g_assert (authorizer != NULL); - g_assert (GDATA_IS_CLIENT_LOGIN_AUTHORIZER (authorizer)); - g_assert (GDATA_IS_AUTHORIZER (authorizer)); - - g_object_unref (authorizer); - - /* Try again with a custom domain. Note that, as in test_authorization_domain_properties() this should not normally happen in client code. */ - domain = GDATA_AUTHORIZATION_DOMAIN (g_object_new (GDATA_TYPE_AUTHORIZATION_DOMAIN, - "service-name", "test", - "scope", "test", - NULL)); - - domains = g_list_prepend (NULL, domain); - authorizer = gdata_client_login_authorizer_new_for_authorization_domains ("client-id", domains); - g_list_free (domains); - - g_assert (authorizer != NULL); - g_assert (GDATA_IS_CLIENT_LOGIN_AUTHORIZER (authorizer)); - g_assert (GDATA_IS_AUTHORIZER (authorizer)); - - g_object_unref (authorizer); - g_object_unref (domain); -} - -typedef struct { - GDataClientLoginAuthorizer *authorizer; - - guint proxy_resolver_notification_count; - gulong proxy_resolver_signal_handler; - guint timeout_notification_count; - gulong timeout_signal_handler; - guint username_notification_count; - gulong username_signal_handler; - guint password_notification_count; - gulong password_signal_handler; -} ClientLoginAuthorizerData; - -/* Used to count that exactly the right number of notify signals are emitted when setting properties */ -static void -notify_cb (GObject *object, GParamSpec *pspec, guint *notification_count) -{ - /* Check we're running in the main thread */ - g_assert (g_thread_self () == main_thread); - - /* Increment the notification count */ - *notification_count = *notification_count + 1; -} - -static void -connect_to_client_login_authorizer (ClientLoginAuthorizerData *data) -{ - /* Connect to notifications from the object to verify they're only emitted the correct number of times */ - data->proxy_resolver_signal_handler = g_signal_connect (data->authorizer, "notify::proxy-resolver", (GCallback) notify_cb, - &(data->proxy_resolver_notification_count)); - data->timeout_signal_handler = g_signal_connect (data->authorizer, "notify::timeout", (GCallback) notify_cb, - &(data->timeout_notification_count)); - data->username_signal_handler = g_signal_connect (data->authorizer, "notify::username", (GCallback) notify_cb, - &(data->username_notification_count)); - data->password_signal_handler = g_signal_connect (data->authorizer, "notify::password", (GCallback) notify_cb, - &(data->password_notification_count)); -} - -static void -set_up_client_login_authorizer_data (ClientLoginAuthorizerData *data, gconstpointer user_data) -{ - data->authorizer = gdata_client_login_authorizer_new ("client-id", GDATA_TYPE_YOUTUBE_SERVICE); - connect_to_client_login_authorizer (data); -} - -static void -set_up_client_login_authorizer_data_multiple_domains (ClientLoginAuthorizerData *data, gconstpointer user_data) -{ - GList *authorization_domains = NULL; - - authorization_domains = g_list_prepend (authorization_domains, gdata_youtube_service_get_primary_authorization_domain ()); - authorization_domains = g_list_prepend (authorization_domains, gdata_picasaweb_service_get_primary_authorization_domain ()); - data->authorizer = gdata_client_login_authorizer_new_for_authorization_domains ("client-id", authorization_domains); - g_list_free (authorization_domains); - - connect_to_client_login_authorizer (data); -} - -static void -set_up_client_login_authorizer_data_authenticated (ClientLoginAuthorizerData *data, gconstpointer user_data) -{ - gdata_test_mock_server_start_trace (mock_server, "setup-client-login-authorizer-data-authenticated"); - - data->authorizer = gdata_client_login_authorizer_new ("client-id", GDATA_TYPE_YOUTUBE_SERVICE); - g_assert (gdata_client_login_authorizer_authenticate (data->authorizer, USERNAME, PASSWORD, NULL, NULL) == TRUE); - connect_to_client_login_authorizer (data); - - uhm_server_end_trace (mock_server); -} - -static void -tear_down_client_login_authorizer_data (ClientLoginAuthorizerData *data, gconstpointer user_data) -{ - /* Clean up signal handlers */ - g_signal_handler_disconnect (data->authorizer, data->password_signal_handler); - g_signal_handler_disconnect (data->authorizer, data->username_signal_handler); - g_signal_handler_disconnect (data->authorizer, data->timeout_signal_handler); - g_signal_handler_disconnect (data->authorizer, data->proxy_resolver_signal_handler); - - g_object_unref (data->authorizer); -} - -/* Test getting and setting the client-id property */ -static void -test_client_login_authorizer_properties_client_id (ClientLoginAuthorizerData *data, gconstpointer user_data) -{ - gchar *client_id; - - /* Verifying the normal state of the property in a newly-constructed instance of GDataClientLoginAuthorizer */ - g_assert_cmpstr (gdata_client_login_authorizer_get_client_id (data->authorizer), ==, "client-id"); - - g_object_get (data->authorizer, "client-id", &client_id, NULL); - g_assert_cmpstr (client_id, ==, "client-id"); - g_free (client_id); -} - -/* Test getting and setting the username property */ -static void -test_client_login_authorizer_properties_username (ClientLoginAuthorizerData *data, gconstpointer user_data) -{ - gchar *username; - - /* Verifying the normal state of the property in a newly-constructed instance of GDataClientLoginAuthorizer */ - g_assert (gdata_client_login_authorizer_get_username (data->authorizer) == NULL); - - g_object_get (data->authorizer, "username", &username, NULL); - g_assert (username == NULL); - g_free (username); -} - -/* Test getting and setting the password property */ -static void -test_client_login_authorizer_properties_password (ClientLoginAuthorizerData *data, gconstpointer user_data) -{ - gchar *password; - - /* Verifying the normal state of the property in a newly-constructed instance of GDataClientLoginAuthorizer */ - g_assert (gdata_client_login_authorizer_get_password (data->authorizer) == NULL); - - g_object_get (data->authorizer, "password", &password, NULL); - g_assert (password == NULL); - g_free (password); -} - -/* Test getting and setting the proxy-resolver property */ -static void -test_client_login_authorizer_properties_proxy_resolver (ClientLoginAuthorizerData *data, gconstpointer user_data) -{ - GProxyResolver *old_proxy_resolver, *proxy_resolver, *new_proxy_resolver; - - /* Verifying the normal state of the property in a newly-constructed instance of GDataClientLoginAuthorizer. - * Since the resolver comes from the SoupSession, we don’t know whether it’s initially NULL. */ - old_proxy_resolver = gdata_client_login_authorizer_get_proxy_resolver (data->authorizer); - - g_object_get (data->authorizer, "proxy-resolver", &proxy_resolver, NULL); - g_assert (proxy_resolver == old_proxy_resolver); - - g_assert_cmpuint (data->proxy_resolver_notification_count, ==, 0); - - /* Check setting it works and emits a notification */ - new_proxy_resolver = g_object_ref (g_proxy_resolver_get_default ()); - gdata_client_login_authorizer_set_proxy_resolver (data->authorizer, new_proxy_resolver); - - g_assert_cmpuint (data->proxy_resolver_notification_count, ==, 1); - - g_assert (gdata_client_login_authorizer_get_proxy_resolver (data->authorizer) != NULL); - g_assert (gdata_client_login_authorizer_get_proxy_resolver (data->authorizer) == new_proxy_resolver); - - g_object_get (data->authorizer, "proxy-resolver", &proxy_resolver, NULL); - g_assert (proxy_resolver != NULL); - g_assert (gdata_client_login_authorizer_get_proxy_resolver (data->authorizer) == new_proxy_resolver); - g_object_unref (proxy_resolver); - - g_object_unref (new_proxy_resolver); - - /* Check setting it to NULL works */ - gdata_client_login_authorizer_set_proxy_resolver (data->authorizer, NULL); - - g_assert_cmpuint (data->proxy_resolver_notification_count, ==, 2); - - g_assert (gdata_client_login_authorizer_get_proxy_resolver (data->authorizer) == NULL); - - g_object_get (data->authorizer, "proxy-resolver", &proxy_resolver, NULL); - g_assert (proxy_resolver == NULL); - - /* Test that setting it using g_object_set() works */ - new_proxy_resolver = g_object_ref (g_proxy_resolver_get_default ()); - g_object_set (data->authorizer, "proxy-resolver", new_proxy_resolver, NULL); - g_object_unref (new_proxy_resolver); - - g_assert (gdata_client_login_authorizer_get_proxy_resolver (data->authorizer) != NULL); -} - -/* Test getting and setting the timeout property */ -static void -test_client_login_authorizer_properties_timeout (ClientLoginAuthorizerData *data, gconstpointer user_data) -{ - guint timeout; - - /* Verifying the normal state of the property in a newly-constructed instance of GDataClientLoginAuthorizer */ - g_assert_cmpuint (gdata_client_login_authorizer_get_timeout (data->authorizer), ==, 0); - - g_object_get (data->authorizer, "timeout", &timeout, NULL); - g_assert_cmpuint (timeout, ==, 0); - - g_assert_cmpuint (data->timeout_notification_count, ==, 0); - - /* Check setting it works and emits a notification */ - gdata_client_login_authorizer_set_timeout (data->authorizer, 30); - - g_assert_cmpuint (data->timeout_notification_count, ==, 1); - - g_assert_cmpuint (gdata_client_login_authorizer_get_timeout (data->authorizer), ==, 30); - - g_object_get (data->authorizer, "timeout", &timeout, NULL); - g_assert_cmpuint (timeout, ==, 30); - - /* Check setting it back to 0 works */ - gdata_client_login_authorizer_set_timeout (data->authorizer, 0); - - g_assert_cmpuint (data->timeout_notification_count, ==, 2); - - g_assert_cmpuint (gdata_client_login_authorizer_get_timeout (data->authorizer), ==, 0); - - g_object_get (data->authorizer, "timeout", &timeout, NULL); - g_assert_cmpuint (timeout, ==, 0); - - /* Test that setting it using g_object_set() works */ - g_object_set (data->authorizer, "timeout", 15, NULL); - g_assert_cmpuint (gdata_client_login_authorizer_get_timeout (data->authorizer), ==, 15); -} - -/* Standard tests for pre-authentication in sync and async tests with single or multiple domains */ -static void -pre_test_authentication (ClientLoginAuthorizerData *data) -{ - /* Check we're not already authorised any domains */ - g_assert (gdata_authorizer_is_authorized_for_domain (GDATA_AUTHORIZER (data->authorizer), - gdata_youtube_service_get_primary_authorization_domain ()) == FALSE); - g_assert (gdata_authorizer_is_authorized_for_domain (GDATA_AUTHORIZER (data->authorizer), - gdata_picasaweb_service_get_primary_authorization_domain ()) == FALSE); - - g_assert_cmpuint (data->username_notification_count, ==, 0); - g_assert_cmpuint (data->password_notification_count, ==, 0); -} - -/* Standard tests for post-authentication (successful or not controlled by @authorized) in sync tests with single domains */ -static void -post_test_authentication (ClientLoginAuthorizerData *data, gboolean authorized) -{ - /* Are we authorised now? */ - g_assert (gdata_authorizer_is_authorized_for_domain (GDATA_AUTHORIZER (data->authorizer), - gdata_youtube_service_get_primary_authorization_domain ()) == authorized); - - g_assert_cmpuint (data->username_notification_count, ==, 1); - g_assert_cmpuint (data->password_notification_count, ==, 1); - - if (authorized == TRUE) { - /* Check the username and password were set correctly. Note that we always assert that the domain name is present in the username. */ - g_assert_cmpstr (gdata_client_login_authorizer_get_username (data->authorizer), ==, USERNAME); - g_assert_cmpstr (gdata_client_login_authorizer_get_password (data->authorizer), ==, PASSWORD); - } else { - /* Check the username and password are *not* set. */ - g_assert (gdata_client_login_authorizer_get_username (data->authorizer) == NULL); - g_assert (gdata_client_login_authorizer_get_password (data->authorizer) == NULL); - } -} - -/* Test that synchronous authentication against a single authorization domains succeeds */ -static void -test_client_login_authorizer_authenticate_sync (ClientLoginAuthorizerData *data, gconstpointer _username) -{ - const gchar *username = (const gchar*) _username; - gboolean success; - GError *error = NULL; - - gdata_test_mock_server_start_trace (mock_server, "client-login-authorizer-authenticate-sync"); - - pre_test_authentication (data); - - /* Authenticate! */ - success = gdata_client_login_authorizer_authenticate (data->authorizer, username, PASSWORD, NULL, &error); - g_assert_no_error (error); - g_assert (success == TRUE); - g_clear_error (&error); - - post_test_authentication (data, TRUE); - - uhm_server_end_trace (mock_server); -} - -/* Test that authentication using an incorrect password fails */ -static void -test_client_login_authorizer_authenticate_sync_bad_password (ClientLoginAuthorizerData *data, gconstpointer _username) -{ - const gchar *username = (const gchar*) _username; - gboolean success; - GError *error = NULL; - - gdata_test_mock_server_start_trace (mock_server, "client-login-authorizer-authenticate-sync-bad-password"); - - pre_test_authentication (data); - - /* Authenticate! */ - success = gdata_client_login_authorizer_authenticate (data->authorizer, username, INCORRECT_PASSWORD, NULL, &error); - g_assert_error (error, GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR, GDATA_CLIENT_LOGIN_AUTHORIZER_ERROR_BAD_AUTHENTICATION); - g_assert (success == FALSE); - g_clear_error (&error); - - post_test_authentication (data, FALSE); - - uhm_server_end_trace (mock_server); -} - -/* Test that authentication against multiple authorization domains simultaneously and synchronously works */ -static void -test_client_login_authorizer_authenticate_sync_multiple_domains (ClientLoginAuthorizerData *data, gconstpointer user_data) -{ - gboolean success; - GError *error = NULL; - - gdata_test_mock_server_start_trace (mock_server, "client-login-authorizer-authenticate-sync-multiple-domains"); - - pre_test_authentication (data); - - /* Authenticate! */ - success = gdata_client_login_authorizer_authenticate (data->authorizer, USERNAME, PASSWORD, NULL, &error); - g_assert_no_error (error); - g_assert (success == TRUE); - g_clear_error (&error); - - /* Are we authorised in the second domain now? */ - g_assert (gdata_authorizer_is_authorized_for_domain (GDATA_AUTHORIZER (data->authorizer), - gdata_picasaweb_service_get_primary_authorization_domain ()) == TRUE); - - post_test_authentication (data, TRUE); - - uhm_server_end_trace (mock_server); -} - -/* Test that synchronous authentication can be cancelled */ -static void -test_client_login_authorizer_authenticate_sync_cancellation (ClientLoginAuthorizerData *data, gconstpointer user_data) -{ - gboolean success; - GCancellable *cancellable; - GError *error = NULL; - - gdata_test_mock_server_start_trace (mock_server, "client-login-authorizer-authenticate-sync-cancellation"); - - pre_test_authentication (data); - - /* Set up the cancellable */ - cancellable = g_cancellable_new (); - - /* Authenticate! This should return immediately as the cancellable was cancelled beforehand. */ - g_cancellable_cancel (cancellable); - success = gdata_client_login_authorizer_authenticate (data->authorizer, USERNAME, PASSWORD, cancellable, &error); - g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CANCELLED); - g_assert (success == FALSE); - g_clear_error (&error); - - post_test_authentication (data, FALSE); - - g_object_unref (cancellable); - - uhm_server_end_trace (mock_server); -} - -typedef struct { - ClientLoginAuthorizerData parent; - GMainLoop *main_loop; -} ClientLoginAuthorizerAsyncData; - -static void -set_up_client_login_authorizer_async_data (ClientLoginAuthorizerAsyncData *data, gconstpointer user_data) -{ - /* Chain up */ - set_up_client_login_authorizer_data ((ClientLoginAuthorizerData*) data, user_data); - - /* Set up the main loop */ - data->main_loop = g_main_loop_new (NULL, FALSE); -} - -static void -set_up_client_login_authorizer_async_data_multiple_domains (ClientLoginAuthorizerAsyncData *data, gconstpointer user_data) -{ - /* Chain up */ - set_up_client_login_authorizer_data_multiple_domains ((ClientLoginAuthorizerData*) data, user_data); - - /* Set up the main loop */ - data->main_loop = g_main_loop_new (NULL, FALSE); -} - -static void -tear_down_client_login_authorizer_async_data (ClientLoginAuthorizerAsyncData *data, gconstpointer user_data) -{ - g_main_loop_unref (data->main_loop); - - /* Chain up */ - tear_down_client_login_authorizer_data ((ClientLoginAuthorizerData*) data, user_data); -} - -/* Standard tests for post-authentication (successful or not controlled by @authorized) in async tests with single domains */ -static void -post_test_authentication_async (ClientLoginAuthorizerAsyncData *data, gboolean authorized) -{ - /* Spin on the notification counts being incremented */ - while (data->parent.username_notification_count == 0 || data->parent.password_notification_count == 0) { - g_main_context_iteration (g_main_loop_get_context (data->main_loop), FALSE); - } - - post_test_authentication ((ClientLoginAuthorizerData*) data, authorized); -} - -static void -test_client_login_authorizer_authenticate_async_cb (GDataClientLoginAuthorizer *authorizer, GAsyncResult *async_result, - ClientLoginAuthorizerAsyncData *data) -{ - gboolean success; - GError *error = NULL; - - success = gdata_client_login_authorizer_authenticate_finish (authorizer, async_result, &error); - g_assert_no_error (error); - g_assert (success == TRUE); - g_clear_error (&error); - - post_test_authentication_async (data, TRUE); - - g_main_loop_quit (data->main_loop); -} - -/* Test that asynchronous authentication against a single authorization domain works */ -static void -test_client_login_authorizer_authenticate_async (ClientLoginAuthorizerAsyncData *data, gconstpointer user_data) -{ - gdata_test_mock_server_start_trace (mock_server, "client-login-authorizer-authenticate-async"); - - pre_test_authentication ((ClientLoginAuthorizerData*) data); - - /* Create a main loop and authenticate */ - gdata_client_login_authorizer_authenticate_async (data->parent.authorizer, USERNAME, PASSWORD, NULL, - (GAsyncReadyCallback) test_client_login_authorizer_authenticate_async_cb, data); - - g_main_loop_run (data->main_loop); - - uhm_server_end_trace (mock_server); -} - -static void -test_client_login_authorizer_authenticate_async_multiple_domains_cb (GDataClientLoginAuthorizer *authorizer, GAsyncResult *async_result, - ClientLoginAuthorizerAsyncData *data) -{ - gboolean success; - GError *error = NULL; - - success = gdata_client_login_authorizer_authenticate_finish (authorizer, async_result, &error); - g_assert_no_error (error); - g_assert (success == TRUE); - g_clear_error (&error); - - /* Assert that we're now authorised in the second domain */ - g_assert (gdata_authorizer_is_authorized_for_domain (GDATA_AUTHORIZER (authorizer), - gdata_picasaweb_service_get_primary_authorization_domain ()) == TRUE); - - post_test_authentication_async (data, TRUE); - - g_main_loop_quit (data->main_loop); -} - -/* Test that authentication against multiple authorization domains simultaneously and asynchronously works */ -static void -test_client_login_authorizer_authenticate_async_multiple_domains (ClientLoginAuthorizerAsyncData *data, gconstpointer user_data) -{ - gdata_test_mock_server_start_trace (mock_server, "client-login-authorizer-authenticate-async-multiple-domains"); - - pre_test_authentication ((ClientLoginAuthorizerData*) data); - - /* Create a main loop and authenticate */ - gdata_client_login_authorizer_authenticate_async (data->parent.authorizer, USERNAME, PASSWORD, NULL, - (GAsyncReadyCallback) test_client_login_authorizer_authenticate_async_multiple_domains_cb, - data); - - g_main_loop_run (data->main_loop); - - uhm_server_end_trace (mock_server); -} - -static void -test_client_login_authorizer_authenticate_async_cancellation_cb (GDataClientLoginAuthorizer *authorizer, GAsyncResult *async_result, - ClientLoginAuthorizerAsyncData *data) -{ - gboolean success; - GError *error = NULL; - - success = gdata_client_login_authorizer_authenticate_finish (authorizer, async_result, &error); - g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CANCELLED); - g_assert (success == FALSE); - g_clear_error (&error); - - post_test_authentication_async (data, FALSE); - - g_main_loop_quit (data->main_loop); -} - -/* Test that cancellation of asynchronous authentication works */ -static void -test_client_login_authorizer_authenticate_async_cancellation (ClientLoginAuthorizerAsyncData *data, gconstpointer user_data) -{ - GCancellable *cancellable; - - gdata_test_mock_server_start_trace (mock_server, "client-login-authorizer-authenticate-async-cancellation"); - - pre_test_authentication ((ClientLoginAuthorizerData*) data); - - /* Set up the cancellable */ - cancellable = g_cancellable_new (); - - /* Create a main loop and authenticate */ - gdata_client_login_authorizer_authenticate_async (data->parent.authorizer, USERNAME, PASSWORD, cancellable, - (GAsyncReadyCallback) test_client_login_authorizer_authenticate_async_cancellation_cb, - data); - g_cancellable_cancel (cancellable); - - g_main_loop_run (data->main_loop); - - g_object_unref (cancellable); - - uhm_server_end_trace (mock_server); -} - -/* Test that gdata_authorizer_refresh_authorization() is a no-op (when authorised or not) */ -static void -test_client_login_authorizer_refresh_authorization (ClientLoginAuthorizerData *data, gconstpointer user_data) -{ - GError *error = NULL; - - g_assert (gdata_authorizer_refresh_authorization (GDATA_AUTHORIZER (data->authorizer), NULL, &error) == FALSE); - g_assert_no_error (error); - g_clear_error (&error); -} - -/* Test that processing a request with a NULL domain will not change the request. */ -static void -test_client_login_authorizer_process_request_null (ClientLoginAuthorizerData *data, gconstpointer user_data) -{ - SoupMessage *message; - SoupMessageHeadersIter iter; - guint header_count = 0; - const gchar *name, *value; - - /* Create a new message with an empty set of request headers */ - message = soup_message_new (SOUP_METHOD_GET, "https://example.com/"); - - /* Process the message */ - gdata_authorizer_process_request (GDATA_AUTHORIZER (data->authorizer), NULL, message); - - /* Check that the set of request headers is still empty */ - soup_message_headers_iter_init (&iter, message->request_headers); - - while (soup_message_headers_iter_next (&iter, &name, &value) == TRUE) { - header_count++; - } - - g_assert_cmpuint (header_count, ==, 0); - - g_object_unref (message); -} - -/* Test that processing a request with an authorizer which hasn't been authenticated yet will not change the request. */ -static void -test_client_login_authorizer_process_request_unauthenticated (ClientLoginAuthorizerData *data, gconstpointer user_data) -{ - SoupMessage *message; - SoupMessageHeadersIter iter; - guint header_count = 0; - const gchar *name, *value; - - /* Create a new message with an empty set of request headers */ - message = soup_message_new (SOUP_METHOD_GET, "https://example.com/"); - - /* Process the message */ - gdata_authorizer_process_request (GDATA_AUTHORIZER (data->authorizer), gdata_youtube_service_get_primary_authorization_domain (), message); - - /* Check that the set of request headers is still empty */ - soup_message_headers_iter_init (&iter, message->request_headers); - - while (soup_message_headers_iter_next (&iter, &name, &value) == TRUE) { - header_count++; - } - - g_assert_cmpuint (header_count, ==, 0); - - g_object_unref (message); -} - -/* Test that processing a request with an authorizer which has been authenticated will change the request. */ -static void -test_client_login_authorizer_process_request_authenticated (ClientLoginAuthorizerData *data, gconstpointer user_data) -{ - SoupMessage *message; - SoupMessageHeadersIter iter; - guint header_count = 0; - const gchar *name, *value; - - /* Create a new message with an empty set of request headers */ - message = soup_message_new (SOUP_METHOD_GET, "https://example.com/"); - - /* Process the message */ - gdata_authorizer_process_request (GDATA_AUTHORIZER (data->authorizer), gdata_youtube_service_get_primary_authorization_domain (), message); - - /* Check that at least one new header has been set */ - soup_message_headers_iter_init (&iter, message->request_headers); - - while (soup_message_headers_iter_next (&iter, &name, &value) == TRUE) { - header_count++; - } - - g_assert_cmpuint (header_count, >, 0); - - g_object_unref (message); -} - -static void -test_client_login_authorizer_process_request_insecure_subprocess (ClientLoginAuthorizerData *data, gconstpointer user_data) -{ - SoupMessage *message; - - /* Create a new message which uses HTTP instead of HTTPS */ - message = soup_message_new (SOUP_METHOD_GET, "http://example.com/"); - gdata_authorizer_process_request (GDATA_AUTHORIZER (data->authorizer), gdata_youtube_service_get_primary_authorization_domain (), - message); - g_object_unref (message); -} - -/* Test that processing a HTTP request (as opposed to the more normal HTTPS request) with an authenticated authorizer will abort rather than - * transmitting the user's private auth token over an insecure HTTP connection. */ -static void -test_client_login_authorizer_process_request_insecure (ClientLoginAuthorizerData *data, gconstpointer user_data) -{ - /* Process the message */ -#if GLIB_CHECK_VERSION(2, 38, 0) - g_test_trap_subprocess ("/client-login-authorizer/process-request/insecure/subprocess", 0, 0); -#else - if (g_test_trap_fork (0, 0) == TRUE) { - test_client_login_authorizer_process_request_insecure_subprocess (data, user_data); - exit (0); - } -#endif - - /* Assert that it aborted */ - g_test_trap_assert_failed (); - g_test_trap_assert_stderr_unmatched ("Not authorizing a non-HTTPS message with the user's ClientLogin " - "auth token as the connection isn't secure."); -} - -static void -mock_server_notify_resolver_cb (GObject *object, GParamSpec *pspec, gpointer user_data) -{ - UhmServer *server; - UhmResolver *resolver; - - server = UHM_SERVER (object); - - /* Set up the expected domain names here. This should technically be split up between - * the different unit test suites, but that's too much effort. */ - resolver = uhm_server_get_resolver (server); - - if (resolver != NULL) { - const gchar *ip_address = uhm_server_get_address (server); - - uhm_resolver_add_A (resolver, "www.google.com", ip_address); - } -} - -int -main (int argc, char *argv[]) -{ - GFile *trace_directory; - gchar *path = NULL; - - gdata_test_init (argc, argv); - - mock_server = gdata_test_get_mock_server (); - g_signal_connect (G_OBJECT (mock_server), "notify::resolver", (GCallback) mock_server_notify_resolver_cb, NULL); - path = g_test_build_filename (G_TEST_DIST, "traces/client-login-authorizer", NULL); - trace_directory = g_file_new_for_path (path); - g_free (path); - uhm_server_set_trace_directory (mock_server, trace_directory); - g_object_unref (trace_directory); - - main_thread = g_thread_self (); - - g_test_add_func ("/client-login-authorizer/constructor", test_client_login_authorizer_constructor); - g_test_add_func ("/client-login-authorizer/constructor/for-domains", test_client_login_authorizer_constructor_for_domains); - - g_test_add ("/client-login-authorizer/properties/client-id", ClientLoginAuthorizerData, NULL, set_up_client_login_authorizer_data, - test_client_login_authorizer_properties_client_id, tear_down_client_login_authorizer_data); - g_test_add ("/client-login-authorizer/properties/username", ClientLoginAuthorizerData, NULL, set_up_client_login_authorizer_data, - test_client_login_authorizer_properties_username, tear_down_client_login_authorizer_data); - g_test_add ("/client-login-authorizer/properties/password", ClientLoginAuthorizerData, NULL, set_up_client_login_authorizer_data, - test_client_login_authorizer_properties_password, tear_down_client_login_authorizer_data); - g_test_add ("/client-login-authorizer/properties/proxy-resolver", ClientLoginAuthorizerData, NULL, set_up_client_login_authorizer_data, - test_client_login_authorizer_properties_proxy_resolver, tear_down_client_login_authorizer_data); - g_test_add ("/client-login-authorizer/properties/timeout", ClientLoginAuthorizerData, NULL, set_up_client_login_authorizer_data, - test_client_login_authorizer_properties_timeout, tear_down_client_login_authorizer_data); - - g_test_add ("/client-login-authorizer/refresh-authorization/unauthenticated", ClientLoginAuthorizerData, NULL, - set_up_client_login_authorizer_data, test_client_login_authorizer_refresh_authorization, - tear_down_client_login_authorizer_data); - - g_test_add ("/client-login-authorizer/process-request/null", ClientLoginAuthorizerData, NULL, - set_up_client_login_authorizer_data, test_client_login_authorizer_process_request_null, tear_down_client_login_authorizer_data); - g_test_add ("/client-login-authorizer/process-request/unauthenticated", ClientLoginAuthorizerData, NULL, - set_up_client_login_authorizer_data, test_client_login_authorizer_process_request_unauthenticated, - tear_down_client_login_authorizer_data); - - /* Test once with the domain attached and once without */ - g_test_add ("/client-login-authorizer/authenticate/sync", ClientLoginAuthorizerData, USERNAME, set_up_client_login_authorizer_data, - test_client_login_authorizer_authenticate_sync, tear_down_client_login_authorizer_data); - g_test_add ("/client-login-authorizer/authenticate/sync/no-domain", ClientLoginAuthorizerData, USERNAME_NO_DOMAIN, - set_up_client_login_authorizer_data, test_client_login_authorizer_authenticate_sync, - tear_down_client_login_authorizer_data); - g_test_add ("/client-login-authorizer/authenticate/sync/bad-password", ClientLoginAuthorizerData, USERNAME, - set_up_client_login_authorizer_data, test_client_login_authorizer_authenticate_sync_bad_password, - tear_down_client_login_authorizer_data); - g_test_add ("/client-login-authorizer/authenticate/sync/multiple-domains", ClientLoginAuthorizerData, NULL, - set_up_client_login_authorizer_data_multiple_domains, test_client_login_authorizer_authenticate_sync_multiple_domains, - tear_down_client_login_authorizer_data); - g_test_add ("/client-login-authorizer/authenticate/sync/cancellation", ClientLoginAuthorizerData, NULL, - set_up_client_login_authorizer_data, test_client_login_authorizer_authenticate_sync_cancellation, - tear_down_client_login_authorizer_data); - - /* Async tests */ - g_test_add ("/client-login-authorizer/authenticate/async", ClientLoginAuthorizerAsyncData, NULL, - set_up_client_login_authorizer_async_data, test_client_login_authorizer_authenticate_async, - tear_down_client_login_authorizer_async_data); - g_test_add ("/client-login-authorizer/authenticate/async/multiple-domains", ClientLoginAuthorizerAsyncData, NULL, - set_up_client_login_authorizer_async_data_multiple_domains, - test_client_login_authorizer_authenticate_async_multiple_domains, tear_down_client_login_authorizer_async_data); - g_test_add ("/client-login-authorizer/authenticate/async/cancellation", ClientLoginAuthorizerAsyncData, NULL, - set_up_client_login_authorizer_async_data, test_client_login_authorizer_authenticate_async_cancellation, - tear_down_client_login_authorizer_async_data); - - /* Miscellaneous other tests which require authentication */ - g_test_add ("/client-login-authorizer/refresh-authorization/authenticated", ClientLoginAuthorizerData, NULL, - set_up_client_login_authorizer_data_authenticated, test_client_login_authorizer_refresh_authorization, - tear_down_client_login_authorizer_data); - - g_test_add ("/client-login-authorizer/process-request/authenticated", ClientLoginAuthorizerData, NULL, - set_up_client_login_authorizer_data_authenticated, test_client_login_authorizer_process_request_authenticated, - tear_down_client_login_authorizer_data); - g_test_add ("/client-login-authorizer/process-request/insecure", ClientLoginAuthorizerData, NULL, - set_up_client_login_authorizer_data_authenticated, test_client_login_authorizer_process_request_insecure, - tear_down_client_login_authorizer_data); -#if GLIB_CHECK_VERSION(2, 38, 0) - g_test_add ("/client-login-authorizer/process-request/insecure/subprocess", ClientLoginAuthorizerData, NULL, - set_up_client_login_authorizer_data_authenticated, test_client_login_authorizer_process_request_insecure_subprocess, - tear_down_client_login_authorizer_data); -#endif - - return g_test_run (); -} diff --git a/gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-async b/gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-async deleted file mode 100644 index 86bbaf90..00000000 --- a/gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-async +++ /dev/null @@ -1,27 +0,0 @@ -> POST /accounts/ClientLogin HTTP/1.1 -> Soup-Debug-Timestamp: 1375110168 -> Soup-Debug: SoupSession 1 (0x64f4c0), SoupMessage 1 (0x94f680), SoupSocket 1 (0x9736a0) -> Host: www.google.com -> Content-Type: application/x-www-form-urlencoded -> Accept-Encoding: gzip, deflate -> Connection: Keep-Alive -> -> accountType=HOSTED%5FOR%5FGOOGLE&Email=libgdata%2Etest%40gmail%2Ecom&Passwd=gdata%2Dgdata&service=youtube&source=client%2Did - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1375110168 -< Soup-Debug: SoupMessage 1 (0x94f680) -< Content-Type: text/plain -< Cache-control: no-cache, no-store -< Pragma: no-cache -< Expires: Mon, 01-Jan-1990 00:00:00 GMT -< Date: Mon, 29 Jul 2013 15:02:48 GMT -< X-Content-Type-Options: nosniff -< X-XSS-Protection: 1; mode=block -< Content-Length: 881 -< Server: GSE -< -< SID=DQAAAMwAAADmP_tUgWHXHh6NbcApflUSoY1-8C9N1orEKV9DtPUnVb5PKcPiXPnJZsD9MyHZ2Ez-P88hJyhCkaAVPJE17JcTkklWPoKR_czKzlC9zMBmouo0XzVLsIcb1cYf1lsvJxizRKmRqrDwDi3ROuRBfLA0dNKgn4jzNIL3b6RDpJzLRJUoM6BQHYFv5iddFQig5GXoH60BoTLiZy1TjceDtfFRCbEHz0TvY8-FhzqI_T6zNsJugtJ9QJ-2_wA5MVnoK12QXK-3U0eZl3pYudpxCtQ2 -< LSID=DQAAAM8AAAABmiv6l-cKNjg-5_RGZGbQEkV4uJHvNXZJa3CwDdr5FddDXNMA-TBc50Gal5K0LQ7Dh0998X2Smacq1PYDb2GHAbYPfT53XnYvP12ZpYqhzU1rTAY2sYch-N5qhJn4aVbW1JJouqiz4SDRrv8E8xrrkcjiD5RwTCTH0PPii-MEOYauoDZ8KSuaSp5Ac0aZtpQqH1xXhQX1FDQVbbsg2lYidVg5_aDyIrfz29mL7IAH-45rni9naUc2Ssn360wmX6oWlr3_9zCU9SYKjBtdOYAv -< Auth=DQAAAM4AAAABmiv6l-cKNjg-5_RGZGbQEkV4uJHvNXZJa3CwDdr5FddDXNMA-TBc50Gal5K0LQ5yi9X9_zrGCpiq0Xl_xGhOhn8r2wXprLZAi-R9XKAY8Lh7oaZbvNSB1budL8svMXnfpAOv8utorFpOcf-Ikb-ZqtCBEt2dJSFZ5egoy370rLrOl-vQoWuZR_413FEpdd21Cza4gaE2ppkAuPwfMi280t9bxDej6yOvx-xfMEubg_uvrpfUM9jh6u349GgmA3xeyQvZrgYINIHtzOpWHsXL - diff --git a/gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-async-cancellation b/gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-async-cancellation deleted file mode 100644 index e69de29b..00000000 --- a/gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-async-cancellation +++ /dev/null diff --git a/gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-async-multiple-domains b/gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-async-multiple-domains deleted file mode 100644 index 8198cda9..00000000 --- a/gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-async-multiple-domains +++ /dev/null @@ -1,54 +0,0 @@ -> POST /accounts/ClientLogin HTTP/1.1 -> Soup-Debug-Timestamp: 1375110170 -> Soup-Debug: SoupSession 1 (0x64f4c0), SoupMessage 1 (0x7fffe00148e0), SoupSocket 1 (0x973760) -> Host: www.google.com -> Content-Type: application/x-www-form-urlencoded -> Accept-Encoding: gzip, deflate -> Connection: Keep-Alive -> -> accountType=HOSTED%5FOR%5FGOOGLE&Email=libgdata%2Etest%40gmail%2Ecom&Passwd=gdata%2Dgdata&service=lh2&source=client%2Did - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1375110170 -< Soup-Debug: SoupMessage 1 (0x7fffe00148e0) -< Content-Type: text/plain -< Cache-control: no-cache, no-store -< Pragma: no-cache -< Expires: Mon, 01-Jan-1990 00:00:00 GMT -< Date: Mon, 29 Jul 2013 15:02:50 GMT -< X-Content-Type-Options: nosniff -< X-XSS-Protection: 1; mode=block -< Content-Length: 881 -< Server: GSE -< -< SID=DQAAAMwAAADyQT1vzewdUG6u2-LIIy1B4wmmAdKzxhvEgHnLY4ERbKQLY6VFF1L6NfI-AsMSRFehDF_dFUfc2GlIwTLV2dbfG-zMZJJt4YDTzFPv3RQWzxiF_2dMjdKQ2xiz57vwp3L-jmJRtzYlywj6ZYTQzytUMUdT24X9bNwD9JKUyiZwq_XDQV7ZjLLrHZI8AJkex6RFZg-dGbdN0An8bkAonS6wounyQmQTrP0Wmdt_DrVAbQfv67M_7YASKg_VdB5WPkzgPKKnAe_WbZfFcxI4qYwt -< LSID=DQAAAM8AAADL5a5ZSpWbRw4eN3FeEt5oiS6l4JAd0Tb0KIUy9GR2OAgfwUGtzgmyyoWNrbBBy3HT8-M8edREQSp-tTS90Ma4xioQEeLr6z6W0XggZ4pX1OjAOHVfeHIAUH6XTB_bIk1ToRaYys3Gb2VJSDPWwNPpiOrDoKMfc8oTmP0OSawNxsdj7xQgNel76j2-o4SWsJD_9os78Se7MWJUqz58j9DYrabY8vFGQ1HMxYs1HJLDOXfzNPW_zSJRofnKggzWifn4BjZzXULTeIUUyBfe2fqF -< Auth=DQAAAM4AAADL5a5ZSpWbRw4eN3FeEt5oiS6l4JAd0Tb0KIUy9GR2OAgfwUGtzgmyyoWNrbBBy3FYlhWiZLmMfRgM7A2mohEVjPv-9nzdDjEAgE5B66UzTyQ6RxiHx-P2DSCSQ8DCwG7ivoBnEvHOIHllG9dVshK_hA9FsXEdfuRS_jKgqu7mSkeONOtZ2q_Vfu1pVZmPQpe0_1hTMoQHKUtyqKyXX2q-2V7J_nJgOes4GzrJ1IGb2AjT857LZt4HA-92fCmEtCR5Os2SEcwvFfqEIQ00cHhi - -> POST /accounts/ClientLogin HTTP/1.1 -> Soup-Debug-Timestamp: 1375110170 -> Soup-Debug: SoupSession 1 (0x64f4c0), SoupMessage 2 (0x7fffe0014ac0), SoupSocket 2 (0x7fffe00060b0) -> Host: www.google.com -> Content-Type: application/x-www-form-urlencoded -> Accept-Encoding: gzip, deflate -> Connection: Keep-Alive -> -> accountType=HOSTED%5FOR%5FGOOGLE&Email=libgdata%2Etest%40gmail%2Ecom&Passwd=gdata%2Dgdata&service=youtube&source=client%2Did - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1375110170 -< Soup-Debug: SoupMessage 2 (0x7fffe0014ac0) -< Content-Type: text/plain -< Cache-control: no-cache, no-store -< Pragma: no-cache -< Expires: Mon, 01-Jan-1990 00:00:00 GMT -< Date: Mon, 29 Jul 2013 15:02:50 GMT -< X-Content-Type-Options: nosniff -< X-XSS-Protection: 1; mode=block -< Content-Length: 881 -< Server: GSE -< -< SID=DQAAAMwAAADyQT1vzewdUG6u2-LIIy1B4wmmAdKzxhvEgHnLY4ERbKQLY6VFF1L6NfI-AsMSRFehDF_dFUfc2GlIwTLV2dbfG-zMZJJt4YDTzFPv3RQWzxiF_2dMjdKQ2xiz57vwp3L-jmJRtzYlywj6ZYTQzytUMUdT24X9bNwD9JKUyiZwq_XDQV7ZjLLrHZI8AJkex6RFZg-dGbdN0An8bkAonS6wYsz70of-EtqXQFzfwu63hGxwEG27auFbbVkaCZQR0KzME0YCAIuDHw1u8GmTYFZ2 -< LSID=DQAAAM8AAADL5a5ZSpWbRw4eN3FeEt5oiS6l4JAd0Tb0KIUy9GR2OAgfwUGtzgmyyoWNrbBBy3HT8-M8edREQSp-tTS90Ma4xioQEeLr6z6W0XggZ4pX1OjAOHVfeHIAUH6XTB_bIk1ToRaYys3Gb2VJSDPWwNPpiOrDoKMfc8oTmP0OSawNxsdj7xQgNel76j2-o4SWsJD_9os78Se7MWJUqz58j9DYvkTok12MLUsqcRw7y5OSBWuYwYrQY_uhLBgNp25L7i59m-k0BNuQCE8xJ3_Ph6KA -< Auth=DQAAAM4AAADL5a5ZSpWbRw4eN3FeEt5oiS6l4JAd0Tb0KIUy9GR2OAgfwUGtzgmyyoWNrbBBy3HKydTEG30TtszT2DVOZz3JxWAQ5YJ9jpHolcnlOAvAhtDrJEEbQxAf454jMDe0qRVmBHKn_eXqxJ99ETf8xRLfykBETMABfSrxHrOIjBtsqkQDppF8t13tOvX_k8oiTKUIvSRxccozsGFFufSm2rudLesDmVUil0X45VNPkND-wgPtZ94cDjQWAy9OryUNX6tAt98IzHYfHuyCNMB1iHrL - diff --git a/gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-sync b/gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-sync deleted file mode 100644 index 371e19b3..00000000 --- a/gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-sync +++ /dev/null @@ -1,27 +0,0 @@ -> POST /accounts/ClientLogin HTTP/1.1 -> Soup-Debug-Timestamp: 1375110168 -> Soup-Debug: SoupSession 1 (0x64f5d0), SoupMessage 1 (0x94f0e0), SoupSocket 1 (0x9733a0) -> Host: www.google.com -> Content-Type: application/x-www-form-urlencoded -> Accept-Encoding: gzip, deflate -> Connection: Keep-Alive -> -> accountType=HOSTED%5FOR%5FGOOGLE&Email=libgdata%2Etest&Passwd=gdata%2Dgdata&service=youtube&source=client%2Did - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1375110168 -< Soup-Debug: SoupMessage 1 (0x94f0e0) -< Content-Type: text/plain -< Cache-control: no-cache, no-store -< Pragma: no-cache -< Expires: Mon, 01-Jan-1990 00:00:00 GMT -< Date: Mon, 29 Jul 2013 15:02:48 GMT -< X-Content-Type-Options: nosniff -< X-XSS-Protection: 1; mode=block -< Content-Length: 881 -< Server: GSE -< -< SID=DQAAAM0AAADmP_tUgWHXHh6NbcApflUSoY1-8C9N1orEKV9DtPUnVb5PKcPiXPnJZsD9MyHZ2Ez-P88hJyhCkaAVPJE17JcTkklWPoKR_czKzlC9zMBmouo0XzVLsIcb1cYf1lsvJxizRKmRqrDwDi3ROuRBfLA0dNKgn4jzNIL3b6RDpJzLRJUoM6BQHYFv5iddFQig5GW1wShnmYMMAIveeJ6osZ53E8HdxKRIgSnb7z1o3U093k6QTxblJm7kYK7gCBNFzFCfgm0BvpkZYrZrqv0blOdQ -< LSID=DQAAAM4AAAABmiv6l-cKNjg-5_RGZGbQEkV4uJHvNXZJa3CwDdr5FddDXNMA-TBc50Gal5K0LQ7Dh0998X2Smacq1PYDb2GHAbYPfT53XnYvP12ZpYqhzU1rTAY2sYch-N5qhJn4aVbW1JJouqiz4SDRrv8E8xrrkcjiD5RwTCTH0PPii-MEOYauoDZ8KSuaSp5Ac0aZtpTtbS8_4tawRbZCy04qahKAGzpUL5W9boFSWQ4qYSFbM1dcrs2GItyT_MwHX-N9GAOWTSw1toVC7KA4zFAXMo13 -< Auth=DQAAAM4AAAABmiv6l-cKNjg-5_RGZGbQEkV4uJHvNXZJa3CwDdr5FddDXNMA-TBc50Gal5K0LQ5yi9X9_zrGCpiq0Xl_xGhOhn8r2wXprLZAi-R9XKAY8Lh7oaZbvNSB1budL8svMXnfpAOv8utorFpOcf-Ikb-ZqtCBEt2dJSFZ5egoy370rLrOl-vQoWuZR_413FEpdd21Cza4gaE2ppkAuPwfMi28W2Hm8EXOEAk1wo8zM0Y5TvMjzfVtKz8Il3Im30vLd6GhvrIOUh4tEDGv1aiBMkFz - diff --git a/gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-sync-bad-password b/gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-sync-bad-password deleted file mode 100644 index 833c2fb3..00000000 --- a/gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-sync-bad-password +++ /dev/null @@ -1,25 +0,0 @@ -> POST /accounts/ClientLogin HTTP/1.1 -> Soup-Debug-Timestamp: 1375110169 -> Soup-Debug: SoupSession 1 (0x64f6e0), SoupMessage 1 (0x94f2c0), SoupSocket 1 (0x973460) -> Host: www.google.com -> Content-Type: application/x-www-form-urlencoded -> Accept-Encoding: gzip, deflate -> Connection: Keep-Alive -> -> accountType=HOSTED%5FOR%5FGOOGLE&Email=libgdata%2Etest%40gmail%2Ecom&Passwd=bad%2Dpassword&service=youtube&source=client%2Did - -< HTTP/1.1 403 Forbidden -< Soup-Debug-Timestamp: 1375110169 -< Soup-Debug: SoupMessage 1 (0x94f2c0) -< Content-Type: text/plain -< Cache-control: no-cache, no-store -< Pragma: no-cache -< Expires: Mon, 01-Jan-1990 00:00:00 GMT -< Date: Mon, 29 Jul 2013 15:02:49 GMT -< X-Content-Type-Options: nosniff -< X-XSS-Protection: 1; mode=block -< Content-Length: 24 -< Server: GSE -< -< Error=BadAuthentication - diff --git a/gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-sync-cancellation b/gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-sync-cancellation deleted file mode 100644 index e69de29b..00000000 --- a/gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-sync-cancellation +++ /dev/null diff --git a/gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-sync-multiple-domains b/gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-sync-multiple-domains deleted file mode 100644 index 6d24c787..00000000 --- a/gdata/tests/traces/client-login-authorizer/client-login-authorizer-authenticate-sync-multiple-domains +++ /dev/null @@ -1,54 +0,0 @@ -> POST /accounts/ClientLogin HTTP/1.1 -> Soup-Debug-Timestamp: 1375110169 -> Soup-Debug: SoupSession 1 (0x64f6e0), SoupMessage 1 (0x94f3b0), SoupSocket 1 (0x973520) -> Host: www.google.com -> Content-Type: application/x-www-form-urlencoded -> Accept-Encoding: gzip, deflate -> Connection: Keep-Alive -> -> accountType=HOSTED%5FOR%5FGOOGLE&Email=libgdata%2Etest%40gmail%2Ecom&Passwd=gdata%2Dgdata&service=lh2&source=client%2Did - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1375110169 -< Soup-Debug: SoupMessage 1 (0x94f3b0) -< Content-Type: text/plain -< Cache-control: no-cache, no-store -< Pragma: no-cache -< Expires: Mon, 01-Jan-1990 00:00:00 GMT -< Date: Mon, 29 Jul 2013 15:02:49 GMT -< X-Content-Type-Options: nosniff -< X-XSS-Protection: 1; mode=block -< Content-Length: 881 -< Server: GSE -< -< SID=DQAAAMwAAAD07FskgfXFNdDMtLDfUapjQKinfmMwhTtuY3V94-cAmdz9eoV6xxpCu3lUly70qLmHPBknwcg9SU91IgYCISZA0CzUcNY-YHkjbrgvJ8feP_VIFO7rttvfwazNrw0QdImUaABg0cSnzwHeOxEltwnplGoL12-fY7BRpsf7l68INZo9gb67NpUII_wz83bWb_z4KWArJOjBNGFILENsdGaju-iFGQP3ZQWkKCDq7P3mx8WisZWyvSpE1KJljzlQFiEyGfWaY5wzPru0DckejS2K -< LSID=DQAAAM4AAADbzphieXqjM4jfRZ9O_2EXH9S4WfujAM5nbQYQ2bf3mthINyqd71sVIp-M4YWoOUyRTgsC9F1id10obKSkOYfmKflNprDeTFzgh-Is7afsYkIvRs2mcSpFGM4-TH57iEJQVRlrn0iS4vliS4UJG1u6spbhJtm937oDYNfndhzfThpGVtYFXpq6I9Qav2GMWbzDiADm0oFiFCijO9OCjgvXbXt4ixoLkOdCHFa-kPs64fcT9W_Lq6xVoofS1tX5RmU49NnBCLE7HOnVAELiOnnY -< Auth=DQAAAM4AAADbzphieXqjM4jfRZ9O_2EXH9S4WfujAM5nbQYQ2bf3mthINyqd71sVIp-M4YWoOUwl116nNNvnUOJPySn77VlGJ7mkN5JuVJaCjqgpiCHIH5ZiR0Q1d8lIB2lnkpqGUpkeZ7tqmN5kkXaPEEV8_4Hhzk3DmDrevHyiKYh_NQzYXZvtD_asaOA_RhSKVV8ffnDULiV2mRvewYiGTEAT2TkZxCaOhaZcgcfaF1PWEjgf7ltthUKiSOtWQCAMiTkQPs7jbcmhue4SEZXVGDpbGuFr - -> POST /accounts/ClientLogin HTTP/1.1 -> Soup-Debug-Timestamp: 1375110169 -> Soup-Debug: SoupSession 1 (0x64f6e0), SoupMessage 2 (0x94f3b0), SoupSocket 2 (0x9735e0) -> Host: www.google.com -> Content-Type: application/x-www-form-urlencoded -> Accept-Encoding: gzip, deflate -> Connection: Keep-Alive -> -> accountType=HOSTED%5FOR%5FGOOGLE&Email=libgdata%2Etest%40gmail%2Ecom&Passwd=gdata%2Dgdata&service=youtube&source=client%2Did - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1375110169 -< Soup-Debug: SoupMessage 2 (0x94f3b0) -< Content-Type: text/plain -< Cache-control: no-cache, no-store -< Pragma: no-cache -< Expires: Mon, 01-Jan-1990 00:00:00 GMT -< Date: Mon, 29 Jul 2013 15:02:49 GMT -< X-Content-Type-Options: nosniff -< X-XSS-Protection: 1; mode=block -< Content-Length: 881 -< Server: GSE -< -< SID=DQAAAMwAAAD07FskgfXFNdDMtLDfUapjQKinfmMwhTtuY3V94-cAmdz9eoV6xxpCu3lUly70qLmHPBknwcg9SU91IgYCISZA0CzUcNY-YHkjbrgvJ8feP_VIFO7rttvfwazNrw0QdImUaABg0cSnzwHeOxEltwnplGoL12-fY7BRpsf7l68INZo9gb67NpUII_wz83bWb_z4KWArJOjBNGFILENsdGajV-_wXsp1yWU2wdVU3Iv5BM54QgU_2Fa1N0KiO3Hl7nP0lKLrixvPapog-cmVXL6h -< LSID=DQAAAM4AAADbzphieXqjM4jfRZ9O_2EXH9S4WfujAM5nbQYQ2bf3mthINyqd71sVIp-M4YWoOUyRTgsC9F1id10obKSkOYfmKflNprDeTFzgh-Is7afsYkIvRs2mcSpFGM4-TH57iEJQVRlrn0iS4vliS4UJG1u6spbhJtm937oDYNfndhzfThpGVtYFXpq6I9Qav2GMWbzDiADm0oFiFCijO9OCjgvX3Wjt2PtjkzPv_IbQssLsgHuMZrIiDY8fPh4NvDaRZUeT5_Ovk__RCqD1eVhLwhhr -< Auth=DQAAAM4AAADbzphieXqjM4jfRZ9O_2EXH9S4WfujAM5nbQYQ2bf3mthINyqd71sVIp-M4YWoOUyqdYB0QClm_Brz7bdTLZBY9x1fkNpIUCpjexl88vcm9VKzACCp1S8ftkpgBWlDnXLrvoc91y0rVEmhjmAsS9Rgwyr4b94oZ0StfpUNt4zh0EgRo5JxEzrqyRnhcBPMPLYsG4G9nDRbpmFvnAMxe_Hiuv5O_Ege8tmgM8EWE6IyKaXBAPuVxrVBQPTE_yxt3rbcOMKVkGHbDyPj9QqbZlFH - diff --git a/gdata/tests/traces/client-login-authorizer/setup-client-login-authorizer-data-authenticated b/gdata/tests/traces/client-login-authorizer/setup-client-login-authorizer-data-authenticated deleted file mode 100644 index e1d9d53f..00000000 --- a/gdata/tests/traces/client-login-authorizer/setup-client-login-authorizer-data-authenticated +++ /dev/null @@ -1,27 +0,0 @@ -> POST /accounts/ClientLogin HTTP/1.1 -> Soup-Debug-Timestamp: 1375110167 -> Soup-Debug: SoupSession 1 (0x64f2a0), SoupMessage 1 (0x94f590), SoupSocket 1 (0x973220) -> Host: www.google.com -> Content-Type: application/x-www-form-urlencoded -> Accept-Encoding: gzip, deflate -> Connection: Keep-Alive -> -> accountType=HOSTED%5FOR%5FGOOGLE&Email=libgdata%2Etest%40gmail%2Ecom&Passwd=gdata%2Dgdata&service=youtube&source=client%2Did - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1375110167 -< Soup-Debug: SoupMessage 1 (0x94f590) -< Content-Type: text/plain -< Cache-control: no-cache, no-store -< Pragma: no-cache -< Expires: Mon, 01-Jan-1990 00:00:00 GMT -< Date: Mon, 29 Jul 2013 15:02:47 GMT -< X-Content-Type-Options: nosniff -< X-XSS-Protection: 1; mode=block -< Content-Length: 881 -< Server: GSE -< -< SID=DQAAAM0AAACQTYSnz2Te6_o7SkZ8vWPjLzvf4aGTBxrnTulW9ykw2-PYoWl88PxNZgQmXsLCC043mMKsR2DNzjfoM7-rOrCDP609kiKrVzhcP0FobCYJLHK-aZIzq7vovAq-DJG2LjSHjqf0HYkGhYLodiGRYZKEDnOOhr03RWKWzl2DQS7acyq_F1uVXLEtc6YXRWp2n1DBmoSmmmFnp8pvC8onimc1Zcha9cnjuSLE3tbDrLBA8ps1CJHK5bWl3nELNRrwisrei_iw6LAHtq6BIpB-lnl1 -< LSID=DQAAAM4AAACb6htOq1itKNd5LVXNJx2kfaRm7mP3FHlVMie2h7vxaylu1rqnq7v7WhNl0d-bI6jZEthh-vndHPnHkGgSDPXXht1jr52P34ze8P1ztZoD_-l1inTHr9IE0y31sBUXP7oiPPecehau_AuIJ_-PJPYskG5ibwBX42mkee7y7uzulU9Gl6J_vxrZblIMzzMb331vRfheCTnNoE9PBYDSWEPCdMk6z5I_QbO2qRa-qXbd4kJuzSn_HKvVlK3Isy96JqXfyremEc643DwdutwIwMMG -< Auth=DQAAAM8AAACb6htOq1itKNd5LVXNJx2kfaRm7mP3FHlVMie2h7vxaylu1rqnq7v7WhNl0d-bI6jpJUWjFYRNWcd1jrcC9Yx1DREDvZfTWHftUNcZDEciKLKBXtNd2zzYKe7-Z7hL3tYOebD8ulI1Ql_xhaeQPtARdYoSRs_G3bjfrajKcDrtZMBmpxJgB3qs2l0XRRJpV-OZtad-PMyv7CBm1j2LYQindXcTq8GVliYmZIvM9wah4XsrxPM3xXTBv_aHl-R6AHq86iD0KNvNVEl7z3oonr61 - |