Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test gets skipped with pattern: verify OR os == 'linux' && (asan || tsan)
- Manifest: toolkit/components/places/tests/browser/browser.toml
/**
* Any copyright is dedicated to the Public Domain.
*/
"use strict";
const TEST_PAGE = `data:text/html,
add_setup(async function () {
await SpecialPowers.pushPrefEnv({
set: [
// Enable restriction feature.
["places.history.floodingPrevention.enabled", true],
// Restrict from the second visit.
["places.history.floodingPrevention.restrictionCount", 1],
// Stop expiring.
["places.history.floodingPrevention.restrictionExpireSeconds", 100],
// Always appply flooding preveition.
[
"places.history.floodingPrevention.maxSecondsFromLastUserInteraction",
0,
],
// To enable UserActivation by EventUtils.synthesizeMouseAtCenter() in ContentTask.spawn() in synthesizeVisitByUser().
["test.events.async.enabled", true],
],
});
});
add_task(async function same_origin_but_other() {
await BrowserTestUtils.withNewTab(
{ gBrowser, url: TEST_PAGE },
async browser => {
info("Sanity check");
visitCount: 0,
isVisited: false,
});
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
visitCount: 0,
isVisited: false,
});
visitCount: 0,
isVisited: false,
});
visitCount: 0,
isVisited: false,
});
visitCount: 1,
isVisited: true,
});
info("Visit others by Scripts");
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
info("Check the status");
visitCount: 1,
isVisited: true,
});
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
visitCount: 0,
isVisited: true,
});
visitCount: 0,
isVisited: true,
});
visitCount: 1,
isVisited: true,
});
}
);
await clearHistoryAndHistoryCache();
});