diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2007-05-21 00:43:37 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2007-05-21 00:43:37 (GMT) |
commit | d8d3d5a63b7934f0740cdebb5f3b1d8fc99ed16b (patch) | |
tree | b86deecdb2650a5fc77c454f12802332c3b59096 | |
parent | e92cafce48d41dcf92ba07adeb179c529ea7fd26 (diff) |
Split the tests
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | m4/gecko.m4 | 2 | ||||
-rw-r--r-- | tests/test-app-components.py | 42 | ||||
-rw-r--r-- | tests/test-dom.py | 32 | ||||
-rw-r--r-- | tests/test-pref-service.py | 31 | ||||
-rw-r--r-- | tests/test-web-view.py | 32 |
6 files changed, 108 insertions, 33 deletions
diff --git a/Makefile.am b/Makefile.am index af437a6..26226b0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1 +1,3 @@ SUBDIRS = src + +ACLOCAL_AMFLAGS = -I m4 diff --git a/m4/gecko.m4 b/m4/gecko.m4 index d32d4fe..d81c56a 100644 --- a/m4/gecko.m4 +++ b/m4/gecko.m4 @@ -329,7 +329,7 @@ gecko_cv_extra_pkg_dependencies= if test "$gecko_cv_gecko_version_int" -ge "1009000"; then gecko_cv_extra_libs="-L$_GECKO_LIBDIR -lxul -lpyxpcom" - gecko_cv_glue_libs="-L$_GECKO_LIBDIR -lxpcomglue_s" + gecko_cv_glue_libs="-L$_GECKO_LIBDIR/sdk -lxpcomglue_s" else gecko_cv_extra_pkg_dependencies="${gecko_cv_gecko}-gtkmozembed" fi diff --git a/tests/test-app-components.py b/tests/test-app-components.py new file mode 100644 index 0000000..08ecc46 --- /dev/null +++ b/tests/test-app-components.py @@ -0,0 +1,42 @@ +import os + +import gtk + +import hulahop +hulahop.startup(os.path.expanduser('~/.test-hulahop')) +from hulahop.webview import WebView + +from xpcom import components +from xpcom.server.factory import Factory + +class AppLauncher: + _com_interfaces_ = components.interfaces.nsIHelperAppLauncherDialog + + def promptForSaveToFile(self, launcher, windowContext, + defaultFile, suggestedFileExtension): + print 'promptForSaveToFile' + + def show(self, launcher, context, reason): + print 'show' + +def _quit(window): + hulahop.shutdown() + gtk.main_quit() + +registrar = components.registrar +registrar.registerFactory('{64355793-988d-40a5-ba8e-fcde78cac631}"', + 'Test Application Launcher', + '@mozilla.org/helperapplauncherdialog;1', + Factory(AppLauncher)) + +window = gtk.Window() +window.connect("destroy", _quit) + +web_view = WebView() +web_view.load_uri('http://www.google.com') +window.add(web_view) +web_view.show() + +window.show() + +gtk.main() diff --git a/tests/test-dom.py b/tests/test-dom.py new file mode 100644 index 0000000..200ec35 --- /dev/null +++ b/tests/test-dom.py @@ -0,0 +1,32 @@ +import os + +import gtk + +import hulahop +hulahop.startup(os.path.expanduser('~/.test-hulahop')) +from hulahop.webview import WebView + +from xpcom import components + +class EventListener: + _com_interfaces_ = components.interfaces.nsIDOMEventListener + + def handleEvent(self, event): + print 'Mouse down' + +def _quit(window): + hulahop.shutdown() + gtk.main_quit() + +window = gtk.Window() +window.connect("destroy", _quit) + +web_view = WebView() +web_view.window_root.addEventListener('mousedown', EventListener(), False) +web_view.load_uri('http://www.google.com') +window.add(web_view) +web_view.show() + +window.show() + +gtk.main() diff --git a/tests/test-pref-service.py b/tests/test-pref-service.py new file mode 100644 index 0000000..c14cc15 --- /dev/null +++ b/tests/test-pref-service.py @@ -0,0 +1,31 @@ +import os + +import gtk + +import hulahop +hulahop.startup(os.path.expanduser('~/.test-hulahop')) +from hulahop.webview import WebView + +from xpcom import components + +def _quit(window): + hulahop.shutdown() + gtk.main_quit() + +cls = components.classes["@mozilla.org/preferences-service;1"] +prefService = cls.getService(components.interfaces.nsIPrefService) +branch = prefService.getBranch('') +branch.setBoolPref('security.warn_submit_insecure', False) +branch.setBoolPref('security.warn_submit_insecure.show_once', False) + +window = gtk.Window() +window.connect("destroy", _quit) + +web_view = WebView() +web_view.load_uri('http://www.google.com') +window.add(web_view) +web_view.show() + +window.show() + +gtk.main() diff --git a/tests/test-web-view.py b/tests/test-web-view.py index 3ca693a..0542654 100644 --- a/tests/test-web-view.py +++ b/tests/test-web-view.py @@ -6,46 +6,14 @@ import hulahop hulahop.startup(os.path.expanduser('~/.test-hulahop')) from hulahop.webview import WebView -from xpcom import components -from xpcom.server.factory import Factory - -class AppLauncher: - _com_interfaces_ = components.interfaces.nsIHelperAppLauncherDialog - - def promptForSaveToFile(self, launcher, windowContext, - defaultFile, suggestedFileExtension): - print 'promptForSaveToFile' - - def show(self, launcher, context, reason): - print 'show' - -class EventListener: - _com_interfaces_ = components.interfaces.nsIDOMEventListener - - def handleEvent(self, event): - print 'Mouse down' - def _quit(window): hulahop.shutdown() gtk.main_quit() -registrar = components.registrar -registrar.registerFactory('{64355793-988d-40a5-ba8e-fcde78cac631}"', - 'Test Application Launcher', - '@mozilla.org/helperapplauncherdialog;1', - Factory(AppLauncher)) - -cls = components.classes["@mozilla.org/preferences-service;1"] -prefService = cls.getService(components.interfaces.nsIPrefService) -branch = prefService.getBranch('') -branch.setBoolPref('security.warn_submit_insecure', False) -branch.setBoolPref('security.warn_submit_insecure.show_once', False) - window = gtk.Window() window.connect("destroy", _quit) web_view = WebView() -web_view.window_root.addEventListener('mousedown', EventListener(), False) web_view.load_uri('http://www.google.com') window.add(web_view) web_view.show() |