michael@0: function run_test() { michael@0: var Ci = Components.interfaces; michael@0: var Cc = Components.classes; michael@0: michael@0: // 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: load("results.js"); // gives us a `vectors' array michael@0: michael@0: var ParserUtils = Cc["@mozilla.org/parserutils;1"].getService(Ci.nsIParserUtils); michael@0: var sanitizeFlags = ParserUtils.SanitizerCidEmbedsOnly|ParserUtils.SanitizerDropForms|ParserUtils.SanitizerDropNonCSSPresentation; michael@0: // flags according to michael@0: // http://mxr.mozilla.org/comm-central/source/mailnews/mime/src/mimemoz2.cpp#2218 michael@0: // and default settings michael@0: michael@0: michael@0: for (var item in vectors) { michael@0: var evil = vectors[item].data; michael@0: var sanitized = vectors[item].sanitized; michael@0: var out = ParserUtils.sanitize(evil, sanitizeFlags); michael@0: do_check_eq(sanitized, out); michael@0: } michael@0: }