function stubForwardBack(visibilityStateAfterRestore) {
  return browser.executeAsync((visibilityStateAfterRestore, done) => {
    self.__stubForwardBack(visibilityStateAfterRestore).then(done);
  }, visibilityStateAfterRestore);
}
Overrides the document's `visibilityState` property, sets the body's hidden
attribute (to prevent painting) and dispatches a `visibilitychange` event.
@return {Promise<void>}