[kazehakase-svn] [3621] * module/embed/gecko/kz-gecko-single.cpp: Workaround for test.

Zurück zum Archiv-Index

svnno****@sourc***** svnno****@sourc*****
Wed Feb 11 14:27:23 JST 2009


Revision: 3621
          http://svn.sourceforge.jp/view?root=kazehakase&view=rev&rev=3621
Author:   ikezoe
Date:     2009-02-11 14:27:23 +0900 (Wed, 11 Feb 2009)

Log Message:
-----------
	* module/embed/gecko/kz-gecko-single.cpp: Workaround for test.
	* test/test-embed-engine.c: Added.

Modified Paths:
--------------
    kazehakase/trunk/ChangeLog
    kazehakase/trunk/module/embed/gecko/kz-gecko-single.cpp
    kazehakase/trunk/test/Makefile.am
    kazehakase/trunk/test/run-test.sh

Added Paths:
-----------
    kazehakase/trunk/test/test-embed-engine.c

Modified: kazehakase/trunk/ChangeLog
===================================================================
--- kazehakase/trunk/ChangeLog	2009-02-11 02:04:46 UTC (rev 3620)
+++ kazehakase/trunk/ChangeLog	2009-02-11 05:27:23 UTC (rev 3621)
@@ -7,6 +7,8 @@
 	* module/embed/moz-web-view: Added for Gecko on Windows. 
 	MozWebView is in http://hg.mozilla.org/incubator/embedding/
 	* macros/gecko.m4: Disable gtkmozembed by default.
+	* module/embed/gecko/kz-gecko-single.cpp: Workaround for test.
+	* test/test-embed-engine.c: Added.
 
 2009-02-05  Hiroyuki Ikezoe  <poinc****@ikezo*****>
 

Modified: kazehakase/trunk/module/embed/gecko/kz-gecko-single.cpp
===================================================================
--- kazehakase/trunk/module/embed/gecko/kz-gecko-single.cpp	2009-02-11 02:04:46 UTC (rev 3620)
+++ kazehakase/trunk/module/embed/gecko/kz-gecko-single.cpp	2009-02-11 05:27:23 UTC (rev 3621)
@@ -115,21 +115,25 @@
              GObjectConstructParam *props)
 {
 	GObject *object;
+	GObjectClass *klass;
+	KzGeckoSinglePrivate *priv;
+	KzProfile *profile;
 
-	if (!the_kz_gecko_single) 
-	{
-		KzGeckoSinglePrivate *priv;
-		KzProfile *profile;
-		GObjectClass *klass = G_OBJECT_CLASS(kz_gecko_single_parent_class);
-		object = klass->constructor(type, n_props, props);
+	if (the_kz_gecko_single) 
+		return G_OBJECT(g_object_ref(the_kz_gecko_single));
 
-		the_kz_gecko_single = KZ_GECKO_SINGLE(object);
+	klass = G_OBJECT_CLASS(kz_gecko_single_parent_class);
+	object = klass->constructor(type, n_props, props);
 
-		priv = KZ_GECKO_SINGLE_GET_PRIVATE(object);
-		
+	the_kz_gecko_single = KZ_GECKO_SINGLE(object);
+
+	priv = KZ_GECKO_SINGLE_GET_PRIVATE(object);
+
+	mozilla_register_components();
+
+	if (priv->kz_app)
+	{
 		profile = kz_app_get_profile(priv->kz_app);
-
-		mozilla_register_components();
 		set_user_agent(profile);
 		g_signal_connect(profile, "changed::Global",
 				G_CALLBACK(cb_global_profile_changed), NULL);
@@ -140,10 +144,6 @@
 		g_signal_connect(profile, "changed::Privacy",
 				G_CALLBACK(cb_privacy_profile_changed), NULL);
 	}
-	else
-	{
-		object = G_OBJECT(g_object_ref(the_kz_gecko_single));
-	}
 	return object;
 }
 

Modified: kazehakase/trunk/test/Makefile.am
===================================================================
--- kazehakase/trunk/test/Makefile.am	2009-02-11 02:04:46 UTC (rev 3620)
+++ kazehakase/trunk/test/Makefile.am	2009-02-11 05:27:23 UTC (rev 3621)
@@ -10,7 +10,8 @@
 	test-bookmark-file.la		\
 	test-bookmark-separator.la	\
 	test-root-bookmark.la		\
-	test-profile.la
+	test-profile.la			\
+	test-embed-engine.la
 endif
 
 EXTRA_DIST =		\
@@ -30,7 +31,11 @@
 	-I$(top_srcdir)/src/widget			\
 	-I$(top_builddir)/src/libegg/pixbufthumbnail
 
-AM_CFLAGS = $(GCUTTER_CFLAGS)
+AM_CFLAGS = 					\
+	$(GCUTTER_CFLAGS)			\
+	$(KAZEHAKASE_CFLAGS)			\
+	-DGECKO_VERSION=\"$(GECKO_VERSION)\"
+
 AM_LDFLAGS =			\
 	-module			\
 	-rpath "`pwd`/.libs"	\
@@ -55,6 +60,8 @@
 test_root_bookmark_la_LIBADD = kz_test_utils.la
 test_profile_la_SOURCES = test-profile.c
 test_profile_la_LIBADD = kz_test_utils.la
+test_embed_engine_la_SOURCES = test-embed-engine.c
 
+
 echo-cutter:
 	@echo $(CUTTER)

Modified: kazehakase/trunk/test/run-test.sh
===================================================================
--- kazehakase/trunk/test/run-test.sh	2009-02-11 02:04:46 UTC (rev 3620)
+++ kazehakase/trunk/test/run-test.sh	2009-02-11 05:27:23 UTC (rev 3621)
@@ -20,6 +20,7 @@
 export BASE_DIR="`dirname $0`"
 top_dir="$BASE_DIR/.."
 top_dir="`cd $top_dir; pwd`"
+export KZ_EMBED_MODULE_DIR="$top_dir/module/embed/gecko/.libs"
 
 if test x"$NO_MAKE" != x"yes"; then
     if which gmake > /dev/null; then

Added: kazehakase/trunk/test/test-embed-engine.c
===================================================================
--- kazehakase/trunk/test/test-embed-engine.c	                        (rev 0)
+++ kazehakase/trunk/test/test-embed-engine.c	2009-02-11 05:27:23 UTC (rev 3621)
@@ -0,0 +1,51 @@
+#include "kz-embed.h"
+
+#include <gcutter.h>
+
+void test_names (void);
+void test_ids (void);
+
+static GList *expected;
+
+void
+cut_startup (void)
+{
+    kz_embed_load(NULL);
+}
+
+void
+cut_shutdown (void)
+{
+    kz_embed_unload();
+    kz_embed_exit();
+}
+
+void
+setup (void)
+{
+    expected = NULL;
+}
+
+void
+teardown (void)
+{
+    g_list_free(expected);
+}
+
+void
+test_names (void)
+{
+    expected = g_list_append(expected, GECKO_VERSION);
+    gcut_assert_equal_list_string(expected, kz_embed_engine_names());
+}
+
+void
+test_ids (void)
+{
+    expected = g_list_append(expected, "gecko");
+    gcut_assert_equal_list_string(expected, kz_embed_engine_ids());
+}
+
+/*
+vi:ts=4:nowrap:ai:expandtab:sw=4
+*/




More information about the Kazehakase-cvs mailing list
Zurück zum Archiv-Index