[seed] tests: Add test of the self parameter to init, and of passing additional properties to GObject const
- From: Robert Carr <racarr src gnome org>
- To: svn-commits-list gnome org
- Subject: [seed] tests: Add test of the self parameter to init, and of passing additional properties to GObject const
- Date: Mon, 25 May 2009 16:42:10 -0400 (EDT)
commit 1a599fdb7e834e5b35a2e9fbb379c9976022086e
Author: Robert Carr <racarr svn gnome org>
Date: Mon May 25 16:42:00 2009 -0400
tests: Add test of the self parameter to init, and of passing additional properties to GObject constructors
---
tests/javascript/gtypes/Makefile.am | 2 ++
tests/javascript/gtypes/gtype-extraprop.js | 21 +++++++++++++++++++++
tests/javascript/gtypes/gtype-self.js | 21 +++++++++++++++++++++
3 files changed, 44 insertions(+), 0 deletions(-)
diff --git a/tests/javascript/gtypes/Makefile.am b/tests/javascript/gtypes/Makefile.am
index b300326..8c0778c 100644
--- a/tests/javascript/gtypes/Makefile.am
+++ b/tests/javascript/gtypes/Makefile.am
@@ -5,5 +5,7 @@ EXTRA_DIST = \
gtype.js \
gtype-signal-args.js \
gtype-property-construct.js \
+ gtype-self.js \
+ gtype-extraprop.js \
gtype-signal.js
diff --git a/tests/javascript/gtypes/gtype-extraprop.js b/tests/javascript/gtypes/gtype-extraprop.js
new file mode 100755
index 0000000..118d3ed
--- /dev/null
+++ b/tests/javascript/gtypes/gtype-extraprop.js
@@ -0,0 +1,21 @@
+#!/usr/bin/env seed
+// Returns: 0
+// STDIN:
+// STDOUT:1
+// STDERR:
+
+Gtk = imports.gi.Gtk;
+Gtk.init(Seed.argv);
+
+HelloWindowType = {
+ parent: Gtk.Window.type,
+ name: "HelloWindow",
+ init: function(self){
+ Seed.print(self.test);
+ }};
+
+HelloWindow = new GType(HelloWindowType);
+w = new HelloWindow({test: 1});
+
+w.show();
+
diff --git a/tests/javascript/gtypes/gtype-self.js b/tests/javascript/gtypes/gtype-self.js
new file mode 100755
index 0000000..be3434d
--- /dev/null
+++ b/tests/javascript/gtypes/gtype-self.js
@@ -0,0 +1,21 @@
+#!/usr/bin/env seed
+// Returns: 0
+// STDIN:
+// STDOUT:1
+// STDERR:
+
+Gtk = imports.gi.Gtk;
+Gtk.init(Seed.argv);
+
+HelloWindowType = {
+ parent: Gtk.Window.type,
+ name: "HelloWindow",
+ init: function(self){
+ Seed.print(this==self);
+ }};
+
+HelloWindow = new GType(HelloWindowType);
+w = new HelloWindow();
+
+w.show();
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]