Thu, 15 Jan 2015 21:03:48 +0100
Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)
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 | } |