Add automated tests on function-type FSCommand parameter passing.
[gnash.git] / testsuite / actionscript.all / rtrace.as
blob7255fc8fe8e3b5126c94cf9004d57176876e8516
1 //
2 // Copyright (C) 2005, 2006, 2007, 2009, 2010 Free Software
3 // Foundation, Inc
4 //
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.
9 //
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
20 #ifndef _RTRACE_AS_
21 #define _RTRACE_AS_
23 #ifndef USE_RTRACE
24 // Set the URL to the location of the testreport.php script
25 // (you should really set USE_RTRACE before including this file though)
26 #define USE_RTRACE "http://localhost/testreport.php";
27 #endif
29 var traced = "";
31 rtrace = function (msg)
33 last_trace_time = getTimer();
34 traced += msg+"\n";
38 report = function()
40 var url = USE_RTRACE;
41 getUrl(url, 'report', 'POST');
44 var last_trace_time = getTimer();
47 // getTimer() return milliseconds, so
48 // we send the report after 1 second of inactivity
49 // and check for it every 1/2 seconds
51 var interval = setInterval(
52 function() {
53 if (getTimer() - last_trace_time > 1000 ) {
54 clearInterval(interval);
55 report();
58 500);
60 #endif // _RTRACE_AS_