load() {
    var self = this;
    // Return any pending or resolved loader promise.
    if (this.loader_) {
      return this.loader_;
    }
    var url = goog.html.TrustedResourceUrl.fromConstant(
        firebaseui.auth.GoogleYolo.GOOGLE_YOLO_SRC_);
    if (!getGoogleAccountsId()) {
      // Wait for DOM to be ready.
      this.loader_ = firebaseui.auth.util.onDomReady().then(function() {
        // In case it was still being loaded while DOM was not ready.
        // Resolve immediately.
        if (getGoogleAccountsId()) {
          return;
        }
        return new goog.Promise(function(resolve, reject) {
          // Timeout after a certain delay.
          var timer = setTimeout(function() {
            // On error, nullify loader to allow retrial.
            self.loader_ = null;
            reject(new Error('Network error!'));
          }, firebaseui.auth.GoogleYolo.LOAD_TIMEOUT_MS_);
          // On googleyolo load callback, clear timeout and resolve loader.
          goog.global[firebaseui.auth.GoogleYolo.CALLBACK_] = function() {
            clearTimeout(timer);
            resolve();
          };
          // Load googleyolo dependency.
          goog.Promise.resolve(goog.net.jsloader.safeLoad(url))
              .then(() => {
                // Callback does not always trigger. Trigger on load and
                // google.accounts.id reference is available.
                if (getGoogleAccountsId()) {
                  resolve();
                }
              })
              .thenCatch(function(error) {
                // On error, clear timer and nullify loader to allow retrial.
                clearTimeout(timer);
                self.loader_ = null;
                reject(error);
              });
        });
      });
      return this.loader_;
    }
    // Already available, resolve immediately.
    return goog.Promise.resolve();
  }
@return {!goog.Promise<void>} A promise that resolves when googleyolo is
    loaded.