summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/Tests/Window/Base64.js
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries/LibWeb/Tests/Window/Base64.js')
-rw-r--r--Libraries/LibWeb/Tests/Window/Base64.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/Libraries/LibWeb/Tests/Window/Base64.js b/Libraries/LibWeb/Tests/Window/Base64.js
new file mode 100644
index 0000000000..2cc12ea741
--- /dev/null
+++ b/Libraries/LibWeb/Tests/Window/Base64.js
@@ -0,0 +1,19 @@
+loadPage("file:///res/html/misc/blank.html");
+
+afterPageLoad(() => {
+ test("atob", () => {
+ expect(atob("YQ==")).toBe("a");
+ expect(atob("YWE=")).toBe("aa");
+ expect(atob("YWFh")).toBe("aaa");
+ expect(atob("YWFhYQ==")).toBe("aaaa");
+ expect(atob("/w==")).toBe("\xff");
+ });
+
+ test("btoa", () => {
+ expect(btoa("a")).toBe("YQ==");
+ expect(btoa("aa")).toBe("YWE=");
+ expect(btoa("aaa")).toBe("YWFh");
+ expect(btoa("aaaa")).toBe("YWFhYQ==");
+ expect(btoa("\xff")).toBe("/w==");
+ });
+});