Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Side by Side Diff: LayoutTests/css3/escape-dom-api.html

Issue 1253403005: Implement CSS.escape (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix final test Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/css3/escape-dom-api-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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 shouldThrow("CSS.escape('\0')");
12 shouldThrow("CSS.escape('a\0')");
13 shouldThrow("CSS.escape('\0b')");
14 shouldThrow("CSS.escape('a\0b')");
15
16 shouldThrow("CSS.escape()");
17 shouldBeEqualToString("CSS.escape(true)", "true");
18 shouldBeEqualToString("CSS.escape(false)", "false");
19 shouldBeEqualToString("CSS.escape(null)", "null");
20 shouldBeEqualToString("CSS.escape('')", "");
21
22 shouldBeEqualToString("CSS.escape('\x01\x02\x1E\x1F')", "\\1 \\2 \\1e \\1f " );
23
24 shouldBeEqualToString("CSS.escape('0a')", "\\30 a");
25 shouldBeEqualToString("CSS.escape('1a')", "\\31 a");
26 shouldBeEqualToString("CSS.escape('2a')", "\\32 a");
27 shouldBeEqualToString("CSS.escape('3a')", "\\33 a");
28 shouldBeEqualToString("CSS.escape('4a')", "\\34 a");
29 shouldBeEqualToString("CSS.escape('5a')", "\\35 a");
30 shouldBeEqualToString("CSS.escape('6a')", "\\36 a");
31 shouldBeEqualToString("CSS.escape('7a')", "\\37 a");
32 shouldBeEqualToString("CSS.escape('8a')", "\\38 a");
33 shouldBeEqualToString("CSS.escape('9a')", "\\39 a");
34
35 shouldBeEqualToString("CSS.escape('a0b')", "a0b");
36 shouldBeEqualToString("CSS.escape('a1b')", "a1b");
37 shouldBeEqualToString("CSS.escape('a2b')", "a2b");
38 shouldBeEqualToString("CSS.escape('a3b')", "a3b");
39 shouldBeEqualToString("CSS.escape('a4b')", "a4b");
40 shouldBeEqualToString("CSS.escape('a5b')", "a5b");
41 shouldBeEqualToString("CSS.escape('a6b')", "a6b");
42 shouldBeEqualToString("CSS.escape('a7b')", "a7b");
43 shouldBeEqualToString("CSS.escape('a8b')", "a8b");
44 shouldBeEqualToString("CSS.escape('a9b')", "a9b");
45
46 shouldBeEqualToString("CSS.escape('-0a')", "-\\30 a");
47 shouldBeEqualToString("CSS.escape('-1a')", "-\\31 a");
48 shouldBeEqualToString("CSS.escape('-2a')", "-\\32 a");
49 shouldBeEqualToString("CSS.escape('-3a')", "-\\33 a");
50 shouldBeEqualToString("CSS.escape('-4a')", "-\\34 a");
51 shouldBeEqualToString("CSS.escape('-5a')", "-\\35 a");
52 shouldBeEqualToString("CSS.escape('-6a')", "-\\36 a");
53 shouldBeEqualToString("CSS.escape('-7a')", "-\\37 a");
54 shouldBeEqualToString("CSS.escape('-8a')", "-\\38 a");
55 shouldBeEqualToString("CSS.escape('-9a')", "-\\39 a");
56
57 shouldBeEqualToString("CSS.escape('--a')", "--a");
58
59 shouldBeEqualToString("CSS.escape('\x80\x2D\x5F\xA9')", "\x80\x2D\x5F\xA9");
60 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\x 8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F");
61 shouldBeEqualToString("CSS.escape('\xA0\xA1\xA2')", "\xA0\xA1\xA2");
62 shouldBeEqualToString("CSS.escape('a0123456789b')", "a0123456789b");
63 shouldBeEqualToString("CSS.escape('abcdefghijklmnopqrstuvwxyz')", "abcdefghi jklmnopqrstuvwxyz");
64 shouldBeEqualToString("CSS.escape('ABCDEFGHIJKLMNOPQRSTUVWXYZ')", "ABCDEFGHI JKLMNOPQRSTUVWXYZ");
65
66 shouldBeEqualToString("CSS.escape('\x20\x21\x78\x79')", "\\ \\!xy");
67
68 // astral symbol (U+1D306 TETRAGRAM FOR CENTRE)
69 shouldBeEqualToString("CSS.escape('\uD834\uDF06')", "\uD834\uDF06");
70 // lone surrogates
71 shouldBeEqualToString("CSS.escape('\uDF06')", '\uDF06');
72 shouldBeEqualToString("CSS.escape('\uD834')", '\uD834');
73 </script>
74 </body>
75 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/css3/escape-dom-api-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698