mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 01:05:45 +00:00
Bug 1568734 [wpt PR 18069] - [WPT/common/security-features] Sort keys of test config JSONs, a=testonly
Automatic update from web-platform-tests [WPT/common/security-features] Sort keys of test config JSONs This CL - Sorts they keys of test config JSONs. - Fixes generator errors by removing stale imports. Bug: 906850 Change-Id: I9f88e6d3a32fedc0c31c6cbef4a19b541c38453e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1717309 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org> Cr-Commit-Position: refs/heads/master@{#680903} -- wpt-commits: ed3a7bfab10ddbc105e747d6471660c2064fcc62 wpt-pr: 18069
This commit is contained in:
parent
b026ffa95e
commit
8a9f335f0f
@ -47,13 +47,23 @@ def permute_expansion(expansion,
|
||||
yield next_selection
|
||||
|
||||
|
||||
# Dumps the test config `selection` into a serialized JSON string.
|
||||
# We omit `name` parameter because it is not used by tests.
|
||||
def dump_test_parameters(selection):
|
||||
selection = dict(selection)
|
||||
del selection['name']
|
||||
|
||||
return json.dumps(
|
||||
selection, indent=2, separators=(',', ': '), sort_keys=True)
|
||||
|
||||
|
||||
def generate_selection(config, selection, spec, test_html_template_basename):
|
||||
# TODO: Refactor out this referrer-policy-specific part.
|
||||
if 'referrer_policy' in spec:
|
||||
# Oddball: it can be None, so in JS it's null.
|
||||
selection['referrer_policy'] = spec['referrer_policy']
|
||||
|
||||
test_parameters = json.dumps(selection, indent=2, separators=(',', ':'))
|
||||
test_parameters = dump_test_parameters(selection)
|
||||
# Adjust the template for the test invoking JS. Indent it to look nice.
|
||||
indent = "\n" + " " * 8
|
||||
test_parameters = test_parameters.replace("\n", indent)
|
||||
@ -86,7 +96,7 @@ def generate_selection(config, selection, spec, test_html_template_basename):
|
||||
html_template_filename = os.path.join(util.template_directory,
|
||||
test_html_template_basename)
|
||||
generated_disclaimer = disclaimer_template \
|
||||
% {'generating_script_filename': os.path.relpath(__file__,
|
||||
% {'generating_script_filename': os.path.relpath(sys.argv[0],
|
||||
util.test_root_directory),
|
||||
'html_template_filename': os.path.relpath(html_template_filename,
|
||||
util.test_root_directory)}
|
||||
|
@ -3,7 +3,6 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import json, sys
|
||||
from common_paths import *
|
||||
|
||||
|
||||
def assert_non_empty_string(obj, field):
|
||||
|
@ -3,7 +3,6 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import json, sys
|
||||
from common_paths import *
|
||||
|
||||
|
||||
def assert_non_empty_string(obj, field):
|
||||
|
Loading…
Reference in New Issue
Block a user