function with_iframe(url) {
  return new Promise(function(resolve) {
      var frame = document.createElement('iframe');
      frame.className = 'test-iframe';
      frame.src = url;
      frame.onload = function() { resolve(frame); };
      document.body.appendChild(frame);
    });
}
Adds an iframe to the document and returns a promise that resolves to the
iframe when it finishes loading. The caller is responsible for removing the
iframe later if needed.

@param {string} url
@returns {HTMLIFrameElement}