Closed
Bug 2024192
Opened 5 months ago
Closed 5 months ago
test_ext_webRequest_filterResponseData.js expects the webRequest listener to be called for cached reload
Categories
(WebExtensions :: General, task)
WebExtensions
General
Tracking
(firefox150 fixed)
RESOLVED
FIXED
150 Branch
| Tracking | Status | |
|---|---|---|
| firefox150 | --- | fixed |
People
(Reporter: arai, Assigned: arai)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
the test_alternate_cached_data testcase in test_ext_webRequest_filterResponseData.js expects the webRequest listener to be called for cached reload.
The test does the following:
- load a page
file_script.htmlwithout the extension - the page loads scripts
file_script_good.jsandfile_script_bad.js - start the extension
- the extension adds webRequest listeners for
file_script_good.jsandfile_script_bad.js - reload the page
- expect the webRequest listeners to be called
Once the stencil navigation cache (bug 1670403) is enabled, those scripts are cached in memory, and reloading the page doesn't trigger the webRequest listeners.
This cache behavior is clarified in the API document, and there's a dedicate API to clear the cache, which is webRequest.handlerBehaviorChanged.
We should either:
- if we just apply the restriction here as well, call
webRequest.handlerBehaviorChangedin the testcase - if we try to support this kind of use case, for maximum compatibility, perform the equivalent of
webRequest.handlerBehaviorChangedautomatically on an extension startup
let contentPage = await ExtensionTestUtils.loadContentPage(
"http://example.com/data/file_script.html"
);
await contentPage.close();
await extension.startup();
let page_cached = await ExtensionTestUtils.loadContentPage(
"http://example.com/data/file_script.html"
);
await Promise.all([
extension.awaitMessage("onBeforeRequest"),
extension.awaitMessage("onHeadersReceived"),
]);
background() {
browser.webRequest.onBeforeRequest.addListener(
...
);
browser.webRequest.onHeadersReceived.addListener(
...
);
},
| Assignee | ||
Comment 1•5 months ago
|
||
Updated•5 months ago
|
Attachment #9554232 -
Attachment description: Bug 2024192 - Clear the cache in the webRequest testcase. r?#extension-reviewers! → Bug 2024192 - Part 1: Clear the cache in the webRequest testcase. r?#extension-reviewers!
| Assignee | ||
Comment 2•5 months ago
|
||
| Assignee | ||
Updated•5 months ago
|
Blocks: stencil-nav
Pushed by arai_a@mac.com:
https://github.com/mozilla-firefox/firefox/commit/3769b96df5fa
https://hg.mozilla.org/integration/autoland/rev/37f69337143d
Part 1: Clear the cache in the webRequest testcase. r=extension-reviewers,robwu
https://github.com/mozilla-firefox/firefox/commit/afa1ab3d002a
https://hg.mozilla.org/integration/autoland/rev/86d030b73a04
Part 2: Add test ors for webRequest and script disk/memory cache. r=extension-reviewers,robwu
https://hg.mozilla.org/mozilla-central/rev/37f69337143d
https://hg.mozilla.org/mozilla-central/rev/86d030b73a04
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
status-firefox150:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 150 Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•