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

Side by Side Diff: LayoutTests/fast/dom/Window/atob-btoa.html

Issue 19623002: Make atob() throw an InvalidCharacterError on excess padding characters (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/fast/dom/Window/atob-btoa-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
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../js/resources/js-test-pre.js"></script> 4 <script src="../../js/resources/js-test-pre.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <script> 7 <script>
8 shouldBe('window.atob("YQ==")', '"a"'); 8 shouldBe('window.atob("YQ==")', '"a"');
9 shouldBe('window.atob("YWI=")', '"ab"'); 9 shouldBe('window.atob("YWI=")', '"ab"');
10 shouldBe('window.atob("YWJj")', '"abc"'); 10 shouldBe('window.atob("YWJj")', '"abc"');
(...skipping 28 matching lines...) Expand all
39 shouldThrow('window.atob(" YQ==")'); 39 shouldThrow('window.atob(" YQ==")');
40 shouldThrow('window.atob("YQ==\\u000a")'); 40 shouldThrow('window.atob("YQ==\\u000a")');
41 shouldBe('window.atob("6ek=")', '"éé"'); 41 shouldBe('window.atob("6ek=")', '"éé"');
42 shouldBe('window.atob("6ek")', '"éé"'); 42 shouldBe('window.atob("6ek")', '"éé"');
43 shouldBe('window.atob("gIE=")', '"\u0080\u0081"'); 43 shouldBe('window.atob("gIE=")', '"\u0080\u0081"');
44 shouldThrow('window.atob("тест")'); 44 shouldThrow('window.atob("тест")');
45 shouldThrow('window.atob("z")'); 45 shouldThrow('window.atob("z")');
46 shouldBe('window.atob("zz")', '"Ï"'); 46 shouldBe('window.atob("zz")', '"Ï"');
47 shouldBe('window.atob("zzz")', '"Ï\u003C"'); 47 shouldBe('window.atob("zzz")', '"Ï\u003C"');
48 shouldBe('window.atob("zzz=")', '"Ï\u003C"'); 48 shouldBe('window.atob("zzz=")', '"Ï\u003C"');
49 shouldBe('window.atob("zzz==")', '"Ï\u003C"'); 49 shouldThrow('window.atob("zzz==")'); // excess pad characters.
50 shouldBe('window.atob("zzz===")', '"Ï\u003C"'); 50 shouldThrow('window.atob("zzz===")'); // excess pad characters.
51 shouldBe('window.atob("zzz====")', '"Ï\u003C"'); 51 shouldThrow('window.atob("zzz====")'); // excess pad characters.
52 shouldBe('window.atob("zzzz")', '"Ï\u003Có"'); 52 shouldBe('window.atob("zzzz")', '"Ï\u003Có"');
53 shouldThrow('window.atob("zzzzz")'); 53 shouldThrow('window.atob("zzzzz")');
54 shouldThrow('window.atob("z=zz")'); 54 shouldThrow('window.atob("z=zz")');
55 shouldThrow('window.atob("=")'); 55 shouldThrow('window.atob("=")');
56 shouldThrow('window.atob("==")'); 56 shouldThrow('window.atob("==")');
57 shouldThrow('window.atob("===")'); 57 shouldThrow('window.atob("===")');
58 shouldThrow('window.atob("====")'); 58 shouldThrow('window.atob("====")');
59 shouldThrow('window.atob("=====")'); 59 shouldThrow('window.atob("=====")');
60 window.atob = 0; 60 window.atob = 0;
61 shouldBe('window.atob', '0'); 61 shouldBe('window.atob', '0');
62 shouldBe('typeof window.atob', '"number"'); 62 shouldBe('typeof window.atob', '"number"');
63 63
64 </script> 64 </script>
65 <script src="../../js/resources/js-test-post.js"></script> 65 <script src="../../js/resources/js-test-post.js"></script>
66 </body> 66 </body>
67 </html> 67 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/dom/Window/atob-btoa-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698