tizen beta release
[framework/web/webkit-efl.git] / LayoutTests / svg / dom / string-list-parser.html
1 <html>
2 <head>
3 <script src="../../fast/js/resources/js-test-pre.js"></script>
4 <script src="resources/scripted-random.js"></script>
5 </head>
6 <body>
7 <p id="description"></p>
8 <div id="console"></div>
9 <script>
10     description("This test fuzzes the string list parser with semi-random attribute values and dumps the results of any values that parse successfully.");
11     
12     var characters = [
13         "0",
14         "1",
15         "2",
16         "3",
17         "4",
18         "5",
19         "6",
20         "7",
21         "8",
22         "9",
23         ".",
24         ";",
25         " ",
26         "\t"
27     ];
28     
29     var setElement = document.createElementNS("http://www.w3.org/2000/svg", "set");
30     function parseStringList(string)
31     {
32         setElement.setAttributeNS(null, "begin", string);
33         debug("Can't test the result of parsing a string list: they have no effect yet.");
34     }
35
36     function fuzz()
37     {
38         // Random assortments of valid characters
39         for (var i = 0; i < 250; i++) { //>
40             var lengthList = "";
41             var count = Math.scriptedRandomInt(40);
42             for (var j = 0; j < count; j++) { //>
43                 lengthList += characters[Math.scriptedRandomInt(characters.length)];
44             }
45             parseStringList(lengthList);
46         }
47         
48         // Empty-ish string lists
49         parseStringList("");
50         parseStringList(String.fromCharCode(0));
51     }
52     
53     fuzz();
54
55 </script>
56 <script src="../../fast/js/resources/js-test-post.js"></script>
57 </html>