Implementation:SeleniumHQ Selenium Closure Testing RecordFunction
| Knowledge Sources | |
|---|---|
| Domains | JavaScript_Atoms, Vendored_Library |
| Last Updated | 2026-02-12 00:00 GMT |
Overview
Vendored Google Closure Library module providing a helper for recording function calls in tests, used by Selenium JavaScript atoms.
Description
goog.testing.recordFunction is a vendored copy of the Google Closure Library module. It provides helper utilities for recording the calls of a function, including call count, arguments, return values, and context (this). It wraps an original function to create a recorded version that tracks all invocations. Also provides goog.testing.recordConstructor for recording constructor calls and goog.testing.FunctionCall to represent individual recorded calls. Selenium uses this as part of its JavaScript atom infrastructure.
Usage
This module is consumed internally by Selenium's JavaScript atoms build system. Not imported directly by end users.
Code Reference
Source Location
- Repository: SeleniumHQ_Selenium
- File: third_party/closure/goog/testing/recordfunction.js
- Lines: 1-323
Key Exports
goog.provide('goog.testing.FunctionCall');
goog.provide('goog.testing.recordConstructor');
goog.provide('goog.testing.recordFunction');
// Key API on recorded functions:
goog.testing.recordedFunction_.getCallCount = function() {};
goog.testing.recordedFunction_.assertCallCount = function(a, opt_b) {};
goog.testing.recordedFunction_.getCalls = function() {};
goog.testing.recordedFunction_.getLastCall = function() {};