~ubuntu-branches/ubuntu/maverick/gnash/maverick

« back to all changes in this revision

Viewing changes to testsuite/misc-haxe.all/classes.all/net/LocalConnection_as.hx

  • Committer: Bazaar Package Importer
  • Author(s): Sindhudweep Narayan Sarkar
  • Date: 2009-10-07 00:06:10 UTC
  • mfrom: (1.1.12 upstream)
  • Revision ID: james.westby@ubuntu.com-20091007000610-mj9rwqe774gizn1j
Tags: 0.8.6-0ubuntu1
new upstream release 0.8.6 (LP: #435897)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// LocalConnection_as.hx:  ActionScript 3 "LocalConnection" class, for Gnash.
 
2
//
 
3
// Generated by gen-as3.sh on: 20090514 by "rob". Remove this
 
4
// after any hand editing loosing changes.
 
5
//
 
6
//   Copyright (C) 2009 Free Software Foundation, Inc.
 
7
//
 
8
// This program is free software; you can redistribute it and/or modify
 
9
// it under the terms of the GNU General Public License as published by
 
10
// the Free Software Foundation; either version 3 of the License, or
 
11
// (at your option) any later version.
 
12
//
 
13
// This program is distributed in the hope that it will be useful,
 
14
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
// GNU General Public License for more details.
 
17
//
 
18
// You should have received a copy of the GNU General Public License
 
19
// along with this program; if not, write to the Free Software
 
20
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
21
//
 
22
 
 
23
// This test case must be processed by CPP before compiling to include the
 
24
//  DejaGnu.hx header file for the testing framework support.
 
25
 
 
26
// There are several event handlers there, we will fix them later.
 
27
 
 
28
 
 
29
#if flash9
 
30
import flash.net.LocalConnection;
 
31
import flash.display.MovieClip;
 
32
#else
 
33
import flash.LocalConnection;
 
34
import flash.MovieClip;
 
35
#end
 
36
 
 
37
import flash.Lib;
 
38
import Type;
 
39
import Reflect;
 
40
import Std;
 
41
 
 
42
// import our testing API
 
43
import DejaGnu;
 
44
 
 
45
// Class must be named with the _as suffix, as that's the same name as the file.
 
46
class LocalConnection_as {
 
47
    static function main() {
 
48
        var x1:LocalConnection = new LocalConnection();
 
49
        //x1: rec in the old ming tests.
 
50
 
 
51
        // Make sure we actually get a valid class 
 
52
 
 
53
//      DejaGnu.note("Type of x1: "   + Type.typeof(x1));    // TObject       
 
54
 
 
55
//      This is test 1
 
56
 
 
57
//      DejaGnu.note( "LocalConnection type is" + Type.typeof(LocalConnection) );
 
58
//      DejaGnu.note( "x1 type is" + Type.typeof(x1) );
 
59
                
 
60
#if flash9
 
61
//      DejaGnu.note( "LocalConnection type of v9 is" + Type.typeof(LocalConnection) );
 
62
        if (Type.typeof(LocalConnection) == ValueType.TObject && x1 != null) {
 
63
            DejaGnu.pass("LocalConnection class exists");
 
64
        } else {
 
65
            DejaGnu.fail("LocalConnection class doesn't exist");
 
66
        }
 
67
#else
 
68
//      DejaGnu.note( "LocalConnection type of v8 is" + Type.typeof(LocalConnection) );
 
69
        if (Type.typeof(x1) == ValueType.TObject && x1 != null) {
 
70
            DejaGnu.pass("LocalConnection class exists");
 
71
        } else {
 
72
            DejaGnu.fail("LocalConnection class doesn't exist");
 
73
        }
 
74
#end
 
75
 
 
76
// Tests to see if all the properties exist. All these do is test for
 
77
// existance of a property, and don't test the functionality at all. This
 
78
// is primarily useful only to test completeness of the API implementation.
 
79
//      if (x1.client == Object) {
 
80
//          DejaGnu.pass("LocalConnection.client property exists");
 
81
//      } else {
 
82
//          DejaGnu.fail("LocalConnection.client property doesn't exist");
 
83
//      }
 
84
 
 
85
//Si modified May 27
 
86
//This is test 2
 
87
//      DejaGnu.note("ME1 "   + Type.typeof(String));
 
88
//      DejaGnu.note("ME2 "   + Type.typeof(x1.domain));        
 
89
//      if (Type.typeof(x1.domain)== Type.typeof(String));              
 
90
 
 
91
//      DejaGnu.note("Type of x1.domain "  + Type.typeof(x1.domain));
 
92
 
 
93
#if flash9
 
94
        if (Std.is(x1.domain,String) ) {
 
95
            DejaGnu.pass("LocalConnection.domain(String) property exists");
 
96
        } else {
 
97
            DejaGnu.fail("LocalConnection.domain(String) property doesn't exist");
 
98
        }
 
99
#else
 
100
 
 
101
       if (Type.typeof(x1.domain) == TFunction  ){
 
102
            DejaGnu.pass("LocalConnection.domain(Function) property exists");
 
103
        } else {
 
104
            DejaGnu.fail("LocalConnection.domain(Function) property doesn't exist");
 
105
        }
 
106
#end
 
107
 
 
108
// Tests to see if all the methods exist. All these do is test for
 
109
// existance of a method, and don't test the functionality at all. This
 
110
// is primarily useful only to test completeness of the API implementation.
 
111
 
 
112
 
 
113
//Si modified May 27
 
114
//This is test 3
 
115
#if flash9
 
116
        if (Type.typeof(x1.allowDomain) == ValueType.TFunction ) {
 
117
            DejaGnu.pass("LocalConnection::allowDomain() method exists");
 
118
        } else {
 
119
            DejaGnu.xfail("LocalConnection::allowDomain() method doesn't exist");
 
120
        }
 
121
#else
 
122
//      DejaGnu.note("Warning! A event handler here: allowDomain"   + Type.typeof(x1.allowDomain)); 
 
123
        if (Type.typeof(x1.allowDomain) == ValueType.TFunction) {
 
124
            DejaGnu.pass("LocalConnection::allowDomain() method exists");
 
125
        } else {
 
126
            DejaGnu.xfail("LocalConnection::allowDomain() method doesn't exist");
 
127
        }
 
128
#end
 
129
 
 
130
//Si modified May 27
 
131
//This is test 4
 
132
 
 
133
//      DejaGnu.note("Type of x1.allowInsecureDomain "   + Type.typeof(x1.allowInsecureDomain));
 
134
 
 
135
#if flash9
 
136
        if (Type.typeof(x1.allowInsecureDomain) == ValueType.TFunction) {
 
137
            DejaGnu.pass("LocalConnection::allowInsecureDomain() method exists");
 
138
        } else {
 
139
            DejaGnu.xfail("LocalConnection::allowInsecureDomain() method doesn't exist");
 
140
        }
 
141
#else
 
142
        DejaGnu.note("Warning! A event handler here: allosDa "   + Type.typeof(x1.allowInsecureDomain));
 
143
 
 
144
        if (Type.typeof(x1.allowInsecureDomain) == ValueType.TFunction) {
 
145
            DejaGnu.pass("LocalConnection::allowInsecureDomain() method exists");
 
146
        } else {
 
147
            DejaGnu.xfail("LocalConnection::allowInsecureDomain() method doesn't exist");
 
148
        }
 
149
#end
 
150
 
 
151
//Si modified May 27
 
152
//This is test 5
 
153
#if flash9
 
154
        if (Type.typeof(x1.close) == ValueType.TFunction) {
 
155
            DejaGnu.pass("LocalConnection::close() method exists");
 
156
        } else {
 
157
            DejaGnu.fail("LocalConnection::close() method doesn't exist");
 
158
        }
 
159
#else
 
160
        if (Type.typeof(x1.close) == ValueType.TFunction) {
 
161
            DejaGnu.pass("LocalConnection::close() method exists");
 
162
        } else {
 
163
            DejaGnu.fail("LocalConnection::close() method doesn't exist");
 
164
        }
 
165
#end
 
166
 
 
167
//Si modified May 27
 
168
//This is test 6
 
169
#if flash9
 
170
        if (Type.typeof(x1.connect) == ValueType.TFunction) {
 
171
            DejaGnu.pass("LocalConnection::connect() method exists");
 
172
        } else {
 
173
            DejaGnu.fail("LocalConnection::connect() method doesn't exist");
 
174
        }
 
175
#else
 
176
        if (Type.typeof(x1.connect) == ValueType.TFunction) {
 
177
            DejaGnu.pass("LocalConnection::connect() method exists");
 
178
        } else {
 
179
            DejaGnu.fail("LocalConnection::connect() method doesn't exist");
 
180
        }
 
181
#end
 
182
 
 
183
//Si modified May 27
 
184
//This is test 7
 
185
#if flash9
 
186
        if (Type.typeof(x1.send) == ValueType.TFunction) {
 
187
            DejaGnu.pass("LocalConnection::send() method exists");
 
188
        } else {
 
189
            DejaGnu.fail("LocalConnection::send() method doesn't exist");
 
190
        }
 
191
#else
 
192
        if (Type.typeof(x1.send) == ValueType.TFunction) {
 
193
            DejaGnu.pass("LocalConnection::send() method exists");
 
194
        } else {
 
195
            DejaGnu.fail("LocalConnection::send() method doesn't exist");
 
196
        }
 
197
#end
 
198
 
 
199
// Si:
 
200
// Add the following Ming test ");cases
 
201
// June 11, 2009
 
202
 
 
203
DejaGnu.note("\n The following tests come from the Ming test. \n Some of the tests may be  duplicated ! \n" );
 
204
 
 
205
//check_equals(LocalConnection.prototype.__proto__, Object.prototype);
 
206
 
 
207
#if ( flash6 || flash7 || flash8)
 
208
        if ( Reflect.isObject(untyped LocalConnection.__proto__)) {
 
209
                DejaGnu.pass("LocalConnection.prototype.__proto__ field exists");
 
210
        } else {
 
211
                DejaGnu.fail("LocalConnection.prototype.__proto__ field does not exist");
 
212
        }
 
213
#end
 
214
 
 
215
//Si
 
216
//Not sure what happens here.
 
217
/*
 
218
#if ( flash6 || flash7 || flash8)
 
219
        if ( untyped LocalConnection.__proto__ == untyped Object.prototype) {
 
220
                DejaGnu.pass(" LocalConnection.prototype.__proto__ references Object.prototype");
 
221
        } else {
 
222
                DejaGnu.fail(" LocalConnection.prototype.__proto__ does not reference Object.prototype");
 
223
        }
 
224
#end
 
225
*/
 
226
 
 
227
#if ( flash6 || flash7 || flash8)
 
228
if (untyped LocalConnection.prototype.hasOwnProperty("send")){
 
229
        DejaGnu.pass("LocalConnection.prototype. 'send' property exists");
 
230
        } else {
 
231
                DejaGnu.fail("LocalConnection.prototype. 'send' property does not exist");
 
232
        }
 
233
 
 
234
if (untyped LocalConnection.prototype.hasOwnProperty("connect")) {
 
235
        DejaGnu.pass("LocalConnection.prototype. 'connect' property exists");
 
236
        } else {
 
237
                DejaGnu.fail("LocalConnection.prototype. 'connect' property does not exist");
 
238
        }
 
239
 
 
240
if (untyped LocalConnection.prototype.hasOwnProperty("close")) {
 
241
        DejaGnu.pass("LocalConnection.prototype. 'close' property exists");
 
242
        } else {
 
243
                DejaGnu.fail("LocalConnection.prototype. 'close'  property does not exist");
 
244
        }
 
245
 
 
246
if (untyped LocalConnection.prototype.hasOwnProperty("domain")) {
 
247
        DejaGnu.pass("LocalConnection.prototype. 'domain' property exists");
 
248
        } else {
 
249
                DejaGnu.fail("LocalConnection.prototype. 'domain'  property does not exist");
 
250
        }
 
251
#end
 
252
 
 
253
if  (untyped LocalConnection.prototype.hasOwnProperty("allowDomain")){
 
254
                DejaGnu.xpass("LocalConnection.prototype. 'allowdomain' property exists");
 
255
        } else {
 
256
                DejaGnu.xfail("LocalConnection.prototype. 'allowdomain' should be a event handler/function");
 
257
        }
 
258
 
 
259
if (untyped LocalConnection.prototype.hasOwnProperty("onStatus")){
 
260
        DejaGnu.xpass("LocalConnection.prototype. 'onStatus' property exists");
 
261
        } else {
 
262
                DejaGnu.xfail("LocalConnection.prototype. 'onStatus' should be a event handler/function");
 
263
        }
 
264
     
 
265
//check_equals (domain, "");
 
266
#if ( flash6 || flash7 || flash8)
 
267
if (x1.domain() == "localhost"){
 
268
        DejaGnu.pass("x1.domain is 'localhost' ");
 
269
        } else {
 
270
            DejaGnu.fail("x1.domain is not 'localhost' ");
 
271
        }
 
272
#end
 
273
#if flash9
 
274
if (x1.domain == "localhost"){
 
275
        DejaGnu.pass("x1.domain is 'localhost' ");
 
276
        } else {
 
277
            DejaGnu.fail("x1.domain is not 'localhost' ");
 
278
        }
 
279
#end
 
280
 
 
281
#if ( flash6 || flash7 || flash8 )
 
282
// test the LocalConnection::domain method
 
283
if (Type.typeof(untyped x1.domain)== TFunction){
 
284
        DejaGnu.pass("System.security 'domain' is a function");
 
285
        } else {
 
286
            DejaGnu.fail("System.security 'domain' is not a function");
 
287
        }
 
288
#end
 
289
 
 
290
// test the LocalConnection::close method
 
291
if (Type.typeof(untyped x1.close) == TFunction) {
 
292
        DejaGnu.pass("System.security 'close' is a function");
 
293
        } else {
 
294
            DejaGnu.fail("System.security 'close' is not a function");
 
295
        }
 
296
 
 
297
// test the LocalConnection::connect method
 
298
if (Type.typeof(untyped x1.connect)== TFunction){
 
299
        DejaGnu.pass("System.security 'connect' is a function");
 
300
        } else {
 
301
            DejaGnu.fail("System.security 'connect' is not a function");
 
302
        }
 
303
 
 
304
// test the LocalConnection::send method
 
305
if (Type.typeof(untyped x1.send)== TFunction) {
 
306
        DejaGnu.pass("System.security 'send' is a function");
 
307
        } else {
 
308
            DejaGnu.fail("System.security 'send' is not a function");
 
309
        }
 
310
 
 
311
//Si
 
312
//Build another LocalConnection Object x2 besides x1
 
313
        var x2:LocalConnection = new LocalConnection();
 
314
        //x2 :snd in the old ming tests
 
315
if (x1!=x2){
 
316
        DejaGnu.pass("We build two different objects: x1 != x2");
 
317
        } else {
 
318
            DejaGnu.fail("We build two different objects. But x1 equas to x2 now!");
 
319
        }
 
320
#if ( flash6 || flash7 || flash8 )
 
321
        var my_domain:String=x1.domain();
 
322
        if (x1!=x2){
 
323
        DejaGnu.pass("my_domain equals to 'localhost'. ");
 
324
        } else {
 
325
            DejaGnu.fail("my_domain does not equals to 'localhost'.");
 
326
        }
 
327
 
 
328
#end
 
329
#if ( flash9 )
 
330
        var my_domain:String=x1.domain;
 
331
        if (x1!=x2){
 
332
        DejaGnu.pass("my_domain equals to 'localhost'. ");
 
333
        } else {
 
334
            DejaGnu.fail("my_domain does not equals to 'localhost'.");
 
335
        }
 
336
#end
 
337
 
 
338
//Si
 
339
//Start the array tests
 
340
 
 
341
        var statuses:Array<Int> = new Array();
 
342
 
 
343
#if ( flash6 || flash7 || flash8 )
 
344
        x1.onStatus = function(obj) {
 
345
            statuses.push(obj.code);
 
346
};
 
347
 
 
348
    //DejaGnu.note("The following test fails!!");
 
349
        //var tempstring:String="Hello Si";
 
350
        var ret:Bool = x1.connect("");
 
351
        
 
352
        if (ret==false){
 
353
        DejaGnu.pass("x1.connect is false for empty");
 
354
        } else {
 
355
            DejaGnu.fail("x1.connect should be false");
 
356
        }
 
357
        if (statuses.length==0){
 
358
        DejaGnu.pass("statuses.length is zero");
 
359
        } else {
 
360
            DejaGnu.fail("statuses.length is not zero");
 
361
        }
 
362
#end
 
363
#if flash9
 
364
        //EVENT HANDLER
 
365
#end
 
366
 
 
367
#if ( flash6 || flash7 || flash8 )
 
368
        x1.onStatus = function(obj) {
 
369
            statuses.push(obj.code);
 
370
};
 
371
        ret = Reflect.callMethod(x1,Reflect.field(x1,"connect"),[]);
 
372
        if (ret==false){
 
373
                DejaGnu.pass("x1.connect() should be false.");
 
374
        } else {
 
375
            DejaGnu.fail("x1.connect(0 should be false!");
 
376
        }
 
377
 
 
378
        if (statuses.length==0){
 
379
                DejaGnu.pass("statuses.length is zero");
 
380
        } else {
 
381
            DejaGnu.fail("statuses.length is not zero");
 
382
        }
 
383
 
 
384
        ret = Reflect.callMethod(x1,Reflect.field(x1,"connect"),[3]);
 
385
        if (ret==false){
 
386
                DejaGnu.pass("x1.connect(3) should be false.");
 
387
        } else {
 
388
            DejaGnu.fail("x1.connect(3) should be false!");
 
389
        }
 
390
        if (statuses.length==0){
 
391
                DejaGnu.pass("statuses.length is zero");
 
392
        } else {
 
393
            DejaGnu.fail("statuses.length is not zero");
 
394
        }
 
395
//Si
 
396
//'undefined' is replaced by 'null' !!!
 
397
//haxe can not recognize 'undefined'.
 
398
        ret = Reflect.callMethod(x1,Reflect.field(x1,"connect"),[null]);
 
399
        if (ret==false){
 
400
        DejaGnu.pass("x1.connect(null) should be false.");
 
401
        } else {
 
402
            DejaGnu.fail("x1.connect(null) should be false!");
 
403
        }
 
404
        if (statuses.length==0){
 
405
                DejaGnu.pass("statuses.length is zero");
 
406
        } else {
 
407
            DejaGnu.fail("statuses.length is not zero");
 
408
        }
 
409
 
 
410
        ret = Reflect.callMethod(x1,Reflect.field(x1,"connect"),[""]);
 
411
        if (ret==false){
 
412
                DejaGnu.pass("x1.connect('') should be false.");
 
413
        } else {
 
414
            DejaGnu.fail("x1.connect('') shoulad be false!");
 
415
        }
 
416
        if (statuses.length==0){
 
417
                DejaGnu.pass("statuses.length is zero");
 
418
        } else {
 
419
            DejaGnu.fail("statuses.length is not zero");
 
420
        }
 
421
 
 
422
        ret = Reflect.callMethod(x1,Reflect.field(x1,"connect"),["string",7]);
 
423
        if (ret==true){
 
424
                DejaGnu.pass("x1.connect('string',7) should be true.");
 
425
        } else {
 
426
            DejaGnu.fail("x1.connect('string',7) shoulad be true!");
 
427
        }       
 
428
        if (statuses.length==0){
 
429
                DejaGnu.pass("statuses.length is zero");
 
430
        } else {
 
431
            DejaGnu.fail("statuses.length is not zero");
 
432
        }
 
433
 
 
434
        ret = Reflect.callMethod(x1,Reflect.field(x1,"connect"),["string"]);
 
435
        if (ret==false){
 
436
        DejaGnu.pass("x1.connect('string') is false since this con");
 
437
        } else {
 
438
            DejaGnu.fail("x1.connect('string') should fail");
 
439
        }
 
440
        if (statuses.length==0){
 
441
                DejaGnu.pass("statuses.length is zero");
 
442
        } else {
 
443
            DejaGnu.fail("statuses.length is not zero");
 
444
        }
 
445
        x1.close();
 
446
        
 
447
        var ret:Bool = x1.connect("string");    
 
448
        if (ret==true){
 
449
        DejaGnu.pass("x1.connect('string') is true.");
 
450
        } else {
 
451
            DejaGnu.fail("x1.connect('string') should be true");
 
452
        }
 
453
        if (statuses.length==0){
 
454
                DejaGnu.pass("statuses.length is zero");
 
455
        } else {
 
456
            DejaGnu.fail("statuses.length is not zero");
 
457
        }
 
458
#end
 
459
 
 
460
#if ( flash6 || flash7 || flash8 )
 
461
        var result:Bool = x1.connect("lc_test");
 
462
        if (x1.domain()== "localhost"){
 
463
                DejaGnu.pass("x1.connect('lc_test'); x1.domain equals to 'localhost'");
 
464
        } else {
 
465
            DejaGnu.fail("x1.connect('lc_test'); x1.domain() does not equals to 'localhost'");
 
466
        }
 
467
//Si
 
468
// Old NOTE: This test will fail if a shared memory segment of the same
 
469
// name exists. So the first time it'll pass, then it'll fail.
 
470
//The old notes could be wrong!!!!
 
471
 
 
472
        if (result == true){
 
473
                DejaGnu.pass("x1.connect('lc_test'); result is true for the first time");
 
474
        } else {
 
475
            DejaGnu.xfail("x1.connect('lc_test'); result could be wrong after the first time'");
 
476
        }
 
477
 
 
478
// Checks only for syntactical correctness, not success
 
479
// Be more careful for these test cases which touch the shared memory.
 
480
 
 
481
        result=x2.send("string","string","string","string");
 
482
        if (result == true){
 
483
                DejaGnu.pass("x2.send('String','String','String','String'); result is true for x2.send");
 
484
        } else {
 
485
            DejaGnu.fail("x2.send('String','String','String','String'); results is true for x2.send");
 
486
        }
 
487
 
 
488
        result=x2.send("lc_test", "testfunc", "val");
 
489
        if (result == true){
 
490
                DejaGnu.pass("x2.send('lc_test','testfunc','val'); result is true for x2.send");
 
491
        } else {
 
492
            DejaGnu.fail("x2.send('lc_test','testfunc','val'); results is true for x2.send");
 
493
        }
 
494
 
 
495
        result = x2.send("lc_test", "send");
 
496
        if (result == false){
 
497
                DejaGnu.pass("x2.send('lc_test','send'); result is false for this x2.send");
 
498
        } else {
 
499
            DejaGnu.fail("x2.send('lc_test','send'); results should be false for this x2.send");
 
500
        }
 
501
 
 
502
        result = x2.send("lc_test", "Send");
 
503
        if (result == false){
 
504
                DejaGnu.pass("x2.send('lc_test','Send'); result is false for this x2.send");
 
505
        } else {
 
506
            DejaGnu.fail("x2.send('lc_test','Send'); results should be false for this x2.send");
 
507
        }
 
508
        
 
509
        result = x2.send("lc_test", "DOMAIn");
 
510
        if (result == false){
 
511
                DejaGnu.pass("x2.send('lc_test',''DOMAIn); result is false for this x2.send");
 
512
        } else {
 
513
            DejaGnu.fail("x2.send('lc_test','DOMAIn'); results should be false for this x2.send");
 
514
        }
 
515
 
 
516
        result = x2.send("lc_test", "close");
 
517
        if (result == false){
 
518
                DejaGnu.pass("x2.send('lc_test','close'); result is false for this x2.send");
 
519
        } else {
 
520
            DejaGnu.fail("x2.send('lc_test','close'); results should be false for this x2.send");
 
521
        }
 
522
 
 
523
        result = x2.send("lc_test", "conNeCt");
 
524
        if (result == false){
 
525
                DejaGnu.pass("x2.send('lc_test','conNeCt'); result is false for this x2.send");
 
526
        } else {
 
527
            DejaGnu.fail("x2.send('lc_test','conNeCt'); results should be false for this x2.send");
 
528
        }
 
529
 
 
530
        result = x2.send("lc_test", "onStatus");
 
531
        if (result == false){
 
532
                DejaGnu.pass("x2.send('lc_test','onStatus'); result is false for this x2.send");
 
533
        } else {
 
534
            DejaGnu.fail("x2.send('lc_test','onStatus'); results should be false for this x2.send");
 
535
        }
 
536
 
 
537
        result = x2.send("lc_test", "ALLOWDOMAIN");
 
538
        if (result == false){
 
539
                DejaGnu.pass("x2.send('lc_test','ALLOWDOMAIN');result is false for this x2.send");
 
540
        } else {
 
541
            DejaGnu.fail("x2.send('lc_test','ALLOWDOMAIN');results should be false for this x2.send");
 
542
        }
 
543
 
 
544
        result = x2.send("lc_test", "");
 
545
        if (result == false){
 
546
                DejaGnu.pass("x2.send('lc_test',''); result is false for this x2.send");
 
547
        } else {
 
548
            DejaGnu.fail("x2.send('lc_test',''); results should be false for this x2.send");
 
549
        }
 
 
b'\tresult = Reflect.callMethod(x2,Reflect.field(x2,"send"),[]);'
 
550
        if (result == false){
 
551
                DejaGnu.pass("x2.send() should be false.");
 
552
        } else {
 
553
            DejaGnu.fail("x2.send() should be false!");
 
554
        }
 
555
        result = Reflect.callMethod(x2,Reflect.field(x2,"send"),[3]);
 
556
        if (result==false){
 
557
                DejaGnu.pass("x2.send(3) should be false.");
 
558
        } else {
 
559
            DejaGnu.fail("x2.send(3) should be false!");
 
560
        }
 
561
        result = Reflect.callMethod(x2,Reflect.field(x2,"send"),["lc_test", 1]);
 
562
        if (result==false){
 
563
                DejaGnu.pass("x2.send('lc_test',1) should be false.");
 
564
        } else {
 
565
            DejaGnu.fail("x2.send('lc_test',1) should be false!");
 
566
        }
 
567
//Si
 
568
//built a static function, named funcname
 
569
        result = Reflect.callMethod(x2,Reflect.field(x2,"send"),["lc_test", funcname]);
 
570
        if (result==false){
 
571
                DejaGnu.pass("x2.send should be false.");
 
572
        } else {
 
573
            DejaGnu.fail("x2.send should false!");
 
574
        }
 
575
 
 
576
        // But anything else is fine.
 
577
        result = x2.send("lc_test", "8");
 
578
        if (result == true){
 
579
                DejaGnu.pass("x2.send('lc_test', '8'); result is true");
 
580
        } else {
 
581
            DejaGnu.fail("x2.send('lc_test','8'); results should be true");
 
582
        }
 
583
 
 
584
        result = x2.send("lc_test", "ß");
 
585
        if (result == true){
 
586
                DejaGnu.pass("x2.send('lc_test','ß'); result is true");
 
587
        } else {
 
588
            DejaGnu.fail("x2.send('lc_test','ß'); results should be true");
 
589
        }
 
590
 
 
591
        result = x2.send("lc_test", "&");
 
592
        if (result == true){
 
593
                DejaGnu.pass("result is true");
 
594
        } else {
 
595
            DejaGnu.fail("result should be true");
 
596
        }
 
597
        result = x2.send("lc_test", ".");
 
598
        if (result == true){
 
599
                DejaGnu.pass("x2.send('lc_test', '.'); result is true");
 
600
        } else {
 
601
            DejaGnu.fail(" x2.send('lc_test', '.'); results should be true");
 
602
        }
 
603
        result = x2.send("lc_test", "g.");
 
604
        if (result == true){
 
605
                DejaGnu.pass(" x2.send(lc_test','g.'); result is true");
 
606
        } else {
 
607
            DejaGnu.fail(" x2.send('lc_test', 'g.'); fresults should be true");
 
608
        }
 
609
 
 
610
        result = x2.send("lc_test", "getSeconds");
 
611
        if (result == true){
 
612
                DejaGnu.pass(" x2.send('lc_test','getSeconds');result is true");
 
613
        } else {
 
614
            DejaGnu.fail(" x2.send('lc_test','getSeconds');results should be true");
 
615
        }
 
616
 
 
617
        var funcname:String = "onFullScreen";
 
618
        result = x2.send("lc_test", funcname);
 
619
        if (result == true){
 
620
                DejaGnu.pass("x2.send('lc_test',funcname); result is true");
 
621
        } else {
 
622
            DejaGnu.fail("x2.send('lc_test',funcname); results should be true");
 
623
        }
 
624
        x2.close();
 
625
 
 
626
#end
 
627
 
 
628
 
 
629
 
 
630
       DejaGnu.done();
 
631
// Call this after finishing all tests. It prints out the totals.
 
632
 
 
633
 
 
634
 
 
635
// Si
 
636
// The following ming tests have not been implemented for some reasons.
 
637
/*
 
638
// undefined
 
639
result = snd.send("lc_test", funcname);
 
640
check_equals (result, false);
 
641
 
 
642
*/
 
643
 
 
644
 
 
645
    }
 
646
 
 
647
    static function funcname () {}
 
648
}
 
649
 
 
650
// local Variables:
 
651
// mode: C++
 
652
// indent-tabs-mode: t
 
653
// End