Skip to content

Commit

Permalink
Foxhound: Tidy up test formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
tmbrbr committed Jan 23, 2024
1 parent ff15a47 commit ea28d9c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
5 changes: 5 additions & 0 deletions taint/test/mochitest/test_dom_parser.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,13 @@

const doc1 = parser.parseFromString(tainted_dom_str, "text/html");

check_tainted(doc1.body.firstChild.outerHTML);
check_tainted(doc1.body.firstChild.textContent);

check_tainted(doc1.body.innerHTML);
check_tainted(doc1.body.outerHTML);
check_tainted(doc1.body.textContent);

const tainted_xml_str = "<warning>" + tainted_str + "</warning>";
const doc2 = parser.parseFromString(tainted_xml_str, "application/xml");

Expand Down
32 changes: 16 additions & 16 deletions taint/test/mochitest/test_sinks.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@

let string_content = "hello";
let sink_names = [
"document.write",
"document.writeln",
"innerHTML",
"outerHTML",
"insertAdjacentHTML",
"insertAdjacentText",
"embed.src",
"media.src",
"track.src",
"Range.createContextualFragment(fragment)",
"EventSource",
"eventHandler",
"document.write",
"document.writeln",
"innerHTML",
"outerHTML",
"insertAdjacentHTML",
"insertAdjacentText",
"embed.src",
"media.src",
"track.src",
"Range.createContextualFragment(fragment)",
"EventSource",
"eventHandler",
];

let i = 0;
Expand All @@ -32,10 +32,10 @@
let flow = report.detail.str.taint[0].flow;
is(flow[2].operation, sink_names[i]);

i += 1;
if (i >= sink_names.length) {
SimpleTest.finish();
}
i += 1;
if (i >= sink_names.length) {
SimpleTest.finish();
}
}, false);

let taint_string = String.tainted(string_content);
Expand Down

0 comments on commit ea28d9c

Please sign in to comment.