summaryrefslogtreecommitdiffstats
path: root/dom/quota/test/xpcshell/test_originWithCaret.js
diff options
context:
space:
mode:
Diffstat (limited to 'dom/quota/test/xpcshell/test_originWithCaret.js')
-rw-r--r--dom/quota/test/xpcshell/test_originWithCaret.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/dom/quota/test/xpcshell/test_originWithCaret.js b/dom/quota/test/xpcshell/test_originWithCaret.js
new file mode 100644
index 0000000000..7afce4f5cc
--- /dev/null
+++ b/dom/quota/test/xpcshell/test_originWithCaret.js
@@ -0,0 +1,17 @@
+/**
+ * Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/
+ */
+
+"use strict";
+
+async function testSteps() {
+ Assert.throws(
+ () => {
+ const principal = getPrincipal("http://example.com^123");
+ getSimpleDatabase(principal);
+ },
+ /NS_ERROR_MALFORMED_URI/,
+ "^ is not allowed in the hostname"
+ );
+}