Closed Bug 1348214 Opened 7 years ago Closed 7 years ago

Clear storage per origin when loading storage test cases

Categories

(Testing :: web-platform-tests, enhancement)

Version 3
enhancement
Not set
normal

Tracking

(firefox55 fixed)

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: shawnjohnjr, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Follow-up Bug 1268804, to clear storage per origin when loading storage test cases.

In bug 1268804 Comment 158, Comment 161, the problem here is that we don't clear origins between tests.

We supposed to cleanup from test itself.
We did cleanup[1] per origin by calling QuotaManager API in mochitest/xpcshell tests using SpecialPowers.

We need to cleanup directories under a user's Firefox profile 
<profile>/storage — the main top level directory for storages maintained by the quota manager (see below.)
<profile>/storage/permanent — persistent data storage repository
<profile>/storage/temporary — temporary data storage repository
<profile>/storage/default — default data storage repository

If I understand correctly, we should use standard DOM API in wpt tests.
So I think we can't do cleanup from the test itself.
That's why we're trying to figure out how we can cleanup from testrunner.

[1] http://searchfox.org/mozilla-central/source/dom/quota/test/unit/head.js#122
Comment on attachment 8849044 [details]
Bug 1348214 - Clear storage per origin when loading storage test cases,

https://reviewboard.mozilla.org/r/121898/#review123916

I think this will need to be refactored in the future to find something that works cross-browser, but if you need this for the current tests to work I think it's OK to land.

::: testing/web-platform/harness/wptrunner/executors/executormarionette.py:345
(Diff revision 1)
>          self.url = url
>          self.timeout = timeout
>          self.result_flag = threading.Event()
>  
>      def run(self):
> +        index = self.url.rfind("/storage/");

This isn't a good long term soution here. If this is something that all browser vendors are going to implement I guess we should add something like `<meta name=storage value=clear>` if the storage should be cleared before a test. But I'm OK to take this in the short term if it's blocking tests from landing.
Attachment #8849044 - Flags: review?(james) → review+
Comment on attachment 8849044 [details]
Bug 1348214 - Clear storage per origin when loading storage test cases,

https://reviewboard.mozilla.org/r/121898/#review123916

I see. I saw you raised the question to public-test-infra mailing list.
Pushed by shuang@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5053e5c27f4d
Clear storage per origin when loading storage test cases, r=jgraham
https://hg.mozilla.org/mozilla-central/rev/5053e5c27f4d
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: