~ubuntu-branches/ubuntu/saucy/mozjs17/saucy

« back to all changes in this revision

Viewing changes to js/src/tests/e4x/XML/regress-324688.js

  • Committer: Package Import Robot
  • Author(s): Rico Tzschichholz
  • Date: 2013-05-25 12:24:23 UTC
  • Revision ID: package-import@ubuntu.com-20130525122423-zmxucrhtensw90xy
Tags: upstream-17.0.0
ImportĀ upstreamĀ versionĀ 17.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// |reftest| pref(javascript.options.xml.content,true) skip -- bug 528404 - disable due to random timeouts
 
2
/* -*- Mode: java; tab-width:8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 
3
 
 
4
/* This Source Code Form is subject to the terms of the Mozilla Public
 
5
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 
6
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
7
 
 
8
 
 
9
var summary = 'No Syntax Error when trailing space and XML.ignoreWhitespace ' +
 
10
    'true';
 
11
var BUGNUMBER = 324688;
 
12
var actual = 'No Error';
 
13
var expect = 'No Error';
 
14
var t; // use global scope to prevent timer from being GC'ed
 
15
START(summary);
 
16
 
 
17
function init()
 
18
{
 
19
    if (typeof Components != 'undefined')
 
20
    {
 
21
        try
 
22
        {
 
23
            netscape.security.PrivilegeManager.
 
24
                enablePrivilege('UniversalXPConnect');
 
25
 
 
26
            var TestObject = {
 
27
            observe: function () {
 
28
                    try
 
29
                    {
 
30
                        printBugNumber(BUGNUMBER);
 
31
                        printStatus (summary);
 
32
                        printStatus('Browser only: requires UniversalXPConnect');
 
33
 
 
34
                        printStatus("XML.ignoreWhitespace=" +
 
35
                                    XML.ignoreWhitespace);
 
36
                        var x = new XML("<a></a> ");
 
37
                    }
 
38
                    catch(ex2)
 
39
                    {
 
40
                        actual = ex2 + '';
 
41
                    }
 
42
                    print('expect = ' + expect);
 
43
                    print('actual = ' + actual);
 
44
                    TEST(1, expect, actual);
 
45
                    END();
 
46
                    gDelayTestDriverEnd = false;
 
47
                    jsTestDriverEnd();
 
48
                }
 
49
            };
 
50
 
 
51
            t = Components.classes["@mozilla.org/timer;1"].
 
52
                createInstance(Components.interfaces.nsITimer);
 
53
            t.init(TestObject, 100, t.TYPE_ONE_SHOT);
 
54
        }
 
55
        catch(ex)
 
56
        {
 
57
            printStatus('Requires UniversalXPConnect');
 
58
        }
 
59
    }
 
60
}
 
61
 
 
62
if (typeof window != 'undefined')
 
63
{
 
64
    // delay test driver end
 
65
    gDelayTestDriverEnd = true;
 
66
 
 
67
    window.addEventListener("load", init, false);
 
68
}
 
69
else
 
70
{
 
71
    TEST(1, expect, actual);
 
72
    END();
 
73
}
 
74