2 * Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 #define INPUT_FILENAME "NetStream-SquareTest.swf"
23 #include "MovieTester.h"
25 #include "string_table.h"
26 #include "MovieClip.h"
27 #include "DisplayObject.h"
28 #include "DisplayList.h"
30 #include "GnashSleep.h"
35 #include "GnashSystemIOHeaders.h"
37 using namespace gnash
;
41 main(int /*argc*/, char** /*argv*/)
43 string filename
= string(TGTDIR
) + string("/") + string(INPUT_FILENAME
);
44 MovieTester
tester(filename
);
46 gnash::RcInitFile
& rc
= gnash::RcInitFile::getDefaultInstance();
47 rc
.addLocalSandboxPath(MEDIADIR
);
49 gnash::LogFile
& dbglogfile
= gnash::LogFile::getDefaultInstance();
50 dbglogfile
.setVerbosity(1);
52 MovieClip
* root
= tester
.getRootMovie();
55 if ( ! tester
.canTestVideo() )
57 cout
<< "UNTESTED: NetStream video (not supported by this build)."
62 // On NetStatus.Play.Stop we jump to last frame and stop,
63 // so this loop is about equivalent to running a
64 // generic self-contained test.
66 // When all possible tests are implemented as self-contained, we'll
67 // add tests that can't be self-contained.
71 const ObjectURI
& k
= getURI(vm
, "startNotified");
73 while (!getObject(root
)->get_member(k
, &tmp
) )
77 // sleep to give the NetStream a chance to load
78 // data and trigger notifications
79 // needs more analisys to find a good way for doing this..
80 gnashSleep(10000); // 10 milliseconds should be enough for loading
83 cout
<< "Pressing space" << endl
;
84 tester
.pressKey(key::SPACE
);
85 tester
.releaseKey(key::SPACE
);
87 while (root
->get_current_frame() < 2)
91 // sleep to give the NetStream a chance to
92 // load data and trigger notifications
93 // needs more analisys to find a good way for doing this..
94 gnashSleep(10000); // 10 milliseconds should be enough for loading
99 bool endOfTestFound
= getObject(root
)->get_member(getURI(vm
, "end_of_test"),
101 check(endOfTestFound
);