+'use strict';
+
var DygraphsLocalTester = function() {
this.tc = null; // Selected test case
this.name = null;
* In some cases we will still allow warnings to be warnings, however.
*/
DygraphsLocalTester.prototype.overrideWarn = function() {
- // save Dygraph.warn so we can catch warnings.
- var originalDygraphWarn = Dygraph.warn;
- Dygraph.warn = function(msg) {
- // This warning is still
+ // save console.warn so we can catch warnings.
+ var originalWarn = console.warn;
+ console.warn = function(msg) {
+ // This warning is pervasive enough that we'll let it slide (for now).
if (msg == "Using default labels. Set labels explicitly via 'labels' in the options parameter") {
- originalDygraphWarn(msg);
+ originalWarn(msg);
return;
}
throw 'Warnings not permitted: ' + msg;
}
- Dygraph.prototype.warn = Dygraph.warn;
};
DygraphsLocalTester.prototype.processVariables = function() {
var a = document.createElement('a');
a.href = href;
a.id = id;
- a.innerText = text;
+ a.textContent = text;
return a;
}
DygraphsLocalTester.prototype.createResultsDiv = function(summary, durationms) {
- div = document.createElement('div');
+ var div = document.createElement('div');
div.id='results';
var body = document.getElementsByTagName('body')[0];
var tdResult = document.createElement('td');
tdResult.setAttribute('class', 'outcome');
- tdResult.innerText = result.result ? 'pass' : 'fail';
+ tdResult.textContent = result.result ? 'pass' : 'fail';
tr.appendChild(tdResult);
var tdName = document.createElement('td');
tr.appendChild(tdName);
var tdDuration = document.createElement('td');
- tdDuration.innerText = result.duration + ' ms';
+ tdDuration.textContent = result.duration + ' ms';
tr.appendChild(tdDuration);
if (result.e) {
var createLink = function(parent, title, url) {
var li = createAttached('li', parent);
var a = createAttached('a', li);
- a.innerHTML = title;
+ a.textContent = title;
a.href = url;
return li;
}
if (this.tc == null) {
- description.innerHTML = 'Test cases:';
+ description.textContent = 'Test cases:';
var testCases = getAllTestCases();
createLink(list, '(run all tests)', document.URL + '?command=runAllTests');
for (var idx in testCases) {
createLink(list, entryName, document.URL + '?testCaseName=' + entryName);
}
} else {
- description.innerHTML = 'Tests for ' + name;
+ description.textContent = 'Tests for ' + name;
var names = this.tc.getTestNames();
createLink(list, 'Run All Tests', document.URL + '&command=runAllTests');
for (var idx in names) {