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

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

Issue 58143002: WindowBase64::atob() does not remove space characters from input (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix style issue Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/dom/Window/atob-btoa-expected.txt » ('j') | Source/wtf/text/Base64.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/Window/atob-btoa.html
diff --git a/LayoutTests/fast/dom/Window/atob-btoa.html b/LayoutTests/fast/dom/Window/atob-btoa.html
index fb4c0b783093e341c9dcfc66dae8ebff7f1bb917..ccef129d8e427439dc391a9a85e167a064e7bb3d 100644
--- a/LayoutTests/fast/dom/Window/atob-btoa.html
+++ b/LayoutTests/fast/dom/Window/atob-btoa.html
@@ -11,6 +11,7 @@ shouldBe('window.atob("YWJj")', '"abc"');
shouldBe('window.atob("YWJjZA==")', '"abcd"');
shouldBe('window.atob("YWJjZGU=")', '"abcde"');
shouldBe('window.atob("YWJjZGVm")', '"abcdef"');
+
shouldBe('window.btoa("a")', '"YQ=="');
shouldBe('window.btoa("ab")', '"YWI="');
shouldBe('window.btoa("abc")', '"YWJj"');
@@ -36,8 +37,19 @@ shouldThrow('window.atob()', '"TypeError: Failed to execute \'atob\' on \'Window
shouldBe('window.atob("")', '""');
shouldBe('window.atob(null)', '"\x9Eée"'); // Gets converted to "null" string.
shouldThrow('window.atob(undefined)');
-shouldThrow('window.atob(" YQ==")');
-shouldThrow('window.atob("YQ==\\u000a")');
+
+// HTML space characters in input.
+shouldBe('window.atob(" YQ==")', '"a"');
tkent 2013/11/05 21:39:07 nit: You can avoid nested quotes by shouldBeEqualT
Inactive 2013/11/05 21:55:57 I know, I was too lazy to fix all of the pre-exist
+shouldBe('window.atob("YQ== ")', '"a"');
+shouldBe('window.atob("YQ== ")', '"a"');
+shouldBe('window.atob("YQ==\\u000a")', '"a"');
+shouldBe('window.atob("YQ ==")', '"a"');
+shouldBe('window.atob("YQ\\t==")', '"a"');
+shouldBe('window.atob("YQ\\n==")', '"a"');
+shouldBe('window.atob("YQ\\f==")', '"a"');
+shouldBe('window.atob("YQ\\r==")', '"a"');
+shouldBe('window.atob("YQ\\t\\n\\f\\r ==")', '"a"');
+
shouldBe('window.atob("6ek=")', '"éé"');
shouldBe('window.atob("6ek")', '"éé"');
shouldBe('window.atob("gIE=")', '"\u0080\u0081"');
« no previous file with comments | « no previous file | LayoutTests/fast/dom/Window/atob-btoa-expected.txt » ('j') | Source/wtf/text/Base64.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698