[Swfdec] test/trace
Pekka Lampila
medar at kemper.freedesktop.org
Sun Oct 28 07:13:28 PDT 2007
test/trace/Makefile.am | 11 +++++
test/trace/text-field-init-native-5.swf |binary
test/trace/text-field-init-native-5.swf.trace | 2 +
test/trace/text-field-init-native-6.swf |binary
test/trace/text-field-init-native-6.swf.trace | 2 +
test/trace/text-field-init-native-7.swf |binary
test/trace/text-field-init-native-7.swf.trace | 2 +
test/trace/text-field-init-native-8.swf |binary
test/trace/text-field-init-native-8.swf.trace | 2 +
test/trace/text-field-init-native.c | 49 ++++++++++++++++++++++++++
10 files changed, 68 insertions(+)
New commits:
commit c591a9ef90de7a70a19484ba4a7f3c4e992d7571
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Sun Oct 28 15:56:38 2007 +0200
Add text-field-init-native test. Include text-field-5.swf in Makefile.am
diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index 2ff2699..8b76930 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -1939,12 +1939,23 @@ EXTRA_DIST = \
text-field-html-input-8.swf \
text-field-html-input-8.swf.trace \
text-field-init.as \
+ text-field-init-5.swf \
+ text-field-init-5.swf.trace \
text-field-init-6.swf \
text-field-init-6.swf.trace \
text-field-init-7.swf \
text-field-init-7.swf.trace \
text-field-init-8.swf \
text-field-init-8.swf.trace \
+ text-field-init-native.as \
+ text-field-init-native-5.swf \
+ text-field-init-native-5.swf.trace \
+ text-field-init-native-6.swf \
+ text-field-init-native-6.swf.trace \
+ text-field-init-native-7.swf \
+ text-field-init-native-7.swf.trace \
+ text-field-init-native-8.swf \
+ text-field-init-native-8.swf.trace \
text-field-length.as \
text-field-length-5.swf \
text-field-length-5.swf.trace \
diff --git a/test/trace/text-field-init-native-5.swf b/test/trace/text-field-init-native-5.swf
new file mode 100644
index 0000000..0431b9d
Binary files /dev/null and b/test/trace/text-field-init-native-5.swf differ
diff --git a/test/trace/text-field-init-native-5.swf.trace b/test/trace/text-field-init-native-5.swf.trace
new file mode 100644
index 0000000..80b01f7
--- /dev/null
+++ b/test/trace/text-field-init-native-5.swf.trace
@@ -0,0 +1,2 @@
+Test whether native properties of TextField are initialized if the movie contains an EditText tag
+undefined
diff --git a/test/trace/text-field-init-native-6.swf b/test/trace/text-field-init-native-6.swf
new file mode 100644
index 0000000..82ea798
Binary files /dev/null and b/test/trace/text-field-init-native-6.swf differ
diff --git a/test/trace/text-field-init-native-6.swf.trace b/test/trace/text-field-init-native-6.swf.trace
new file mode 100644
index 0000000..e6459e5
--- /dev/null
+++ b/test/trace/text-field-init-native-6.swf.trace
@@ -0,0 +1,2 @@
+Test whether native properties of TextField are initialized if the movie contains an EditText tag
+true
diff --git a/test/trace/text-field-init-native-7.swf b/test/trace/text-field-init-native-7.swf
new file mode 100644
index 0000000..d022b13
Binary files /dev/null and b/test/trace/text-field-init-native-7.swf differ
diff --git a/test/trace/text-field-init-native-7.swf.trace b/test/trace/text-field-init-native-7.swf.trace
new file mode 100644
index 0000000..e6459e5
--- /dev/null
+++ b/test/trace/text-field-init-native-7.swf.trace
@@ -0,0 +1,2 @@
+Test whether native properties of TextField are initialized if the movie contains an EditText tag
+true
diff --git a/test/trace/text-field-init-native-8.swf b/test/trace/text-field-init-native-8.swf
new file mode 100644
index 0000000..257d609
Binary files /dev/null and b/test/trace/text-field-init-native-8.swf differ
diff --git a/test/trace/text-field-init-native-8.swf.trace b/test/trace/text-field-init-native-8.swf.trace
new file mode 100644
index 0000000..e6459e5
--- /dev/null
+++ b/test/trace/text-field-init-native-8.swf.trace
@@ -0,0 +1,2 @@
+Test whether native properties of TextField are initialized if the movie contains an EditText tag
+true
diff --git a/test/trace/text-field-init-native.c b/test/trace/text-field-init-native.c
new file mode 100644
index 0000000..58bd26f
--- /dev/null
+++ b/test/trace/text-field-init-native.c
@@ -0,0 +1,49 @@
+/* gcc `pkg-config --libs --cflags libming` text-field-init-native.c -o text-field-init-native && ./text-field-init-native
+ */
+
+#include <ming.h>
+
+static void
+do_movie (int version)
+{
+ char name[100];
+ SWFMovie movie;
+ SWFTextField text;
+ SWFDisplayItem display;
+
+ movie = newSWFMovieWithVersion (version);
+ movie = newSWFMovie();
+ SWFMovie_setRate (movie, 1);
+ SWFMovie_setDimension (movie, 200, 150);
+
+ text = newSWFTextField ();
+ display = SWFMovie_add (movie, (SWFBlock) text);
+
+ SWFMovie_add (movie, (SWFBlock) newSWFAction (""
+ "trace ('Test whether native properties of TextField are initialized if the movie contains an EditText tag');"
+ "_global.TextField.prototype.hasOwnProperty = ASnative (101, 5);"
+ "trace (_global.TextField.prototype.hasOwnProperty ('text'));"
+ "_global.TextField.prototype = new Object ();"
+ "loadMovie (\"FSCommand:quit\", \"\");"
+ ""));
+ SWFMovie_nextFrame (movie);
+
+ sprintf (name, "text-field-init-native-%d.swf", version);
+ SWFMovie_save (movie, name);
+}
+
+int
+main (int argc, char **argv)
+{
+ int i;
+
+ if (Ming_init ())
+ return 1;
+
+ for (i = 8; i >= 5; i--) {
+ do_movie (i);
+ }
+
+ return 0;
+}
+
More information about the Swfdec
mailing list