copy over lots of changes from "shrink" branch.
[dygraphs.git] / auto_tests / misc / local.js
index 9ca6e1a..05927a5 100644 (file)
@@ -1,3 +1,5 @@
+'use strict';
+
 var DygraphsLocalTester = function() {
   this.tc = null; // Selected test case
   this.name = null; 
@@ -32,7 +34,6 @@ DygraphsLocalTester.prototype.overrideWarn = function() {
     }
     throw 'Warnings not permitted: ' + msg;
   }
-  Dygraph.prototype.warn = Dygraph.warn;
 };
 
 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;
-  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];
@@ -147,7 +148,7 @@ DygraphsLocalTester.prototype.postResults = function(summary, durationms) {
 
     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');
@@ -159,7 +160,7 @@ DygraphsLocalTester.prototype.postResults = function(summary, durationms) {
     tr.appendChild(tdName);
 
     var tdDuration = document.createElement('td');
-    tdDuration.innerText = result.duration + ' ms';
+    tdDuration.textContent = result.duration + ' ms';
     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);
-      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) {
@@ -207,7 +208,7 @@ DygraphsLocalTester.prototype.listTests = function() {
         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) {