[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/loadMov...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog testsuite/misc-ming.all/loadMov... |
Date: |
Wed, 09 Jan 2008 17:09:17 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 08/01/09 17:09:17
Modified files:
. : ChangeLog
testsuite/misc-ming.all: loadMovieTest.c loadMovieTestRunner.cpp
Log message:
Initial work to turn loadMovieTest.swf into a self-described/contained
testcase.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5355&r2=1.5356
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/loadMovieTest.c?cvsroot=gnash&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/loadMovieTestRunner.cpp?cvsroot=gnash&r1=1.13&r2=1.14
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.5355
retrieving revision 1.5356
diff -u -b -r1.5355 -r1.5356
--- ChangeLog 9 Jan 2008 16:21:38 -0000 1.5355
+++ ChangeLog 9 Jan 2008 17:09:16 -0000 1.5356
@@ -1,5 +1,11 @@
2008-01-09 Sandro Santilli <address@hidden>
+ * testsuite/misc-ming.all/: loadMovieTest.c, loadMovieTestRunner.cpp:
+ Initial work to turn loadMovieTest.swf into a
+ self-described/contained testcase.
+
+2008-01-09 Sandro Santilli <address@hidden>
+
* server/asobj/Math.cpp: make _global.Math inherit
from Object.
* testsuite/actionscript.all/Math.as: test that _global.Math
Index: testsuite/misc-ming.all/loadMovieTest.c
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/loadMovieTest.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- testsuite/misc-ming.all/loadMovieTest.c 1 Jul 2007 10:54:55 -0000
1.5
+++ testsuite/misc-ming.all/loadMovieTest.c 9 Jan 2008 17:09:16 -0000
1.6
@@ -78,12 +78,18 @@
SWFDisplayItem_setName(it, name);
SWFDisplayItem_moveTo(it, x, y);
+ // last portion of the url (before the slash)
+ char* fname = strrchr(url, '/');
+ if ( fname ) fname++;
+ else fname = url;
+
/* "Click" handler */
- sprintf(action, " \
-%s.onPress = function () { \
- coverart.loadMovie('%s'); \
-}; \
-", name, url);
+ snprintf(action, 1023,
+ "%s.onPress = function () { "
+ " coverart.loadMovie('%s');"
+ " _level0.expectLoaded = '%s';"
+ "};"
+ ,name, url, fname);
ac = compileSWFActionCode(action);
@@ -97,6 +103,8 @@
SWFFillStyle fstyle;
SWFMovieClip mc_coverart;
SWFDisplayItem it;
+#define BUFSIZE 1024
+ char buf[BUFSIZE];
sh_coverart = newSWFShape();
fstyle = SWFShape_addSolidFillStyle(sh_coverart, 0,0,0,255);
@@ -113,6 +121,29 @@
it = SWFMovie_add(mo, (SWFBlock)mc_coverart);
SWFDisplayItem_setName(it, "coverart");
SWFDisplayItem_moveTo(it, x, y);
+
+ snprintf(buf, BUFSIZE,
+ "_level0.coverart.onMouseDown = function() {"
+ //" _root.note('_url is '+this._url);"
+ " var lastUrlComponent =
this._url.substring(this._url.lastIndexOf('/')+1);"
+ //" _root.note('last component of _url is '+lastUrlComponent);"
+ " _root.check_equals(lastUrlComponent, _level0.expectLoaded,
'%s:%d');"
+ " _root.check_equals(this.getDepth(), -16377);"
+ " if ( Key.isDown(Key.SHIFT) ) _root.totals();"
+ " else _root.note('2 tests run');"
+ "};"
+ , __FILE__, __LINE__);
+
+ printf("%s", buf);
+
+ SWFDisplayItem_addAction(it, compileSWFActionCode(buf),
+ SWFACTION_ROLLOVER);
+
+ SWFDisplayItem_addAction(it, compileSWFActionCode(
+ "delete _level0.coverart.onMouseDown;"
+ ),
+ SWFACTION_ROLLOUT);
+
}
SWFTextField
@@ -146,6 +177,8 @@
{
SWFMovie mo;
SWFMovieClip dejagnuclip;
+ SWFDisplayItem it;
+
char file_lynch[256];
char file_green[256];
char file_offspring[256];
@@ -198,9 +231,9 @@
*****************************************************/
dejagnuclip = get_dejagnu_clip((SWFBlock)get_default_font(mediadir),
10, 0, 0, 800, 600);
- //it = SWFMovie_add(mo, (SWFBlock)dejagnuclip);
- //SWFDisplayItem_moveTo(it, 0, 200);
- //SWFMovie_nextFrame(mo);
+ it = SWFMovie_add(mo, (SWFBlock)dejagnuclip);
+ SWFDisplayItem_moveTo(it, 0, 250);
+ SWFMovie_nextFrame(mo);
/*****************************************************
*
@@ -256,9 +289,17 @@
puts("Adding coverart");
- add_coverart(mo, 500, 200);
+ add_coverart(mo, 600, 100);
- add_actions(mo, "stop();");
+ add_actions(mo,
+ "note('Click on each image to load it into the container on the
right.');"
+ "note('Click on the container to run tests after each load.');"
+ "note('Shift-click on the container to get results printed.');"
+ "_level0.expectLoaded = 'loadMovieTest.swf';"
+ // TODO: add self-contained tests after each load
+ // like for the DragAndDropTest.as movie
+ "stop();"
+ );
SWFMovie_nextFrame(mo); /* showFrame */
/*****************************************************
Index: testsuite/misc-ming.all/loadMovieTestRunner.cpp
===================================================================
RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/loadMovieTestRunner.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- testsuite/misc-ming.all/loadMovieTestRunner.cpp 8 Jan 2008 11:37:21
-0000 1.13
+++ testsuite/misc-ming.all/loadMovieTestRunner.cpp 9 Jan 2008 17:09:16
-0000 1.14
@@ -94,8 +94,8 @@
root = tester->getRootMovie();
assert(root.get());
- check_equals(root->get_frame_count(), 1);
- check_equals(root->get_current_frame(), 0);
+ check_equals(root->get_frame_count(), 2);
+ check_equals(root->get_current_frame(), 1);
tester->advance();
check_equals(root->get_current_frame(), 0);