summaryrefslogtreecommitdiffstats
path: root/netwerk/test/unit/test_bug660066.js
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /netwerk/test/unit/test_bug660066.js
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'netwerk/test/unit/test_bug660066.js')
-rw-r--r--netwerk/test/unit/test_bug660066.js42
1 files changed, 42 insertions, 0 deletions
diff --git a/netwerk/test/unit/test_bug660066.js b/netwerk/test/unit/test_bug660066.js
new file mode 100644
index 000000000..99c01c40c
--- /dev/null
+++ b/netwerk/test/unit/test_bug660066.js
@@ -0,0 +1,42 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+Components.utils.import("resource://gre/modules/NetUtil.jsm");
+const SIMPLEURI_SPEC = "data:text/plain,hello world";
+const BLOBURI_SPEC = "blob:123456";
+
+function do_info(text, stack) {
+ if (!stack)
+ stack = Components.stack.caller;
+
+ dump( "\n" +
+ "TEST-INFO | " + stack.filename + " | [" + stack.name + " : " +
+ stack.lineNumber + "] " + text + "\n");
+}
+
+function do_check_uri_neq(uri1, uri2)
+{
+ do_info("Checking equality in forward direction...");
+ do_check_false(uri1.equals(uri2));
+ do_check_false(uri1.equalsExceptRef(uri2));
+
+ do_info("Checking equality in reverse direction...");
+ do_check_false(uri2.equals(uri1));
+ do_check_false(uri2.equalsExceptRef(uri1));
+}
+
+function run_test()
+{
+ var simpleURI = NetUtil.newURI(SIMPLEURI_SPEC);
+ var fileDataURI = NetUtil.newURI(BLOBURI_SPEC);
+
+ do_info("Checking that " + SIMPLEURI_SPEC + " != " + BLOBURI_SPEC);
+ do_check_uri_neq(simpleURI, fileDataURI);
+
+ do_info("Changing the nsSimpleURI spec to match the nsFileDataURI");
+ simpleURI.spec = BLOBURI_SPEC;
+
+ do_info("Verifying that .spec matches");
+ do_check_eq(simpleURI.spec, fileDataURI.spec);
+
+ do_info("Checking that nsSimpleURI != nsFileDataURI despite their .spec matching")
+ do_check_uri_neq(simpleURI, fileDataURI);
+}