indow.location.pathname.replace(/\/[^\/]*$/, '/') ;

function with_iframe(url)
{
  return new Promise(function(resolve) {
      var frame = document.createElement('iframe');
      frame.src = url;
      frame.onload = function() { resolve(frame); };
      document.body.appendChild(frame);
    });
}

function loadIFrameAndFetch(iframeURL, fetchURL, expectedFetchResult, title)
{
    promise_test(async () => {
        const frame = await with_iframe(iframeURL);
        let receiveMessage;
        const promise