Commit 09e9b5ee authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

[devtools] Clear issues upon committing a new page load

This prevents issues from the previous page from showing up in the
issues panel.

Bug: chromium:1057979
Change-Id: If2f61d9c8a402b30a41d4d9f83b9f356633eb5a0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2164625
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: default avatarAndrey Kosyakov <caseq@chromium.org>
Reviewed-by: default avatarMike West <mkwst@chromium.org>
Cr-Commit-Position: refs/heads/master@{#762435}
parent a46869ea
......@@ -854,6 +854,7 @@ void Page::UpdateAcceleratedCompositingSettings() {
void Page::DidCommitLoad(LocalFrame* frame) {
if (main_frame_ == frame) {
GetConsoleMessageStorage().Clear();
GetInspectorIssueStorage().Clear();
// TODO(loonybear): Most of this doesn't appear to take into account that
// each SVGImage gets it's own Page instance.
GetDeprecation().ClearSuppression();
......
(async function(testRunner) {
const {page, session, dp} = await testRunner.startBlank(
`Verifies that inspector issues do not persist through reloads.\n`);
// Trigger a known issue, inspector-protocol/network/same-site-issue-blocked-cookie-not-secure.js ensures this
// issue is actually triggered.
const setCookieUrl = 'https://cookie.test:8443/inspector-protocol/network/resources/set-cookie.php?cookie='
+ encodeURIComponent('name=value; SameSite=None');
await session.evaluateAsync(`fetch('${setCookieUrl}', {method: 'POST', credentials: 'include'})`);
// Reloading the page should clear the issue.
await dp.Page.reload();
// This should never be printed.
dp.Audits.onIssueAdded(() => testRunner.log(`Issue should have been cleared by the reload`));
await dp.Audits.enable();
testRunner.completeTest();
})
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment