Add method to auto tests' proxy to clear the call list for better testing.
[dygraphs.git] / auto_tests / tests / Proxy.js
index 51a6e94..9ffc385 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (c)  2011 Google, Inc.
+// Copyright (c) 2011 Google, Inc.
 //
 // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to deal
@@ -38,7 +38,7 @@ var Proxy = function(delegate) {
       function makeFunc(name) {
         return function() {
           this.log__(name, arguments);
-          this.delegate__[name].apply(this.delegate__, arguments);
+          return this.delegate__[name].apply(this.delegate__, arguments);
         }
       };
       this[propname] = makeFunc(propname);
@@ -72,3 +72,6 @@ Proxy.prototype.log__ = function(name, args) {
   this.calls__.push(call);
 };
 
+Proxy.reset = function(proxy) {
+  proxy.calls__ = [];
+}