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