summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Libraries/LibWeb/Tests/Document/Doctype.js10
-rw-r--r--Libraries/LibWeb/Tests/Window/Base64.js19
2 files changed, 24 insertions, 5 deletions
diff --git a/Libraries/LibWeb/Tests/Document/Doctype.js b/Libraries/LibWeb/Tests/Document/Doctype.js
index 6f327240f7..49f67e460b 100644
--- a/Libraries/LibWeb/Tests/Document/Doctype.js
+++ b/Libraries/LibWeb/Tests/Document/Doctype.js
@@ -2,10 +2,10 @@ loadPage("file:///res/html/misc/blank.html");
afterPageLoad(() => {
test("Basic functionality", () => {
- expect(document.compatMode).toBe("CSS1Compat");
- expect(document.doctype).toBeDefined();
- expect(document.doctype.name).toBe("html");
- expect(document.doctype.publicId).toBe("");
- expect(document.doctype.systemId).toBe("");
+ expect(document.compatMode).toBe("CSS1Compat");
+ expect(document.doctype).toBeDefined();
+ expect(document.doctype.name).toBe("html");
+ expect(document.doctype.publicId).toBe("");
+ expect(document.doctype.systemId).toBe("");
});
});
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==");
+ });
+});