diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /parser/xml/test/unit/test_sanitizer.js | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-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 'parser/xml/test/unit/test_sanitizer.js')
-rw-r--r-- | parser/xml/test/unit/test_sanitizer.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/parser/xml/test/unit/test_sanitizer.js b/parser/xml/test/unit/test_sanitizer.js new file mode 100644 index 000000000..b8aaa1e08 --- /dev/null +++ b/parser/xml/test/unit/test_sanitizer.js @@ -0,0 +1,21 @@ +function run_test() { + var Ci = Components.interfaces; + var Cc = Components.classes; + + // vectors by the html5security project (https://code.google.com/p/html5security/ & Creative Commons 3.0 BY), see CC-BY-LICENSE for the full license + load("results.js"); // gives us a `vectors' array + + var ParserUtils = Cc["@mozilla.org/parserutils;1"].getService(Ci.nsIParserUtils); + var sanitizeFlags = ParserUtils.SanitizerCidEmbedsOnly|ParserUtils.SanitizerDropForms|ParserUtils.SanitizerDropNonCSSPresentation; + // flags according to + // http://mxr.mozilla.org/comm-central/source/mailnews/mime/src/mimemoz2.cpp#2218 + // and default settings + + + for (var item in vectors) { + var evil = vectors[item].data; + var sanitized = vectors[item].sanitized; + var out = ParserUtils.sanitize(evil, sanitizeFlags); + do_check_eq(sanitized, out); + } +} |