projects
/
dygraphs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Call .destroy() on plugins (fixes #418)
[dygraphs.git]
/
auto_tests
/
misc
/
local.js
diff --git
a/auto_tests/misc/local.js
b/auto_tests/misc/local.js
index
9ca6e1a
..
4b1ea40
100644
(file)
--- a/
auto_tests/misc/local.js
+++ b/
auto_tests/misc/local.js
@@
-1,3
+1,5
@@
+'use strict';
+
var DygraphsLocalTester = function() {
this.tc = null; // Selected test case
this.name = null;
var DygraphsLocalTester = function() {
this.tc = null; // Selected test case
this.name = null;
@@
-22,17
+24,16
@@
var DygraphsLocalTester = function() {
* In some cases we will still allow warnings to be warnings, however.
*/
DygraphsLocalTester.prototype.overrideWarn = function() {
* 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 original
DygraphWarn = Dygraph
.warn;
-
Dygraph
.warn = function(msg) {
- // This warning is
still
+ // save
console
.warn so we can catch warnings.
+ var original
Warn = 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") {
if (msg == "Using default labels. Set labels explicitly via 'labels' in the options parameter") {
- original
Dygraph
Warn(msg);
+ originalWarn(msg);
return;
}
throw 'Warnings not permitted: ' + msg;
}
return;
}
throw 'Warnings not permitted: ' + msg;
}
- Dygraph.prototype.warn = Dygraph.warn;
};
DygraphsLocalTester.prototype.processVariables = function() {
};
DygraphsLocalTester.prototype.processVariables = function() {
@@
-76,12
+77,12
@@
DygraphsLocalTester.prototype.createAnchor = function(href, id, text) {
var a = document.createElement('a');
a.href = href;
a.id = id;
var a = document.createElement('a');
a.href = href;
a.id = id;
- a.
innerTex
t = text;
+ a.
textConten
t = text;
return a;
}
DygraphsLocalTester.prototype.createResultsDiv = function(summary, durationms) {
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];
div.id='results';
var body = document.getElementsByTagName('body')[0];
@@
-147,7
+148,7
@@
DygraphsLocalTester.prototype.postResults = function(summary, durationms) {
var tdResult = document.createElement('td');
tdResult.setAttribute('class', 'outcome');
var tdResult = document.createElement('td');
tdResult.setAttribute('class', 'outcome');
- tdResult.
innerTex
t = result.result ? 'pass' : 'fail';
+ tdResult.
textConten
t = result.result ? 'pass' : 'fail';
tr.appendChild(tdResult);
var tdName = document.createElement('td');
tr.appendChild(tdResult);
var tdName = document.createElement('td');
@@
-159,7
+160,7
@@
DygraphsLocalTester.prototype.postResults = function(summary, durationms) {
tr.appendChild(tdName);
var tdDuration = document.createElement('td');
tr.appendChild(tdName);
var tdDuration = document.createElement('td');
- tdDuration.
innerTex
t = result.duration + ' ms';
+ tdDuration.
textConten
t = result.duration + ' ms';
tr.appendChild(tdDuration);
if (result.e) {
tr.appendChild(tdDuration);
if (result.e) {
@@
-194,12
+195,12
@@
DygraphsLocalTester.prototype.listTests = function() {
var createLink = function(parent, title, url) {
var li = createAttached('li', parent);
var a = createAttached('a', li);
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) {
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) {
var testCases = getAllTestCases();
createLink(list, '(run all tests)', document.URL + '?command=runAllTests');
for (var idx in testCases) {
@@
-207,7
+208,7
@@
DygraphsLocalTester.prototype.listTests = function() {
createLink(list, entryName, document.URL + '?testCaseName=' + entryName);
}
} else {
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) {
var names = this.tc.getTestNames();
createLink(list, 'Run All Tests', document.URL + '&command=runAllTests');
for (var idx in names) {