summaryrefslogtreecommitdiffstats
path: root/services/common/tests/unit/test_utils_deepCopy.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 /services/common/tests/unit/test_utils_deepCopy.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 'services/common/tests/unit/test_utils_deepCopy.js')
-rw-r--r--services/common/tests/unit/test_utils_deepCopy.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/services/common/tests/unit/test_utils_deepCopy.js b/services/common/tests/unit/test_utils_deepCopy.js
new file mode 100644
index 000000000..a743d37d3
--- /dev/null
+++ b/services/common/tests/unit/test_utils_deepCopy.js
@@ -0,0 +1,18 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+Cu.import("resource://testing-common/services/common/utils.js");
+
+function run_test() {
+ let thing = {o: {foo: "foo", bar: ["bar"]}, a: ["foo", {bar: "bar"}]};
+ let ret = TestingUtils.deepCopy(thing);
+ do_check_neq(ret, thing)
+ do_check_neq(ret.o, thing.o);
+ do_check_neq(ret.o.bar, thing.o.bar);
+ do_check_neq(ret.a, thing.a);
+ do_check_neq(ret.a[1], thing.a[1]);
+ do_check_eq(ret.o.foo, thing.o.foo);
+ do_check_eq(ret.o.bar[0], thing.o.bar[0]);
+ do_check_eq(ret.a[0], thing.a[0]);
+ do_check_eq(ret.a[1].bar, thing.a[1].bar);
+}