+pallosp who knows more about Closure testing than anyone else.
One of the problems of the Closure testing framework is that there are
too many ways to do something. In your case I can think of quite a few
ways. From least intrusive to most intrusive:
1. Override the function manually and set and increment a counter
2. goog.testing.recordFunction
3. goog.testing.createFunctionMock
4. goog.testing.createMethodMock
5. goog.testing.createLooseMock
6. goog.testing.createStrictMock
In your case I think recordFunction is the most suitable. You might
also want to use goog.testing.PropertyReplacer to ensure that the
method/function is restore afterwards.
erik