[html] Special-case Variant conversion in unit test
authorKalle Vahlman <kalle.vahlman@movial.com>
Thu, 30 Apr 2009 06:45:44 +0000 (09:45 +0300)
committerKalle Vahlman <kalle.vahlman@movial.com>
Thu, 30 Apr 2009 06:48:10 +0000 (09:48 +0300)
html/unit.html

index 694f57da08527273ca2ad7e66c575624d765af7a..8a119a539a638e66dffe9a6a37d30b28c92d4cbf 100644 (file)
@@ -17,18 +17,18 @@ var good = 0;
 var bad = 0;
 var current_test = null;
 
-function Test(method_name, arg, convert, xfail, signature, next_test)
+function Test(method_name, arg, convert, xfail, signature, variant_signature)
 {
   this.method_name = method_name;
   this.arg = arg;
   this.convert = convert;
   this.signature = signature;
+  this.variant_signature = variant_signature;
   this.xfail = xfail;
   n_tests++;
   if (!xfail)
     n_tests++;
 
-  this.next = next_test;
 }
 
 Test.prototype =
@@ -38,6 +38,7 @@ Test.prototype =
   convert: null,
   xfail: false,
   signature: null,
+  variant_signature: null,
   signal: null,
   next: null,
 
@@ -73,7 +74,13 @@ Test.prototype =
     var send_arg;
     if (this.convert instanceof Function)
     {
-      send_arg = this.convert(this.arg);
+      if (this.convert == dbus.Variant)
+      {
+        send_arg = this.convert(this.variant_signature, this.arg);
+      } else {
+        send_arg = this.convert(this.arg);
+      }
+
       if (!send_arg)
       {
         var color = 'red';