summaryrefslogtreecommitdiffstats
path: root/devtools/shared/jsbeautify/tests
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 /devtools/shared/jsbeautify/tests
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 'devtools/shared/jsbeautify/tests')
-rw-r--r--devtools/shared/jsbeautify/tests/unit/head_jsbeautify.js17
-rw-r--r--devtools/shared/jsbeautify/tests/unit/test.js23
-rw-r--r--devtools/shared/jsbeautify/tests/unit/xpcshell.ini8
3 files changed, 48 insertions, 0 deletions
diff --git a/devtools/shared/jsbeautify/tests/unit/head_jsbeautify.js b/devtools/shared/jsbeautify/tests/unit/head_jsbeautify.js
new file mode 100644
index 000000000..1abf07664
--- /dev/null
+++ b/devtools/shared/jsbeautify/tests/unit/head_jsbeautify.js
@@ -0,0 +1,17 @@
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+var Cc = Components.classes;
+var Ci = Components.interfaces;
+var Cu = Components.utils;
+var Cr = Components.results;
+
+const { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
+
+var beautify = require("devtools/shared/jsbeautify/beautify");
+var SanityTest = require('devtools/shared/jsbeautify/lib/sanitytest');
+var Urlencoded = require('devtools/shared/jsbeautify/lib/urlencode_unpacker');
+var {run_beautifier_tests} = require('devtools/shared/jsbeautify/src/beautify-tests');
diff --git a/devtools/shared/jsbeautify/tests/unit/test.js b/devtools/shared/jsbeautify/tests/unit/test.js
new file mode 100644
index 000000000..9b507624c
--- /dev/null
+++ b/devtools/shared/jsbeautify/tests/unit/test.js
@@ -0,0 +1,23 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2; fill-column: 80 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+function run_test() {
+ var sanityTest = new SanityTest();
+ var results = run_beautifier_tests(sanityTest,
+ Urlencoded,
+ beautify.js,
+ beautify.html,
+ beautify.css);
+
+ for (let [test_name, parameters, expected_value, result] of sanityTest.successes) {
+ equal(result, expected_value, "actual result matches expected");
+ }
+
+ for (let [test_name, parameters, expected_value, result] of sanityTest.failures) {
+ equal(result, expected_value, "actual result matches expected");
+ }
+}
diff --git a/devtools/shared/jsbeautify/tests/unit/xpcshell.ini b/devtools/shared/jsbeautify/tests/unit/xpcshell.ini
new file mode 100644
index 000000000..3d89527c6
--- /dev/null
+++ b/devtools/shared/jsbeautify/tests/unit/xpcshell.ini
@@ -0,0 +1,8 @@
+[DEFAULT]
+tags = devtools
+head = head_jsbeautify.js
+tail =
+firefox-appdir = browser
+skip-if = toolkit == 'android'
+
+[test.js]