function registerService(channel, name, objectPayload = undefined) {
  return new GoogPromise((resolve, reject) => {
    channel.registerService(name, resolve, objectPayload);
  });
}
Registers a service on a channel that will accept a single test message and
then fire a Promise.
@param {!MessagingMessageChannel} channel
@param {string} name The service name.
@param {boolean=} objectPayload Whether incoming payloads should be parsed as
    Objects instead of raw strings.
@return {!GoogPromise<(string|!Object)>} A promise that resolves with the
    value of the first message received on the service.