Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<!-- This tests that a navigation initiator that has been replaced by the time
the navigation it initiates is blocked, will not receive the SPV event.
An iframe will navigate another iframe and the navigate itself.
The second iframe's navigation response will be delayed by the server but will
eventually be blocked by the CSP of the first iframe.
By the time this happens the first iframe should be an entirely different
document and it should not receive a SPV event -->
var t = async_test("Test that no spv event is raised");
window.onmessage = t.step_func(function(e) {
if ( == "end_test") t.done();
else assert_unreached("Should not have raised a spv event");
var frames_loaded_count = 0;
var frame_loaded = function() {
if (++frames_loaded_count == 2) {
// both child frame have loaded we can start the
// test now, send a message to iframe1 so it knows to start
document.getElementById('iframe1').contentWindow.postMessage('start_test', '*');
var i1 = document.createElement('iframe');
i1.src = "support/spv-test-iframe1.sub.html?report_id={{$id:uuid()}}"; = "iframe1"; = "iframe1";
i1.onload = frame_loaded;
var i2 = document.createElement('iframe');
i2.src = "support/spv-test-iframe2.sub.html"; = "iframe2"; = "iframe2";
i2.onload = frame_loaded;
<script async defer src='../support/checkReport.sub.js?reportExists=false&reportID={{$id}}'></script>