Remove legacy options:
[dygraphs.git] / auto_tests / tests / simple_drawing.js
index 75a6e87..5ffe532 100644 (file)
@@ -41,10 +41,16 @@ SimpleDrawingTestCase.prototype.tearDown = function() {
 
 SimpleDrawingTestCase.prototype.testDrawSimpleRangePlusOne = function() {
   var opts = {
-    drawXGrid: false,
-    drawYGrid: false,
-    drawXAxis: false,
-    drawYAxis: false,
+    axes : {
+      x : {
+        drawGrid: false,
+        drawAxis: false,
+      },
+      y : {
+        drawGrid: false,
+        drawAxis: false,
+      }
+    },
     valueRange: [0,51] }
 
   var graph = document.getElementById("graph");
@@ -55,16 +61,23 @@ SimpleDrawingTestCase.prototype.testDrawSimpleRangePlusOne = function() {
     strokeStyle: "#008080",
     lineWidth: 1
   });
+  g.destroy(); // to balance context saves and destroys.
   CanvasAssertions.assertBalancedSaveRestore(htx);
 };
 
 // See http://code.google.com/p/dygraphs/issues/detail?id=185
 SimpleDrawingTestCase.prototype.testDrawSimpleRangeZeroToFifty = function() {
   var opts = {
-    drawXGrid: false,
-    drawYGrid: false,
-    drawXAxis: false,
-    drawYAxis: false,
+    axes : {
+      x : {
+        drawGrid: false,
+        drawAxis: false,
+      },
+      y : {
+        drawGrid: false,
+        drawAxis: false,
+      }
+    },
     valueRange: [0,50] }
 
   var graph = document.getElementById("graph");
@@ -76,6 +89,7 @@ SimpleDrawingTestCase.prototype.testDrawSimpleRangeZeroToFifty = function() {
     lineWidth: 1
   });
   assertEquals(1, lines.length);
+  g.destroy(); // to balance context saves and destroys.
   CanvasAssertions.assertBalancedSaveRestore(htx);
 };
 
@@ -84,6 +98,7 @@ SimpleDrawingTestCase.prototype.testDrawWithAxis = function() {
   var g = new Dygraph(graph, ZERO_TO_FIFTY);
 
   var htx = g.hidden_ctx_;
+  g.destroy(); // to balance context saves and destroys.
   CanvasAssertions.assertBalancedSaveRestore(htx);
 };
 
@@ -93,12 +108,20 @@ SimpleDrawingTestCase.prototype.testDrawWithAxis = function() {
  */
 SimpleDrawingTestCase.prototype.testDrawSimpleDash = function() {
   var opts = {
-      drawXGrid: false,
-      drawYGrid: false,
-      drawXAxis: false,
-      drawYAxis: false,
+    axes: {
+      x: {
+        drawGrid: false,
+        drawAxis: false
+      },
+      y: {
+        drawGrid: false,
+        drawAxis: false
+      }
+    },
+    series: {
       'Y1': {strokePattern: [25, 7, 7, 7]},
-      colors: ['#ff0000']
+    },
+    colors: ['#ff0000']
   };
 
   var graph = document.getElementById("graph");
@@ -110,6 +133,7 @@ SimpleDrawingTestCase.prototype.testDrawSimpleDash = function() {
 
   // TODO(danvk): figure out a good way to restore this test.
   // assertEquals(29, CanvasAssertions.numLinesDrawn(htx, "#ff0000"));
+  g.destroy(); // to balance context saves and destroys.
   CanvasAssertions.assertBalancedSaveRestore(htx);
 };
 
@@ -119,10 +143,16 @@ SimpleDrawingTestCase.prototype.testDrawSimpleDash = function() {
  */
 SimpleDrawingTestCase.prototype.testDrawThickLine = function() {
   var opts = {
-    drawXGrid: false,
-    drawYGrid: false,
-    drawXAxis: false,
-    drawYAxis: false,
+    axes : {
+      x : {
+        drawGrid: false,
+        drawAxis: false,
+      },
+      y : {
+        drawGrid: false,
+        drawAxis: false,
+      }
+    },
     strokeWidth: 15,
     colors: ['#ff0000']
   };
@@ -146,5 +176,6 @@ SimpleDrawingTestCase.prototype.testDrawThickLine = function() {
 
   // TODO(danvk): figure out a good way to restore this test.
   // assertEquals(29, CanvasAssertions.numLinesDrawn(htx, "#ff0000"));
+  g.destroy(); // to balance context saves and destroys.
   CanvasAssertions.assertBalancedSaveRestore(htx);
 };