Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Apr 24, 2019

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Apr 14, 2019

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}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already reviewed downstream.

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}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants