tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

child-navigates-parent-same-origin.window.js (824B)


      1 // META: script=resources/wait-for-messages.js
      2 
      3 function testNavigation(url) {
      4  return async (t) => {
      5    // Start waiting for messages before inserting the child frame, to avoid any
      6    // race conditions.
      7    const messagesPromise = waitForMessages(3);
      8 
      9    const iframe = document.createElement("iframe");
     10    iframe.src = url;
     11    document.body.appendChild(iframe);
     12 
     13    const messages = await messagesPromise;
     14    assert_array_equals(messages, ["initial", "inner", "destination"]);
     15  }
     16 }
     17 
     18 promise_test(
     19    testNavigation("resources/child-navigates-parent-location-initial.html"),
     20    "Child document navigates same-origin parent via document.location");
     21 
     22 promise_test(
     23    testNavigation("resources/child-navigates-parent-submit-initial.html"),
     24    "Child document navigates same-origin parent via form submission");