);
    container.appendChild(s);

    // Try to insertAdjacentText into the <script>, starting from the <p>
    await checkMessage(t, _ =>
      p.insertAdjacentText("beforebegin",
                           "postMessage('beforebegin should be blocked', '*');")
    );
    assert_true(s.textContent.includes("postMessage"));
    await checkMessage(t, _ =>
      p.insertAdjacentText("afterend",
                           "postMessage('afterend should be blocked', '*');")
    );
    assert_true(s.textContent.in