function setGlobalNavigator(navigatorObj) {
  const mockGlobal = {
    'navigator': navigatorObj,
  };
  stubs.set(goog, 'global', mockGlobal);
}
Replaces the navigator object on globalThis.
@param {?Object|undefined} navigatorObj The navigator object to set