gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] [SCM] Gnash branch, master, updated. 9df5cf7a3c1900185523


From: Benjamin Wolsey
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. 9df5cf7a3c19001855238837d70161923999fcb0
Date: Fri, 26 Nov 2010 12:02:27 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  9df5cf7a3c19001855238837d70161923999fcb0 (commit)
       via  5bdc73b3c48708d4a9e2930fe2600a7eb13cbc33 (commit)
       via  347185936c77d1dbea708368b2af8ca2055f4407 (commit)
      from  54d730c333d57cbfed3c63d37c16a68dbf10f00a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=9df5cf7a3c19001855238837d70161923999fcb0


commit 9df5cf7a3c19001855238837d70161923999fcb0
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Nov 26 12:59:30 2010 +0100

    Run test and expect pass.

diff --git a/testsuite/misc-ming.all/Makefile.am 
b/testsuite/misc-ming.all/Makefile.am
index f607318..7e4bf5b 100644
--- a/testsuite/misc-ming.all/Makefile.am
+++ b/testsuite/misc-ming.all/Makefile.am
@@ -277,6 +277,8 @@ check_SCRIPTS += remotingTestRunner
 endif
 if ENABLE_RED5_TESTING
 check_SCRIPTS += red5test-runner
+endif
+if ENABLE_RTMPY_TESTING
 check_SCRIPTS += rtmpytest-runner
 endif
 endif
@@ -1744,6 +1746,9 @@ endif
 if ENABLE_RED5_TESTING
 TEST_CASES += red5test-runner
 endif
+if ENABLE_RTMPY_TESTING
+TEST_CASES += rtmpytest-runner
+endif
 endif
 
 if MING_SUPPORTS_INIT_ACTIONS
diff --git a/testsuite/misc-ming.all/rtmpytest.as 
b/testsuite/misc-ming.all/rtmpytest.as
index ae13c6d..359bd06 100644
--- a/testsuite/misc-ming.all/rtmpytest.as
+++ b/testsuite/misc-ming.all/rtmpytest.as
@@ -216,7 +216,7 @@ ncrtmp.initial = function(arg) {
 
     xcheck(o.hasOwnProperty("pageUrl"));
 
-    xcheck_equals(o.pageUrl, undefined);
+    check_equals(o.pageUrl, undefined);
 
     xcheck(o.hasOwnProperty("videoFunction"));
 

http://git.savannah.gnu.org/cgit//commit/?id=5bdc73b3c48708d4a9e2930fe2600a7eb13cbc33


commit 5bdc73b3c48708d4a9e2930fe2600a7eb13cbc33
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Nov 26 12:41:16 2010 +0100

    Minor changes to server.

diff --git a/testsuite/rtmpy-echo-server.py b/testsuite/rtmpy-echo-server.py
index 890f7c6..9208ca4 100644
--- a/testsuite/rtmpy-echo-server.py
+++ b/testsuite/rtmpy-echo-server.py
@@ -20,13 +20,12 @@ class LiveApplication(server.Application):
     def onConnect(self, client, **args):
         print("Connection")
         client.call("initial", [ "connection attempt received", args ])
-        print(args.items())
+        print(args)
         return True
 
     def onConnectAccept(self, client, **args):
         print("Connection accepted", client)
-        client.call("welcome", [ "You have connected!" ] + args.items())
-        print(args.items())
+        client.call("welcome", [ "You have connected!", args ])
         return True
 
     def onDownstreamBandwidth(self, interval, bandwidth):

http://git.savannah.gnu.org/cgit//commit/?id=347185936c77d1dbea708368b2af8ca2055f4407


commit 347185936c77d1dbea708368b2af8ca2055f4407
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Nov 26 12:40:09 2010 +0100

    Add rtmpy test.

diff --git a/configure.ac b/configure.ac
index a58b9e9..da25354 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2244,6 +2244,20 @@ if test x$cross_compiling = xno; then
 fi
 AM_CONDITIONAL(ENABLE_RED5_TESTING, [ test x"$RED5_HOST" != x ])
 
+if test x$cross_compiling = xno; then
+  AC_ARG_ENABLE([rtmpy_testing],
+      dnl # TODO: find out how to add [quotes] around '=<baseurl>'
+         AC_HELP_STRING([--enable-rtmpy-testing=<host>],
+                 [Enable rtmpy based testing (default host is 
www.gnashdev.org)]),
+             [case "${enableval}" in
+             no) RTMPY_HOST="" ;;
+            yes) RTMPY_HOST="www.gnashdev.org" ;;
+              *) RTMPY_HOST="${enableval}";;
+           esac])
+  AC_SUBST(RTMPY_HOST)
+fi
+AM_CONDITIONAL(ENABLE_RTMPY_TESTING, [ test x"$RTMPY_HOST" != x ])
+
 dnl The name might differ between systems.
 if test x"$testsuite" = x"yes"; then
 AC_PATH_PROGS(NETCAT, [nc netcat])
diff --git a/testsuite/misc-ming.all/Makefile.am 
b/testsuite/misc-ming.all/Makefile.am
index 288be6d..f607318 100644
--- a/testsuite/misc-ming.all/Makefile.am
+++ b/testsuite/misc-ming.all/Makefile.am
@@ -277,6 +277,7 @@ check_SCRIPTS += remotingTestRunner
 endif
 if ENABLE_RED5_TESTING
 check_SCRIPTS += red5test-runner
+check_SCRIPTS += rtmpytest-runner
 endif
 endif
 
@@ -1493,6 +1494,15 @@ red5test-runner: $(srcdir)/../generic-testrunner.sh 
red5test.swf
        sh $< -c "ENDOFTEST" $(top_builddir) red5test.swf > $@
        chmod 755 $@
 
+rtmpytest.swf: $(srcdir)/rtmpytest.as Dejagnu.swf Makefile 
../actionscript.all/check.as ../actionscript.all/utils.as
+       $(MAKESWF) -n network -r12 -o $@ -v7 -DRTMPY_HOST='\"$(RTMPY_HOST)\"' \
+               -DUSE_DEJAGNU_MODULE -DOUTPUT_VERSION=7 Dejagnu.swf 
$(srcdir)/rtmpytest.as \
+               $(srcdir)/../actionscript.all/dejagnu_so_fini.as
+
+rtmpytest-runner: $(srcdir)/../generic-testrunner.sh rtmpytest.swf
+       sh $< -c "ENDOFTEST" $(top_builddir) rtmpytest.swf > $@
+       chmod 755 $@
+
 case6.swf: $(srcdir)/case6.as Makefile ../actionscript.all/check.as
        $(MAKESWF) -v6 -o $@ -DUSE_DEJAGNU_MODULE -DOUTPUT_VERSION=6 
-I$(srcdir)/../actionscript.all $(srcdir)/case6.as 
 
diff --git a/testsuite/misc-ming.all/red5test.as 
b/testsuite/misc-ming.all/red5test.as
index e9a6117..43fd249 100644
--- a/testsuite/misc-ming.all/red5test.as
+++ b/testsuite/misc-ming.all/red5test.as
@@ -151,9 +151,6 @@ runtests = function(nc)
     test1(nc);
 };
 
-//
-// do the same thing for RTMP
-//
 ncrtmp = new NetConnection();
 ncrtmp.statuses = new Array();
 ncrtmp.onStatus = function()
diff --git a/testsuite/misc-ming.all/red5test.as 
b/testsuite/misc-ming.all/rtmpytest.as
similarity index 60%
copy from testsuite/misc-ming.all/red5test.as
copy to testsuite/misc-ming.all/rtmpytest.as
index e9a6117..ae13c6d 100644
--- a/testsuite/misc-ming.all/red5test.as
+++ b/testsuite/misc-ming.all/rtmpytest.as
@@ -1,13 +1,11 @@
-// This test relies on a default deploy of red5 on localhost
-//
-// Build with:
-//        makeswf -n network -o red5test.swf ../Dejagnu.swf red5test.as 
../actionscript.all/dejagnu_so_fini.as
-// Run with:
-//        firefox red5test.swf
-// Or:
-//        gnash red5test.swf
-//
-//
+// This test may have similarities to the red5test, but we don't
+// attempt to keep them in sync.
+
+// Differences between red5 and rtmpy:
+// rtmpy always returns an object: a single primitive type is
+// convert to the corresponding object. If several arguments are
+// sent, an array is returned. This array may contain primitive
+// types.
 
 note("SWF" + OUTPUT_VERSION + " - " + System.capabilities.version + "\n");
 rcsid="red5test.as - <bzr revno here>";
@@ -26,16 +24,20 @@ stop();
 
 endOfTest = function()
 {
-    totals(38);
+    // Should be incremented on connect
+    check_equals(welcomecalls, 1);
+    check_equals(connectcalls, 1);
+
+    totals(57);
     trace("ENDOFTEST");
     play();
 };
 
 // -P FlashVars='hostname=localhost,rtmptport5080=rtmpport=1935'
-hostname = RED5_HOST;
+hostname = RTMPY_HOST;
 
 if (rtmpport == undefined) {
-    rtmpport = 1935;
+    rtmpport = 9984;
     note("No RTMP port specified, defaulting to "+rtmpport);
 }
 
@@ -46,8 +48,8 @@ test1 = function(nc)
     o.onResult = function(arg)
     {
         check_equals(arguments.length, 1);
-        check_equals(arg, "hello");
-        check_equals(typeof(arg), "string");
+        check_equals(arg.toString(), "hello");
+        check_equals(typeof(arg), "object");
         test2(nc);
     };
     nc.call("echo", o, "hello");
@@ -60,7 +62,8 @@ test2 = function(nc)
     o.onResult = function(arg)
     {
         check_equals(arguments.length, 1);
-        check_equals(typeof(arg), "number");
+        check_equals(typeof(arg), "object");
+        check_equals(arg.toString(), "24");
         test3(nc);
     };
     nc.call("echo", o, 24);
@@ -131,32 +134,52 @@ test5 = function(nc)
     };
 
     nc.onStatus = function(obj) {
+        trace(dumpObject(obj));
         check_equals(typeof(obj), "object");
-        check(obj.hasOwnProperty("application"));
         check(obj.hasOwnProperty("level"));
         check(obj.hasOwnProperty("code"));
         check(obj.hasOwnProperty("description"));
-        check_equals(obj.application, 
"org.red5.server.service.MethodNotFoundException");
         check_equals(obj.level, "error");
         check_equals(obj.code, "NetConnection.Call.Failed");
-        check_equals(obj.description, "Method nonexistentfunc with arguments 
[hello, null] not found");
-        endOfTest();
+        check_equals(obj.description, "Unknown method u'nonexistentfunc'");
+        nc.onStatus = defaultOnStatus;
+        test6(nc);
     };
 
     nc.call("nonexistentfunc", o, "hello", null);
 };
 
+test6 = function(nc)
+{
+    note("Running test 6");
+    o = {};
+    o.onResult = function(obj) {
+        trace(dumpObject(obj));
+        test7(nc);
+    };
+
+    nc.call("echo", o, 1);
+};
+
+test7 = function(nc)
+{
+    nc.onStatus = function(obj) {
+        check_equals(obj.level, "status");
+        check_equals(obj.code, "NetConnection.Connect.Closed");
+        endOfTest();
+    };
+    nc.close();
+};
+
+
 runtests = function(nc)
 {
     test1(nc);
 };
 
-//
-// do the same thing for RTMP
-//
 ncrtmp = new NetConnection();
 ncrtmp.statuses = new Array();
-ncrtmp.onStatus = function()
+defaultOnStatus = function()
 {
     this.statuses.push(arguments);
     note('NetConnection.onStatus called with args: ' + dumpObject(arguments));
@@ -169,7 +192,53 @@ ncrtmp.onStatus = function()
     runtests(this);
 };
 
-rtmpuri = "rtmp://"+hostname+":"+rtmpport+"/echo";
+ncrtmp.onStatus = defaultOnStatus;
+
+ncrtmp.disconnected = function(arg) {
+    fail("boohoo");
+};
+
+welcomecalls = 0;
+ncrtmp.welcome = function(arg) {
+    ++welcomecalls;
+    xcheck_equals(arg[0].toString(), "You have connected!");
+    trace(dumpObject(arg[1]));
+};
+
+connectcalls = 0;
+ncrtmp.initial = function(arg) {
+    ++connectcalls;
+    xcheck_equals(arg[0].toString(), "connection attempt received");
+    o = arg[1];
+
+    xcheck(o.hasOwnProperty("fpad"));
+    xcheck_equals(o.fpad, false);
+
+    xcheck(o.hasOwnProperty("pageUrl"));
+
+    xcheck_equals(o.pageUrl, undefined);
+
+    xcheck(o.hasOwnProperty("videoFunction"));
+
+    xcheck(o.hasOwnProperty("tcUrl"));
+
+    xcheck(o.hasOwnProperty("app"));
+    xcheck_equals(o.app, "rtmpyecho");
+
+    xcheck(o.hasOwnProperty("flashVer"));
+    xcheck_equals(o.flashVer, $version);
+
+    xcheck(o.hasOwnProperty("audioCodecs"));
+    xcheck(o.hasOwnProperty("videoCodecs"));
+
+    xcheck(o.hasOwnProperty("swfUrl"));
+
+    xcheck(o.hasOwnProperty("capabilities"));
+
+    trace(dumpObject(arg[1]));
+};
+
+rtmpuri = "rtmp://"+hostname+":"+rtmpport+"/rtmpyecho";
 note("Connecting to "+rtmpuri);
 ncrtmp.connect(rtmpuri);
 
diff --git a/testsuite/rtmpy-echo-server.py b/testsuite/rtmpy-echo-server.py
new file mode 100644
index 0000000..890f7c6
--- /dev/null
+++ b/testsuite/rtmpy-echo-server.py
@@ -0,0 +1,52 @@
+from rtmpy import server
+
+from twisted.internet import reactor
+
+
+class LiveApplication(server.Application):
+    """
+    The simplest application possible.
+    """
+
+    def startup(self):
+        print("Startup")
+
+    def onAppStart(self):
+        print("App start")
+    
+    def onAppStop(self):
+        print("App stop")
+
+    def onConnect(self, client, **args):
+        print("Connection")
+        client.call("initial", [ "connection attempt received", args ])
+        print(args.items())
+        return True
+
+    def onConnectAccept(self, client, **args):
+        print("Connection accepted", client)
+        client.call("welcome", [ "You have connected!" ] + args.items())
+        print(args.items())
+        return True
+
+    def onDownstreamBandwidth(self, interval, bandwidth):
+        print("Downstream Bandwidth:", interval, bandwidth)
+        return True
+
+    def echo(self, *args, **kw):
+        print("echo", args, kw)
+        return args
+
+    def onDisconnect(self, client):
+       # This is probably never actually sent.
+       client.call("disconnected", "arg1");
+        return True;
+
+
+app = LiveApplication()
+
+reactor.listenTCP(9984, server.ServerFactory({
+    'rtmpyecho': app
+}))
+
+reactor.run()

-----------------------------------------------------------------------

Summary of changes:
 configure.ac                                       |   14 +++
 testsuite/misc-ming.all/Makefile.am                |   15 +++
 testsuite/misc-ming.all/red5test.as                |    3 -
 .../misc-ming.all/{red5test.as => rtmpytest.as}    |  119 +++++++++++++++----
 testsuite/rtmpy-echo-server.py                     |   51 +++++++++
 5 files changed, 174 insertions(+), 28 deletions(-)
 copy testsuite/misc-ming.all/{red5test.as => rtmpytest.as} (61%)
 create mode 100644 testsuite/rtmpy-echo-server.py


hooks/post-receive
-- 
Gnash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]