function waitForPageChange() {
  return new goog.Promise(function(resolve, reject) {
    goog.events.listenOnce(
        pageEventDispatcher,
        'pageEnter',
        function(event) {
          resolve();
        });
    goog.events.listenOnce(
        pageEventDispatcher,
        'pageExit',
        function(event) {
          resolve();
        });
  });
}
@return {!goog.Promise<void>} A promise that resolves on next page change.