[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_start-
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_start-73-g94a88f8 |
Date: |
Thu, 17 Feb 2011 11:05:38 +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 94a88f8cb5ebbfa2896ec176a8c0cc91dd3ed9ad (commit)
from 1dabdaacf42b570fe9b1b1385f43caec3218722f (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=94a88f8cb5ebbfa2896ec176a8c0cc91dd3ed9ad
commit 94a88f8cb5ebbfa2896ec176a8c0cc91dd3ed9ad
Author: Sandro Santilli <address@hidden>
Date: Thu Feb 17 12:00:20 2011 +0100
Enhance loadMovieTest and runner to test you can pass a path-based target
to GETURL.
diff --git a/testsuite/misc-ming.all/loading/loadMovieTest.c
b/testsuite/misc-ming.all/loading/loadMovieTest.c
index 3e7f043..e1cc53a 100644
--- a/testsuite/misc-ming.all/loading/loadMovieTest.c
+++ b/testsuite/misc-ming.all/loading/loadMovieTest.c
@@ -1,6 +1,6 @@
/***********************************************************************
*
- * Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
+ * Copyright (C) 2007, 2009, 2010, 2011 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
@@ -87,10 +87,17 @@ add_clip(SWFMovie mo, char* file, char* name,
/* "Click" handler */
snprintf(action, 1023,
"%s.onPress = function () { "
- " coverart.loadMovie('%s');"
- " _level0.expectLoaded = '%s';"
+ " if ( Key.isDown(Key.SHIFT) ) { "
+ " loadMovie('%s', '/coverart');" /* Uses GETURL tag */
+ " _level0.loadMethod = 'GETURL, target:/coverart';"
+ " } else {"
+ " coverart.loadMovie('%s');"
+ " _level0.loadMethod = 'MovieClip.loadMovie';"
+ " }"
+ " _level0.expectLoaded = '%s';"
+ " note('Wait for the image to appear on the right. Then click
on it.');"
"};"
- ,name, url, fname);
+ , name, url, url, fname);
ac = compileSWFActionCode(action);
@@ -104,7 +111,7 @@ add_coverart(SWFMovie mo, int x, int y)
SWFFillStyle fstyle;
SWFMovieClip mc_coverart;
SWFDisplayItem it;
-#define BUFSIZE 1024
+#define BUFSIZE 2048
char buf[BUFSIZE];
sh_coverart = newSWFShape();
@@ -143,15 +150,30 @@ add_coverart(SWFMovie mo, int x, int y)
" _root.check_equals(lastUrlComponent, _level0.expectLoaded,
'%s:%d');"
" _root.check_equals(this.getDepth(), -16376);"
" _root.check_equals(this.getBytesLoaded(),
this.getBytesTotal());"
- " _root.check(this.getBytesLoaded() > 0);" /* assuming
something was loaded here */
- " _root.note('bytesLoaded: '+this.getBytesLoaded());"
- " if ( Key.isDown(Key.SHIFT) ) { "
- " trace('SHIFT-click on coverart...');"
- //" _root.note('SHIFT-click on coverart...');"
- " _root.totals(26, '"__FILE__"');"
- " _root.END_OF_TEST = true;"
- " }"
- " else _root.note('2 tests run');"
+ /* assuming something was loaded here */
+ " _root.check(this.getBytesLoaded() > 0);"
+ " _root.clicks++;"
+
+ " if ( _root.clicks < 4 ) {"
+ " _root.check_equals(_root.loadMethod, "
+ " 'MovieClip.loadMovie');"
+ " } else if ( _root.clicks < 7 ) {"
+ " _root.check_equals(_root.loadMethod, "
+ " 'GETURL, target:/coverart');"
+ " }"
+
+ " if ( _root.clicks < 3 ) {"
+ " _root.note('Click on the '+"
+ " _root.imagenames[_root.clicks]+' image.');"
+ " }"
+ " else if ( _root.clicks < 6 ) {"
+ " _root.note('SHIFT-Click on the '+"
+ " _root.imagenames[_root.clicks-3]+' image.');"
+ " } else {"
+ " _root.note('The test is over');"
+ " _root.totals(44, '"__FILE__"');"
+ " _root.END_OF_TEST = true;"
+ " }"
"};"
, __FILE__, __LINE__);
@@ -320,9 +342,9 @@ main(int argc, char** argv)
add_coverart(mo, 600, 100);
add_actions(mo,
- "note('Click on each image to load it into the container on the
right.');"
- "note('After each load, click on the container.');"
- "note('Finally, shift-click on the container to get results
printed.');"
+ "_root.imagenames = ['first','second','third'];"
+ "_root.clicks = 0;"
+ "note('Click on the '+_root.imagenames[_root.clicks]+'
image.');"
"_level0.expectLoaded = 'loadMovieTest.swf';"
// TODO: add self-contained tests after each load
// like for the DragAndDropTest.as movie
diff --git a/testsuite/misc-ming.all/loading/loadMovieTestRunner.cpp
b/testsuite/misc-ming.all/loading/loadMovieTestRunner.cpp
index 488a507..12e78c4 100644
--- a/testsuite/misc-ming.all/loading/loadMovieTestRunner.cpp
+++ b/testsuite/misc-ming.all/loading/loadMovieTestRunner.cpp
@@ -72,63 +72,46 @@ checkScribbling()
check_equals(coverart->getDisplayList().size(), initial_child_count);
}
-int
-main(int /*argc*/, char** /*argv*/)
+/* Wait until the coverart character is different from the given character */
+MovieClip*
+waitForLoad(MovieClip* from)
{
- gnash::LogFile& dbglogfile = gnash::LogFile::getDefaultInstance();
- dbglogfile.setVerbosity(1);
+ MovieClip* coverart;
- string filename = string(TGTDIR) + string("/") + string(INPUT_FILENAME);
- tester.reset(new MovieTester(filename));
+ // Wait for the movie to load
+ // TODO: drop this test and use a self-containment instead
+ do {
+ usleep(500); // give it some time...
+ tester->advance(); // loads (should) happen on next advance
+ coverart =
const_cast<DisplayObject*>(tester->findDisplayItemByName(*root,
"coverart"))->to_movie();
+ } while (coverart == from);
+
+ return coverart;
+}
+
+void
+clickCycle(MovieClip* coverart, bool withShift)
+{
- URL baseURL(filename);
URL mediaURL(MEDIADIR"/");
URL lynchURL("lynch.swf", mediaURL);
URL greenURL("green.jpg", mediaURL);
URL offspringURL("offspring.swf", mediaURL);
- std::string url;
-
- gnash::RcInitFile& rc = gnash::RcInitFile::getDefaultInstance();
- rc.addLocalSandboxPath(MEDIADIR);
-
-
- root = tester->getRootMovie();
- assert(root);
-
- check_equals(root->get_frame_count(), 2);
- check_equals(root->get_current_frame(), 0);
-
- tester->advance();
- check_equals(root->get_current_frame(), 1);
-
- // Verify that 'coverart' exists and is empty
- DisplayObject* coverartch =
const_cast<DisplayObject*>(tester->findDisplayItemByName(*root, "coverart"));
- MovieClip* coverart = coverartch->to_movie();
- check(coverart);
- url = coverart->get_root()->url();
- check_equals(coverart->get_root()->url(), baseURL.str());
-
- // Check scribbling on the empty canvas
- checkScribbling();
+ /*------------------------------------- */
// Click on the first (lynch)
tester->movePointerTo(80, 80);
check(tester->isMouseOverMouseEntity());
- tester->pressMouseButton();
- // Wait for the movie to load
- // TODO: drop this test and use a self-containment instead
- do {
- usleep(500); // give it some time...
- tester->advance(); // loads (should) happen on next advance
- coverartch =
const_cast<DisplayObject*>(tester->findDisplayItemByName(*root, "coverart"));
- } while (coverartch->to_movie() == coverart);
+ if ( withShift ) tester->pressKey(key::SHIFT);
+ tester->pressMouseButton();
- coverart = coverartch->to_movie();
+ coverart = waitForLoad(coverart);
check_equals(coverart->get_root()->url(), lynchURL.str());
tester->depressMouseButton();
+ if ( withShift ) tester->releaseKey(key::SHIFT);
// Check scribbling on the lynch
checkScribbling();
@@ -137,23 +120,22 @@ main(int /*argc*/, char** /*argv*/)
tester->movePointerTo(640,180);
tester->click(); tester->advance();
+ /*------------------------------------- */
+
// Click on the second (green)
tester->movePointerTo(280, 80);
check(tester->isMouseOverMouseEntity());
+
+ if ( withShift ) tester->pressKey(key::SHIFT);
tester->click();
+ if ( withShift ) tester->releaseKey(key::SHIFT);
- // Wait for the movie to load
- // TODO: drop this test and use a self-containment instead
- do {
- usleep(500); // give it some time...
- tester->advance(); // loads (should) happen on next advance
- coverartch =
const_cast<DisplayObject*>(tester->findDisplayItemByName(*root, "coverart"));
- } while (coverartch->to_movie() == coverart);
+ coverart = waitForLoad(coverart);
- coverart = coverartch->to_movie();
check_equals(coverart->get_root()->url(), greenURL.str());
// TODO: find a way to test if the jpeg is really displayed
- // (like turn it into a mouse-event-handling char and use
isMouseOverActiveEntity ?)
+ // (like turn it into a mouse-event-handling char and
+ // use isMouseOverActiveEntity ?)
// Check scribbling on the jpeg
checkScribbling();
@@ -162,20 +144,18 @@ main(int /*argc*/, char** /*argv*/)
tester->movePointerTo(640,180);
tester->click(); tester->advance();
+ /*------------------------------------- */
+
// Click on the third (offspring)
tester->movePointerTo(480, 80);
check(tester->isMouseOverMouseEntity());
+
+ if ( withShift ) tester->pressKey(key::SHIFT);
tester->click();
+ if ( withShift ) tester->releaseKey(key::SHIFT);
- // Wait for the movie to load
- // TODO: drop this test and use a self-containment instead
- do {
- usleep(500); // give it some time...
- tester->advance(); // loads (should) happen on next advance
- coverartch =
const_cast<DisplayObject*>(tester->findDisplayItemByName(*root, "coverart"));
- } while (coverartch->to_movie() == coverart);
+ coverart = waitForLoad(coverart);
- coverart = coverartch->to_movie();
check_equals(coverart->get_root()->url(), offspringURL.str());
// Check scribbling on the offspring
@@ -184,11 +164,43 @@ main(int /*argc*/, char** /*argv*/)
// Run 'coverart' tests..
tester->movePointerTo(640,180);
tester->click(); tester->advance();
+}
- // Get summary ...
- tester->pressKey(key::SHIFT);
- tester->click(); tester->advance();
- tester->releaseKey(key::SHIFT);
+int
+main(int /*argc*/, char** /*argv*/)
+{
+ gnash::LogFile& dbglogfile = gnash::LogFile::getDefaultInstance();
+ dbglogfile.setVerbosity(1);
+
+ string filename = string(TGTDIR) + string("/") + string(INPUT_FILENAME);
+ tester.reset(new MovieTester(filename));
+
+ URL baseURL(filename);
+
+ gnash::RcInitFile& rc = gnash::RcInitFile::getDefaultInstance();
+ rc.addLocalSandboxPath(MEDIADIR);
+
+ root = tester->getRootMovie();
+ assert(root);
+
+ check_equals(root->get_frame_count(), 2);
+ check_equals(root->get_current_frame(), 0);
+
+ tester->advance();
+ check_equals(root->get_current_frame(), 1);
+
+ // Verify that 'coverart' exists and is empty
+ DisplayObject* coverartch =
const_cast<DisplayObject*>(tester->findDisplayItemByName(*root, "coverart"));
+ MovieClip* coverart = coverartch->to_movie();
+ check(coverart);
+ std::string url = coverart->get_root()->url();
+ check_equals(coverart->get_root()->url(), baseURL.str());
+
+ // Check scribbling on the empty canvas
+ checkScribbling();
+
+ clickCycle(coverart, false);
+ clickCycle(coverart, true);
// Consistency checking
VM& vm = getVM(*getObject(root));
-----------------------------------------------------------------------
Summary of changes:
testsuite/misc-ming.all/loading/loadMovieTest.c | 56 ++++++---
.../misc-ming.all/loading/loadMovieTestRunner.cpp | 134 +++++++++++---------
2 files changed, 112 insertions(+), 78 deletions(-)
hooks/post-receive
--
Gnash
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_start-73-g94a88f8,
Sandro Santilli <=