globalPointer function
Returns the globally used HtmlPointer in Html based tests.
Implementation
HtmlPointer globalPointer(SyncFn? syncFn) {
assert(syncFn != null);
// [SyncFn] may change based on when this function is called.
// If it does change, we need to create a new [HtmlPointer] since this
// indicates the scope of the [HtmlPointer] is outdated.
if (_cachedSyncFn == null || _cachedSyncFn != syncFn) {
_cachedSyncFn = syncFn;
_globalPointer = HtmlPointer(_cachedSyncFn!);
}
return _globalPointer;
}