[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/NetStre...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/NetStre... |
Date: |
Sat, 10 May 2008 15:40:48 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 08/05/10 15:40:48
Modified files:
. : ChangeLog
testsuite/misc-ming.all: NetStream-SquareTest.c
NetStream-SquareTestRunner.cpp
Log message:
* testsuite/misc-ming.all/: NetStream-SquareTest.c,
NetStream-SquareTestRunner.cpp: add test for pause/play
using user-interaction + some events-related tests.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6577&r2=1.6578
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/NetStream-SquareTest.c?cvsroot=gnash&r1=1.25&r2=1.26
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/NetStream-SquareTestRunner.cpp?cvsroot=gnash&r1=1.9&r2=1.10
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6577
retrieving revision 1.6578
diff -u -b -r1.6577 -r1.6578
--- ChangeLog 10 May 2008 11:05:26 -0000 1.6577
+++ ChangeLog 10 May 2008 15:40:46 -0000 1.6578
@@ -1,5 +1,11 @@
2008-05-10 Sandro Santilli <address@hidden>
+ * testsuite/misc-ming.all/: NetStream-SquareTest.c,
+ NetStream-SquareTestRunner.cpp: add test for pause/play
+ using user-interaction + some events-related tests.
+
+2008-05-10 Sandro Santilli <address@hidden>
+
* libbase/utility.h: add smallestMultipleContaining
utility function.
* libbase/FLVParser.{cpp,h}: always allocate a multiple
Index: testsuite/misc-ming.all/NetStream-SquareTest.c
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/NetStream-SquareTest.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -b -r1.25 -r1.26
--- testsuite/misc-ming.all/NetStream-SquareTest.c 26 Mar 2008 18:37:17
-0000 1.25
+++ testsuite/misc-ming.all/NetStream-SquareTest.c 10 May 2008 15:40:47
-0000 1.26
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2007 Free Software Foundation, Inc.
+ * Copyright (C) 2007, 2008 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -96,6 +96,11 @@
sprintf(buffer_b,
// bytesTotal (read-only)
"stream.play('%s');"
+ "stream.pause(true);"
+ "stream.paused=true;"
+ "_root.metadataNotified=0;"
+ "_root.startNotified=0;"
+ "_root.stopNotified=0;"
"stop();",
filename);
@@ -236,6 +241,19 @@
SWFMovie_add(mo, (SWFBlock)newSWFAction(
+ "_root.onKeyDown = function() {"
+ " _root.note(' bufferLength:'+stream.bufferLength+"
+ " ' bytesLoaded:'+stream.bytesLoaded+"
+ " ' currentFps:'+stream.currentFps+'
time:'+stream.time);"
+ " var ascii = Key.getAscii();"
+ " trace('Key down: '+ascii);"
+ " if ( ascii == 32 ) {" // ' ' - start/stop playback
+ " stream.paused = !stream.paused;"
+ " stream.pause(stream.paused);"
+ " }"
+ "};"
+ "Key.addListener(_root);"
+
"stream.onStatus = function(info) {"
" if ( ! _root.enumerableStatusInfoChecked ) {"
@@ -265,18 +283,27 @@
// Print some info
" _root.note('onStatus('+info.code+') called'); "
- " _root.note(' bufferLength:'+stream.bufferLength+"
- " ' bytesLoaded:'+stream.bytesLoaded+"
- " ' currentFps:'+stream.currentFps+' time:'+stream.time);"
- " if ( info.code == 'NetStream.Play.Stop' )"
+ " if ( info.code == 'NetStream.Play.Start' )"
+ " {"
+ " check(!_root.startNotified, 'No duplicated Play.Start
notification');"
+ " _root.startNotified++;"
+ " }"
+
+ " else if ( info.code == 'NetStream.Play.Stop' )"
" {"
+ " if ( ! _root.stopNotified )"
+ " {"
+ " _root.stopNotified++;"
+ " stream.seek(0);"
+ " } else {"
+ " _root.stopNotified++;"
" _root.check(this instanceOf NetStream); "
" _root.check_equals(this.bufferTime, 2); "
" _root.check_equals(this.bytesTotal, 21482); "
- " this.stopNotified = true;"
" _root.nextFrame();"
" }"
+ " }"
#if 0
" else if ( info.code == 'NetStream.Buffer.Empty' &&
this.stopNotified ) "
" {"
@@ -302,8 +329,15 @@
" }"
" _root.note('onMetaData: '+s);"
+ // don't run other tests if already done
+ // BTW: should be called once, gnash (gst) calls this twice
+ // and would succeed in composition checking in second
call.
+ " if ( _root.metadataNotified ) return;"
+
+ " _root.metadataNotified++;"
+ " xcheck(_root.startNotified, 'onMetaData should be notified
after Play.Start');"
" check_equals(arguments.length, 1, 'single argument');"
- " check(info instanceof Object);"
+ " check(info instanceof Object, 'onMetaData argument should be
instanceof Object');"
// Test enumeration
" var enu = new Array;"
@@ -397,12 +431,17 @@
" delete info.duration;"
" check(!info.hasOwnProperty('duration'), 'metadata duration
can be deleted');"
+ " _root.note('- Press space to continue, or any key to just see
info about playhed -');"
+
"};"
));
SWFMovie_nextFrame(mo);
- SWFMovie_add(mo, (SWFBlock)newSWFAction("totals(112); stop();"));
+ check_equals(mo, "metadataNotified", "1");
+ check_equals(mo, "stopNotified", "2");
+ check_equals(mo, "startNotified", "1");
+ SWFMovie_add(mo, (SWFBlock)newSWFAction("totals(117); stop();"));
SWFMovie_nextFrame(mo);
Index: testsuite/misc-ming.all/NetStream-SquareTestRunner.cpp
===================================================================
RCS file:
/sources/gnash/gnash/testsuite/misc-ming.all/NetStream-SquareTestRunner.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- testsuite/misc-ming.all/NetStream-SquareTestRunner.cpp 21 Jan 2008
23:26:51 -0000 1.9
+++ testsuite/misc-ming.all/NetStream-SquareTestRunner.cpp 10 May 2008
15:40:47 -0000 1.10
@@ -21,6 +21,8 @@
#define INPUT_FILENAME "NetStream-SquareTest.swf"
#include "MovieTester.h"
+#include "VM.h"
+#include "string_table.h"
#include "sprite_instance.h"
#include "character.h"
#include "dlist.h"
@@ -62,7 +64,10 @@
// When all possible tests are implemented as self-contained, we'll
// add tests that can't be self-contained.
//
- while (root->get_current_frame() < 2)
+ string_table& st = VM::get().getStringTable();
+ string_table::key k = st.find("startNotified");
+ as_value tmp;
+ while (! root->get_member(k, &tmp) )
{
tester.advance();
@@ -71,6 +76,18 @@
sleep(1);
}
+ cout << "Pressing space" << endl;
+ tester.pressKey(key::SPACE);
+ tester.releaseKey(key::SPACE);
+
+ while (root->get_current_frame() < 2)
+ {
+ tester.advance();
+
+ // sleep to give the NetStream a chance to load data and
trigger notifications
+ // needs more analisys to find a good way for doing this..
+ sleep(1);
+ }
}
- [Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/NetStre...,
Sandro Santilli <=