Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/tests/resources/testharness.js b/tests/resources/testharness.js
- --- a/tests/resources/testharness.js
- +++ b/tests/resources/testharness.js
- @@ -1341,39 +1341,41 @@ policies and contribution forms [3].
- style_element.innerHTML = "table#results > tbody > tr."+result_class+"{display:none}";
- output_document.body.appendChild(style_element);
- } else if (style_element && input_element.checked) {
- style_element.parentNode.removeChild(style_element);
- }
- });
- });
- - var template = ["section", {},
- - ["h2", {}, "Details"],
- - ["table", {"id":"results"},
- - ["tr", {},
- - ["th", {}, "Result"],
- - ["th", {}, "Test Name"],
- - ["th", {}, "Message"]
- - ],
- - ["tbody", {},
- - function(vars) {
- - var rv = map(vars.tests, function(test) {
- - var status = status_text[test.status];
- - return ["tr", {"class":status_class(status)},
- - ["td", {}, status],
- - ["td", {}, test.name],
- - ["td", {}, test.message ? test.message : " "]
- - ];
- - });
- - return rv;
- - }]
- - ]];
- + var section = document.createElement("section");
- + log.appendChild(section);
- + // The table might have tens of thousands of rows. Build it using
- + // string concatenation and append all at once for performance's sake.
- + var html = "<h2>Details</h2><table id=results><tr><th>Result<th>Test Name<th>Message<tbody>";
- - log.appendChild(render(template, {tests:tests}, output_document));
- + var escape_html = function(input) {
- + // Warning: only use in attributes if they're double-quoted.
- + return input
- + .replace(/\&/g, "&")
- + .replace(/</g, "<")
- + .replace(/"/g, """);
- + };
- +
- + for (var i = 0; i < tests.length; i++)
- + {
- + html += '<tr class="'
- + + escape_html(status_class(status_text[tests[i].status]))
- + + '">'
- + + '<td>' + escape_html(status_text[tests[i].status])
- + + '<td>' + escape_html(tests[i].name)
- + + '<td>' + escape_html(tests[i].message ? tests[i].message : " ");
- + }
- +
- + section.innerHTML = html;
- };
- var output = new Output();
- add_start_callback(function (properties) {output.setup(properties);});
- add_result_callback(function (test) {output.show_status(tests);});
- add_completion_callback(function (tests, harness_status) {output.show_results(tests, harness_status);});
- /*
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement