From 4707563ce91e069b58ed6c1be38c8e4ace4a2150 Mon Sep 17 00:00:00 2001
From: Robert Konigsberg <konigsberg@google.com>
Date: Thu, 7 Feb 2013 09:25:11 -0500
Subject: [PATCH] Namespace the canvas proxy in auto tests.

---
 auto_tests/tests/custom_bars.js    | 6 +++---
 auto_tests/tests/error_bars.js     | 6 +++---
 auto_tests/tests/missing_points.js | 8 ++++----
 auto_tests/tests/simple_drawing.js | 6 +++---
 auto_tests/tests/to_dom_coords.js  | 6 +++---
 5 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/auto_tests/tests/custom_bars.js b/auto_tests/tests/custom_bars.js
index 493e86c..2169ade 100644
--- a/auto_tests/tests/custom_bars.js
+++ b/auto_tests/tests/custom_bars.js
@@ -6,16 +6,16 @@
  */
 var CustomBarsTestCase = TestCase("custom-bars");
 
-var _origFunc = Dygraph.getContext;
+CustomBarsTestCase._origFunc = Dygraph.getContext;
 CustomBarsTestCase.prototype.setUp = function() {
   document.body.innerHTML = "<div id='graph'></div>";
   Dygraph.getContext = function(canvas) {
-    return new Proxy(_origFunc(canvas));
+    return new Proxy(CustomBarsTestCase._origFunc(canvas));
   }
 };
 
 CustomBarsTestCase.prototype.tearDown = function() {
-  Dygraph.getContext = _origFunc;
+  Dygraph.getContext = CustomBarsTestCase._origFunc;
 };
 
 // This test used to reliably produce an infinite loop.
diff --git a/auto_tests/tests/error_bars.js b/auto_tests/tests/error_bars.js
index 1ede89b..5144363 100644
--- a/auto_tests/tests/error_bars.js
+++ b/auto_tests/tests/error_bars.js
@@ -9,16 +9,16 @@ errorBarsTestCase.prototype.setUp = function() {
   document.body.innerHTML = "<div id='graph'></div>";
 };
 
-var _origFunc = Dygraph.getContext;
+errorBarsTestCase._origFunc = Dygraph.getContext;
 errorBarsTestCase.prototype.setUp = function() {
   document.body.innerHTML = "<div id='graph'></div>";
   Dygraph.getContext = function(canvas) {
-    return new Proxy(_origFunc(canvas));
+    return new Proxy(errorBarsTestCase._origFunc(canvas));
   }
 };
 
 errorBarsTestCase.prototype.tearDown = function() {
-  Dygraph.getContext = _origFunc;
+  Dygraph.getContext = errorBarsTestCase._origFunc;
 };
 
 errorBarsTestCase.prototype.testErrorBarsDrawn = function() {
diff --git a/auto_tests/tests/missing_points.js b/auto_tests/tests/missing_points.js
index 594282c..68a5024 100644
--- a/auto_tests/tests/missing_points.js
+++ b/auto_tests/tests/missing_points.js
@@ -27,16 +27,16 @@ var ZERO_TO_FIFTY = [[ 10, 0 ] , [ 20, 50 ]];
 
 var MissingPointsTestCase = TestCase("missing-points");
 
-var _origFunc = Dygraph.getContext;
+MissingPointsTestCase._origFunc = Dygraph.getContext;
 MissingPointsTestCase.prototype.setUp = function() {
   document.body.innerHTML = "<div id='graph'></div>";
   Dygraph.getContext = function(canvas) {
-    return new Proxy(_origFunc(canvas));
+    return new Proxy(MissingPointsTestCase._origFunc(canvas));
   }
 };
 
 MissingPointsTestCase.prototype.tearDown = function() {
-  Dygraph.getContext = _origFunc;
+  Dygraph.getContext = MissingPointsTestCase._origFunc;
 };
 
 MissingPointsTestCase.prototype.testSeparatedPointsDontDraw = function() {
@@ -166,4 +166,4 @@ MissingPointsTestCase.prototype.testConnectSeparatedPointsWithNan = function() {
     var line = lines[idx];
     console.log(line[0].args, line[1].args, line[0].properties.strokeStyle);
   }
-*/
\ No newline at end of file
+*/
diff --git a/auto_tests/tests/simple_drawing.js b/auto_tests/tests/simple_drawing.js
index a4acd28..75a6e87 100644
--- a/auto_tests/tests/simple_drawing.js
+++ b/auto_tests/tests/simple_drawing.js
@@ -27,16 +27,16 @@ var ZERO_TO_FIFTY = [[ 10, 0 ] , [ 20, 50 ]];
 
 var SimpleDrawingTestCase = TestCase("simple-drawing");
 
-var _origFunc = Dygraph.getContext;
+SimpleDrawingTestCase._origFunc = Dygraph.getContext;
 SimpleDrawingTestCase.prototype.setUp = function() {
   document.body.innerHTML = "<div id='graph'></div>";
   Dygraph.getContext = function(canvas) {
-    return new Proxy(_origFunc(canvas));
+    return new Proxy(SimpleDrawingTestCase._origFunc(canvas));
   }
 };
 
 SimpleDrawingTestCase.prototype.tearDown = function() {
-  Dygraph.getContext = _origFunc;
+  Dygraph.getContext = SimpleDrawingTestCase._origFunc;
 };
 
 SimpleDrawingTestCase.prototype.testDrawSimpleRangePlusOne = function() {
diff --git a/auto_tests/tests/to_dom_coords.js b/auto_tests/tests/to_dom_coords.js
index 3def1ef..dae4f44 100644
--- a/auto_tests/tests/to_dom_coords.js
+++ b/auto_tests/tests/to_dom_coords.js
@@ -6,16 +6,16 @@
 
 var ToDomCoordsTestCase = TestCase("to-dom-coords");
 
-var _origFunc = Dygraph.getContext;
+ToDomCoordsTestCase._origFunc = Dygraph.getContext;
 ToDomCoordsTestCase.prototype.setUp = function() {
   document.body.innerHTML = "<div id='graph'></div>";
   Dygraph.getContext = function(canvas) {
-    return new Proxy(_origFunc(canvas));
+    return new Proxy(ToDomCoordsTestCase._origFunc(canvas));
   }
 };
 
 ToDomCoordsTestCase.prototype.tearDown = function() {
-  Dygraph.getContext = _origFunc;
+  Dygraph.getContext = ToDomCoordsTestCase._origFunc;
 };
 
 // Checks that toDomCoords and toDataCoords are inverses of one another.
-- 
2.7.4