Closed Bug 1475849 Opened 6 years ago Closed 6 years ago

Refactor worker tests within test_CSP.html

Categories

(Core :: DOM: Security, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: ckerschb, Assigned: tnguyen)

References

(Blocks 1 open bug)

Details

(Whiteboard: [domsecurity-active])

Attachments

(1 file, 1 obsolete file)

The test test_CSP.html seems overly complicated, especially the worker tests within that test should be refactored and put into a separate test. We should create a new test for all of [1] and add nice documentation around how each test should behalf, especially the sub worker inheritance tests are hard to follow. [1] https://dxr.mozilla.org/mozilla-central/source/dom/security/test/csp/test_CSP.html#32-55
Blocks: 965637
Priority: -- → P3
Whiteboard: [domsecurity-backlog1]
Assignee: nobody → tnguyen
Status: NEW → ASSIGNED
Whiteboard: [domsecurity-backlog1] → [domsecurity-active]
Interestingly, if I put the meta CSP, the <script> that triggers new worker, the worker can not get the CSP from meta tag (I have no idea why). Then I have to put the test into an iframe then add Content-Security-Policy header in ^headers^ file. Hi Christoph, could you please run the tests on the bug 965637 you are trying to fix and tell me your result? It passed all the tests on my local machine.
Flags: needinfo?(ckerschb)
MozReview-Commit-ID: 8ACGbm2htCF
Attachment #8993401 - Attachment is obsolete: true
See Also: → 1477178
(In reply to Thomas Nguyen[:tnguyen] ni? plz from comment #2) > Interestingly, if I put the meta CSP, the <script> that triggers new worker, > the worker can not get the CSP from meta tag (I have no idea why). Then I > have to put the test into an iframe then add Content-Security-Policy header > in ^headers^ file. Let's investigate that as a follow up within Bug 1477178 - marking dependency for that. I guess with my changes from Bug 965637 it should also work correctly for meta CSP. > Hi Christoph, could you please run the tests on the bug 965637 you are > trying to fix and tell me your result? > It passed all the tests on my local machine. Tests work with my changes from Bug 965637 applied. From a first glance, tests look good, but I need to take a closer look when reviewing. Pushing the latest changeset to TRY for Thomas: https://treeherder.mozilla.org/#/jobs?repo=try&revision=de284f702c557b8e2634f65b12701718dabdf4e1
Blocks: 1477178
Flags: needinfo?(ckerschb)
Priority: P3 → P2
Comment on attachment 8993579 [details] Bug 1475849 - Refactor worker tests within test_CSP.html Christoph Kerschbaumer [:ckerschb] has approved the revision. https://phabricator.services.mozilla.com/D2257
Attachment #8993579 - Flags: review+
Summing it up for the record what happened within this bug: * We moved all the worker tests from test_CSP.html into test_csp_worker_inheritance.csp * Thomas extended the test coverage for all kinds of sub-worker inheritance, where the worker is either delivered through with it's own CSP or the worker is supposed to inherit it's csp from the parent (e.g. in case of blob). * Thomas added tests for top-level workers, sub-workers and sub-sub-workers * Overall we extended the test coverage and simplified the tests adding more comments of expected behavior! Thanks Thomas for doing that!
Keywords: checkin-needed
Pushed by archaeopteryx@coole-files.de: https://hg.mozilla.org/integration/mozilla-inbound/rev/f08dcbe14baf Refactor worker tests within test_CSP.html r=ckerschb
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: