Closed Bug 1546991 Opened 5 years ago Closed 5 years ago

[wpt-sync] Sync PR 16345 - [WPT/common/security-features] Merge generate.py (1/2)

Categories

(Testing :: web-platform-tests, defect, P4)

defect

Tracking

(firefox69 fixed)

RESOLVED FIXED
mozilla69
Tracking Status
firefox69 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 16345 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/16345
Details from upstream follow.

Hiroshige Hayashizaki <hiroshige@chromium.org> wrote:

[WPT/common/security-features] Merge generate.py (1/2)

This CL introduces ReferrerPolicy/MixedContentConfig classes in generate.py,
that encapsulates test-specific things, e.g.:

  • Test description (moved from test_description.template)
  • File paths (moved from common_paths.py etc.)
  • The logic for generating \<meta>/http headers (moved from
    generate_selection() in generate.py).

After this CL, the most part of
{mixed-content,referrer-policy}/generic/tools/generate.py are the same,
except for *Config classes.
This CL leaves the common parts in place in generate.py only for ease of
codereview, and a subsequent CL will merge them to common/.

  • Functions in common_paths.py (which are not test-dependent) are moved to
    common/security-features/tools/util.py.
  • test.js.template is removed and instead generator.py generates the content
    using json.dumps().
  • Pretty printing of test.debug.html.template are removed.
  • Other templates are merged/moved to common/security-features/tools/template.

This CL doesn't modify the generated files, because
the diffs in generated files don't affect behavior:
comments, location of \<meta>, addition of \<meta charset='utf-8'>,
and orders of JSON keys.
I'm planning to larger changes to generated files later, and will
regenerate files after that.

Bug: 906850
Change-Id: Ib509ede41e160b5b03876fe162d1d62c54e13151
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1566818
Commit-Queue: Hiroshige Hayashizaki \<hiroshige@chromium.org>
Reviewed-by: Jochen Eisinger \<jochen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#653782}

The PR was not expected to affect any tests, but the try push wasn't a success. Check the try results for infrastructure issues
Pushed by james@hoppipolla.co.uk:
https://hg.mozilla.org/integration/mozilla-inbound/rev/9199a0ed1b2b
[wpt PR 16345] - [WPT/common/security-features] Merge generate.py (1/2), a=testonly
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
You need to log in before you can comment on or make changes to this bug.