blob: a694dd27c2b0dbf3f040d78cd8c1c93525daff8c [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="../resources/inspector-test.js"></script>
<script>
function test()
{
let suite = InspectorTest.createAsyncSuite("Target.PSON");
suite.addTestCase({
name: "InlineDebuggerStatement",
description: "Check that new provisional page can be paused before navigation.",
test(resolve, reject) {
WI.debuggerManager.awaitEvent(WI.DebuggerManager.Event.Paused)
.then(() => {
InspectorTest.pass(`Should pause on debugger statement.`);
// Wait for page reload event to avoid race between test results flushing and the test completion.
let pageLoadPromise = InspectorTest.awaitEvent(FrontendTestHarness.Event.TestPageDidLoad);
//WI.mainTarget.DebuggerAgent.
Promise.resolve().then(() => {
WI.debuggerManager.resume();
});
return pageLoadPromise;
})
.then(resolve);
const url = "http://localhost:8000/inspector/target/resources/inline-debugger-statement.html";
WI.mainTarget.PageAgent.navigate(url);
}
});
suite.runTestCasesAndFinish();
}
</script>
</head>
<body onload="runTest()">
<p>Test that execution will break on inline 'debugger' statement after cross-origin navigation.</p>
</body>
</html>