[maemo-commits] [maemo-commits] r10692 - in projects/haf/trunk/hail: . ut

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Wed Mar 21 15:47:11 EET 2007
Author: fherrera
Date: 2007-03-21 15:47:02 +0200 (Wed, 21 Mar 2007)
New Revision: 10692

Removed:
   projects/haf/trunk/hail/ut/hailapp_tests.c
   projects/haf/trunk/hail/ut/hailapp_tests.h
   projects/haf/trunk/hail/ut/hailappview_tests.c
   projects/haf/trunk/hail/ut/hailappview_tests.h
Modified:
   projects/haf/trunk/hail/ChangeLog
   projects/haf/trunk/hail/ut/Makefile.am
Log:
2007-03-21 15:45  Fernando Herrera  <fernando.herrera-de-las-heras at nokia.com>

        * ut/hailapp*
        * ut/Makefile.am: Removed deprecated widgets.




Modified: projects/haf/trunk/hail/ChangeLog
===================================================================
--- projects/haf/trunk/hail/ChangeLog	2007-03-21 12:12:09 UTC (rev 10691)
+++ projects/haf/trunk/hail/ChangeLog	2007-03-21 13:47:02 UTC (rev 10692)
@@ -1,3 +1,8 @@
+2007-03-21 15:45  Fernando Herrera  <fernando.herrera-de-las-heras at nokia.com>
+
+	* ut/hailapp*
+	* ut/Makefile.am: Removed deprecated widgets.
+
 2006-10-02 18:30  Fernando Herrera  <fernando.herrera-de-las-heras at nokia.com>
 
 	* Imported 1.2.0 into SVN

Modified: projects/haf/trunk/hail/ut/Makefile.am
===================================================================
--- projects/haf/trunk/hail/ut/Makefile.am	2007-03-21 12:12:09 UTC (rev 10691)
+++ projects/haf/trunk/hail/ut/Makefile.am	2007-03-21 13:47:02 UTC (rev 10692)
@@ -4,8 +4,6 @@
 AM_LDFLAGS = -module -avoid-version $(top_builddir)/hail/.libs/libhail.so
 
 libhail_unittests_la_SOURCES =  hailcaption_tests.c \
-				hailappview_tests.c \
-				hailapp_tests.c \
 				hailbanner_tests.c \
 				hailfindtoolbar_tests.c \
 				hailvolumebar_tests.c \

Deleted: projects/haf/trunk/hail/ut/hailapp_tests.c
===================================================================
--- projects/haf/trunk/hail/ut/hailapp_tests.c	2007-03-21 12:12:09 UTC (rev 10691)
+++ projects/haf/trunk/hail/ut/hailapp_tests.c	2007-03-21 13:47:02 UTC (rev 10692)
@@ -1,230 +0,0 @@
-/*
- * This file is part of hail
- *
- * Copyright (C) 2006 Nokia Corporation.
- *
- * This library 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.
- *
- * This library 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 this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-/**
- * SECTION:hailapp_tests
- * @short_description: unit tests for Atk support of #HildonApp
- * @see_also: #HildonApp
- *
- * Checks accessibility support for #HildonApp
- */
-
-#include <glib.h>
-#include <gtk/gtkwidget.h>
-#include <gtk/gtklabel.h>
-#include <hildon-widgets/hildon-app.h>
-#include <atk/atkcomponent.h>
-
-#include <assert.h>
-#include <string.h>
-#include <hailapp_tests.h>
-#include <hailappview_tests.h>
-
-static const gchar * test_label = "test label";
-
-static GtkWidget * get_hildon_app (void);
-
-static GtkWidget * get_hildon_app (void)
-{
-  GtkWidget * app = NULL;
-
-  app = hildon_app_new ();
-  return app;
-}
-
-/**
- * test_app_get_accessible:
- *
- * should get the accessible object for #HildonApp
- *
- * Return value: 1 if the test is passed
- */
-int test_app_get_accessible ()
-{
-    GtkWidget * app = NULL;
-    AtkObject * accessible = NULL;
-
-    app = get_hildon_app ();
-    assert (HILDON_IS_APP (app));
-
-    accessible = gtk_widget_get_accessible(app);
-    assert (G_TYPE_CHECK_INSTANCE_TYPE(accessible, g_type_from_name("GailWindow")));
-    return 1;
-}
-
-/**
- * test_app_get_children:
- *
- * check that there's no children when no #HildonAppView has been embedded
- * and check that there's one when there's a #HildonAppView  inside
- *
- * Return value: 1 if the test is passed
- */
-int test_app_get_children(void)
-{
-    GtkWidget * app = NULL;
-    AtkObject * accessible = NULL;
-    GtkWidget * app_view = NULL;
-
-    app = get_hildon_app ();
-    assert (HILDON_IS_APP (app));
-
-    accessible = gtk_widget_get_accessible(app);
-    assert (G_TYPE_CHECK_INSTANCE_TYPE(accessible, g_type_from_name("GailWindow")));
-
-    /* check that there are no children (no appview yet) */
-    assert (atk_object_get_n_accessible_children(accessible) == 0);
-
-    app_view = get_hildon_app_view();
-    hildon_app_set_appview (HILDON_APP(app), HILDON_APPVIEW(app_view));
-
-    /* check that now there is a children (the contained widget too) */
-    assert (atk_object_get_n_accessible_children(accessible) == 1);
-  
-  return 1;
-}
-
-/**
- * test_app_get_name:
- *
- * check that the name of the #HildonApp is taken right through Atk
- *
- * Return value: 1 if the test is passed
- */
-int test_app_get_name(void)
-{
-  GtkWidget * app = NULL;
-  AtkObject * accessible = NULL;
-  GtkWidget * app_view1 = NULL;
-  
-  app = get_hildon_app ();
-  assert (HILDON_IS_APP (app));
-  
-  accessible = gtk_widget_get_accessible(app);
-  assert (G_TYPE_CHECK_INSTANCE_TYPE(accessible, g_type_from_name("GailWindow")));
-
-  app_view1 = get_hildon_app_view();
-  hildon_app_set_appview (HILDON_APP(app), HILDON_APPVIEW(app_view1));
-
-  gtk_widget_show(app);
-
-  hildon_app_set_title(HILDON_APP(app), test_label);
-  assert (GTK_WIDGET_REALIZED(app));
-  assert(gtk_window_get_title(GTK_WINDOW(app)) != NULL);
-  assert(atk_object_get_name(ATK_OBJECT(accessible)) != NULL);
-  assert (strcmp(atk_object_get_name(ATK_OBJECT(accessible)), test_label) == 0);
-  
-
-  return 1;
-}
-
-/* this function is a signal handler to detect if the signal is emitted */
-void test_app_children_changed_signal_handler (AtkObject * object,
-					       guint child_index,
-					       gpointer child_pointer,
-					       gpointer user_data)
-{
-  gboolean * is_ok = NULL;
-  is_ok = (gboolean *) user_data;
-  *is_ok = 0;
-
-  if (!G_TYPE_CHECK_INSTANCE_TYPE(object, g_type_from_name("GailWindow")))
-    return;
-
-  *is_ok = 1;
-}
-
-/**
- * test_app_children_changed:
- *
- * Check that when we change the HildonAppView embedded in HildonApp, the correspondant 
- * children-changed event is called
- *
- * Return value: 1 if the test is passed
- */
-int test_app_children_changed (void)
-{
-    GtkWidget * app = NULL;
-    AtkObject * accessible = NULL;
-    GtkWidget * app_view1 = NULL;
-    GtkWidget * app_view2 = NULL;
-    AtkObject * accessible_app_view1 = NULL;
-    AtkObject * accessible_app_view2 = NULL;
-    AtkObject * accessible_ref = NULL;
-    gboolean add_called = FALSE;
-
-    app = get_hildon_app ();
-    assert (HILDON_IS_APP (app));
-
-    accessible = gtk_widget_get_accessible(app);
-    assert (G_TYPE_CHECK_INSTANCE_TYPE(accessible, g_type_from_name("GailWindow")));
-
-    g_signal_connect(accessible, "children-changed::add", 
-		     (GCallback) test_app_children_changed_signal_handler,
-		     &add_called);
-
-    app_view1 = get_hildon_app_view();
-    app_view2 = get_hildon_app_view();
-    accessible_app_view1 = gtk_widget_get_accessible(app_view1);
-    accessible_app_view2 = gtk_widget_get_accessible(app_view2);
-    assert(accessible_app_view1 != accessible_app_view2);
-
-    hildon_app_set_appview (HILDON_APP(app), HILDON_APPVIEW(app_view1));
-    accessible_ref = atk_object_ref_accessible_child(accessible, 0);
-    assert (accessible_ref == accessible_app_view1);
-    g_object_unref(accessible_ref);
-    
-    hildon_app_set_appview (HILDON_APP(app), HILDON_APPVIEW(app_view2));
-    accessible_ref = atk_object_ref_accessible_child(accessible, 1);
-    assert (accessible_ref == accessible_app_view2);
-    g_object_unref(accessible_ref);
-    
-    assert (atk_object_get_n_accessible_children(accessible) == 2);
-
-    assert (add_called);
-  
-  return 1;
-}
-
-/**
- * test_app_role:
- *
- * HailApp role should be #ATK_ROLE_FRAME
- *
- * Return value: 1 if the test is passed
- */
-int test_app_role(void)
-{
-  GtkWidget * app = NULL;
-  AtkObject * accessible = NULL;
-  
-  app = get_hildon_app ();
-  assert (HILDON_IS_APP (app));
-  
-  accessible = gtk_widget_get_accessible(app);
-  assert (G_TYPE_CHECK_INSTANCE_TYPE(accessible, g_type_from_name("GailWindow")));
-
-  assert(atk_object_get_role(accessible) == ATK_ROLE_FRAME);
-
-  return 1;
-}
-

Deleted: projects/haf/trunk/hail/ut/hailapp_tests.h
===================================================================
--- projects/haf/trunk/hail/ut/hailapp_tests.h	2007-03-21 12:12:09 UTC (rev 10691)
+++ projects/haf/trunk/hail/ut/hailapp_tests.h	2007-03-21 13:47:02 UTC (rev 10692)
@@ -1,29 +0,0 @@
-/*
- * This file is part of hail
- *
- * Copyright (C) 2006 Nokia Corporation.
- *
- * This library 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.
- *
- * This library 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 this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-/* unit tests for app */
-int test_app_get_accessible(void);
-int test_app_get_children(void);
-int test_app_get_name(void);
-int test_app_children_changed (void);
-int test_app_role(void);
-

Deleted: projects/haf/trunk/hail/ut/hailappview_tests.c
===================================================================
--- projects/haf/trunk/hail/ut/hailappview_tests.c	2007-03-21 12:12:09 UTC (rev 10691)
+++ projects/haf/trunk/hail/ut/hailappview_tests.c	2007-03-21 13:47:02 UTC (rev 10692)
@@ -1,289 +0,0 @@
-/*
- * This file is part of hail
- *
- * Copyright (C) 2006 Nokia Corporation.
- *
- * This library 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.
- *
- * This library 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 this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-/**
- * SECTION:hailappview_tests
- * @short_description: unit tests for Atk support of #HildonAppview
- * @see_also: #HailAppView, #HildonAppview
- *
- * Checks accessibility support for #HildonAppview, provided
- * in hail by #HailAppView
- */
-
-
-#include <glib.h>
-#include <gtk/gtkwidget.h>
-#include <hildon-widgets/hildon-appview.h>
-#include <hildon-widgets/hildon-app.h>
-#include <hail/hailappview.h>
-#include <gtk/gtklabel.h>
-
-#include <string.h>
-#include <assert.h>
-
-static const gchar * test_label = "test label";
-
-
-static const gchar * test_app_view_title = "app view title";
-
-/**
- * get_hildon_app_view:
- *
- * obtains a #HildonAppView instance ready to use in tests
- *
- * Return value: a #HildonAppView
- */
-GtkWidget * 
-get_hildon_app_view (void)
-{
-  GtkWidget * app_view = NULL;
-
-  app_view = hildon_appview_new (test_app_view_title);
-  return app_view;
-}
-
-/**
- * test_app_view_get_accessible:
- *
- * should get the accessible object for hildon-caption
- *
- * Return value: 1 if the test is passed.
- */
-int test_app_view_get_accessible ()
-{
-    GtkWidget * app_view = NULL;
-    AtkObject * accessible = NULL;
-
-    app_view = get_hildon_app_view ();
-    assert (HILDON_IS_APPVIEW (app_view));
-
-    accessible = gtk_widget_get_accessible(app_view);
-    assert (HAIL_IS_APP_VIEW (accessible));
-
-    return 1;
-}
-
-/**
- * test_app_view_get_children:
- *
- * should get the expected accessible children of the app view
- *
- * Return value: 1 if the test is passed.
- */
-int test_app_view_get_children(void)
-{
-    GtkWidget * app_view = NULL;
-    AtkObject * accessible = NULL;
-    GtkWidget * label = NULL;
-
-    app_view = get_hildon_app_view ();
-    assert (HILDON_IS_APPVIEW (app_view));
-
-    accessible = gtk_widget_get_accessible(app_view);
-    assert (HAIL_IS_APP_VIEW (accessible));
-
-    /* check that there are 2 children (toolbar and menu) */
-    assert (atk_object_get_n_accessible_children(accessible) == 2);
-
-    label = gtk_label_new(test_label);
-    gtk_container_add(GTK_CONTAINER(app_view), label);
-
-    /* check that now there are 3 children (the contained widget too) */
-    assert (atk_object_get_n_accessible_children(accessible) == 3);
-  
-  return 1;
-}
-
-/**
- * test_app_view_get_bin:
- *
- * should get the embedded widget  of the app view
- *
- * Return value: 1 if the test is passed.
- */
-int test_app_view_get_bin(void)
-{
-    GtkWidget * app_view = NULL;
-    AtkObject * accessible = NULL;
-    GtkWidget * label = NULL;
-    AtkObject * accessible_child = NULL;
-
-    app_view = get_hildon_app_view ();
-    assert (HILDON_IS_APPVIEW (app_view));
-
-    accessible = gtk_widget_get_accessible(app_view);
-    assert (HAIL_IS_APP_VIEW (accessible));
-
-    label = gtk_label_new(test_label);
-    gtk_container_add(GTK_CONTAINER(app_view), label);
-
-    accessible_child = atk_object_ref_accessible_child(accessible, 0);
-    assert(GTK_ACCESSIBLE(accessible_child)->widget == label);
-  
-  return 1;
-}
-
-/**
- * test_app_view_get_toolbars:
- *
- * should get the toolbars  of the app view
- *
- * Return value: 1 if the test is passed.
- */
-int test_app_view_get_toolbars(void)
-{
-    GtkWidget * app_view = NULL;
-    AtkObject * accessible = NULL;
-    GtkWidget * label = NULL;
-    AtkObject * accessible_child = NULL;
-    AtkObject * accessible_toolbar = NULL;
-
-    app_view = get_hildon_app_view ();
-    assert (HILDON_IS_APPVIEW (app_view));
-
-    accessible = gtk_widget_get_accessible(app_view);
-    assert (HAIL_IS_APP_VIEW (accessible));
-
-    /* get accessible of the toolbar container */
-    accessible_toolbar = gtk_widget_get_accessible(HILDON_APPVIEW(app_view)->vbox);
-    assert (ATK_IS_OBJECT(accessible_toolbar));
-
-    accessible_child = atk_object_ref_accessible_child(accessible, 0);
-    assert(accessible_child == accessible_toolbar);
-    g_object_unref(accessible_child);
-
-    label = gtk_label_new(test_label);
-    gtk_container_add(GTK_CONTAINER(app_view), label);
-
-    accessible_child = atk_object_ref_accessible_child(accessible, 1);
-    assert(accessible_child == accessible_toolbar);
-    g_object_unref(accessible_child);
-  
-  return 1;
-}
-
-/**
- * test_app_view_get_menu:
- *
- * Tries to get the menu of the app view
- *
- * Return value: 1 if the test is passed.
- */
-int test_app_view_get_menu(void)
-{
-    GtkWidget * app_view = NULL;
-    AtkObject * accessible = NULL;
-    GtkWidget * label = NULL;
-    AtkObject * accessible_child = NULL;
-    AtkObject * accessible_menu = NULL;
-
-    app_view = get_hildon_app_view ();
-    assert (HILDON_IS_APPVIEW (app_view));
-
-    accessible = gtk_widget_get_accessible(app_view);
-    assert (HAIL_IS_APP_VIEW (accessible));
-
-    /* get accessible of the toolbar container */
-    accessible_menu = gtk_widget_get_accessible(GTK_WIDGET(hildon_appview_get_menu(HILDON_APPVIEW(app_view))));
-    assert (ATK_IS_OBJECT(accessible_menu));
-
-    accessible_child = atk_object_ref_accessible_child(accessible, 1);
-    assert(accessible_child == accessible_menu);
-    g_object_unref(accessible_child);
-
-    label = gtk_label_new(test_label);
-    gtk_container_add(GTK_CONTAINER(app_view), label);
-
-    accessible_child = atk_object_ref_accessible_child(accessible, 2);
-    assert(accessible_child == accessible_menu);
-    g_object_unref(accessible_child);
-  return 1;
-}
-
-/**
- * test_app_view_fullscreen_actions:
- *
- * Checks the fullscreen actions. It gets a #HildonAppView embedded in a #HildonApp. Then
- * it checks that without fullscreen key allowed, we cannot get an action. After this,
- * it changes the state of fullscreen with do_action to check if it's updated correctly
- *
- * Return value: 1 if the test is passed.
- */
-int test_app_view_fullscreen_actions(void)
-{
-   GtkWidget * app_view = NULL;
-    AtkObject * accessible = NULL;
-    GtkWidget * app = NULL;
-
-    app_view = get_hildon_app_view ();
-    assert (HILDON_IS_APPVIEW (app_view));
-
-    app = hildon_app_new ();
-    assert(HILDON_IS_APP(app));
-
-    hildon_app_set_appview(HILDON_APP(app), HILDON_APPVIEW(app_view));
-    gtk_widget_show(app);
-
-    accessible = gtk_widget_get_accessible(app_view);
-    assert (HAIL_IS_APP_VIEW (accessible));
-
-    assert (!hildon_appview_get_fullscreen_key_allowed(HILDON_APPVIEW(app_view)));
-    assert (atk_action_get_n_actions(ATK_ACTION(accessible)) == 0);
-
-    hildon_appview_set_fullscreen_key_allowed(HILDON_APPVIEW(app_view), TRUE);
-    assert (atk_action_get_n_actions(ATK_ACTION(accessible)) == 1);
-
-    assert(!hildon_appview_get_fullscreen(HILDON_APPVIEW(app_view)));
-    assert (strcmp(atk_action_get_name(ATK_ACTION(accessible),0),"fullscreen")==0);
-    assert (atk_action_do_action(ATK_ACTION(accessible),0));
-
-    assert(hildon_appview_get_fullscreen(HILDON_APPVIEW(app_view)));
-    assert (strcmp(atk_action_get_name(ATK_ACTION(accessible),0),"unfullscreen")==0);
-    assert (atk_action_do_action(ATK_ACTION(accessible),0));
-    assert (!hildon_appview_get_fullscreen(HILDON_APPVIEW(app_view)));
-
-    return 1;
-}
-
-/**
- * test_app_view_get_role:
- *
- * check that the role for a HildonAppView is a #ATK_ROLE_FRAME
- *
- * Return value: 1 if the test is passed.
- */
-int test_app_view_get_role(void)
-{
-   GtkWidget * app_view = NULL;
-    AtkObject * accessible = NULL;
-
-    app_view = get_hildon_app_view ();
-    assert (HILDON_IS_APPVIEW (app_view));
-
-    accessible = gtk_widget_get_accessible(app_view);
-    assert (HAIL_IS_APP_VIEW (accessible));
-
-    assert(atk_object_get_role(accessible) == ATK_ROLE_FRAME);
-
-    return 1;
-}
-

Deleted: projects/haf/trunk/hail/ut/hailappview_tests.h
===================================================================
--- projects/haf/trunk/hail/ut/hailappview_tests.h	2007-03-21 12:12:09 UTC (rev 10691)
+++ projects/haf/trunk/hail/ut/hailappview_tests.h	2007-03-21 13:47:02 UTC (rev 10692)
@@ -1,39 +0,0 @@
-/*
- * This file is part of hail
- *
- * Copyright (C) 2006 Nokia Corporation.
- *
- * This library 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.
- *
- * This library 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 this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#ifndef __HAILAPPVIEW_TESTS_H__
-#define __HAILAPPVIEW_TESTS_H__
-
-#include <gtk/gtkwidget.h>
-
-GtkWidget * get_hildon_app_view (void);
-
-/* unit tests for app view */
-int test_app_view_get_accessible(void);
-int test_app_view_get_children(void);
-int test_app_view_get_bin(void);
-int test_app_view_get_toolbars(void);
-int test_app_view_get_menu(void);
-int test_app_view_fullscreen_actions(void);
-int test_app_view_get_role(void);
-
-#endif /*__HAILAPPVIEW_TESTS_H__ */


More information about the maemo-commits mailing list