Mark http/tests/websocket/tests/hybi/secure-cookie-secure-connection.pl as a failure...
[WebKit-https.git] / LayoutTests / css3 / escape-dom-api.html
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <script src="../resources/js-test.js"></script>
5 </head>
6 <body>
7 <script>
8     // Test from https://github.com/mathiasbynens/CSS.escape
9     description("Test window.CSS.escape()");
10
11     shouldBe("CSS.escape.length", "1");
12
13     shouldBeEqualToString("CSS.escape('\0')", "\ufffd");
14     shouldBeEqualToString("CSS.escape('a\0')", "a\ufffd");
15     shouldBeEqualToString("CSS.escape('\0b')", "\ufffdb");
16     shouldBeEqualToString("CSS.escape('a\0b')", "a\ufffdb");
17
18     shouldBeEqualToString("CSS.escape('\ufffd')", "\ufffd");
19     shouldBeEqualToString("CSS.escape('a\ufffd')", "a\ufffd");
20     shouldBeEqualToString("CSS.escape('\ufffdb')", "\ufffdb");
21     shouldBeEqualToString("CSS.escape('a\ufffdb')", "a\ufffdb");
22
23     shouldThrow("CSS.escape()");
24     shouldBeEqualToString("CSS.escape(undefined)", "undefined");
25     shouldBeEqualToString("CSS.escape(true)", "true");
26     shouldBeEqualToString("CSS.escape(false)", "false");
27     shouldBeEqualToString("CSS.escape(null)", "null");
28     shouldBeEqualToString("CSS.escape('')", "");
29
30     shouldBeEqualToString("CSS.escape('\x01\x02\x1E\x1F')", "\\1 \\2 \\1e \\1f ");
31
32     shouldBeEqualToString("CSS.escape('0a')", "\\30 a");
33     shouldBeEqualToString("CSS.escape('1a')", "\\31 a");
34     shouldBeEqualToString("CSS.escape('2a')", "\\32 a");
35     shouldBeEqualToString("CSS.escape('3a')", "\\33 a");
36     shouldBeEqualToString("CSS.escape('4a')", "\\34 a");
37     shouldBeEqualToString("CSS.escape('5a')", "\\35 a");
38     shouldBeEqualToString("CSS.escape('6a')", "\\36 a");
39     shouldBeEqualToString("CSS.escape('7a')", "\\37 a");
40     shouldBeEqualToString("CSS.escape('8a')", "\\38 a");
41     shouldBeEqualToString("CSS.escape('9a')", "\\39 a");
42
43     shouldBeEqualToString("CSS.escape('a0b')", "a0b");
44     shouldBeEqualToString("CSS.escape('a1b')", "a1b");
45     shouldBeEqualToString("CSS.escape('a2b')", "a2b");
46     shouldBeEqualToString("CSS.escape('a3b')", "a3b");
47     shouldBeEqualToString("CSS.escape('a4b')", "a4b");
48     shouldBeEqualToString("CSS.escape('a5b')", "a5b");
49     shouldBeEqualToString("CSS.escape('a6b')", "a6b");
50     shouldBeEqualToString("CSS.escape('a7b')", "a7b");
51     shouldBeEqualToString("CSS.escape('a8b')", "a8b");
52     shouldBeEqualToString("CSS.escape('a9b')", "a9b");
53
54     shouldBeEqualToString("CSS.escape('-0a')", "-\\30 a");
55     shouldBeEqualToString("CSS.escape('-1a')", "-\\31 a");
56     shouldBeEqualToString("CSS.escape('-2a')", "-\\32 a");
57     shouldBeEqualToString("CSS.escape('-3a')", "-\\33 a");
58     shouldBeEqualToString("CSS.escape('-4a')", "-\\34 a");
59     shouldBeEqualToString("CSS.escape('-5a')", "-\\35 a");
60     shouldBeEqualToString("CSS.escape('-6a')", "-\\36 a");
61     shouldBeEqualToString("CSS.escape('-7a')", "-\\37 a");
62     shouldBeEqualToString("CSS.escape('-8a')", "-\\38 a");
63     shouldBeEqualToString("CSS.escape('-9a')", "-\\39 a");
64
65     shouldBeEqualToString("CSS.escape('-')", "\\-");
66     shouldBeEqualToString("CSS.escape('-a')", "-a");
67     shouldBeEqualToString("CSS.escape('--')", "--");
68     shouldBeEqualToString("CSS.escape('--a')", "--a");
69
70     shouldBeEqualToString("CSS.escape('\x80\x2D\x5F\xA9')", "\x80\x2D\x5F\xA9");
71     shouldBeEqualToString("CSS.escape('\x7F\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F')", "\\7f \x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F");
72     shouldBeEqualToString("CSS.escape('\xA0\xA1\xA2')", "\xA0\xA1\xA2");
73     shouldBeEqualToString("CSS.escape('a0123456789b')", "a0123456789b");
74     shouldBeEqualToString("CSS.escape('abcdefghijklmnopqrstuvwxyz')", "abcdefghijklmnopqrstuvwxyz");
75     shouldBeEqualToString("CSS.escape('ABCDEFGHIJKLMNOPQRSTUVWXYZ')", "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
76
77     shouldBeEqualToString("CSS.escape('\x20\x21\x78\x79')", "\\ \\!xy");
78
79     // astral symbol (U+1D306 TETRAGRAM FOR CENTRE)
80     shouldBeEqualToString("CSS.escape('\uD834\uDF06')", "\uD834\uDF06");
81     // lone surrogates
82     shouldBeEqualToString("CSS.escape('\uDF06')", '\uDF06');
83     shouldBeEqualToString("CSS.escape('\uD834')", '\uD834');
84 </script>
85 </body>
86 </html>