parser/xml/test/unit/test_sanitizer.js

Thu, 15 Jan 2015 21:13:52 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:13:52 +0100
branch
TOR_BUG_9701
changeset 12
7540298fafa1
permissions
-rw-r--r--

Remove forgotten relic of ABI crash risk averse overloaded method change.

michael@0 1 function run_test() {
michael@0 2 var Ci = Components.interfaces;
michael@0 3 var Cc = Components.classes;
michael@0 4
michael@0 5 // vectors by the html5security project (https://code.google.com/p/html5security/ & Creative Commons 3.0 BY), see CC-BY-LICENSE for the full license
michael@0 6 load("results.js"); // gives us a `vectors' array
michael@0 7
michael@0 8 var ParserUtils = Cc["@mozilla.org/parserutils;1"].getService(Ci.nsIParserUtils);
michael@0 9 var sanitizeFlags = ParserUtils.SanitizerCidEmbedsOnly|ParserUtils.SanitizerDropForms|ParserUtils.SanitizerDropNonCSSPresentation;
michael@0 10 // flags according to
michael@0 11 // http://mxr.mozilla.org/comm-central/source/mailnews/mime/src/mimemoz2.cpp#2218
michael@0 12 // and default settings
michael@0 13
michael@0 14
michael@0 15 for (var item in vectors) {
michael@0 16 var evil = vectors[item].data;
michael@0 17 var sanitized = vectors[item].sanitized;
michael@0 18 var out = ParserUtils.sanitize(evil, sanitizeFlags);
michael@0 19 do_check_eq(sanitized, out);
michael@0 20 }
michael@0 21 }

mercurial