gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/trunk r11165: Modified DejaGnu.hx to allow


From: Bob Naugle
Subject: [Gnash-commit] /srv/bzr/gnash/trunk r11165: Modified DejaGnu.hx to allow for viewing of entire test cases in gflashplayer
Date: Wed, 24 Jun 2009 16:03:53 -0600
User-agent: Bazaar (1.13.1)

------------------------------------------------------------
revno: 11165
committer: Bob Naugle <address@hidden>
branch nick: trunk
timestamp: Wed 2009-06-24 16:03:53 -0600
message:
  Modified DejaGnu.hx to allow for viewing of entire test cases in gflashplayer
modified:
  testsuite/misc-haxe.all/classes.all/DejaGnu.hx
=== modified file 'testsuite/misc-haxe.all/classes.all/DejaGnu.hx'
--- a/testsuite/misc-haxe.all/classes.all/DejaGnu.hx    2009-06-22 21:33:57 
+0000
+++ b/testsuite/misc-haxe.all/classes.all/DejaGnu.hx    2009-06-24 22:03:53 
+0000
@@ -20,8 +20,12 @@
 import flash.Lib;
 #if flash9
 import flash.text.TextField;
+import flash.text.TextFieldType;
+import flash.external.ExternalInterface;
+import flash.display.MovieClip;
 #else
 import flash.TextField;
+import flash.MovieClip;
 #end
 import haxe.PosInfos;
 
@@ -33,32 +37,34 @@
     static var untest = 0;
     static var unresolve = 0;
     static var position:PosInfos;
+       static var trace = untyped __global__['trace'];
 
     // This is a trick to force our 'init' function
     // to be automatically called at the start of the movie.
     static var inithack = init();
 
-#if flash9
-    static var tf:flash.text.TextField;
-#else
-    static var tf:flash.TextField;
-#end    
+    static var tf:TextField; 
+       
     static function init() {
         //if(dejagnu_module_initialized == 1) return;
         
         // create a textfield to output to
 #if flash9
-       tf = new flash.text.TextField();
-       tf.autoSize = flash.text.TextFieldAutoSize.LEFT;
-        //flash.Lib.current.createTextField("textout", 99, 10, 10, 500, 500);
+       tf = new TextField();
+       //tf.autoSize = flash.text.TextFieldAutoSize.LEFT;
+       //tf.multiline = true;
+       tf.wordWrap = true;
+       tf.width = 390;
+       tf.height = 300;
+       //tf.border = true;
+    //flash.Lib.current.createTextField("textout", 99, 10, 10, 500, 500);
        flash.Lib.current.addChild(tf);
 #else
-       flash.Lib._root.createNewTextField("tf",10,0,0,300,300);
+       flash.Lib.current.createTextField("tf", 10,0,0,390,390);
        tf.multiline = true;
        tf.wordWrap = true;
        tf.autoSize = "left";
-//     tf = new flash.TextField();
-//     tf.autoSize = flash.TextFieldAutoSize.LEFT;
+       tf.border = true;
 #end
         //dejagnu_module_initialized = 1;
 
@@ -89,6 +95,56 @@
         xtrace(msg);
     }
     
+       static public function check_equals(obt:Dynamic, exp:Dynamic, msg) {
+        if(msg == null) msg = "";
+        if ( obt == exp ) {
+            pass(obt+' == '+exp+' '+msg);
+        } else {
+            fail('expected: "'+exp+'" , obtained: "'+obt+'" '+msg);
+               }
+    }
+       
+       static public function xcheck_equals(obt:Dynamic, exp:Dynamic, msg)
+       {
+               if(msg == null) msg = "";
+               if ( obt == exp ) 
+               {
+                       xpass(obt+' == '+exp+' '+msg);
+               }
+               else 
+               {
+                       xfail('expected: '+exp+' , obtained: '+obt+" "+msg);
+               }
+       }
+       
+       static public function check(a : Dynamic, msg)
+       {
+               if ( a ) 
+               {
+                       if ( msg != null ) pass(msg);
+                       else pass(a);
+               }
+               else 
+               {
+                       if ( msg != null ) fail(msg);
+                       else fail(a);
+               }
+       }
+       
+       static public function xcheck(a : Dynamic, msg)
+       {
+               if ( a ) 
+               {
+                       if ( msg != null ) xpass(msg);
+                       else xpass(a);
+               }
+               else 
+               {
+                       if ( msg != null ) xfail(msg);
+                       else xfail(a);
+               }
+       }
+       
     static function testcount() {
         var c = 0;
         if ( passed > 0 ) c += passed;
@@ -137,7 +193,10 @@
     }
     
     static function xtrace(msg) {
-        tf.text += msg + "\n";
+        tf.text += msg+"\n";
+               //trace(msg);
+               //tf.text = "<head>\n<style 
type=\"text/css\">\n</style>\n</head>\n<body>\n<textarea cols=\"30\" 
rows=\"4\">\nHere's enough text to make this textarea grow scrollbars....\nHTML 
scrollbars, scrollbar color, change browser scrollbars,\ncss scrollbar, change 
color of the scrollbar...\n</textarea>\n</body>";
+               //tf.htmlText = "<head>\n<style 
type=\"text/css\">\n</style>\n</head>\n<body>\n<textarea cols=\"30\" 
rows=\"4\">\nHere's enough text to make this textarea grow scrollbars....\nHTML 
scrollbars, scrollbar color, change browser scrollbars,\ncss scrollbar, change 
color of the scrollbar...\n</textarea>\n</body>";
 //#if flash9
         flash.Lib.trace(msg);
 //#else        


reply via email to

[Prev in Thread] Current Thread [Next in Thread]