<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="../resources/inspector-test.js"></script>
<script>
function test()
{
    let suite = InspectorTest.createAsyncSuite("Network.interceptWithRequest");

    suite.addTestCase({
        name: "Network.interceptRequest.MainResource",
        description: "Main resource uses request interception on next page load",
        async test() {
            let localResourceOverride = WI.LocalResourceOverride.create("http://127.0.0.1:8000/inspector/network/intercept-request-main-resource.html", WI.LocalResourceOverride.InterceptType.Request, {
                requestURL: "http://127.0.0.1:8000/inspector/network/resources/intercept-request-overriden-page.html",
            });
            WI.networkManager.addLocalResourceOverride(localResourceOverride);

            await InspectorTest.reloadPage({ignoreCache: false, revalidateAllResources: true});
        }
    });

    suite.runTestCasesAndFinish();
}
</script>
</head>
<body onload="runTest()">
<p>Test request interception intercepting the main resource load.</p>
<script>alert("ORIGINAL HTML CONTENT");</script>
</body>
</html>
